PluginProbe
Gutenberg / 23.2.2
Gutenberg v23.2.2
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / modules / boot / index.js

index.js in Gutenberg 23.2.2, at build/modules/boot/index.js

2,922 lines 136.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __getProtoOf = Object.getPrototypeOf;
6 var __hasOwnProp = Object.prototype.hasOwnProperty;
7 var __commonJS = (cb, mod) => function __require() {
8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9 };
10 var __export = (target, all) => {
11 for (var name in all)
12 __defProp(target, name, { get: all[name], enumerable: true });
13 };
14 var __copyProps = (to, from, except, desc) => {
15 if (from && typeof from === "object" || typeof from === "function") {
16 for (let key of __getOwnPropNames(from))
17 if (!__hasOwnProp.call(to, key) && key !== except)
18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19 }
20 return to;
21 };
22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23 // If the importer is in node compatibility mode or this is not an ESM
24 // file that has been converted to a CommonJS file using a Babel-
25 // compatible transform (i.e. "__esModule" has not been set), then set
26 // "default" to the CommonJS "module.exports" for node compatibility.
27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28 mod
29 ));
30
31 // package-external:@wordpress/element
32 var require_element = __commonJS({
33 "package-external:@wordpress/element"(exports, module) {
34 module.exports = window.wp.element;
35 }
36 });
37
38 // package-external:@wordpress/data
39 var require_data = __commonJS({
40 "package-external:@wordpress/data"(exports, module) {
41 module.exports = window.wp.data;
42 }
43 });
44
45 // package-external:@wordpress/i18n
46 var require_i18n = __commonJS({
47 "package-external:@wordpress/i18n"(exports, module) {
48 module.exports = window.wp.i18n;
49 }
50 });
51
52 // vendor-external:react
53 var require_react = __commonJS({
54 "vendor-external:react"(exports, module) {
55 module.exports = window.React;
56 }
57 });
58
59 // vendor-external:react/jsx-runtime
60 var require_jsx_runtime = __commonJS({
61 "vendor-external:react/jsx-runtime"(exports, module) {
62 module.exports = window.ReactJSXRuntime;
63 }
64 });
65
66 // package-external:@wordpress/primitives
67 var require_primitives = __commonJS({
68 "package-external:@wordpress/primitives"(exports, module) {
69 module.exports = window.wp.primitives;
70 }
71 });
72
73 // package-external:@wordpress/compose
74 var require_compose = __commonJS({
75 "package-external:@wordpress/compose"(exports, module) {
76 module.exports = window.wp.compose;
77 }
78 });
79
80 // package-external:@wordpress/theme
81 var require_theme = __commonJS({
82 "package-external:@wordpress/theme"(exports, module) {
83 module.exports = window.wp.theme;
84 }
85 });
86
87 // package-external:@wordpress/private-apis
88 var require_private_apis = __commonJS({
89 "package-external:@wordpress/private-apis"(exports, module) {
90 module.exports = window.wp.privateApis;
91 }
92 });
93
94 // package-external:@wordpress/components
95 var require_components = __commonJS({
96 "package-external:@wordpress/components"(exports, module) {
97 module.exports = window.wp.components;
98 }
99 });
100
101 // package-external:@wordpress/core-data
102 var require_core_data = __commonJS({
103 "package-external:@wordpress/core-data"(exports, module) {
104 module.exports = window.wp.coreData;
105 }
106 });
107
108 // package-external:@wordpress/notices
109 var require_notices = __commonJS({
110 "package-external:@wordpress/notices"(exports, module) {
111 module.exports = window.wp.notices;
112 }
113 });
114
115 // package-external:@wordpress/html-entities
116 var require_html_entities = __commonJS({
117 "package-external:@wordpress/html-entities"(exports, module) {
118 module.exports = window.wp.htmlEntities;
119 }
120 });
121
122 // package-external:@wordpress/keycodes
123 var require_keycodes = __commonJS({
124 "package-external:@wordpress/keycodes"(exports, module) {
125 module.exports = window.wp.keycodes;
126 }
127 });
128
129 // package-external:@wordpress/commands
130 var require_commands = __commonJS({
131 "package-external:@wordpress/commands"(exports, module) {
132 module.exports = window.wp.commands;
133 }
134 });
135
136 // package-external:@wordpress/url
137 var require_url = __commonJS({
138 "package-external:@wordpress/url"(exports, module) {
139 module.exports = window.wp.url;
140 }
141 });
142
143 // package-external:@wordpress/editor
144 var require_editor = __commonJS({
145 "package-external:@wordpress/editor"(exports, module) {
146 module.exports = window.wp.editor;
147 }
148 });
149
150 // package-external:@wordpress/keyboard-shortcuts
151 var require_keyboard_shortcuts = __commonJS({
152 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
153 module.exports = window.wp.keyboardShortcuts;
154 }
155 });
156
157 // packages/boot/build-module/components/app/index.mjs
158 var import_element17 = __toESM(require_element(), 1);
159 var import_data11 = __toESM(require_data(), 1);
160
161 // packages/boot/build-module/components/app/router.mjs
162 var import_i18n11 = __toESM(require_i18n(), 1);
163 var import_element16 = __toESM(require_element(), 1);
164
165 // node_modules/clsx/dist/clsx.mjs
166 function r(e) {
167 var t, f, n = "";
168 if ("string" == typeof e || "number" == typeof e) n += e;
169 else if ("object" == typeof e) if (Array.isArray(e)) {
170 var o = e.length;
171 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
172 } else for (f in e) e[f] && (n && (n += " "), n += f);
173 return n;
174 }
175 function clsx() {
176 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
177 return n;
178 }
179 var clsx_default = clsx;
180
181 // node_modules/@base-ui/utils/esm/useRefWithInit.js
182 var React = __toESM(require_react(), 1);
183 var UNINITIALIZED = {};
184 function useRefWithInit(init2, initArg) {
185 const ref = React.useRef(UNINITIALIZED);
186 if (ref.current === UNINITIALIZED) {
187 ref.current = init2(initArg);
188 }
189 return ref;
190 }
191
192 // node_modules/@base-ui/utils/esm/warn.js
193 var set;
194 if (true) {
195 set = /* @__PURE__ */ new Set();
196 }
197 function warn(...messages) {
198 if (true) {
199 const messageKey = messages.join(" ");
200 if (!set.has(messageKey)) {
201 set.add(messageKey);
202 console.warn(`Base UI: ${messageKey}`);
203 }
204 }
205 }
206
207 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
208 var React4 = __toESM(require_react(), 1);
209
210 // node_modules/@base-ui/utils/esm/useMergedRefs.js
211 function useMergedRefs(a, b, c, d) {
212 const forkRef = useRefWithInit(createForkRef).current;
213 if (didChange(forkRef, a, b, c, d)) {
214 update(forkRef, [a, b, c, d]);
215 }
216 return forkRef.callback;
217 }
218 function useMergedRefsN(refs) {
219 const forkRef = useRefWithInit(createForkRef).current;
220 if (didChangeN(forkRef, refs)) {
221 update(forkRef, refs);
222 }
223 return forkRef.callback;
224 }
225 function createForkRef() {
226 return {
227 callback: null,
228 cleanup: null,
229 refs: []
230 };
231 }
232 function didChange(forkRef, a, b, c, d) {
233 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
234 }
235 function didChangeN(forkRef, newRefs) {
236 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
237 }
238 function update(forkRef, refs) {
239 forkRef.refs = refs;
240 if (refs.every((ref) => ref == null)) {
241 forkRef.callback = null;
242 return;
243 }
244 forkRef.callback = (instance) => {
245 if (forkRef.cleanup) {
246 forkRef.cleanup();
247 forkRef.cleanup = null;
248 }
249 if (instance != null) {
250 const cleanupCallbacks = Array(refs.length).fill(null);
251 for (let i = 0; i < refs.length; i += 1) {
252 const ref = refs[i];
253 if (ref == null) {
254 continue;
255 }
256 switch (typeof ref) {
257 case "function": {
258 const refCleanup = ref(instance);
259 if (typeof refCleanup === "function") {
260 cleanupCallbacks[i] = refCleanup;
261 }
262 break;
263 }
264 case "object": {
265 ref.current = instance;
266 break;
267 }
268 default:
269 }
270 }
271 forkRef.cleanup = () => {
272 for (let i = 0; i < refs.length; i += 1) {
273 const ref = refs[i];
274 if (ref == null) {
275 continue;
276 }
277 switch (typeof ref) {
278 case "function": {
279 const cleanupCallback = cleanupCallbacks[i];
280 if (typeof cleanupCallback === "function") {
281 cleanupCallback();
282 } else {
283 ref(null);
284 }
285 break;
286 }
287 case "object": {
288 ref.current = null;
289 break;
290 }
291 default:
292 }
293 }
294 };
295 }
296 };
297 }
298
299 // node_modules/@base-ui/utils/esm/getReactElementRef.js
300 var React3 = __toESM(require_react(), 1);
301
302 // node_modules/@base-ui/utils/esm/reactVersion.js
303 var React2 = __toESM(require_react(), 1);
304 var majorVersion = parseInt(React2.version, 10);
305 function isReactVersionAtLeast(reactVersionToCheck) {
306 return majorVersion >= reactVersionToCheck;
307 }
308
309 // node_modules/@base-ui/utils/esm/getReactElementRef.js
310 function getReactElementRef(element) {
311 if (!/* @__PURE__ */ React3.isValidElement(element)) {
312 return null;
313 }
314 const reactElement = element;
315 const propsWithRef = reactElement.props;
316 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
317 }
318
319 // node_modules/@base-ui/utils/esm/mergeObjects.js
320 function mergeObjects(a, b) {
321 if (a && !b) {
322 return a;
323 }
324 if (!a && b) {
325 return b;
326 }
327 if (a || b) {
328 return {
329 ...a,
330 ...b
331 };
332 }
333 return void 0;
334 }
335
336 // node_modules/@base-ui/utils/esm/empty.js
337 var EMPTY_ARRAY = Object.freeze([]);
338 var EMPTY_OBJECT = Object.freeze({});
339
340 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
341 function getStateAttributesProps(state, customMapping) {
342 const props = {};
343 for (const key in state) {
344 const value = state[key];
345 if (customMapping?.hasOwnProperty(key)) {
346 const customProps = customMapping[key](value);
347 if (customProps != null) {
348 Object.assign(props, customProps);
349 }
350 continue;
351 }
352 if (value === true) {
353 props[`data-${key.toLowerCase()}`] = "";
354 } else if (value) {
355 props[`data-${key.toLowerCase()}`] = value.toString();
356 }
357 }
358 return props;
359 }
360
361 // node_modules/@base-ui/react/esm/utils/resolveClassName.js
362 function resolveClassName(className, state) {
363 return typeof className === "function" ? className(state) : className;
364 }
365
366 // node_modules/@base-ui/react/esm/utils/resolveStyle.js
367 function resolveStyle(style, state) {
368 return typeof style === "function" ? style(state) : style;
369 }
370
371 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
372 var EMPTY_PROPS = {};
373 function mergeProps(a, b, c, d, e) {
374 if (!c && !d && !e && !a) {
375 return createInitialMergedProps(b);
376 }
377 let merged = createInitialMergedProps(a);
378 if (b) {
379 merged = mergeInto(merged, b);
380 }
381 if (c) {
382 merged = mergeInto(merged, c);
383 }
384 if (d) {
385 merged = mergeInto(merged, d);
386 }
387 if (e) {
388 merged = mergeInto(merged, e);
389 }
390 return merged;
391 }
392 function mergePropsN(props) {
393 if (props.length === 0) {
394 return EMPTY_PROPS;
395 }
396 if (props.length === 1) {
397 return createInitialMergedProps(props[0]);
398 }
399 let merged = createInitialMergedProps(props[0]);
400 for (let i = 1; i < props.length; i += 1) {
401 merged = mergeInto(merged, props[i]);
402 }
403 return merged;
404 }
405 function createInitialMergedProps(inputProps) {
406 if (isPropsGetter(inputProps)) {
407 return {
408 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
409 };
410 }
411 return copyInitialProps(inputProps);
412 }
413 function mergeInto(merged, inputProps) {
414 if (isPropsGetter(inputProps)) {
415 return resolvePropsGetter(inputProps, merged);
416 }
417 return mutablyMergeInto(merged, inputProps);
418 }
419 function copyInitialProps(inputProps) {
420 const copiedProps = {
421 ...inputProps
422 };
423 for (const propName in copiedProps) {
424 const propValue = copiedProps[propName];
425 if (isEventHandler(propName, propValue)) {
426 copiedProps[propName] = wrapEventHandler(propValue);
427 }
428 }
429 return copiedProps;
430 }
431 function mutablyMergeInto(mergedProps, externalProps) {
432 if (!externalProps) {
433 return mergedProps;
434 }
435 for (const propName in externalProps) {
436 const externalPropValue = externalProps[propName];
437 switch (propName) {
438 case "style": {
439 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
440 break;
441 }
442 case "className": {
443 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
444 break;
445 }
446 default: {
447 if (isEventHandler(propName, externalPropValue)) {
448 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
449 } else {
450 mergedProps[propName] = externalPropValue;
451 }
452 }
453 }
454 }
455 return mergedProps;
456 }
457 function isEventHandler(key, value) {
458 const code0 = key.charCodeAt(0);
459 const code1 = key.charCodeAt(1);
460 const code2 = key.charCodeAt(2);
461 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
462 }
463 function isPropsGetter(inputProps) {
464 return typeof inputProps === "function";
465 }
466 function resolvePropsGetter(inputProps, previousProps) {
467 if (isPropsGetter(inputProps)) {
468 return inputProps(previousProps);
469 }
470 return inputProps ?? EMPTY_PROPS;
471 }
472 function mergeEventHandlers(ourHandler, theirHandler) {
473 if (!theirHandler) {
474 return ourHandler;
475 }
476 if (!ourHandler) {
477 return wrapEventHandler(theirHandler);
478 }
479 return (...args) => {
480 const event = args[0];
481 if (isSyntheticEvent(event)) {
482 const baseUIEvent = event;
483 makeEventPreventable(baseUIEvent);
484 const result2 = theirHandler(...args);
485 if (!baseUIEvent.baseUIHandlerPrevented) {
486 ourHandler?.(...args);
487 }
488 return result2;
489 }
490 const result = theirHandler(...args);
491 ourHandler?.(...args);
492 return result;
493 };
494 }
495 function wrapEventHandler(handler) {
496 if (!handler) {
497 return handler;
498 }
499 return (...args) => {
500 const event = args[0];
501 if (isSyntheticEvent(event)) {
502 makeEventPreventable(event);
503 }
504 return handler(...args);
505 };
506 }
507 function makeEventPreventable(event) {
508 event.preventBaseUIHandler = () => {
509 event.baseUIHandlerPrevented = true;
510 };
511 return event;
512 }
513 function mergeClassNames(ourClassName, theirClassName) {
514 if (theirClassName) {
515 if (ourClassName) {
516 return theirClassName + " " + ourClassName;
517 }
518 return theirClassName;
519 }
520 return ourClassName;
521 }
522 function isSyntheticEvent(event) {
523 return event != null && typeof event === "object" && "nativeEvent" in event;
524 }
525
526 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
527 var import_react = __toESM(require_react(), 1);
528 function useRenderElement(element, componentProps, params = {}) {
529 const renderProp = componentProps.render;
530 const outProps = useRenderElementProps(componentProps, params);
531 if (params.enabled === false) {
532 return null;
533 }
534 const state = params.state ?? EMPTY_OBJECT;
535 return evaluateRenderProp(element, renderProp, outProps, state);
536 }
537 function useRenderElementProps(componentProps, params = {}) {
538 const {
539 className: classNameProp,
540 style: styleProp,
541 render: renderProp
542 } = componentProps;
543 const {
544 state = EMPTY_OBJECT,
545 ref,
546 props,
547 stateAttributesMapping,
548 enabled = true
549 } = params;
550 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
551 const style = enabled ? resolveStyle(styleProp, state) : void 0;
552 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
553 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
554 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
555 if (typeof document !== "undefined") {
556 if (!enabled) {
557 useMergedRefs(null, null);
558 } else if (Array.isArray(ref)) {
559 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
560 } else {
561 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
562 }
563 }
564 if (!enabled) {
565 return EMPTY_OBJECT;
566 }
567 if (className !== void 0) {
568 outProps.className = mergeClassNames(outProps.className, className);
569 }
570 if (style !== void 0) {
571 outProps.style = mergeObjects(outProps.style, style);
572 }
573 return outProps;
574 }
575 function resolveRenderFunctionProps(props) {
576 if (Array.isArray(props)) {
577 return mergePropsN(props);
578 }
579 return mergeProps(void 0, props);
580 }
581 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
582 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
583 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
584 function evaluateRenderProp(element, render, props, state) {
585 if (render) {
586 if (typeof render === "function") {
587 if (true) {
588 warnIfRenderPropLooksLikeComponent(render);
589 }
590 return render(props, state);
591 }
592 const mergedProps = mergeProps(props, render.props);
593 mergedProps.ref = props.ref;
594 let newElement = render;
595 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
596 const children = React4.Children.toArray(render);
597 newElement = children[0];
598 }
599 if (true) {
600 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
601 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
602 }
603 }
604 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
605 }
606 if (element) {
607 if (typeof element === "string") {
608 return renderTag(element, props);
609 }
610 }
611 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
612 }
613 function warnIfRenderPropLooksLikeComponent(renderFn) {
614 const functionName = renderFn.name;
615 if (functionName.length === 0) {
616 return;
617 }
618 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
619 return;
620 }
621 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
622 return;
623 }
624 warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
625 }
626 function renderTag(Tag, props) {
627 if (Tag === "button") {
628 return /* @__PURE__ */ (0, import_react.createElement)("button", {
629 type: "button",
630 ...props,
631 key: props.key
632 });
633 }
634 if (Tag === "img") {
635 return /* @__PURE__ */ (0, import_react.createElement)("img", {
636 alt: "",
637 ...props,
638 key: props.key
639 });
640 }
641 return /* @__PURE__ */ React4.createElement(Tag, props);
642 }
643
644 // node_modules/@base-ui/react/esm/use-render/useRender.js
645 function useRender(params) {
646 return useRenderElement(params.defaultTagName ?? "div", params, params);
647 }
648
649 // packages/ui/build-module/text/text.mjs
650 var import_element = __toESM(require_element(), 1);
651 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
652 function getRuntime() {
653 const globalScope = globalThis;
654 if (globalScope.__wpStyleRuntime) {
655 return globalScope.__wpStyleRuntime;
656 }
657 globalScope.__wpStyleRuntime = {
658 documents: /* @__PURE__ */ new Map(),
659 styles: /* @__PURE__ */ new Map(),
660 injectedStyles: /* @__PURE__ */ new WeakMap()
661 };
662 if (typeof document !== "undefined") {
663 registerDocument(document);
664 }
665 return globalScope.__wpStyleRuntime;
666 }
667 function documentContainsStyleHash(targetDocument, hash) {
668 if (!targetDocument.head) {
669 return false;
670 }
671 for (const style of targetDocument.head.querySelectorAll(
672 `style[${STYLE_HASH_ATTRIBUTE}]`
673 )) {
674 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
675 return true;
676 }
677 }
678 return false;
679 }
680 function injectStyle(targetDocument, hash, css) {
681 if (!targetDocument.head) {
682 return;
683 }
684 const runtime = getRuntime();
685 let injectedStyles = runtime.injectedStyles.get(targetDocument);
686 if (!injectedStyles) {
687 injectedStyles = /* @__PURE__ */ new Set();
688 runtime.injectedStyles.set(targetDocument, injectedStyles);
689 }
690 if (injectedStyles.has(hash)) {
691 return;
692 }
693 if (documentContainsStyleHash(targetDocument, hash)) {
694 injectedStyles.add(hash);
695 return;
696 }
697 const style = targetDocument.createElement("style");
698 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
699 style.appendChild(targetDocument.createTextNode(css));
700 targetDocument.head.appendChild(style);
701 injectedStyles.add(hash);
702 }
703 function registerDocument(targetDocument) {
704 const runtime = getRuntime();
705 runtime.documents.set(
706 targetDocument,
707 (runtime.documents.get(targetDocument) ?? 0) + 1
708 );
709 for (const [hash, css] of runtime.styles) {
710 injectStyle(targetDocument, hash, css);
711 }
712 return () => {
713 const count = runtime.documents.get(targetDocument);
714 if (count === void 0) {
715 return;
716 }
717 if (count <= 1) {
718 runtime.documents.delete(targetDocument);
719 return;
720 }
721 runtime.documents.set(targetDocument, count - 1);
722 };
723 }
724 function registerStyle(hash, css) {
725 const runtime = getRuntime();
726 runtime.styles.set(hash, css);
727 for (const targetDocument of runtime.documents.keys()) {
728 injectStyle(targetDocument, hash, css);
729 }
730 }
731 if (typeof process === "undefined" || true) {
732 registerStyle("0c8601dd83", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}');
733 }
734 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
735 if (typeof process === "undefined" || true) {
736 registerStyle("1fb29d3a3c", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}");
737 }
738 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
739 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
740 const element = useRender({
741 render,
742 defaultTagName: "span",
743 ref,
744 props: mergeProps(props, {
745 className: clsx_default(
746 style_default.text,
747 global_css_defense_default.heading,
748 global_css_defense_default.p,
749 style_default[variant],
750 className
751 )
752 })
753 });
754 return element;
755 });
756
757 // packages/icons/build-module/icon/index.mjs
758 var import_element2 = __toESM(require_element(), 1);
759 var icon_default = (0, import_element2.forwardRef)(
760 ({ icon, size = 24, ...props }, ref) => {
761 return (0, import_element2.cloneElement)(icon, {
762 width: size,
763 height: size,
764 ...props,
765 ref
766 });
767 }
768 );
769
770 // packages/icons/build-module/library/arrow-up-left.mjs
771 var import_primitives = __toESM(require_primitives(), 1);
772 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
773 var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) });
774
775 // packages/icons/build-module/library/check.mjs
776 var import_primitives2 = __toESM(require_primitives(), 1);
777 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
778 var check_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
779
780 // packages/icons/build-module/library/chevron-down-small.mjs
781 var import_primitives3 = __toESM(require_primitives(), 1);
782 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
783 var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "m15.99 10.889-3.988 3.418-3.988-3.418.976-1.14 3.012 2.582 3.012-2.581.976 1.139Z" }) });
784
785 // packages/icons/build-module/library/chevron-left-small.mjs
786 var import_primitives4 = __toESM(require_primitives(), 1);
787 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
788 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
789
790 // packages/icons/build-module/library/chevron-left.mjs
791 var import_primitives5 = __toESM(require_primitives(), 1);
792 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
793 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
794
795 // packages/icons/build-module/library/chevron-right-small.mjs
796 var import_primitives6 = __toESM(require_primitives(), 1);
797 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
798 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
799
800 // packages/icons/build-module/library/chevron-right.mjs
801 var import_primitives7 = __toESM(require_primitives(), 1);
802 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
803 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
804
805 // packages/icons/build-module/library/menu.mjs
806 var import_primitives8 = __toESM(require_primitives(), 1);
807 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
808 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) });
809
810 // packages/icons/build-module/library/search.mjs
811 var import_primitives9 = __toESM(require_primitives(), 1);
812 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
813 var search_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
814
815 // packages/icons/build-module/library/wordpress.mjs
816 var import_primitives10 = __toESM(require_primitives(), 1);
817 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
818 var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) });
819
820 // packages/ui/build-module/stack/stack.mjs
821 var import_element3 = __toESM(require_element(), 1);
822 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
823 function getRuntime2() {
824 const globalScope = globalThis;
825 if (globalScope.__wpStyleRuntime) {
826 return globalScope.__wpStyleRuntime;
827 }
828 globalScope.__wpStyleRuntime = {
829 documents: /* @__PURE__ */ new Map(),
830 styles: /* @__PURE__ */ new Map(),
831 injectedStyles: /* @__PURE__ */ new WeakMap()
832 };
833 if (typeof document !== "undefined") {
834 registerDocument2(document);
835 }
836 return globalScope.__wpStyleRuntime;
837 }
838 function documentContainsStyleHash2(targetDocument, hash) {
839 if (!targetDocument.head) {
840 return false;
841 }
842 for (const style of targetDocument.head.querySelectorAll(
843 `style[${STYLE_HASH_ATTRIBUTE2}]`
844 )) {
845 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
846 return true;
847 }
848 }
849 return false;
850 }
851 function injectStyle2(targetDocument, hash, css) {
852 if (!targetDocument.head) {
853 return;
854 }
855 const runtime = getRuntime2();
856 let injectedStyles = runtime.injectedStyles.get(targetDocument);
857 if (!injectedStyles) {
858 injectedStyles = /* @__PURE__ */ new Set();
859 runtime.injectedStyles.set(targetDocument, injectedStyles);
860 }
861 if (injectedStyles.has(hash)) {
862 return;
863 }
864 if (documentContainsStyleHash2(targetDocument, hash)) {
865 injectedStyles.add(hash);
866 return;
867 }
868 const style = targetDocument.createElement("style");
869 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
870 style.appendChild(targetDocument.createTextNode(css));
871 targetDocument.head.appendChild(style);
872 injectedStyles.add(hash);
873 }
874 function registerDocument2(targetDocument) {
875 const runtime = getRuntime2();
876 runtime.documents.set(
877 targetDocument,
878 (runtime.documents.get(targetDocument) ?? 0) + 1
879 );
880 for (const [hash, css] of runtime.styles) {
881 injectStyle2(targetDocument, hash, css);
882 }
883 return () => {
884 const count = runtime.documents.get(targetDocument);
885 if (count === void 0) {
886 return;
887 }
888 if (count <= 1) {
889 runtime.documents.delete(targetDocument);
890 return;
891 }
892 runtime.documents.set(targetDocument, count - 1);
893 };
894 }
895 function registerStyle2(hash, css) {
896 const runtime = getRuntime2();
897 runtime.styles.set(hash, css);
898 for (const targetDocument of runtime.documents.keys()) {
899 injectStyle2(targetDocument, hash, css);
900 }
901 }
902 if (typeof process === "undefined" || true) {
903 registerStyle2("b51ff41489", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}");
904 }
905 var style_default2 = { "stack": "_19ce0419607e1896__stack" };
906 var gapTokens = {
907 xs: "var(--wpds-dimension-gap-xs, 4px)",
908 sm: "var(--wpds-dimension-gap-sm, 8px)",
909 md: "var(--wpds-dimension-gap-md, 12px)",
910 lg: "var(--wpds-dimension-gap-lg, 16px)",
911 xl: "var(--wpds-dimension-gap-xl, 24px)",
912 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
913 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
914 };
915 var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
916 const style = {
917 gap: gap && gapTokens[gap],
918 alignItems: align,
919 justifyContent: justify,
920 flexDirection: direction,
921 flexWrap: wrap
922 };
923 const element = useRender({
924 render,
925 ref,
926 props: mergeProps(props, { style, className: style_default2.stack })
927 });
928 return element;
929 });
930
931 // packages/admin-ui/build-module/navigable-region/index.mjs
932 var import_element4 = __toESM(require_element(), 1);
933 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
934 var NavigableRegion = (0, import_element4.forwardRef)(
935 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
936 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
937 Tag,
938 {
939 ref,
940 className: clsx_default("admin-ui-navigable-region", className),
941 "aria-label": ariaLabel,
942 role: "region",
943 tabIndex: "-1",
944 ...props,
945 children
946 }
947 );
948 }
949 );
950 NavigableRegion.displayName = "NavigableRegion";
951 var navigable_region_default = NavigableRegion;
952
953 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs
954 var import_components = __toESM(require_components(), 1);
955 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle");
956
957 // packages/admin-ui/build-module/page/header.mjs
958 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
959 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
960 function getRuntime3() {
961 const globalScope = globalThis;
962 if (globalScope.__wpStyleRuntime) {
963 return globalScope.__wpStyleRuntime;
964 }
965 globalScope.__wpStyleRuntime = {
966 documents: /* @__PURE__ */ new Map(),
967 styles: /* @__PURE__ */ new Map(),
968 injectedStyles: /* @__PURE__ */ new WeakMap()
969 };
970 if (typeof document !== "undefined") {
971 registerDocument3(document);
972 }
973 return globalScope.__wpStyleRuntime;
974 }
975 function documentContainsStyleHash3(targetDocument, hash) {
976 if (!targetDocument.head) {
977 return false;
978 }
979 for (const style of targetDocument.head.querySelectorAll(
980 `style[${STYLE_HASH_ATTRIBUTE3}]`
981 )) {
982 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
983 return true;
984 }
985 }
986 return false;
987 }
988 function injectStyle3(targetDocument, hash, css) {
989 if (!targetDocument.head) {
990 return;
991 }
992 const runtime = getRuntime3();
993 let injectedStyles = runtime.injectedStyles.get(targetDocument);
994 if (!injectedStyles) {
995 injectedStyles = /* @__PURE__ */ new Set();
996 runtime.injectedStyles.set(targetDocument, injectedStyles);
997 }
998 if (injectedStyles.has(hash)) {
999 return;
1000 }
1001 if (documentContainsStyleHash3(targetDocument, hash)) {
1002 injectedStyles.add(hash);
1003 return;
1004 }
1005 const style = targetDocument.createElement("style");
1006 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
1007 style.appendChild(targetDocument.createTextNode(css));
1008 targetDocument.head.appendChild(style);
1009 injectedStyles.add(hash);
1010 }
1011 function registerDocument3(targetDocument) {
1012 const runtime = getRuntime3();
1013 runtime.documents.set(
1014 targetDocument,
1015 (runtime.documents.get(targetDocument) ?? 0) + 1
1016 );
1017 for (const [hash, css] of runtime.styles) {
1018 injectStyle3(targetDocument, hash, css);
1019 }
1020 return () => {
1021 const count = runtime.documents.get(targetDocument);
1022 if (count === void 0) {
1023 return;
1024 }
1025 if (count <= 1) {
1026 runtime.documents.delete(targetDocument);
1027 return;
1028 }
1029 runtime.documents.set(targetDocument, count - 1);
1030 };
1031 }
1032 function registerStyle3(hash, css) {
1033 const runtime = getRuntime3();
1034 runtime.styles.set(hash, css);
1035 for (const targetDocument of runtime.documents.keys()) {
1036 injectStyle3(targetDocument, hash, css);
1037 }
1038 }
1039 if (typeof process === "undefined" || true) {
1040 registerStyle3("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1041 }
1042 var style_default3 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1043 function Header({
1044 headingLevel = 1,
1045 breadcrumbs,
1046 badges,
1047 visual,
1048 title,
1049 subTitle,
1050 actions,
1051 showSidebarToggle = true
1052 }) {
1053 const HeadingTag = `h${headingLevel}`;
1054 return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { direction: "column", className: style_default3.header, children: [
1055 /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1056 Stack,
1057 {
1058 className: style_default3["header-content"],
1059 direction: "row",
1060 gap: "sm",
1061 justify: "space-between",
1062 children: [
1063 /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [
1064 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1065 SidebarToggleSlot,
1066 {
1067 bubblesVirtually: true,
1068 className: style_default3["sidebar-toggle-slot"]
1069 }
1070 ),
1071 visual && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1072 "div",
1073 {
1074 className: style_default3["header-visual"],
1075 "aria-hidden": "true",
1076 children: visual
1077 }
1078 ),
1079 title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1080 Text,
1081 {
1082 className: style_default3["header-title"],
1083 render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(HeadingTag, {}),
1084 variant: "heading-lg",
1085 children: title
1086 }
1087 ),
1088 breadcrumbs,
1089 badges
1090 ] }),
1091 actions && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1092 Stack,
1093 {
1094 align: "center",
1095 className: style_default3["header-actions"],
1096 direction: "row",
1097 gap: "sm",
1098 children: actions
1099 }
1100 )
1101 ]
1102 }
1103 ),
1104 subTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1105 Text,
1106 {
1107 render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", {}),
1108 variant: "body-md",
1109 className: style_default3["header-subtitle"],
1110 children: subTitle
1111 }
1112 )
1113 ] });
1114 }
1115
1116 // packages/admin-ui/build-module/page/index.mjs
1117 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
1118 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
1119 function getRuntime4() {
1120 const globalScope = globalThis;
1121 if (globalScope.__wpStyleRuntime) {
1122 return globalScope.__wpStyleRuntime;
1123 }
1124 globalScope.__wpStyleRuntime = {
1125 documents: /* @__PURE__ */ new Map(),
1126 styles: /* @__PURE__ */ new Map(),
1127 injectedStyles: /* @__PURE__ */ new WeakMap()
1128 };
1129 if (typeof document !== "undefined") {
1130 registerDocument4(document);
1131 }
1132 return globalScope.__wpStyleRuntime;
1133 }
1134 function documentContainsStyleHash4(targetDocument, hash) {
1135 if (!targetDocument.head) {
1136 return false;
1137 }
1138 for (const style of targetDocument.head.querySelectorAll(
1139 `style[${STYLE_HASH_ATTRIBUTE4}]`
1140 )) {
1141 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
1142 return true;
1143 }
1144 }
1145 return false;
1146 }
1147 function injectStyle4(targetDocument, hash, css) {
1148 if (!targetDocument.head) {
1149 return;
1150 }
1151 const runtime = getRuntime4();
1152 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1153 if (!injectedStyles) {
1154 injectedStyles = /* @__PURE__ */ new Set();
1155 runtime.injectedStyles.set(targetDocument, injectedStyles);
1156 }
1157 if (injectedStyles.has(hash)) {
1158 return;
1159 }
1160 if (documentContainsStyleHash4(targetDocument, hash)) {
1161 injectedStyles.add(hash);
1162 return;
1163 }
1164 const style = targetDocument.createElement("style");
1165 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
1166 style.appendChild(targetDocument.createTextNode(css));
1167 targetDocument.head.appendChild(style);
1168 injectedStyles.add(hash);
1169 }
1170 function registerDocument4(targetDocument) {
1171 const runtime = getRuntime4();
1172 runtime.documents.set(
1173 targetDocument,
1174 (runtime.documents.get(targetDocument) ?? 0) + 1
1175 );
1176 for (const [hash, css] of runtime.styles) {
1177 injectStyle4(targetDocument, hash, css);
1178 }
1179 return () => {
1180 const count = runtime.documents.get(targetDocument);
1181 if (count === void 0) {
1182 return;
1183 }
1184 if (count <= 1) {
1185 runtime.documents.delete(targetDocument);
1186 return;
1187 }
1188 runtime.documents.set(targetDocument, count - 1);
1189 };
1190 }
1191 function registerStyle4(hash, css) {
1192 const runtime = getRuntime4();
1193 runtime.styles.set(hash, css);
1194 for (const targetDocument of runtime.documents.keys()) {
1195 injectStyle4(targetDocument, hash, css);
1196 }
1197 }
1198 if (typeof process === "undefined" || true) {
1199 registerStyle4("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1200 }
1201 var style_default4 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1202 function Page({
1203 headingLevel,
1204 breadcrumbs,
1205 badges,
1206 visual,
1207 title,
1208 subTitle,
1209 children,
1210 className,
1211 actions,
1212 ariaLabel,
1213 hasPadding = false,
1214 showSidebarToggle = true
1215 }) {
1216 const classes = clsx_default(style_default4.page, className);
1217 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : "");
1218 return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [
1219 (title || breadcrumbs || badges || actions || visual) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1220 Header,
1221 {
1222 headingLevel,
1223 breadcrumbs,
1224 badges,
1225 visual,
1226 title,
1227 subTitle,
1228 actions,
1229 showSidebarToggle
1230 }
1231 ),
1232 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1233 "div",
1234 {
1235 className: clsx_default(
1236 style_default4.content,
1237 style_default4["has-padding"]
1238 ),
1239 children
1240 }
1241 ) : children
1242 ] });
1243 }
1244 Page.SidebarToggleFill = SidebarToggleFill;
1245 var page_default = Page;
1246
1247 // packages/boot/build-module/components/app/router.mjs
1248 var import_data10 = __toESM(require_data(), 1);
1249 var import_core_data6 = __toESM(require_core_data(), 1);
1250 import {
1251 privateApis as routePrivateApis6
1252 } from "@wordpress/route";
1253
1254 // packages/boot/build-module/components/root/index.mjs
1255 var import_notices = __toESM(require_notices(), 1);
1256 var import_compose4 = __toESM(require_compose(), 1);
1257 var import_components14 = __toESM(require_components(), 1);
1258 import { privateApis as routePrivateApis5 } from "@wordpress/route";
1259 var import_element15 = __toESM(require_element(), 1);
1260 var import_i18n10 = __toESM(require_i18n(), 1);
1261
1262 // packages/boot/build-module/components/site-hub/index.mjs
1263 var import_data3 = __toESM(require_data(), 1);
1264 var import_components3 = __toESM(require_components(), 1);
1265 var import_i18n2 = __toESM(require_i18n(), 1);
1266 var import_core_data2 = __toESM(require_core_data(), 1);
1267 var import_html_entities = __toESM(require_html_entities(), 1);
1268 var import_keycodes = __toESM(require_keycodes(), 1);
1269 var import_commands = __toESM(require_commands(), 1);
1270 var import_url = __toESM(require_url(), 1);
1271
1272 // packages/boot/build-module/components/site-icon-link/index.mjs
1273 var import_components2 = __toESM(require_components(), 1);
1274 import { Link, privateApis as routePrivateApis } from "@wordpress/route";
1275
1276 // packages/boot/build-module/lock-unlock.mjs
1277 var import_private_apis = __toESM(require_private_apis(), 1);
1278 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1279 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1280 "@wordpress/boot"
1281 );
1282
1283 // packages/boot/build-module/components/site-icon/index.mjs
1284 var import_data = __toESM(require_data(), 1);
1285 var import_i18n = __toESM(require_i18n(), 1);
1286 var import_core_data = __toESM(require_core_data(), 1);
1287 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1288 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='3ada0e3b8a']")) {
1289 const style = document.createElement("style");
1290 style.setAttribute("data-wp-hash", "3ada0e3b8a");
1291 style.appendChild(document.createTextNode(".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-fg-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}"));
1292 document.head.appendChild(style);
1293 }
1294 function SiteIcon({ className }) {
1295 const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => {
1296 const { getEntityRecord } = select(import_core_data.store);
1297 const siteData = getEntityRecord(
1298 "root",
1299 "__unstableBase",
1300 void 0
1301 );
1302 return {
1303 isRequestingSite: !siteData,
1304 siteIconUrl: siteData?.site_icon_url
1305 };
1306 }, []);
1307 let icon = null;
1308 if (isRequestingSite && !siteIconUrl) {
1309 icon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "boot-site-icon__image" });
1310 } else {
1311 icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1312 "img",
1313 {
1314 className: "boot-site-icon__image",
1315 alt: (0, import_i18n.__)("Site Icon"),
1316 src: siteIconUrl
1317 }
1318 ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1319 icon_default,
1320 {
1321 className: "boot-site-icon__icon",
1322 icon: wordpress_default,
1323 size: 48
1324 }
1325 );
1326 }
1327 return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: clsx_default(className, "boot-site-icon"), children: icon });
1328 }
1329 var site_icon_default = SiteIcon;
1330
1331 // packages/boot/build-module/components/site-icon-link/index.mjs
1332 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1333 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='5aacc86eea']")) {
1334 const style = document.createElement("style");
1335 style.setAttribute("data-wp-hash", "5aacc86eea");
1336 style.appendChild(document.createTextNode(".boot-site-icon-link{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}"));
1337 document.head.appendChild(style);
1338 }
1339 var { useCanGoBack, useRouter } = unlock(routePrivateApis);
1340 function SiteIconLink({
1341 to,
1342 isBackButton,
1343 ...props
1344 }) {
1345 const router = useRouter();
1346 const canGoBack = useCanGoBack();
1347 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_components2.Tooltip, { text: props["aria-label"], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1348 Link,
1349 {
1350 to,
1351 "aria-label": props["aria-label"],
1352 className: "boot-site-icon-link",
1353 onClick: (event) => {
1354 if (canGoBack && isBackButton) {
1355 event.preventDefault();
1356 router.history.back();
1357 }
1358 },
1359 children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(site_icon_default, {})
1360 }
1361 ) });
1362 }
1363 var site_icon_link_default = SiteIconLink;
1364
1365 // packages/boot/build-module/store/index.mjs
1366 var import_data2 = __toESM(require_data(), 1);
1367
1368 // packages/boot/build-module/store/reducer.mjs
1369 var initialState = {
1370 menuItems: {},
1371 routes: [],
1372 dashboardLink: void 0
1373 };
1374 function reducer(state = initialState, action) {
1375 switch (action.type) {
1376 case "REGISTER_MENU_ITEM":
1377 return {
1378 ...state,
1379 menuItems: {
1380 ...state.menuItems,
1381 [action.id]: action.menuItem
1382 }
1383 };
1384 case "UPDATE_MENU_ITEM":
1385 return {
1386 ...state,
1387 menuItems: {
1388 ...state.menuItems,
1389 [action.id]: {
1390 ...state.menuItems[action.id],
1391 ...action.updates
1392 }
1393 }
1394 };
1395 case "REGISTER_ROUTE":
1396 return {
1397 ...state,
1398 routes: [...state.routes, action.route]
1399 };
1400 case "SET_DASHBOARD_LINK":
1401 return {
1402 ...state,
1403 dashboardLink: action.dashboardLink
1404 };
1405 }
1406 return state;
1407 }
1408
1409 // packages/boot/build-module/store/actions.mjs
1410 var actions_exports = {};
1411 __export(actions_exports, {
1412 registerMenuItem: () => registerMenuItem,
1413 registerRoute: () => registerRoute,
1414 setDashboardLink: () => setDashboardLink,
1415 updateMenuItem: () => updateMenuItem
1416 });
1417 function registerMenuItem(id, menuItem) {
1418 return {
1419 type: "REGISTER_MENU_ITEM",
1420 id,
1421 menuItem
1422 };
1423 }
1424 function updateMenuItem(id, updates) {
1425 return {
1426 type: "UPDATE_MENU_ITEM",
1427 id,
1428 updates
1429 };
1430 }
1431 function registerRoute(route) {
1432 return {
1433 type: "REGISTER_ROUTE",
1434 route
1435 };
1436 }
1437 function setDashboardLink(dashboardLink) {
1438 return {
1439 type: "SET_DASHBOARD_LINK",
1440 dashboardLink
1441 };
1442 }
1443
1444 // packages/boot/build-module/store/selectors.mjs
1445 var selectors_exports = {};
1446 __export(selectors_exports, {
1447 getDashboardLink: () => getDashboardLink,
1448 getMenuItems: () => getMenuItems,
1449 getRoutes: () => getRoutes
1450 });
1451 function getMenuItems(state) {
1452 return Object.values(state.menuItems);
1453 }
1454 function getRoutes(state) {
1455 return state.routes;
1456 }
1457 function getDashboardLink(state) {
1458 return state.dashboardLink;
1459 }
1460
1461 // packages/boot/build-module/store/index.mjs
1462 var STORE_NAME = "wordpress/boot";
1463 var store = (0, import_data2.createReduxStore)(STORE_NAME, {
1464 reducer,
1465 actions: actions_exports,
1466 selectors: selectors_exports
1467 });
1468 (0, import_data2.register)(store);
1469
1470 // packages/boot/build-module/components/site-hub/index.mjs
1471 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1472 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='bc60675bd6']")) {
1473 const style = document.createElement("style");
1474 style.setAttribute("data-wp-hash", "bc60675bd6");
1475 style.appendChild(document.createTextNode(".boot-site-hub{align-items:center;background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:grid;flex-shrink:0;grid-template-columns:60px 1fr auto;padding-right:16px;position:sticky;top:0;z-index:1}.boot-site-hub__actions{flex-shrink:0}.boot-site-hub__title{align-items:center;display:flex;text-decoration:none}.boot-site-hub__title .components-external-link__contents{margin-inline-start:4px;max-width:140px;overflow:hidden;text-decoration:none}.boot-site-hub__title .components-external-link__icon{opacity:0;transition:opacity .1s ease-out}.boot-site-hub__title:hover .components-external-link__icon{opacity:1}@media not (prefers-reduced-motion){.boot-site-hub__title{transition:outline .1s ease-out}}.boot-site-hub__title:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-site-hub__title-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-size:13px;font-weight:499}.boot-site-hub__title-text,.boot-site-hub__url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boot-site-hub__url{color:var(--wpds-color-fg-content-neutral-weak,#707070);font-size:12px}"));
1476 document.head.appendChild(style);
1477 }
1478 function SiteHub() {
1479 const { dashboardLink, homeUrl, siteTitle } = (0, import_data3.useSelect)((select) => {
1480 const { getEntityRecord } = select(import_core_data2.store);
1481 const _base = getEntityRecord(
1482 "root",
1483 "__unstableBase"
1484 );
1485 return {
1486 dashboardLink: select(store).getDashboardLink(),
1487 homeUrl: _base?.home,
1488 siteTitle: !_base?.name && !!_base?.url ? (0, import_url.filterURLForDisplay)(_base?.url) : _base?.name
1489 };
1490 }, []);
1491 const { open: openCommandCenter } = (0, import_data3.useDispatch)(import_commands.store);
1492 return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "boot-site-hub", children: [
1493 /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1494 site_icon_link_default,
1495 {
1496 to: dashboardLink || "/",
1497 "aria-label": (0, import_i18n2.__)("Go to the Dashboard")
1498 }
1499 ),
1500 /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1501 import_components3.ExternalLink,
1502 {
1503 href: homeUrl ?? "/",
1504 className: "boot-site-hub__title",
1505 children: [
1506 /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__title-text", children: siteTitle && (0, import_html_entities.decodeEntities)(siteTitle) }),
1507 /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__url", children: (0, import_url.filterURLForDisplay)(homeUrl ?? "") })
1508 ]
1509 }
1510 ),
1511 /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components3.__experimentalHStack, { className: "boot-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1512 import_components3.Button,
1513 {
1514 variant: "tertiary",
1515 icon: search_default,
1516 onClick: () => openCommandCenter(),
1517 size: "compact",
1518 label: (0, import_i18n2.__)("Open command palette"),
1519 shortcut: import_keycodes.displayShortcut.primary("k")
1520 }
1521 ) })
1522 ] });
1523 }
1524 var site_hub_default = SiteHub;
1525
1526 // packages/boot/build-module/components/navigation/index.mjs
1527 var import_element8 = __toESM(require_element(), 1);
1528 var import_data6 = __toESM(require_data(), 1);
1529
1530 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1531 var import_components6 = __toESM(require_components(), 1);
1532
1533 // packages/boot/build-module/components/navigation/router-link-item.mjs
1534 var import_element5 = __toESM(require_element(), 1);
1535 var import_components4 = __toESM(require_components(), 1);
1536 import { privateApis as routePrivateApis2 } from "@wordpress/route";
1537 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1538 var { createLink } = unlock(routePrivateApis2);
1539 function AnchorOnlyItem(props, forwardedRef) {
1540 return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components4.__experimentalItem, { as: "a", ref: forwardedRef, ...props });
1541 }
1542 var RouterLinkItem = createLink((0, import_element5.forwardRef)(AnchorOnlyItem));
1543 var router_link_item_default = RouterLinkItem;
1544
1545 // packages/boot/build-module/components/navigation/items.mjs
1546 var import_element6 = __toESM(require_element(), 1);
1547 var import_components5 = __toESM(require_components(), 1);
1548 var import_primitives11 = __toESM(require_primitives(), 1);
1549 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
1550 function isSvg(element) {
1551 return (0, import_element6.isValidElement)(element) && (element.type === import_primitives11.SVG || element.type === "svg");
1552 }
1553 function wrapIcon(icon, shouldShowPlaceholder = true) {
1554 if (isSvg(icon)) {
1555 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components5.Icon, { icon });
1556 }
1557 if (typeof icon === "string" && icon.startsWith("dashicons-")) {
1558 const iconKey = icon.replace(
1559 /^dashicons-/,
1560 ""
1561 );
1562 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1563 import_components5.Dashicon,
1564 {
1565 style: { padding: "2px" },
1566 icon: iconKey,
1567 "aria-hidden": "true"
1568 }
1569 );
1570 }
1571 if (typeof icon === "string" && icon.startsWith("data:")) {
1572 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1573 "img",
1574 {
1575 src: icon,
1576 alt: "",
1577 "aria-hidden": "true",
1578 style: {
1579 width: "20px",
1580 height: "20px",
1581 display: "block",
1582 padding: "2px"
1583 }
1584 }
1585 );
1586 }
1587 if (icon) {
1588 return icon;
1589 }
1590 if (shouldShowPlaceholder) {
1591 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1592 "div",
1593 {
1594 style: { width: "24px", height: "24px" },
1595 "aria-hidden": "true"
1596 }
1597 );
1598 }
1599 return null;
1600 }
1601
1602 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1603 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
1604 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='26b8e27d3f']")) {
1605 const style = document.createElement("style");
1606 style.setAttribute("data-wp-hash", "26b8e27d3f");
1607 style.appendChild(document.createTextNode('.boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}.boot-navigation-item.components-item.active{font-weight:499}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));font-weight:499}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}'));
1608 document.head.appendChild(style);
1609 }
1610 function NavigationItem({
1611 className,
1612 icon,
1613 shouldShowPlaceholder = true,
1614 children,
1615 to
1616 }) {
1617 const isExternal = !String(
1618 new URL(to, window.location.origin)
1619 ).startsWith(window.location.origin);
1620 const content = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_components6.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [
1621 wrapIcon(icon, shouldShowPlaceholder),
1622 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components6.FlexBlock, { children })
1623 ] });
1624 if (isExternal) {
1625 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1626 import_components6.__experimentalItem,
1627 {
1628 as: "a",
1629 href: to,
1630 className: clsx_default("boot-navigation-item", className),
1631 children: content
1632 }
1633 );
1634 }
1635 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1636 router_link_item_default,
1637 {
1638 to,
1639 className: clsx_default("boot-navigation-item", className),
1640 children: content
1641 }
1642 );
1643 }
1644
1645 // packages/boot/build-module/components/navigation/drilldown-item/index.mjs
1646 var import_components7 = __toESM(require_components(), 1);
1647 var import_i18n3 = __toESM(require_i18n(), 1);
1648 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
1649 function DrilldownItem({
1650 className,
1651 id,
1652 icon,
1653 shouldShowPlaceholder = true,
1654 children,
1655 onNavigate
1656 }) {
1657 const handleClick = (e) => {
1658 e.preventDefault();
1659 onNavigate({ id, direction: "forward" });
1660 };
1661 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1662 import_components7.__experimentalItem,
1663 {
1664 className: clsx_default("boot-navigation-item", className),
1665 onClick: handleClick,
1666 children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1667 import_components7.__experimentalHStack,
1668 {
1669 justify: "flex-start",
1670 spacing: 2,
1671 style: { flexGrow: "1" },
1672 children: [
1673 wrapIcon(icon, shouldShowPlaceholder),
1674 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components7.FlexBlock, { children }),
1675 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components7.Icon, { icon: (0, import_i18n3.isRTL)() ? chevron_left_small_default : chevron_right_small_default })
1676 ]
1677 }
1678 )
1679 }
1680 );
1681 }
1682
1683 // packages/boot/build-module/components/navigation/dropdown-item/index.mjs
1684 var import_components8 = __toESM(require_components(), 1);
1685 var import_compose = __toESM(require_compose(), 1);
1686 var import_data4 = __toESM(require_data(), 1);
1687 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
1688 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='608eff82f3']")) {
1689 const style = document.createElement("style");
1690 style.setAttribute("data-wp-hash", "608eff82f3");
1691 style.appendChild(document.createTextNode(".boot-dropdown-item__children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}.boot-dropdown-item__chevron.is-up{transform:rotate(180deg)}"));
1692 document.head.appendChild(style);
1693 }
1694 var ANIMATION_DURATION = 0.2;
1695 function DropdownItem({
1696 className,
1697 id,
1698 icon,
1699 children,
1700 isExpanded,
1701 onToggle
1702 }) {
1703 const menuItems = (0, import_data4.useSelect)(
1704 (select) => (
1705 // @ts-ignore
1706 select(STORE_NAME).getMenuItems()
1707 ),
1708 []
1709 );
1710 const items = menuItems.filter((item) => item.parent === id);
1711 const disableMotion = (0, import_compose.useReducedMotion)();
1712 return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boot-dropdown-item", children: [
1713 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1714 import_components8.__experimentalItem,
1715 {
1716 className: clsx_default("boot-navigation-item", className),
1717 onClick: (e) => {
1718 e.preventDefault();
1719 e.stopPropagation();
1720 onToggle();
1721 },
1722 onMouseDown: (e) => e.preventDefault(),
1723 children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1724 import_components8.__experimentalHStack,
1725 {
1726 justify: "flex-start",
1727 spacing: 2,
1728 style: { flexGrow: "1" },
1729 children: [
1730 wrapIcon(icon, false),
1731 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.FlexBlock, { children }),
1732 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1733 import_components8.Icon,
1734 {
1735 icon: chevron_down_small_default,
1736 className: clsx_default("boot-dropdown-item__chevron", {
1737 "is-up": isExpanded
1738 })
1739 }
1740 )
1741 ]
1742 }
1743 )
1744 }
1745 ),
1746 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1747 import_components8.__unstableMotion.div,
1748 {
1749 initial: { height: 0 },
1750 animate: { height: "auto" },
1751 exit: { height: 0 },
1752 transition: {
1753 type: "tween",
1754 duration: disableMotion ? 0 : ANIMATION_DURATION,
1755 ease: "easeOut"
1756 },
1757 className: "boot-dropdown-item__children",
1758 children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1759 NavigationItem,
1760 {
1761 to: item.to,
1762 shouldShowPlaceholder: false,
1763 children: item.label
1764 },
1765 index
1766 ))
1767 }
1768 ) })
1769 ] });
1770 }
1771
1772 // packages/boot/build-module/components/navigation/navigation-screen/index.mjs
1773 var import_components9 = __toESM(require_components(), 1);
1774 var import_i18n4 = __toESM(require_i18n(), 1);
1775 var import_compose2 = __toESM(require_compose(), 1);
1776 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
1777 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c5e42e1495']")) {
1778 const style = document.createElement("style");
1779 style.setAttribute("data-wp-hash", "c5e42e1495");
1780 style.appendChild(document.createTextNode(".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-fg-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}"));
1781 document.head.appendChild(style);
1782 }
1783 var ANIMATION_DURATION2 = 0.3;
1784 var slideVariants = {
1785 initial: (direction) => ({
1786 x: direction === "forward" ? 100 : -100,
1787 opacity: 0
1788 }),
1789 animate: {
1790 x: 0,
1791 opacity: 1
1792 },
1793 exit: (direction) => ({
1794 x: direction === "forward" ? 100 : -100,
1795 opacity: 0
1796 })
1797 };
1798 function NavigationScreen({
1799 isRoot,
1800 title,
1801 actions,
1802 content,
1803 description,
1804 animationDirection,
1805 backMenuItem,
1806 backButtonRef,
1807 navigationKey,
1808 onNavigate
1809 }) {
1810 const icon = (0, import_i18n4.isRTL)() ? chevron_right_default : chevron_left_default;
1811 const disableMotion = (0, import_compose2.useReducedMotion)();
1812 const handleBackClick = (e) => {
1813 e.preventDefault();
1814 onNavigate({ id: backMenuItem, direction: "backward" });
1815 };
1816 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1817 "div",
1818 {
1819 className: "boot-navigation-screen",
1820 style: {
1821 overflow: "hidden",
1822 position: "relative",
1823 display: "grid",
1824 gridTemplateColumns: "1fr",
1825 gridTemplateRows: "1fr"
1826 },
1827 children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components9.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1828 import_components9.__unstableMotion.div,
1829 {
1830 custom: animationDirection,
1831 variants: slideVariants,
1832 initial: "initial",
1833 animate: "animate",
1834 exit: "exit",
1835 transition: {
1836 type: "tween",
1837 duration: disableMotion ? 0 : ANIMATION_DURATION2,
1838 ease: [0.33, 0, 0, 1]
1839 },
1840 style: {
1841 width: "100%",
1842 gridColumn: "1",
1843 gridRow: "1"
1844 },
1845 children: [
1846 /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1847 import_components9.__experimentalHStack,
1848 {
1849 spacing: 2,
1850 className: "boot-navigation-screen__title-icon",
1851 children: [
1852 !isRoot && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1853 import_components9.Button,
1854 {
1855 ref: backButtonRef,
1856 icon,
1857 onClick: handleBackClick,
1858 label: (0, import_i18n4.__)("Back"),
1859 size: "small",
1860 variant: "tertiary"
1861 }
1862 ),
1863 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1864 import_components9.__experimentalHeading,
1865 {
1866 className: "boot-navigation-screen__title",
1867 level: 1,
1868 size: "15px",
1869 children: title
1870 }
1871 ),
1872 actions && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__actions", children: actions })
1873 ]
1874 }
1875 ),
1876 description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__description", children: description }),
1877 content
1878 ]
1879 },
1880 navigationKey
1881 ) })
1882 }
1883 );
1884 }
1885
1886 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1887 var import_element7 = __toESM(require_element(), 1);
1888 var import_data5 = __toESM(require_data(), 1);
1889 import { privateApis as routePrivateApis3 } from "@wordpress/route";
1890
1891 // packages/boot/build-module/components/navigation/path-matching.mjs
1892 var isValidParentPath = (currentPath, menuPath) => {
1893 if (!menuPath || menuPath === currentPath) {
1894 return false;
1895 }
1896 const normalizePath = (path) => {
1897 const normalized = path.startsWith("/") ? path : "/" + path;
1898 return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized;
1899 };
1900 const normalizedCurrent = normalizePath(currentPath);
1901 const normalizedMenu = normalizePath(menuPath);
1902 return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/");
1903 };
1904 var findClosestMenuItem = (currentPath, menuItems) => {
1905 const exactMatch = menuItems.find((item) => item.to === currentPath);
1906 if (exactMatch) {
1907 return exactMatch;
1908 }
1909 let bestMatch = null;
1910 let bestPathLength = 0;
1911 for (const item of menuItems) {
1912 if (!item.to) {
1913 continue;
1914 }
1915 if (isValidParentPath(currentPath, item.to)) {
1916 if (item.to.length > bestPathLength) {
1917 bestMatch = item;
1918 bestPathLength = item.to.length;
1919 }
1920 }
1921 }
1922 return bestMatch;
1923 };
1924 var findDrilldownParent = (id, menuItems) => {
1925 if (!id) {
1926 return void 0;
1927 }
1928 const currentItem = menuItems.find((item) => item.id === id);
1929 if (!currentItem) {
1930 return void 0;
1931 }
1932 if (currentItem.parent) {
1933 const parentItem = menuItems.find(
1934 (item) => item.id === currentItem.parent
1935 );
1936 if (parentItem?.parent_type === "drilldown") {
1937 return parentItem.id;
1938 }
1939 if (parentItem) {
1940 return findDrilldownParent(parentItem.id, menuItems);
1941 }
1942 }
1943 return void 0;
1944 };
1945 var findDropdownParent = (id, menuItems) => {
1946 if (!id) {
1947 return void 0;
1948 }
1949 const currentItem = menuItems.find((item) => item.id === id);
1950 if (!currentItem) {
1951 return void 0;
1952 }
1953 if (currentItem.parent) {
1954 const parentItem = menuItems.find(
1955 (item) => item.id === currentItem.parent
1956 );
1957 if (parentItem?.parent_type === "dropdown") {
1958 return parentItem.id;
1959 }
1960 }
1961 return void 0;
1962 };
1963
1964 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1965 var { useRouter: useRouter2, useMatches } = unlock(routePrivateApis3);
1966 function useSidebarParent() {
1967 const matches = useMatches();
1968 const router = useRouter2();
1969 const menuItems = (0, import_data5.useSelect)(
1970 (select) => (
1971 // @ts-ignore
1972 select(STORE_NAME).getMenuItems()
1973 ),
1974 []
1975 );
1976 const currentPath = matches[matches.length - 1].pathname.slice(
1977 router.options.basepath?.length ?? 0
1978 );
1979 const currentMenuItem = findClosestMenuItem(currentPath, menuItems);
1980 const [parentId, setParentId] = (0, import_element7.useState)(
1981 findDrilldownParent(currentMenuItem?.id, menuItems)
1982 );
1983 const [parentDropdownId, setParentDropdownId] = (0, import_element7.useState)(findDropdownParent(currentMenuItem?.id, menuItems));
1984 (0, import_element7.useEffect)(() => {
1985 const matchedMenuItem = findClosestMenuItem(currentPath, menuItems);
1986 const updatedParentId = findDrilldownParent(
1987 matchedMenuItem?.id,
1988 menuItems
1989 );
1990 const updatedDropdownParent = findDropdownParent(
1991 matchedMenuItem?.id,
1992 menuItems
1993 );
1994 setParentId(updatedParentId);
1995 setParentDropdownId(updatedDropdownParent);
1996 }, [currentPath, menuItems]);
1997 return [
1998 parentId,
1999 setParentId,
2000 parentDropdownId,
2001 setParentDropdownId
2002 ];
2003 }
2004
2005 // packages/boot/build-module/components/navigation/index.mjs
2006 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
2007 function Navigation() {
2008 const backButtonRef = (0, import_element8.useRef)(null);
2009 const [animationDirection, setAnimationDirection] = (0, import_element8.useState)(null);
2010 const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent();
2011 const menuItems = (0, import_data6.useSelect)(
2012 (select) => (
2013 // @ts-ignore
2014 select(STORE_NAME).getMenuItems()
2015 ),
2016 []
2017 );
2018 const parent = (0, import_element8.useMemo)(
2019 () => menuItems.find((item) => item.id === parentId),
2020 [menuItems, parentId]
2021 );
2022 const navigationKey = parent ? `drilldown-${parent.id}` : "root";
2023 const handleNavigate = ({
2024 id,
2025 direction
2026 }) => {
2027 setAnimationDirection(direction);
2028 setParentId(id);
2029 };
2030 const handleDropdownToggle = (dropdownId) => {
2031 setParentDropdownId(
2032 parentDropdownId === dropdownId ? void 0 : dropdownId
2033 );
2034 };
2035 const items = (0, import_element8.useMemo)(
2036 () => menuItems.filter((item) => item.parent === parentId),
2037 [menuItems, parentId]
2038 );
2039 const hasRealIcons = items.some((item) => !!item.icon);
2040 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2041 NavigationScreen,
2042 {
2043 isRoot: !parent,
2044 title: parent ? parent.label : "",
2045 backMenuItem: parent?.parent,
2046 backButtonRef,
2047 animationDirection: animationDirection || void 0,
2048 navigationKey,
2049 onNavigate: handleNavigate,
2050 content: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: items.map((item) => {
2051 if (item.parent_type === "dropdown") {
2052 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2053 DropdownItem,
2054 {
2055 id: item.id,
2056 className: "boot-navigation-item",
2057 icon: item.icon,
2058 shouldShowPlaceholder: hasRealIcons,
2059 isExpanded: parentDropdownId === item.id,
2060 onToggle: () => handleDropdownToggle(item.id),
2061 children: item.label
2062 },
2063 item.id
2064 );
2065 }
2066 if (item.parent_type === "drilldown") {
2067 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2068 DrilldownItem,
2069 {
2070 id: item.id,
2071 icon: item.icon,
2072 shouldShowPlaceholder: hasRealIcons,
2073 onNavigate: handleNavigate,
2074 children: item.label
2075 },
2076 item.id
2077 );
2078 }
2079 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2080 NavigationItem,
2081 {
2082 to: item.to,
2083 icon: item.icon,
2084 shouldShowPlaceholder: hasRealIcons,
2085 children: item.label
2086 },
2087 item.id
2088 );
2089 }) })
2090 }
2091 );
2092 }
2093 var navigation_default = Navigation;
2094
2095 // packages/boot/build-module/components/save-button/index.mjs
2096 var import_element10 = __toESM(require_element(), 1);
2097 var import_data8 = __toESM(require_data(), 1);
2098 var import_i18n6 = __toESM(require_i18n(), 1);
2099 var import_core_data4 = __toESM(require_core_data(), 1);
2100 var import_keycodes2 = __toESM(require_keycodes(), 1);
2101 var import_editor2 = __toESM(require_editor(), 1);
2102 var import_components10 = __toESM(require_components(), 1);
2103
2104 // packages/boot/build-module/components/save-panel/use-save-shortcut.mjs
2105 var import_element9 = __toESM(require_element(), 1);
2106 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
2107 var import_i18n5 = __toESM(require_i18n(), 1);
2108 var import_data7 = __toESM(require_data(), 1);
2109 var import_core_data3 = __toESM(require_core_data(), 1);
2110 var import_editor = __toESM(require_editor(), 1);
2111 var shortcutName = "core/boot/save";
2112 function useSaveShortcut({
2113 openSavePanel
2114 }) {
2115 const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data3.store);
2116 const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor.store);
2117 const { savePost } = (0, import_data7.useDispatch)(import_editor.store);
2118 const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)(
2119 import_keyboard_shortcuts.store
2120 );
2121 (0, import_element9.useEffect)(() => {
2122 registerShortcut({
2123 name: shortcutName,
2124 category: "global",
2125 description: (0, import_i18n5.__)("Save your changes."),
2126 keyCombination: {
2127 modifier: "primary",
2128 character: "s"
2129 }
2130 });
2131 return () => {
2132 unregisterShortcut(shortcutName);
2133 };
2134 }, [registerShortcut, unregisterShortcut]);
2135 (0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => {
2136 event.preventDefault();
2137 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2138 const hasDirtyEntities = !!dirtyEntityRecords.length;
2139 const isSaving = dirtyEntityRecords.some(
2140 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2141 );
2142 if (!hasDirtyEntities || isSaving) {
2143 return;
2144 }
2145 if (hasNonPostEntityChanges()) {
2146 openSavePanel();
2147 } else if (!isPostSavingLocked()) {
2148 savePost();
2149 }
2150 });
2151 }
2152
2153 // packages/boot/build-module/components/save-button/index.mjs
2154 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
2155 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='294e36b777']")) {
2156 const style = document.createElement("style");
2157 style.setAttribute("data-wp-hash", "294e36b777");
2158 style.appendChild(document.createTextNode(".boot-save-button{width:100%}"));
2159 document.head.appendChild(style);
2160 }
2161 function SaveButton() {
2162 const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element10.useState)(false);
2163 const { isSaving, dirtyEntityRecordsCount } = (0, import_data8.useSelect)((select) => {
2164 const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data4.store);
2165 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2166 return {
2167 isSaving: dirtyEntityRecords.some(
2168 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2169 ),
2170 dirtyEntityRecordsCount: dirtyEntityRecords.length
2171 };
2172 }, []);
2173 const [showSavedState, setShowSavedState] = (0, import_element10.useState)(false);
2174 (0, import_element10.useEffect)(() => {
2175 if (isSaving) {
2176 setShowSavedState(true);
2177 }
2178 }, [isSaving]);
2179 const hasChanges = dirtyEntityRecordsCount > 0;
2180 (0, import_element10.useEffect)(() => {
2181 if (!isSaving && hasChanges) {
2182 setShowSavedState(false);
2183 }
2184 }, [isSaving, hasChanges]);
2185 function hideSavedState() {
2186 if (showSavedState) {
2187 setShowSavedState(false);
2188 }
2189 }
2190 const shouldShowButton = hasChanges || showSavedState;
2191 useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) });
2192 if (!shouldShowButton) {
2193 return null;
2194 }
2195 const isInSavedState = showSavedState && !hasChanges;
2196 const disabled = isSaving || isInSavedState;
2197 const getLabel = () => {
2198 if (isInSavedState) {
2199 return (0, import_i18n6.__)("Saved");
2200 }
2201 return (0, import_i18n6.sprintf)(
2202 // translators: %d: number of unsaved changes (number).
2203 (0, import_i18n6._n)(
2204 "Review %d change\u2026",
2205 "Review %d changes\u2026",
2206 dirtyEntityRecordsCount
2207 ),
2208 dirtyEntityRecordsCount
2209 );
2210 };
2211 const label = getLabel();
2212 return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2213 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2214 import_components10.Tooltip,
2215 {
2216 text: hasChanges ? label : void 0,
2217 shortcut: import_keycodes2.displayShortcut.primary("s"),
2218 children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2219 import_components10.Button,
2220 {
2221 variant: "primary",
2222 size: "compact",
2223 onClick: () => setIsSaveViewOpened(true),
2224 onBlur: hideSavedState,
2225 disabled,
2226 accessibleWhenDisabled: true,
2227 isBusy: isSaving,
2228 "aria-keyshortcuts": import_keycodes2.rawShortcut.primary("s"),
2229 className: "boot-save-button",
2230 icon: isInSavedState ? check_default : void 0,
2231 children: label
2232 }
2233 )
2234 }
2235 ),
2236 isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2237 import_components10.Modal,
2238 {
2239 title: (0, import_i18n6.__)("Review changes"),
2240 onRequestClose: () => setIsSaveViewOpened(false),
2241 size: "small",
2242 children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2243 import_editor2.EntitiesSavedStates,
2244 {
2245 close: () => setIsSaveViewOpened(false),
2246 variant: "inline"
2247 }
2248 )
2249 }
2250 )
2251 ] });
2252 }
2253
2254 // packages/boot/build-module/components/sidebar/index.mjs
2255 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
2256 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='6064f6f183']")) {
2257 const style = document.createElement("style");
2258 style.setAttribute("data-wp-hash", "6064f6f183");
2259 style.appendChild(document.createTextNode(".boot-sidebar__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}.boot-sidebar__content{contain:content;flex-grow:1;position:relative}.boot-sidebar__footer{padding:16px 8px 8px 16px}"));
2260 document.head.appendChild(style);
2261 }
2262 function Sidebar() {
2263 return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "boot-sidebar__scrollable", children: [
2264 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(site_hub_default, {}),
2265 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(navigation_default, {}) }),
2266 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__footer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SaveButton, {}) })
2267 ] });
2268 }
2269
2270 // packages/boot/build-module/components/save-panel/index.mjs
2271 var import_element11 = __toESM(require_element(), 1);
2272 var import_components11 = __toESM(require_components(), 1);
2273 var import_editor3 = __toESM(require_editor(), 1);
2274 var import_i18n7 = __toESM(require_i18n(), 1);
2275 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
2276 function SavePanel() {
2277 const [isOpen, setIsOpen] = (0, import_element11.useState)(false);
2278 useSaveShortcut({
2279 openSavePanel: () => setIsOpen(true)
2280 });
2281 if (!isOpen) {
2282 return false;
2283 }
2284 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2285 import_components11.Modal,
2286 {
2287 className: "edit-site-save-panel__modal",
2288 onRequestClose: () => setIsOpen(false),
2289 title: (0, import_i18n7.__)("Review changes"),
2290 size: "small",
2291 children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2292 import_editor3.EntitiesSavedStates,
2293 {
2294 close: () => setIsOpen(false),
2295 variant: "inline"
2296 }
2297 )
2298 }
2299 );
2300 }
2301
2302 // packages/boot/build-module/components/canvas-renderer/index.mjs
2303 var import_element13 = __toESM(require_element(), 1);
2304
2305 // packages/boot/build-module/components/canvas/index.mjs
2306 var import_element12 = __toESM(require_element(), 1);
2307 var import_components13 = __toESM(require_components(), 1);
2308 import { useNavigate } from "@wordpress/route";
2309
2310 // packages/boot/build-module/components/canvas/back-button.mjs
2311 var import_components12 = __toESM(require_components(), 1);
2312 var import_compose3 = __toESM(require_compose(), 1);
2313 var import_i18n8 = __toESM(require_i18n(), 1);
2314 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
2315 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c8750e18d1']")) {
2316 const style = document.createElement("style");
2317 style.setAttribute("data-wp-hash", "c8750e18d1");
2318 style.appendChild(document.createTextNode(".boot-canvas-back-button{height:64px;left:0;position:absolute;top:0;width:64px;z-index:100}.boot-canvas-back-button__container{height:100%;position:relative;width:100%}.boot-canvas-back-button__link.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);border-radius:0;display:inline-flex;height:64px;justify-content:center;padding:0;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-canvas-back-button__link.components-button{transition:outline .1s ease-out}}.boot-canvas-back-button__link.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-canvas-back-button__icon{align-items:center;background-color:#ccc;display:flex;height:64px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:64px}.boot-canvas-back-button__icon svg{fill:currentColor}.boot-canvas-back-button__icon.has-site-icon{-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px);background-color:#fff9}.interface-interface-skeleton__header{margin-top:0!important}"));
2319 document.head.appendChild(style);
2320 }
2321 var toggleHomeIconVariants = {
2322 edit: {
2323 opacity: 0,
2324 scale: 0.2
2325 },
2326 hover: {
2327 opacity: 1,
2328 scale: 1,
2329 clipPath: "inset( 22% round 2px )"
2330 }
2331 };
2332 function BootBackButton({ length }) {
2333 const disableMotion = (0, import_compose3.useReducedMotion)();
2334 const handleBack = () => {
2335 window.history.back();
2336 };
2337 if (length > 1) {
2338 return null;
2339 }
2340 const transition = {
2341 duration: disableMotion ? 0 : 0.3
2342 };
2343 return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2344 import_components12.__unstableMotion.div,
2345 {
2346 className: "boot-canvas-back-button",
2347 animate: "edit",
2348 initial: "edit",
2349 whileHover: "hover",
2350 whileTap: "tap",
2351 transition,
2352 children: [
2353 /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2354 import_components12.Button,
2355 {
2356 className: "boot-canvas-back-button__link",
2357 onClick: handleBack,
2358 "aria-label": (0, import_i18n8.__)("Go back"),
2359 __next40pxDefaultSize: true,
2360 children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(site_icon_default, {})
2361 }
2362 ),
2363 /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2364 import_components12.__unstableMotion.div,
2365 {
2366 className: "boot-canvas-back-button__icon",
2367 variants: toggleHomeIconVariants,
2368 children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components12.Icon, { icon: arrow_up_left_default })
2369 }
2370 )
2371 ]
2372 }
2373 );
2374 }
2375
2376 // packages/boot/build-module/components/canvas/index.mjs
2377 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2378 function Canvas({ canvas }) {
2379 const [Editor, setEditor] = (0, import_element12.useState)(null);
2380 const navigate = useNavigate();
2381 (0, import_element12.useEffect)(() => {
2382 import("@wordpress/lazy-editor").then((module) => {
2383 setEditor(() => module.Editor);
2384 }).catch((error) => {
2385 console.error("Failed to load lazy editor:", error);
2386 });
2387 }, []);
2388 if (!Editor) {
2389 return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2390 "div",
2391 {
2392 style: {
2393 display: "flex",
2394 justifyContent: "center",
2395 alignItems: "center",
2396 height: "100%",
2397 padding: "2rem"
2398 },
2399 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Spinner, {})
2400 }
2401 );
2402 }
2403 const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BootBackButton, { length }) : void 0;
2404 return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [
2405 /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2406 "div",
2407 {
2408 style: { height: "100%" },
2409 inert: canvas.isPreview ? "true" : void 0,
2410 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2411 Editor,
2412 {
2413 postType: canvas.postType,
2414 postId: canvas.postId,
2415 settings: {
2416 isPreviewMode: canvas.isPreview,
2417 styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : []
2418 },
2419 backButton
2420 }
2421 )
2422 }
2423 ),
2424 canvas.isPreview && canvas.editLink && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2425 "div",
2426 {
2427 onClick: () => navigate({ to: canvas.editLink }),
2428 onKeyDown: (e) => {
2429 if (e.key === "Enter" || e.key === " ") {
2430 e.preventDefault();
2431 navigate({ to: canvas.editLink });
2432 }
2433 },
2434 style: {
2435 position: "absolute",
2436 inset: 0,
2437 cursor: "pointer",
2438 zIndex: 1
2439 },
2440 role: "button",
2441 tabIndex: 0,
2442 "aria-label": "Click to edit"
2443 }
2444 )
2445 ] });
2446 }
2447
2448 // packages/boot/build-module/components/canvas-renderer/index.mjs
2449 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
2450 function CanvasRenderer({
2451 canvas,
2452 routeContentModule
2453 }) {
2454 const [CustomCanvas, setCustomCanvas] = (0, import_element13.useState)(null);
2455 (0, import_element13.useEffect)(() => {
2456 if (canvas === null && routeContentModule) {
2457 import(routeContentModule).then((module) => {
2458 setCustomCanvas(() => module.canvas);
2459 }).catch((error) => {
2460 console.error("Failed to load custom canvas:", error);
2461 });
2462 } else {
2463 setCustomCanvas(null);
2464 }
2465 }, [canvas, routeContentModule]);
2466 if (canvas === void 0) {
2467 return null;
2468 }
2469 if (canvas === null) {
2470 if (!CustomCanvas) {
2471 return null;
2472 }
2473 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CustomCanvas, {});
2474 }
2475 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Canvas, { canvas });
2476 }
2477
2478 // packages/boot/build-module/components/app/use-route-title.mjs
2479 var import_element14 = __toESM(require_element(), 1);
2480 var import_data9 = __toESM(require_data(), 1);
2481 var import_core_data5 = __toESM(require_core_data(), 1);
2482 var import_i18n9 = __toESM(require_i18n(), 1);
2483 var import_html_entities2 = __toESM(require_html_entities(), 1);
2484 import { speak } from "@wordpress/a11y";
2485 import { privateApis as routePrivateApis4 } from "@wordpress/route";
2486 var { useLocation, useMatches: useMatches2 } = unlock(routePrivateApis4);
2487 function useRouteTitle() {
2488 const location = useLocation();
2489 const matches = useMatches2();
2490 const currentMatch = matches[matches.length - 1];
2491 const routeTitle = currentMatch?.loaderData?.title;
2492 const siteTitle = (0, import_data9.useSelect)(
2493 (select) => select(import_core_data5.store).getEntityRecord(
2494 "root",
2495 "__unstableBase"
2496 )?.name,
2497 []
2498 );
2499 const isInitialLocationRef = (0, import_element14.useRef)(true);
2500 (0, import_element14.useEffect)(() => {
2501 isInitialLocationRef.current = false;
2502 }, [location]);
2503 (0, import_element14.useEffect)(() => {
2504 if (isInitialLocationRef.current) {
2505 return;
2506 }
2507 if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") {
2508 const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle);
2509 const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle);
2510 const formattedTitle = (0, import_i18n9.sprintf)(
2511 /* translators: Admin document title. 1: Admin screen name, 2: Site name. */
2512 (0, import_i18n9.__)("%1$s \u2039 %2$s \u2014 WordPress"),
2513 decodedRouteTitle,
2514 decodedSiteTitle
2515 );
2516 document.title = formattedTitle;
2517 if (decodedRouteTitle) {
2518 speak(decodedRouteTitle, "assertive");
2519 }
2520 }
2521 }, [routeTitle, siteTitle, location]);
2522 }
2523
2524 // packages/boot/build-module/components/user-theme-provider/index.mjs
2525 var import_theme = __toESM(require_theme(), 1);
2526 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
2527 var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider;
2528 var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([
2529 ["light", "#0085ba"],
2530 ["modern", "#3858e9"],
2531 ["blue", "#096484"],
2532 ["coffee", "#46403c"],
2533 ["ectoplasm", "#523f6d"],
2534 ["midnight", "#e14d43"],
2535 ["ocean", "#627c83"],
2536 ["sunrise", "#dd823b"]
2537 ]);
2538 function getAdminThemePrimaryColor() {
2539 const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1];
2540 return theme && THEME_PRIMARY_COLORS.get(theme);
2541 }
2542 function UserThemeProvider({
2543 color,
2544 ...restProps
2545 }) {
2546 const primary = getAdminThemePrimaryColor();
2547 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemeProvider, { ...restProps, color: { primary, ...color } });
2548 }
2549
2550 // packages/boot/build-module/components/root/index.mjs
2551 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
2552 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2553 const style = document.createElement("style");
2554 style.setAttribute("data-wp-hash", "be0c278a6c");
2555 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2556 document.head.appendChild(style);
2557 }
2558 var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock(routePrivateApis5);
2559 function Root() {
2560 const matches = useMatches3();
2561 const location = useLocation2();
2562 const currentMatch = matches[matches.length - 1];
2563 const canvas = currentMatch?.loaderData?.canvas;
2564 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2565 const isFullScreen = canvas && !canvas.isPreview;
2566 useRouteTitle();
2567 const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<");
2568 const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element15.useState)(false);
2569 const disableMotion = (0, import_compose4.useReducedMotion)();
2570 (0, import_element15.useEffect)(() => {
2571 setIsMobileSidebarOpen(false);
2572 }, [location.pathname, isMobileViewport]);
2573 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2574 "div",
2575 {
2576 className: clsx_default("boot-layout", {
2577 "has-canvas": !!canvas || canvas === null,
2578 "has-full-canvas": isFullScreen
2579 }),
2580 children: [
2581 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SavePanel, {}),
2582 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_notices.SnackbarNotices, { className: "boot-notices__snackbar" }),
2583 isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2584 import_components14.Button,
2585 {
2586 icon: menu_default,
2587 onClick: () => setIsMobileSidebarOpen(true),
2588 label: (0, import_i18n10.__)("Open navigation panel"),
2589 size: "compact"
2590 }
2591 ) }),
2592 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2593 import_components14.__unstableMotion.div,
2594 {
2595 initial: { opacity: 0 },
2596 animate: { opacity: 1 },
2597 exit: { opacity: 0 },
2598 transition: {
2599 type: "tween",
2600 duration: disableMotion ? 0 : 0.2,
2601 ease: "easeOut"
2602 },
2603 className: "boot-layout__sidebar-backdrop",
2604 onClick: () => setIsMobileSidebarOpen(false),
2605 onKeyDown: (event) => {
2606 if (event.key === "Escape") {
2607 setIsMobileSidebarOpen(false);
2608 }
2609 },
2610 role: "button",
2611 tabIndex: -1,
2612 "aria-label": (0, import_i18n10.__)(
2613 "Close navigation panel"
2614 )
2615 }
2616 ) }),
2617 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2618 import_components14.__unstableMotion.div,
2619 {
2620 initial: { x: "-100%" },
2621 animate: { x: 0 },
2622 exit: { x: "-100%" },
2623 transition: {
2624 type: "tween",
2625 duration: disableMotion ? 0 : 0.2,
2626 ease: "easeOut"
2627 },
2628 className: "boot-layout__sidebar is-mobile",
2629 children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {})
2630 }
2631 ) }),
2632 !isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {}) }),
2633 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2634 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Outlet, {}),
2635 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2636 "div",
2637 {
2638 className: clsx_default(
2639 "boot-layout__canvas",
2640 {
2641 "has-mobile-drawer": canvas?.isPreview && isMobileViewport
2642 }
2643 ),
2644 children: [
2645 canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__mobile-sidebar-drawer", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2646 import_components14.Button,
2647 {
2648 icon: menu_default,
2649 onClick: () => setIsMobileSidebarOpen(
2650 true
2651 ),
2652 label: (0, import_i18n10.__)(
2653 "Open navigation panel"
2654 ),
2655 size: "compact"
2656 }
2657 ) }),
2658 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2659 CanvasRenderer,
2660 {
2661 canvas,
2662 routeContentModule
2663 }
2664 )
2665 ]
2666 }
2667 )
2668 ] }) })
2669 ]
2670 }
2671 ) }) }) });
2672 }
2673
2674 // packages/boot/build-module/components/app/router.mjs
2675 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
2676 var {
2677 createLazyRoute,
2678 createRouter,
2679 createRootRoute,
2680 createRoute,
2681 RouterProvider,
2682 createBrowserHistory,
2683 parseHref,
2684 useLoaderData
2685 } = unlock(routePrivateApis6);
2686 function NotFoundComponent() {
2687 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(page_default, { title: (0, import_i18n11.__)("Route not found"), hasPadding: true, children: (0, import_i18n11.__)("The page you're looking for does not exist") }) });
2688 }
2689 function createRouteFromDefinition(route, parentRoute) {
2690 let tanstackRoute = createRoute({
2691 getParentRoute: () => parentRoute,
2692 path: route.path,
2693 beforeLoad: async (opts) => {
2694 if (route.route_module) {
2695 const module = await import(route.route_module);
2696 const routeConfig = module.route || {};
2697 if (routeConfig.beforeLoad) {
2698 return routeConfig.beforeLoad({
2699 params: opts.params || {},
2700 search: opts.search || {}
2701 });
2702 }
2703 }
2704 },
2705 loader: async (opts) => {
2706 let routeConfig = {};
2707 if (route.route_module) {
2708 const module = await import(route.route_module);
2709 routeConfig = module.route || {};
2710 }
2711 const context = {
2712 params: opts.params || {},
2713 search: opts.deps || {}
2714 };
2715 const [, loaderData, canvasData, titleData] = await Promise.all([
2716 (0, import_data10.resolveSelect)(import_core_data6.store).getEntityRecord(
2717 "root",
2718 "__unstableBase"
2719 ),
2720 routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0),
2721 routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0),
2722 routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0)
2723 ]);
2724 let inspector = true;
2725 if (routeConfig.inspector) {
2726 inspector = await routeConfig.inspector(context);
2727 }
2728 return {
2729 ...loaderData,
2730 canvas: canvasData,
2731 inspector,
2732 title: titleData,
2733 routeContentModule: route.content_module
2734 };
2735 },
2736 loaderDeps: (opts) => opts.search
2737 });
2738 tanstackRoute = tanstackRoute.lazy(async () => {
2739 const module = route.content_module ? await import(route.content_module) : {};
2740 const Stage = module.stage;
2741 const Inspector = module.inspector;
2742 return createLazyRoute(route.path)({
2743 component: function RouteComponent() {
2744 const { inspector: showInspector } = useLoaderData({ from: route.path }) ?? {};
2745 return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
2746 Stage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Stage, {}) }),
2747 Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__inspector", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Inspector, {}) })
2748 ] });
2749 }
2750 });
2751 });
2752 return tanstackRoute;
2753 }
2754 function createRouteTree(routes, rootComponent = Root) {
2755 const rootRoute = createRootRoute({
2756 component: rootComponent,
2757 context: () => ({})
2758 });
2759 const dynamicRoutes = routes.map(
2760 (route) => createRouteFromDefinition(route, rootRoute)
2761 );
2762 return rootRoute.addChildren(dynamicRoutes);
2763 }
2764 function createPathHistory() {
2765 return createBrowserHistory({
2766 parseLocation: () => {
2767 const url = new URL(window.location.href);
2768 const path = url.searchParams.get("p") || "/";
2769 const pathHref = `${path}${url.hash}`;
2770 return parseHref(pathHref, window.history.state);
2771 },
2772 createHref: (href) => {
2773 const searchParams = new URLSearchParams(window.location.search);
2774 searchParams.set("p", href);
2775 return `${window.location.pathname}?${searchParams}`;
2776 }
2777 });
2778 }
2779 function Router({
2780 routes,
2781 rootComponent = Root
2782 }) {
2783 const router = (0, import_element16.useMemo)(() => {
2784 const history = createPathHistory();
2785 const routeTree = createRouteTree(routes, rootComponent);
2786 return createRouter({
2787 history,
2788 routeTree,
2789 defaultPreload: "intent",
2790 defaultNotFoundComponent: NotFoundComponent,
2791 defaultViewTransition: {
2792 types: ({
2793 fromLocation
2794 }) => {
2795 if (!fromLocation) {
2796 return false;
2797 }
2798 return ["navigate"];
2799 }
2800 }
2801 });
2802 }, [routes, rootComponent]);
2803 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RouterProvider, { router });
2804 }
2805
2806 // packages/boot/build-module/components/root/single-page.mjs
2807 var import_notices2 = __toESM(require_notices(), 1);
2808 var import_components15 = __toESM(require_components(), 1);
2809 import { privateApis as routePrivateApis7 } from "@wordpress/route";
2810 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
2811 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2812 const style = document.createElement("style");
2813 style.setAttribute("data-wp-hash", "be0c278a6c");
2814 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2815 document.head.appendChild(style);
2816 }
2817 var { useMatches: useMatches4, Outlet: Outlet2 } = unlock(routePrivateApis7);
2818 function RootSinglePage() {
2819 const matches = useMatches4();
2820 const currentMatch = matches[matches.length - 1];
2821 const canvas = currentMatch?.loaderData?.canvas;
2822 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2823 const isFullScreen = canvas && !canvas.isPreview;
2824 useRouteTitle();
2825 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components15.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2826 "div",
2827 {
2828 className: clsx_default(
2829 "boot-layout boot-layout--single-page",
2830 {
2831 "has-canvas": !!canvas || canvas === null,
2832 "has-full-canvas": isFullScreen
2833 }
2834 ),
2835 children: [
2836 /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SavePanel, {}),
2837 /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_notices2.SnackbarNotices, { className: "boot-notices__snackbar" }),
2838 /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2839 /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Outlet2, {}),
2840 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2841 CanvasRenderer,
2842 {
2843 canvas,
2844 routeContentModule
2845 }
2846 ) })
2847 ] }) })
2848 ]
2849 }
2850 ) }) }) });
2851 }
2852
2853 // packages/boot/build-module/components/app/index.mjs
2854 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
2855 function App({ rootComponent }) {
2856 const routes = (0, import_data11.useSelect)((select) => select(store).getRoutes(), []);
2857 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Router, { routes, rootComponent });
2858 }
2859 async function init({
2860 mountId,
2861 menuItems,
2862 routes,
2863 initModules,
2864 dashboardLink
2865 }) {
2866 (menuItems ?? []).forEach((menuItem) => {
2867 (0, import_data11.dispatch)(store).registerMenuItem(menuItem.id, menuItem);
2868 });
2869 (routes ?? []).forEach((route) => {
2870 (0, import_data11.dispatch)(store).registerRoute(route);
2871 });
2872 if (dashboardLink) {
2873 (0, import_data11.dispatch)(store).setDashboardLink(dashboardLink);
2874 }
2875 for (const moduleId of initModules ?? []) {
2876 const module = await import(moduleId);
2877 await module.init();
2878 }
2879 const rootElement = document.getElementById(mountId);
2880 if (rootElement) {
2881 const root = (0, import_element17.createRoot)(rootElement);
2882 root.render(
2883 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, {}) })
2884 );
2885 }
2886 }
2887 async function initSinglePage({
2888 mountId,
2889 routes
2890 }) {
2891 (routes ?? []).forEach((route) => {
2892 (0, import_data11.dispatch)(store).registerRoute(route);
2893 });
2894 const rootElement = document.getElementById(mountId);
2895 if (rootElement) {
2896 const root = (0, import_element17.createRoot)(rootElement);
2897 root.render(
2898 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, { rootComponent: RootSinglePage }) })
2899 );
2900 }
2901 }
2902
2903 // packages/boot/build-module/index.mjs
2904 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='fd7d52554d']")) {
2905 const style = document.createElement("style");
2906 style.setAttribute("data-wp-hash", "fd7d52554d");
2907 style.appendChild(document.createTextNode(':root{--wpds-border-radius-xs:1px;--wpds-border-radius-sm:2px;--wpds-border-radius-md:4px;--wpds-border-radius-lg:8px;--wpds-border-width-xs:1px;--wpds-border-width-sm:2px;--wpds-border-width-md:4px;--wpds-border-width-lg:8px;--wpds-border-width-focus:2px;--wpds-color-bg-surface-neutral:#fcfcfc;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f4f4f4;--wpds-color-bg-surface-brand:#ecf0fa;--wpds-color-bg-surface-success:#c6f7cd;--wpds-color-bg-surface-success-weak:#ebffed;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f3f9ff;--wpds-color-bg-surface-warning:#fde6be;--wpds-color-bg-surface-warning-weak:#fff7e1;--wpds-color-bg-surface-caution:#fee995;--wpds-color-bg-surface-caution-weak:#fff9ca;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f5;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e6e6e6;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#ededed;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f5;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-track-neutral-weak:#e4e4e4;--wpds-color-bg-track-neutral:#dbdbdb;--wpds-color-bg-thumb-neutral-weak:#8d8d8d;--wpds-color-bg-thumb-neutral-weak-active:#6e6e6e;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#dbdbdb;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#707070;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#008030;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-weak:#707070;--wpds-color-fg-interactive-neutral-weak-disabled:#8d8d8d;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-stroke-surface-neutral:#dbdbdb;--wpds-color-stroke-surface-neutral-weak:#e4e4e4;--wpds-color-stroke-surface-neutral-strong:#8d8d8d;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#008030;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-warning:#d0b481;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8d8d8d;--wpds-color-stroke-interactive-neutral-active:#6e6e6e;--wpds-color-stroke-interactive-neutral-disabled:#dbdbdb;--wpds-color-stroke-interactive-neutral-strong:#6e6e6e;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-focus-brand:#3858e9;--wpds-cursor-control:pointer;--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px;--wpds-elevation-xs:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-elevation-sm:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-md:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-lg:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-motion-duration-xs:50ms;--wpds-motion-duration-sm:100ms;--wpds-motion-duration-md:200ms;--wpds-motion-duration-lg:300ms;--wpds-motion-duration-xl:400ms;--wpds-motion-easing-subtle:cubic-bezier(0.15,0,0.15,1);--wpds-motion-easing-balanced:cubic-bezier(0.4,0,0.2,1);--wpds-motion-easing-expressive:cubic-bezier(0.25,0,0,1);--wpds-typography-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-typography-font-size-xs:11px;--wpds-typography-font-size-sm:12px;--wpds-typography-font-size-md:13px;--wpds-typography-font-size-lg:15px;--wpds-typography-font-size-xl:20px;--wpds-typography-font-size-2xl:32px;--wpds-typography-line-height-xs:16px;--wpds-typography-line-height-sm:20px;--wpds-typography-line-height-md:24px;--wpds-typography-line-height-lg:28px;--wpds-typography-line-height-xl:32px;--wpds-typography-line-height-2xl:40px;--wpds-typography-font-weight-regular:400;--wpds-typography-font-weight-medium:499}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:4px;--wpds-dimension-padding-md:8px;--wpds-dimension-padding-lg:12px;--wpds-dimension-padding-xl:16px;--wpds-dimension-padding-2xl:20px;--wpds-dimension-padding-3xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:4px;--wpds-dimension-gap-md:8px;--wpds-dimension-gap-lg:12px;--wpds-dimension-gap-xl:20px;--wpds-dimension-gap-2xl:24px;--wpds-dimension-gap-3xl:32px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-padding-xs:8px;--wpds-dimension-padding-sm:12px;--wpds-dimension-padding-md:16px;--wpds-dimension-padding-lg:20px;--wpds-dimension-padding-xl:24px;--wpds-dimension-padding-2xl:32px;--wpds-dimension-padding-3xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-2xl:40px;--wpds-dimension-gap-3xl:48px}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}@media (min-width:600px){.boot-layout-container .boot-layout{bottom:0;left:0;min-height:calc(100vh - 46px);position:absolute;right:0;top:0}}@media (min-width:782px){.boot-layout-container .boot-layout{min-height:calc(100vh - 32px)}body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout{min-height:100vh}}.boot-layout-container .boot-layout img{height:auto;max-width:100%}.boot-layout .boot-notices__snackbar{bottom:24px;box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.boot-layout .boot-notices__snackbar .components-snackbar{margin-inline:auto}'));
2908 document.head.appendChild(style);
2909 }
2910 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='cc217bc358']")) {
2911 const style = document.createElement("style");
2912 style.setAttribute("data-wp-hash", "cc217bc358");
2913 style.appendChild(document.createTextNode("@media (max-width:782px){*{view-transition-name:none!important}}::view-transition-new(root),::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){.boot-layout__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.boot-layout__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.boot-layout.has-full-canvas .boot-layout__canvas .boot-site-icon-link,.boot-layout:not(.has-full-canvas) .boot-site-hub .boot-site-icon-link{view-transition-name:boot--site-icon-link}.boot-layout__stage{view-transition-name:boot--stage}.boot-layout__inspector{view-transition-name:boot--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.boot-layout__stage{view-transition-name:boot-safari--stage}.boot-layout__inspector{view-transition-name:boot-safari--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot-safari--canvas}}.components-popover:first-of-type{view-transition-name:boot--components-popover}}::view-transition-group(boot--canvas),::view-transition-group(boot--canvas-header),::view-transition-group(boot--canvas-sidebar),::view-transition-group(boot-safari--canvas){z-index:1}::view-transition-group(boot--site-icon-link){z-index:2}::view-transition-new(boot--site-icon-link),::view-transition-old(boot--site-icon-link){animation:none}::view-transition-new(boot-safari--canvas),::view-transition-new(boot-safari--inspector),::view-transition-new(boot-safari--stage),::view-transition-old(boot-safari--canvas),::view-transition-old(boot-safari--inspector),::view-transition-old(boot-safari--stage){width:auto}::view-transition-new(boot--canvas),::view-transition-new(boot--inspector),::view-transition-new(boot--stage),::view-transition-old(boot--canvas),::view-transition-old(boot--inspector),::view-transition-old(boot--stage){background:#fff;border-radius:8px;height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}::view-transition-new(boot--canvas),::view-transition-old(boot--canvas){object-position:center top}::view-transition-old(boot--inspector):only-child,::view-transition-old(boot--stage):only-child,::view-transition-old(boot-safari--inspector):only-child,::view-transition-old(boot-safari--stage):only-child{animation-name:zoomOut;will-change:transform,opacity}::view-transition-new(boot--inspector):only-child,::view-transition-new(boot--stage):only-child,::view-transition-new(boot-safari--inspector):only-child,::view-transition-new(boot-safari--stage):only-child{animation-name:zoomIn;will-change:transform,opacity}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}::view-transition-new(boot--canvas):only-child,::view-transition-new(boot-safari--canvas):only-child{animation-name:slideFromRight;will-change:transform}::view-transition-old(boot--canvas):only-child,::view-transition-old(boot-safari--canvas):only-child{animation-name:slideToRight;will-change:transform}@keyframes slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}::view-transition-new(boot--canvas-header):only-child{animation-name:slideHeaderFromTop;will-change:transform}::view-transition-old(boot--canvas-header):only-child{animation-name:slideHeaderToTop;will-change:transform}@keyframes slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes slideHeaderToTop{to{transform:translateY(-100%)}}::view-transition-new(boot--canvas-sidebar):only-child{animation-name:slideSidebarFromRight;will-change:transform}::view-transition-old(boot--canvas-sidebar):only-child{animation-name:slideSidebarToRight;will-change:transform}@keyframes slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes slideSidebarToRight{to{transform:translateX(100%)}}"));
2914 document.head.appendChild(style);
2915 }
2916 export {
2917 init,
2918 initSinglePage,
2919 store
2920 };
2921 //# sourceMappingURL=index.js.map
2922