PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 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 All 404 releases
← All changes | build/scripts/format-library/index.js +4332 -1142 23.8.0 → trunk View file →
@@ -1,5 +1,6 @@
1 1 (function() {
2 +"use strict";
2 3 var wp;
3 4 (wp ||= {}).formatLibrary = (() => {
4 5 var __create = Object.create;
5 6 var __defProp = Object.defineProperty;
@@ -108,9 +109,9 @@
108 109 function is(x, y) {
109 110 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
110 111 }
111 112 function useSyncExternalStore$2(subscribe2, getSnapshot2) {
112 - didWarnOld18Alpha || void 0 === React32.startTransition || (didWarnOld18Alpha = true, console.error(
113 + didWarnOld18Alpha || void 0 === React51.startTransition || (didWarnOld18Alpha = true, console.error(
113 114 "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
114 115 ));
115 116 var value = getSnapshot2();
116 117 if (!didWarnUncachedGetSnapshot) {
@@ -118,9 +119,9 @@
118 119 objectIs(value, cachedValue) || (console.error(
119 120 "The result of getSnapshot should be cached to avoid an infinite loop"
120 121 ), didWarnUncachedGetSnapshot = true);
121 122 }
122 - cachedValue = useState17({
123 + cachedValue = useState21({
123 124 inst: { value, getSnapshot: getSnapshot2 }
124 125 });
125 126 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
126 127 useLayoutEffect3(
@@ -130,9 +131,9 @@
130 131 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
131 132 },
132 133 [subscribe2, value, getSnapshot2]
133 134 );
134 - useEffect12(
135 + useEffect14(
135 136 function() {
136 137 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
137 138 return subscribe2(function() {
138 139 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
@@ -156,10 +157,10 @@
156 157 function useSyncExternalStore$1(subscribe2, getSnapshot2) {
157 158 return getSnapshot2();
158 159 }
159 160 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
160 - var React32 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState17 = React32.useState, useEffect12 = React32.useEffect, useLayoutEffect3 = React32.useLayoutEffect, useDebugValue = React32.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
161 - exports.useSyncExternalStore = void 0 !== React32.useSyncExternalStore ? React32.useSyncExternalStore : shim;
161 + var React51 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React51.useState, useEffect14 = React51.useEffect, useLayoutEffect3 = React51.useLayoutEffect, useDebugValue = React51.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
162 + exports.useSyncExternalStore = void 0 !== React51.useSyncExternalStore ? React51.useSyncExternalStore : shim;
162 163 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
163 164 })();
164 165 }
165 166 });
@@ -175,15 +176,8 @@
175 176 }
176 177 }
177 178 });
178 179
179 - // package-external:@wordpress/a11y
180 - var require_a11y = __commonJS({
181 - "package-external:@wordpress/a11y"(exports, module) {
182 - module.exports = window.wp.a11y;
183 - }
184 - });
185 -
186 180 // package-external:@wordpress/compose
187 181 var require_compose = __commonJS({
188 182 "package-external:@wordpress/compose"(exports, module) {
189 183 module.exports = window.wp.compose;
@@ -189,12 +183,12 @@
189 183 module.exports = window.wp.compose;
190 184 }
191 185 });
192 186
193 - // package-external:@wordpress/private-apis
194 - var require_private_apis = __commonJS({
195 - "package-external:@wordpress/private-apis"(exports, module) {
196 - module.exports = window.wp.privateApis;
187 + // package-external:@wordpress/a11y
188 + var require_a11y = __commonJS({
189 + "package-external:@wordpress/a11y"(exports, module) {
190 + module.exports = window.wp.a11y;
197 191 }
198 192 });
199 193
200 194 // package-external:@wordpress/url
@@ -228,13 +222,19 @@
228 222
229 223 // packages/icons/build-module/icon/index.mjs
230 224 var import_element = __toESM(require_element(), 1);
231 225 var icon_default = (0, import_element.forwardRef)(
232 - ({ icon, size = 24, ...props }, ref) => {
226 + ({ icon, size = 24, style, ...props }, ref) => {
227 + const intrinsicStyle = icon.props.style;
228 + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
233 229 return (0, import_element.cloneElement)(icon, {
234 230 width: size,
235 231 height: size,
236 232 ...props,
233 + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
234 + // stroke-based icons) is preserved unless the consumer overrides
235 + // the same property explicitly.
236 + ...mergedStyle ? { style: mergedStyle } : {},
237 237 ref
238 238 });
239 239 }
240 240 );
@@ -241,82 +241,107 @@
241 241
242 242 // packages/icons/build-module/library/button.mjs
243 243 var import_primitives = __toESM(require_primitives(), 1);
244 244 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
245 - var button_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) });
245 + var button_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M8 11.75H16M5 16.25H19C19.6904 16.25 20.25 15.6904 20.25 15V8.5C20.25 7.80964 19.6904 7.25 19 7.25H5C4.30964 7.25 3.75 7.80964 3.75 8.5V15C3.75 15.6904 4.30964 16.25 5 16.25Z", vectorEffect: "non-scaling-stroke" }) });
246 246
247 247 // packages/icons/build-module/library/chevron-right.mjs
248 248 var import_primitives2 = __toESM(require_primitives(), 1);
249 249 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
250 - var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
250 + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
251 251
252 252 // packages/icons/build-module/library/code.mjs
253 253 var import_primitives3 = __toESM(require_primitives(), 1);
254 254 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
255 - var code_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
255 + var code_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M7.99997 7L3.70708 11.2929C3.31655 11.6834 3.31655 12.3166 3.70708 12.7071L7.99997 17M16 17L20.2929 12.7071C20.6834 12.3166 20.6834 11.6834 20.2929 11.2929L16 7", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) });
256 256
257 257 // packages/icons/build-module/library/color.mjs
258 258 var import_primitives4 = __toESM(require_primitives(), 1);
259 259 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
260 - var color_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) });
260 + var color_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17.25 14C17.25 16.8995 14.8995 19.25 12 19.25C9.10051 19.25 6.75 16.8995 6.75 14C6.75 11.1005 10 7.37 12 5.12C14 7.37 17.25 11.1005 17.25 14Z", vectorEffect: "non-scaling-stroke" }) });
261 261
262 - // packages/icons/build-module/library/format-bold.mjs
262 + // packages/icons/build-module/library/error.mjs
263 263 var import_primitives5 = __toESM(require_primitives(), 1);
264 264 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
265 - var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" }) });
265 + var error_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z", vectorEffect: "non-scaling-stroke" }) });
266 266
267 - // packages/icons/build-module/library/format-italic.mjs
267 + // packages/icons/build-module/library/format-bold.mjs
268 268 var import_primitives6 = __toESM(require_primitives(), 1);
269 269 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
270 - var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) });
270 + var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M13 11.5H7.75M13 11.5L13.7412 11.6059C15.3242 11.832 16.5 13.1877 16.5 14.7868C16.5 16.5614 15.0614 18 13.2868 18H7.75C7.75 18 7.75 14.9338 7.75 11.5M13 11.5L13.2913 11.4417C14.5756 11.1849 15.5 10.0573 15.5 8.74755C15.5 7.23012 14.2699 6 12.7525 6H7.75C7.75 7.65199 7.75 9.63049 7.75 11.5", vectorEffect: "non-scaling-stroke" }) });
271 271
272 - // packages/icons/build-module/library/format-strikethrough.mjs
272 + // packages/icons/build-module/library/format-italic.mjs
273 273 var import_primitives7 = __toESM(require_primitives(), 1);
274 274 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
275 - var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) });
275 + var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M11 19L13.5 5", vectorEffect: "non-scaling-stroke" }) });
276 276
277 - // packages/icons/build-module/library/help.mjs
277 + // packages/icons/build-module/library/format-strikethrough.mjs
278 278 var import_primitives8 = __toESM(require_primitives(), 1);
279 279 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
280 - var help_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) });
280 + var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M9 16.1554C12 18.02 15 16.5283 15 14.2908C15 13.6314 14.6839 12.999 14.1213 12.5328C14.108 12.5217 14.0945 12.5108 14.081 12.5M9 9.31845C9 7.49773 11.4313 6.3247 13.9199 7.4278M5.5 12.5H14.081M18.5 12.5H14.081", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) });
281 281
282 - // packages/icons/build-module/library/inline-image.mjs
282 + // packages/icons/build-module/library/help.mjs
283 283 var import_primitives9 = __toESM(require_primitives(), 1);
284 284 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
285 - var inline_image_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" }) });
285 + var help_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
286 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M9.75 10.25C9.75 9.00736 10.7574 8 12 8C13.2426 8 14.25 9.00736 14.25 10.25C14.25 11.4083 13.3748 12.3621 12.2496 12.4863C12.1124 12.5015 12 12.6119 12 12.75V14M12 15V16.5", vectorEffect: "non-scaling-stroke" }),
287 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" })
288 + ] });
286 289
287 - // packages/icons/build-module/library/language.mjs
290 + // packages/icons/build-module/library/inline-image.mjs
288 291 var import_primitives10 = __toESM(require_primitives(), 1);
289 292 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
290 - var language_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z" }) });
293 + var inline_image_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M13.25 11.3197L11.4155 9.48453C11.3765 9.44547 11.3132 9.44546 11.2741 9.48452L9.05837 11.7003C9.02448 11.7341 8.97132 11.7392 8.93163 11.7124L7.0648 10.4495C7.03003 10.426 6.98426 10.4267 6.95022 10.4513L4.75 12.0405M13.25 11.3197V7C13.25 6.30964 12.6904 5.75 12 5.75H6C5.30964 5.75 4.75 6.30965 4.75 7V12.0405M13.25 11.3197V13C13.25 13.6904 12.6904 14.25 12 14.25H6C5.30964 14.25 4.75 13.6904 4.75 13V12.0405M16 14H20M4 18H20", vectorEffect: "non-scaling-stroke" }) });
291 294
292 - // packages/icons/build-module/library/link.mjs
295 + // packages/icons/build-module/library/language.mjs
293 296 var import_primitives11 = __toESM(require_primitives(), 1);
294 297 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
295 - var link_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
298 + var language_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
299 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M3 6H9.5M16 6H13.5M9.5 6V3M9.5 6H13.5M13.5 6C13.0477 7.24386 11.7361 9.79194 9.44037 12.5512M5.5 16.5C7.04336 15.2139 8.35238 13.8588 9.44037 12.5512M6.5 8C6.9232 8.9522 7.93743 10.7507 9.44037 12.5512M12.5 15.5C11.3314 14.6235 10.305 13.587 9.44037 12.5512", vectorEffect: "non-scaling-stroke" }),
300 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M13.75 20V19.75L14.6667 17M14.6667 17L16.75 10.75H17.25L19.3333 17L20.25 19.75V20M19.3333 17H14.6667", vectorEffect: "non-scaling-stroke" })
301 + ] });
296 302
297 - // packages/icons/build-module/library/math.mjs
303 + // packages/icons/build-module/library/link.mjs
298 304 var import_primitives12 = __toESM(require_primitives(), 1);
299 305 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
300 - var math_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) });
306 + var link_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) });
301 307
302 - // packages/icons/build-module/library/subscript.mjs
308 + // packages/icons/build-module/library/math.mjs
303 309 var import_primitives13 = __toESM(require_primitives(), 1);
304 310 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
305 - var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
311 + var math_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M3 14H5L6.8916 16.3645C6.93974 16.4247 7.03496 16.4101 7.06289 16.3383L10.2521 8.13755C10.4015 7.75318 10.7717 7.5 11.1841 7.5H19M17 11L14.5 13.5M12 16L14.5 13.5M14.5 13.5L17 16M14.5 13.5L12 11", vectorEffect: "non-scaling-stroke" }) });
306 312
307 - // packages/icons/build-module/library/superscript.mjs
313 + // packages/icons/build-module/library/published.mjs
308 314 var import_primitives14 = __toESM(require_primitives(), 1);
309 315 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
310 - var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
316 + var published_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
317 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
318 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" })
319 + ] });
311 320
312 - // packages/icons/build-module/library/text-color.mjs
321 + // packages/icons/build-module/library/subscript.mjs
313 322 var import_primitives15 = __toESM(require_primitives(), 1);
314 323 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
315 - var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" }) });
324 + var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
325 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M17.75 18.5988H15.75C15.75 16.5322 17.75 17.0489 17.75 15.4989C17.75 14.7239 16.75 14.0738 15.75 14.8488", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
326 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
327 + ] });
316 328
329 + // packages/icons/build-module/library/superscript.mjs
330 + var import_primitives16 = __toESM(require_primitives(), 1);
331 + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
332 + var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
333 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M17.75 8.59884H15.75C15.75 6.53219 17.75 7.04885 17.75 5.49887C17.75 4.72388 16.75 4.07384 15.75 4.84884", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
334 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
335 + ] });
336 +
337 + // packages/icons/build-module/library/text-color.mjs
338 + var import_primitives17 = __toESM(require_primitives(), 1);
339 + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
340 + var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.Path, { d: "M8 17.5V17.223L9.01577 14.1757M9.01577 14.1757L11.3243 7.25H11.8784L14.1869 14.1757L15.2027 17.223V17.5M14.1869 14.1757H9.01577", vectorEffect: "non-scaling-stroke" }) });
341 +
317 342 // packages/format-library/build-module/bold/index.mjs
318 - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
343 + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
319 344 var name = "core/bold";
320 345 var title = (0, import_i18n.__)("Bold");
321 346 var bold = {
322 347 name,
@@ -322,18 +347,24 @@
322 347 name,
323 348 title,
324 349 tagName: "strong",
325 350 className: null,
326 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
351 + edit({
352 + isActive,
353 + value,
354 + onChange,
355 + onFocus,
356 + isVisible = true
357 + }) {
327 358 function onToggle() {
328 359 onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
329 360 }
330 361 function onClick() {
331 - onChange((0, import_rich_text.toggleFormat)(value, { type: name }));
362 + onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
332 363 onFocus();
333 364 }
334 - return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
335 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
365 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
366 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
336 367 import_block_editor.RichTextShortcut,
337 368 {
338 369 type: "primary",
339 370 character: "b",
@@ -339,9 +370,9 @@
339 370 character: "b",
340 371 onUse: onToggle
341 372 }
342 373 ),
343 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
374 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
344 375 import_block_editor.RichTextToolbarButton,
345 376 {
346 377 name: "bold",
347 378 icon: format_bold_default,
@@ -351,9 +382,9 @@
351 382 shortcutType: "primary",
352 383 shortcutCharacter: "b"
353 384 }
354 385 ),
355 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
386 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
356 387 import_block_editor.__unstableRichTextInputEvent,
357 388 {
358 389 inputType: "formatBold",
359 390 onInput: onToggle
@@ -366,9 +397,9 @@
366 397 // packages/format-library/build-module/code/index.mjs
367 398 var import_i18n2 = __toESM(require_i18n(), 1);
368 399 var import_rich_text2 = __toESM(require_rich_text(), 1);
369 400 var import_block_editor2 = __toESM(require_block_editor(), 1);
370 - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
401 + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
371 402 var name2 = "core/code";
372 403 var title2 = (0, import_i18n2.__)("Inline code");
373 404 var code = {
374 405 name: name2,
@@ -398,15 +429,20 @@
398 429 value = (0, import_rich_text2.remove)(value, endIndex, endIndex + 1);
399 430 value = (0, import_rich_text2.applyFormat)(value, { type: name2 }, startIndex, endIndex);
400 431 return value;
401 432 },
402 - edit({ value, onChange, onFocus, isActive }) {
433 + edit({
434 + value,
435 + onChange,
436 + onFocus,
437 + isActive
438 + }) {
403 439 function onClick() {
404 440 onChange((0, import_rich_text2.toggleFormat)(value, { type: name2, title: title2 }));
405 441 onFocus();
406 442 }
407 - return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
408 - /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
443 + return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
444 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
409 445 import_block_editor2.RichTextShortcut,
410 446 {
411 447 type: "access",
412 448 character: "x",
@@ -412,9 +448,9 @@
412 448 character: "x",
413 449 onUse: onClick
414 450 }
415 451 ),
416 - /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
452 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
417 453 import_block_editor2.RichTextToolbarButton,
418 454 {
419 455 icon: code_default,
420 456 title: title2,
@@ -448,23 +484,34 @@
448 484
449 485 // node_modules/@base-ui/utils/useControlled.mjs
450 486 var React = __toESM(require_react(), 1);
451 487
452 - // node_modules/@base-ui/utils/error.mjs
453 - var set;
488 + // node_modules/@base-ui/utils/createLogOnce.mjs
489 + var loggedMessages;
454 490 if (true) {
455 - set = /* @__PURE__ */ new Set();
491 + loggedMessages = /* @__PURE__ */ new Set();
456 492 }
457 - function error(...messages) {
458 - if (true) {
459 - const messageKey = messages.join(" ");
460 - if (!set.has(messageKey)) {
461 - set.add(messageKey);
462 - console.error(`Base UI: ${messageKey}`);
493 + function createLogOnce(severity, prefix) {
494 + return function logOnce(...messages) {
495 + if (true) {
496 + const message = messages.join(" ");
497 + const output = prefix ? `${prefix}: ${message}` : message;
498 + const key = `${severity}:${output}`;
499 + if (!loggedMessages.has(key)) {
500 + loggedMessages.add(key);
501 + if (severity === "warn") {
502 + console.warn(output);
503 + } else {
504 + console.error(output);
505 + }
506 + }
463 507 }
464 - }
508 + };
465 509 }
466 510
511 + // node_modules/@base-ui/utils/error.mjs
512 + var error = createLogOnce("error", "Base UI");
513 +
467 514 // node_modules/@base-ui/utils/useControlled.mjs
468 515 function useControlled({
469 516 controlled,
470 517 default: defaultProp,
@@ -474,9 +521,9 @@
474 521 const {
475 522 current: isControlled
476 523 } = React.useRef(controlled !== void 0);
477 524 const [valueState, setValue] = React.useState(defaultProp);
478 - const value = isControlled ? controlled : valueState;
525 + const value = isControlled && controlled !== void 0 ? controlled : valueState;
479 526 if (true) {
480 527 React.useEffect(() => {
481 528 if (isControlled !== (controlled !== void 0)) {
482 529 error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name16} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name16} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
@@ -574,8 +621,20 @@
574 621 );
575 622 }
576 623 }
577 624
625 + // node_modules/@base-ui/utils/warn.mjs
626 + var warn = createLogOnce("warn", "Base UI");
627 +
628 + // node_modules/@base-ui/utils/empty.mjs
629 + function NOOP() {
630 + }
631 + var EMPTY_ARRAY = Object.freeze([]);
632 + var EMPTY_OBJECT = Object.freeze({});
633 +
634 + // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
635 + var React6 = __toESM(require_react(), 1);
636 +
578 637 // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
579 638 var React4 = __toESM(require_react(), 1);
580 639 var noop = () => {
581 640 };
@@ -580,26 +639,8 @@
580 639 var noop = () => {
581 640 };
582 641 var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop;
583 642
584 - // node_modules/@base-ui/utils/warn.mjs
585 - var set2;
586 - if (true) {
587 - set2 = /* @__PURE__ */ new Set();
588 - }
589 - function warn(...messages) {
590 - if (true) {
591 - const messageKey = messages.join(" ");
592 - if (!set2.has(messageKey)) {
593 - set2.add(messageKey);
594 - console.warn(`Base UI: ${messageKey}`);
595 - }
596 - }
597 - }
598 -
599 - // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
600 - var React6 = __toESM(require_react(), 1);
601 -
602 643 // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
603 644 var React5 = __toESM(require_react(), 1);
604 645 var CompositeListContext = /* @__PURE__ */ React5.createContext({
605 646 register: () => {
@@ -605,15 +646,10 @@
605 646 register: () => {
606 647 },
607 648 unregister: () => {
608 649 },
609 - subscribeMapChange: () => {
610 - return () => {
611 - };
650 + subscribeMapChange: () => () => {
612 651 },
613 - elementsRef: {
614 - current: []
615 - },
616 652 nextIndexRef: {
617 653 current: 0
618 654 }
619 655 });
@@ -622,9 +658,9 @@
622 658 return React5.useContext(CompositeListContext);
623 659 }
624 660
625 661 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
626 - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
662 + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
627 663 function CompositeList(props) {
628 664 const {
629 665 children,
630 666 elementsRef,
@@ -631,88 +667,123 @@
631 667 labelsRef,
632 668 onMapChange: onMapChangeProp
633 669 } = props;
634 670 const onMapChange = useStableCallback(onMapChangeProp);
635 - const nextIndexRef = React6.useRef(0);
671 + const [, setMapTick] = React6.useState(false);
636 672 const listeners = useRefWithInit(createListeners).current;
637 673 const map = useRefWithInit(createMap).current;
638 - const [mapTick, setMapTick] = React6.useState(0);
639 - const lastTickRef = React6.useRef(mapTick);
640 - const register = useStableCallback((node, metadata) => {
641 - map.set(node, metadata ?? null);
642 - lastTickRef.current += 1;
643 - setMapTick(lastTickRef.current);
674 + const nextIndexRef = React6.useRef(0);
675 + const isDirtyRef = React6.useRef(true);
676 + const itemsRef = React6.useRef(null);
677 + const mutationObserverRef = React6.useRef(null);
678 + const scheduleMapUpdate = useStableCallback(() => {
679 + if (isDirtyRef.current) {
680 + return;
681 + }
682 + isDirtyRef.current = true;
683 + setMapTick((tick) => !tick);
644 684 });
685 + const register = useStableCallback((node, registration) => {
686 + map.set(node, registration);
687 + scheduleMapUpdate();
688 + });
645 689 const unregister = useStableCallback((node) => {
646 690 map.delete(node);
647 - lastTickRef.current += 1;
648 - setMapTick(lastTickRef.current);
691 + scheduleMapUpdate();
649 692 });
650 - const sortedMap = React6.useMemo(() => {
651 - disableEslintWarning(mapTick);
652 - const newMap = /* @__PURE__ */ new Map();
653 - const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition);
654 - sortedNodes.forEach((node, index) => {
655 - const metadata = map.get(node) ?? {};
656 - newMap.set(node, {
657 - ...metadata,
658 - index
693 + const syncRefs = useStableCallback((items) => {
694 + const nextMap = /* @__PURE__ */ new Map();
695 + elementsRef.current.length = 0;
696 + if (labelsRef) {
697 + labelsRef.current.length = 0;
698 + }
699 + items.forEach((item) => {
700 + nextMap.set(item.element, {
701 + ...item.registration.metadata ?? {},
702 + index: item.index
659 703 });
704 + elementsRef.current[item.index] = item.element;
705 + if (labelsRef) {
706 + labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
707 + }
660 708 });
661 - return newMap;
662 - }, [map, mapTick]);
663 - useIsoLayoutEffect(() => {
664 - if (typeof MutationObserver !== "function" || sortedMap.size === 0) {
665 - return void 0;
709 + nextIndexRef.current = elementsRef.current.length;
710 + return nextMap;
711 + });
712 + function observe(sortedNodes) {
713 + mutationObserverRef.current?.disconnect();
714 + mutationObserverRef.current = null;
715 + if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
716 + return;
666 717 }
667 718 const mutationObserver = new MutationObserver((entries) => {
668 - const diff = /* @__PURE__ */ new Set();
669 - const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
670 - entries.forEach((entry) => {
671 - entry.removedNodes.forEach(updateDiff);
672 - entry.addedNodes.forEach(updateDiff);
673 - });
674 - if (diff.size === 0) {
675 - lastTickRef.current += 1;
676 - setMapTick(lastTickRef.current);
719 + if (!hasMovedNode(entries)) {
720 + return;
677 721 }
722 + let previousConnectedNode = null;
723 + for (const node of sortedNodes) {
724 + if (!node.isConnected) {
725 + continue;
726 + }
727 + if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
728 + mutationObserver.disconnect();
729 + scheduleMapUpdate();
730 + return;
731 + }
732 + previousConnectedNode = node;
733 + }
678 734 });
679 - sortedMap.forEach((_, node) => {
680 - if (node.parentElement) {
681 - mutationObserver.observe(node.parentElement, {
682 - childList: true
683 - });
735 + mutationObserverRef.current = mutationObserver;
736 + const roots = /* @__PURE__ */ new Set();
737 + for (let i = 1; i < sortedNodes.length; i += 1) {
738 + const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
739 + if (root) {
740 + roots.add(root);
684 741 }
742 + }
743 + roots.forEach((root) => mutationObserver.observe(root, {
744 + childList: true
745 + }));
746 + }
747 + const flush = useStableCallback(() => {
748 + const [items, automaticNodes] = getCompositeListSnapshot(map);
749 + const nextMap = syncRefs(items);
750 + const previousItems = itemsRef.current;
751 + const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
752 + const previousItem = previousItems[index2];
753 + return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
685 754 });
686 - return () => {
687 - mutationObserver.disconnect();
688 - };
689 - }, [sortedMap]);
755 + observe(automaticNodes);
756 + itemsRef.current = items;
757 + isDirtyRef.current = false;
758 + if (!changed) {
759 + return;
760 + }
761 + listeners.forEach((listener) => listener(nextMap));
762 + onMapChange(nextMap);
763 + });
690 764 useIsoLayoutEffect(() => {
691 - const shouldUpdateLengths = lastTickRef.current === mapTick;
692 - if (shouldUpdateLengths) {
693 - if (elementsRef.current.length !== sortedMap.size) {
694 - elementsRef.current.length = sortedMap.size;
695 - }
696 - if (labelsRef && labelsRef.current.length !== sortedMap.size) {
697 - labelsRef.current.length = sortedMap.size;
698 - }
699 - nextIndexRef.current = sortedMap.size;
765 + if (!isDirtyRef.current && itemsRef.current) {
766 + syncRefs(itemsRef.current);
700 767 }
701 - onMapChange(sortedMap);
702 - }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);
703 - useIsoLayoutEffect(() => {
704 768 return () => {
705 769 elementsRef.current = [];
770 + if (labelsRef) {
771 + labelsRef.current = [];
772 + }
706 773 };
707 - }, [elementsRef]);
774 + }, [elementsRef, labelsRef, syncRefs]);
708 775 useIsoLayoutEffect(() => {
776 + if (isDirtyRef.current) {
777 + flush();
778 + }
779 + });
780 + useIsoLayoutEffect(() => {
709 781 return () => {
710 - if (labelsRef) {
711 - labelsRef.current = [];
712 - }
782 + mutationObserverRef.current?.disconnect();
783 + isDirtyRef.current = true;
713 784 };
714 - }, [labelsRef]);
785 + }, []);
715 786 const subscribeMapChange = useStableCallback((fn) => {
716 787 listeners.add(fn);
717 788 return () => {
718 789 listeners.delete(fn);
@@ -717,20 +788,15 @@
717 788 return () => {
718 789 listeners.delete(fn);
719 790 };
720 791 });
721 - useIsoLayoutEffect(() => {
722 - listeners.forEach((l) => l(sortedMap));
723 - }, [listeners, sortedMap]);
724 792 const contextValue = React6.useMemo(() => ({
725 793 register,
726 794 unregister,
727 795 subscribeMapChange,
728 - elementsRef,
729 - labelsRef,
730 796 nextIndexRef
731 - }), [register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);
732 - return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CompositeListContext.Provider, {
797 + }), [register, unregister, subscribeMapChange, nextIndexRef]);
798 + return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeListContext.Provider, {
733 799 value: contextValue,
734 800 children
735 801 });
736 802 }
@@ -739,32 +805,67 @@
739 805 }
740 806 function createListeners() {
741 807 return /* @__PURE__ */ new Set();
742 808 }
743 - function sortByDocumentPosition(a, b) {
744 - const position = a.compareDocumentPosition(b);
745 - if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
746 - return -1;
809 + function getCompositeListSnapshot(map) {
810 + const reservedIndices = /* @__PURE__ */ new Set();
811 + const items = [];
812 + const automaticItems = [];
813 + map.forEach((registration, node) => {
814 + if (!node.isConnected) {
815 + return;
816 + }
817 + const index2 = registration.index;
818 + const item = {
819 + index: index2 ?? -1,
820 + element: node,
821 + registration
822 + };
823 + if (index2 === null) {
824 + automaticItems.push(item);
825 + } else if (index2 >= 0) {
826 + reservedIndices.add(index2);
827 + items.push(item);
828 + }
829 + });
830 + let nextAutomaticIndex = 0;
831 + automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
832 + automaticItems.forEach((item) => {
833 + while (reservedIndices.has(nextAutomaticIndex)) {
834 + nextAutomaticIndex += 1;
835 + }
836 + item.index = nextAutomaticIndex;
837 + items.push(item);
838 + nextAutomaticIndex += 1;
839 + });
840 + if (reservedIndices.size > 0) {
841 + items.sort((a, b) => a.index - b.index);
747 842 }
748 - if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
749 - return 1;
843 + return [items, automaticItems.map((item) => item.element)];
844 + }
845 + function getCommonAncestor(firstNode, lastNode) {
846 + let ancestor = firstNode.parentElement;
847 + while (ancestor && !ancestor.contains(lastNode)) {
848 + ancestor = ancestor.parentElement;
750 849 }
751 - return 0;
850 + return ancestor;
752 851 }
753 - function disableEslintWarning(_) {
852 + function hasMovedNode(entries) {
853 + for (const entry of entries) {
854 + for (let i = 0; i < entry.removedNodes.length; i += 1) {
855 + if (entry.removedNodes[i].isConnected) {
856 + return true;
857 + }
858 + }
859 + }
860 + return false;
754 861 }
755 -
756 - // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
757 - var React7 = __toESM(require_react(), 1);
758 - var DirectionContext = /* @__PURE__ */ React7.createContext(void 0);
759 - if (true) DirectionContext.displayName = "DirectionContext";
760 - function useDirection() {
761 - const context = React7.useContext(DirectionContext);
762 - return context?.direction ?? "ltr";
862 + function sortByDocumentPosition(a, b) {
863 + return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
763 864 }
764 865
765 866 // node_modules/@base-ui/react/internals/useRenderElement.mjs
766 - var React10 = __toESM(require_react(), 1);
867 + var React9 = __toESM(require_react(), 1);
767 868
768 869 // node_modules/@base-ui/utils/useMergedRefs.mjs
769 870 function useMergedRefs(a, b, c, d) {
770 871 const forkRef = useRefWithInit(createForkRef).current;
@@ -790,9 +891,9 @@
790 891 function didChange(forkRef, a, b, c, d) {
791 892 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
792 893 }
793 894 function didChangeN(forkRef, newRefs) {
794 - return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
895 + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
795 896 }
796 897 function update(forkRef, refs) {
797 898 forkRef.refs = refs;
798 899 if (refs.every((ref) => ref == null)) {
@@ -837,9 +938,9 @@
837 938 const cleanupCallback = cleanupCallbacks[i];
838 939 if (typeof cleanupCallback === "function") {
839 940 cleanupCallback();
840 941 } else {
841 - ref(null);
942 + void ref(null);
842 943 }
843 944 break;
844 945 }
845 946 case "object": {
@@ -854,13 +955,13 @@
854 955 };
855 956 }
856 957
857 958 // node_modules/@base-ui/utils/getReactElementRef.mjs
858 - var React9 = __toESM(require_react(), 1);
959 + var React8 = __toESM(require_react(), 1);
859 960
860 961 // node_modules/@base-ui/utils/reactVersion.mjs
861 - var React8 = __toESM(require_react(), 1);
862 - var majorVersion = parseInt(React8.version, 10);
962 + var React7 = __toESM(require_react(), 1);
963 + var majorVersion = parseInt(React7.version, 10);
863 964 function isReactVersionAtLeast(reactVersionToCheck) {
864 965 return majorVersion >= reactVersionToCheck;
865 966 }
866 967
@@ -865,9 +966,9 @@
865 966 }
866 967
867 968 // node_modules/@base-ui/utils/getReactElementRef.mjs
868 969 function getReactElementRef(element) {
869 - if (!/* @__PURE__ */ React9.isValidElement(element)) {
970 + if (!/* @__PURE__ */ React8.isValidElement(element)) {
870 971 return null;
871 972 }
872 973 const reactElement = element;
873 974 const propsWithRef = reactElement.props;
@@ -890,14 +991,8 @@
890 991 }
891 992 return void 0;
892 993 }
893 994
894 - // node_modules/@base-ui/utils/empty.mjs
895 - function NOOP() {
896 - }
897 - var EMPTY_ARRAY = Object.freeze([]);
898 - var EMPTY_OBJECT = Object.freeze({});
899 -
900 995 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
901 996 function getStateAttributesProps(state, customMapping) {
902 997 const props = {};
903 998 for (const key in state) {
@@ -1085,10 +1180,13 @@
1085 1180
1086 1181 // node_modules/@base-ui/react/internals/useRenderElement.mjs
1087 1182 var import_react = __toESM(require_react(), 1);
1088 1183 function useRenderElement(element, componentProps, params = {}) {
1089 - const renderProp = componentProps.render;
1090 - const outProps = useRenderElementProps(componentProps, params);
1184 + let renderProp = componentProps.render;
1185 + if (params.enabled !== false) {
1186 + renderProp = unwrapLazyRenderProp(renderProp);
1187 + }
1188 + const outProps = useRenderElementProps(componentProps, params, renderProp);
1091 1189 if (params.enabled === false) {
1092 1190 return null;
1093 1191 }
1094 1192 const state = params.state ?? EMPTY_OBJECT;
@@ -1093,29 +1191,28 @@
1093 1191 }
1094 1192 const state = params.state ?? EMPTY_OBJECT;
1095 1193 return evaluateRenderProp(element, renderProp, outProps, state);
1096 1194 }
1097 - function useRenderElementProps(componentProps, params = {}) {
1195 + function useRenderElementProps(componentProps, params, renderProp) {
1098 1196 const {
1099 1197 className: classNameProp,
1100 - style: styleProp,
1101 - render: renderProp
1198 + style: styleProp
1102 1199 } = componentProps;
1103 1200 const {
1104 1201 state = EMPTY_OBJECT,
1105 1202 ref,
1106 1203 props,
1107 - stateAttributesMapping: stateAttributesMapping3,
1204 + stateAttributesMapping: stateAttributesMapping4,
1108 1205 enabled = true
1109 1206 } = params;
1110 1207 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
1111 1208 const style = enabled ? resolveStyle(styleProp, state) : void 0;
1112 - const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT;
1209 + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping4) : EMPTY_OBJECT;
1113 1210 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
1114 1211 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
1115 1212 if (typeof document !== "undefined") {
1116 1213 if (!enabled) {
1117 - useMergedRefs(null, null);
1214 + void useMergedRefs(null, null);
1118 1215 } else if (Array.isArray(ref)) {
1119 1216 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
1120 1217 } else {
1121 1218 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
@@ -1140,8 +1237,15 @@
1140 1237 }
1141 1238 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1142 1239 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
1143 1240 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
1241 + function unwrapLazyRenderProp(render) {
1242 + if (render?.$$typeof !== REACT_LAZY_TYPE) {
1243 + return render;
1244 + }
1245 + const unwrapped = React9.Children.toArray(render)[0];
1246 + return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render;
1247 + }
1144 1248 function evaluateRenderProp(element, render, props, state) {
1145 1249 if (render) {
1146 1250 if (typeof render === "function") {
1147 1251 if (true) {
@@ -1150,19 +1254,14 @@
1150 1254 return render(props, state);
1151 1255 }
1152 1256 const mergedProps = mergeProps(props, render.props);
1153 1257 mergedProps.ref = props.ref;
1154 - let newElement = render;
1155 - if (newElement?.$$typeof === REACT_LAZY_TYPE) {
1156 - const children = React10.Children.toArray(render);
1157 - newElement = children[0];
1158 - }
1159 1258 if (true) {
1160 - if (!/* @__PURE__ */ React10.isValidElement(newElement)) {
1259 + if (!/* @__PURE__ */ React9.isValidElement(render)) {
1161 1260 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"));
1162 1261 }
1163 1262 }
1164 - return /* @__PURE__ */ React10.cloneElement(newElement, mergedProps);
1263 + return /* @__PURE__ */ React9.cloneElement(render, mergedProps);
1165 1264 }
1166 1265 if (element) {
1167 1266 if (typeof element === "string") {
1168 1267 return renderTag(element, props);
@@ -1197,18 +1296,18 @@
1197 1296 ...props,
1198 1297 key: props.key
1199 1298 });
1200 1299 }
1201 - return /* @__PURE__ */ React10.createElement(Tag, props);
1300 + return /* @__PURE__ */ React9.createElement(Tag, props);
1202 1301 }
1203 1302
1204 1303 // node_modules/@base-ui/utils/useId.mjs
1205 - var React11 = __toESM(require_react(), 1);
1304 + var React10 = __toESM(require_react(), 1);
1206 1305 var globalId = 0;
1207 1306 function useGlobalId(idOverride, prefix = "mui") {
1208 - const [defaultId, setDefaultId] = React11.useState(idOverride);
1307 + const [defaultId, setDefaultId] = React10.useState(idOverride);
1209 1308 const id = idOverride || defaultId;
1210 - React11.useEffect(() => {
1309 + React10.useEffect(() => {
1211 1310 if (defaultId == null) {
1212 1311 globalId += 1;
1213 1312 setDefaultId(`${prefix}-${globalId}`);
1214 1313 }
@@ -1330,19 +1429,18 @@
1330 1429 return details;
1331 1430 }
1332 1431
1333 1432 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1334 - var React13 = __toESM(require_react(), 1);
1433 + var React12 = __toESM(require_react(), 1);
1335 1434
1336 1435 // node_modules/@base-ui/utils/useOnMount.mjs
1337 - var React12 = __toESM(require_react(), 1);
1338 - var EMPTY = [];
1436 + var React11 = __toESM(require_react(), 1);
1339 1437 function useOnMount(fn) {
1340 - React12.useEffect(fn, EMPTY);
1438 + React11.useEffect(fn, EMPTY_ARRAY);
1341 1439 }
1342 1440
1343 1441 // node_modules/@base-ui/utils/useAnimationFrame.mjs
1344 - var EMPTY2 = null;
1442 + var EMPTY = null;
1345 1443 var LAST_RAF = globalThis.requestAnimationFrame;
1346 1444 var Scheduler = class {
1347 1445 /* This implementation uses an array as a backing data-structure for frame callbacks.
1348 1446 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
@@ -1381,13 +1479,16 @@
1381 1479 }
1382 1480 return id;
1383 1481 }
1384 1482 cancel(id) {
1385 - const index = id - this.startId;
1386 - if (index < 0 || index >= this.callbacks.length) {
1483 + const index2 = id - this.startId;
1484 + if (index2 < 0 || index2 >= this.callbacks.length) {
1387 1485 return;
1388 1486 }
1389 - this.callbacks[index] = null;
1487 + if (this.callbacks[index2] === null) {
1488 + return;
1489 + }
1490 + this.callbacks[index2] = null;
1390 1491 this.callbacksCount -= 1;
1391 1492 }
1392 1493 };
1393 1494 var scheduler = new Scheduler();
@@ -1400,9 +1501,9 @@
1400 1501 }
1401 1502 static cancel(id) {
1402 1503 return scheduler.cancel(id);
1403 1504 }
1404 - currentId = EMPTY2;
1505 + currentId = EMPTY;
1405 1506 /**
1406 1507 * Executes `fn` after `delay`, clearing any previously scheduled call.
1407 1508 */
1408 1509 request(fn) {
@@ -1407,16 +1508,16 @@
1407 1508 */
1408 1509 request(fn) {
1409 1510 this.cancel();
1410 1511 this.currentId = scheduler.request(() => {
1411 - this.currentId = EMPTY2;
1512 + this.currentId = EMPTY;
1412 1513 fn();
1413 1514 });
1414 1515 }
1415 1516 cancel = () => {
1416 - if (this.currentId !== EMPTY2) {
1517 + if (this.currentId !== EMPTY) {
1417 1518 scheduler.cancel(this.currentId);
1418 - this.currentId = EMPTY2;
1519 + this.currentId = EMPTY;
1419 1520 }
1420 1521 };
1421 1522 disposeEffect = () => {
1422 1523 return this.cancel;
@@ -1428,11 +1529,11 @@
1428 1529 return timeout;
1429 1530 }
1430 1531
1431 1532 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1432 - function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {
1433 - const [transitionStatus, setTransitionStatus] = React13.useState(open && enableIdleState ? "idle" : void 0);
1434 - const [mounted, setMounted] = React13.useState(open);
1533 + function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
1534 + const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0);
1535 + const [mounted, setMounted] = React12.useState(open && !animateInitialOpen);
1435 1536 if (open && !mounted) {
1436 1537 setMounted(true);
1437 1538 setTransitionStatus("starting");
1438 1539 }
@@ -1485,20 +1586,15 @@
1485 1586 };
1486 1587 }
1487 1588
1488 1589 // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
1489 - var React14 = __toESM(require_react(), 1);
1490 - var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) {
1491 - IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None";
1492 - IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder";
1493 - return IndexGuessBehavior2;
1494 - })({});
1590 + var React13 = __toESM(require_react(), 1);
1495 1591 function useCompositeListItem(params = {}) {
1496 1592 const {
1593 + guess,
1497 1594 label,
1498 1595 metadata,
1499 1596 textRef,
1500 - indexGuessBehavior,
1501 1597 index: externalIndex
1502 1598 } = params;
1503 1599 const {
1504 1600 register,
@@ -1503,14 +1599,12 @@
1503 1599 const {
1504 1600 register,
1505 1601 unregister,
1506 1602 subscribeMapChange,
1507 - elementsRef,
1508 - labelsRef,
1509 1603 nextIndexRef
1510 1604 } = useCompositeListContext();
1511 - const indexRef = React14.useRef(-1);
1512 - const [index, setIndex] = React14.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
1605 + const indexRef = React13.useRef(-1);
1606 + const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => {
1513 1607 if (indexRef.current === -1) {
1514 1608 const newIndex = nextIndexRef.current;
1515 1609 nextIndexRef.current += 1;
1516 1610 indexRef.current = newIndex;
@@ -1515,33 +1609,26 @@
1515 1609 nextIndexRef.current += 1;
1516 1610 indexRef.current = newIndex;
1517 1611 }
1518 1612 return indexRef.current;
1519 - } : -1));
1520 - const componentRef = React14.useRef(null);
1521 - const ref = React14.useCallback((node) => {
1613 + } : -1);
1614 + const index2 = externalIndex ?? internalIndex;
1615 + const componentRef = React13.useRef(null);
1616 + const ref = React13.useCallback((node) => {
1617 + const previousNode = componentRef.current;
1618 + if (previousNode) {
1619 + unregister(previousNode);
1620 + }
1522 1621 componentRef.current = node;
1523 - if (index !== -1 && node !== null) {
1524 - elementsRef.current[index] = node;
1525 - if (labelsRef) {
1526 - const isLabelDefined = label !== void 0;
1527 - labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
1528 - }
1529 - }
1530 - }, [index, elementsRef, labelsRef, label, textRef]);
1531 - useIsoLayoutEffect(() => {
1532 - if (externalIndex != null) {
1533 - return void 0;
1534 - }
1535 - const node = componentRef.current;
1536 1622 if (node) {
1537 - register(node, metadata);
1538 - return () => {
1539 - unregister(node);
1540 - };
1623 + register(node, {
1624 + metadata: metadata ?? null,
1625 + index: externalIndex ?? null,
1626 + label,
1627 + textRef
1628 + });
1541 1629 }
1542 - return void 0;
1543 - }, [externalIndex, register, unregister, metadata]);
1630 + }, [externalIndex, register, unregister, metadata, label, textRef]);
1544 1631 useIsoLayoutEffect(() => {
1545 1632 if (externalIndex != null) {
1546 1633 return void 0;
1547 1634 }
@@ -1547,29 +1634,33 @@
1547 1634 }
1548 1635 return subscribeMapChange((map) => {
1549 1636 const i = componentRef.current ? map.get(componentRef.current)?.index : null;
1550 1637 if (i != null) {
1551 - setIndex(i);
1638 + setInternalIndex(i);
1552 1639 }
1553 1640 });
1554 - }, [externalIndex, subscribeMapChange, setIndex]);
1641 + }, [externalIndex, subscribeMapChange]);
1555 1642 return {
1556 1643 ref,
1557 - index
1644 + index: index2
1558 1645 };
1559 1646 }
1560 1647
1648 + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
1649 + var TransitionStatusDataAttributes_exports = {};
1650 + __export(TransitionStatusDataAttributes_exports, {
1651 + endingStyle: () => endingStyle,
1652 + startingStyle: () => startingStyle
1653 + });
1654 + var startingStyle = "data-starting-style";
1655 + var endingStyle = "data-ending-style";
1656 +
1561 1657 // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
1562 - var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) {
1563 - TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style";
1564 - TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style";
1565 - return TransitionStatusDataAttributes2;
1566 - })({});
1567 1658 var STARTING_HOOK = {
1568 - [TransitionStatusDataAttributes.startingStyle]: ""
1659 + [startingStyle]: ""
1569 1660 };
1570 1661 var ENDING_HOOK = {
1571 - [TransitionStatusDataAttributes.endingStyle]: ""
1662 + [endingStyle]: ""
1572 1663 };
1573 1664 var transitionStatusMapping = {
1574 1665 transitionStatus(value) {
1575 1666 if (value === "starting") {
@@ -1582,18 +1673,34 @@
1582 1673 }
1583 1674 };
1584 1675
1585 1676 // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1586 - var React17 = __toESM(require_react(), 1);
1677 + var React16 = __toESM(require_react(), 1);
1587 1678
1588 1679 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1589 1680 function hasWindow() {
1590 1681 return typeof window !== "undefined";
1591 1682 }
1683 + function getNodeName(node) {
1684 + if (isNode(node)) {
1685 + return (node.nodeName || "").toLowerCase();
1686 + }
1687 + return "#document";
1688 + }
1592 1689 function getWindow(node) {
1593 1690 var _node$ownerDocument;
1594 1691 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1595 1692 }
1693 + function getDocumentElement(node) {
1694 + var _ref;
1695 + return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1696 + }
1697 + function isNode(value) {
1698 + if (!hasWindow()) {
1699 + return false;
1700 + }
1701 + return value instanceof Node || value instanceof getWindow(value).Node;
1702 + }
1596 1703 function isHTMLElement(value) {
1597 1704 if (!hasWindow()) {
1598 1705 return false;
1599 1706 }
@@ -1604,18 +1711,34 @@
1604 1711 return false;
1605 1712 }
1606 1713 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1607 1714 }
1715 + function isLastTraversableNode(node) {
1716 + return /^(html|body|#document)$/.test(getNodeName(node));
1717 + }
1608 1718 function getComputedStyle2(element) {
1609 1719 return getWindow(element).getComputedStyle(element);
1610 1720 }
1721 + function getParentNode(node) {
1722 + if (getNodeName(node) === "html") {
1723 + return node;
1724 + }
1725 + const result = (
1726 + // Step into the shadow DOM of the parent of a slotted node.
1727 + node.assignedSlot || // DOM Element detected.
1728 + node.parentNode || // ShadowRoot detected.
1729 + isShadowRoot(node) && node.host || // Fallback.
1730 + getDocumentElement(node)
1731 + );
1732 + return isShadowRoot(result) ? result.host : result;
1733 + }
1611 1734
1612 1735 // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
1613 - var React15 = __toESM(require_react(), 1);
1614 - var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0);
1736 + var React14 = __toESM(require_react(), 1);
1737 + var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
1615 1738 if (true) CompositeRootContext.displayName = "CompositeRootContext";
1616 1739 function useCompositeRootContext(optional = false) {
1617 - const context = React15.useContext(CompositeRootContext);
1740 + const context = React14.useContext(CompositeRootContext);
1618 1741 if (context === void 0 && !optional) {
1619 1742 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
1620 1743 }
1621 1744 return context;
@@ -1621,9 +1744,9 @@
1621 1744 return context;
1622 1745 }
1623 1746
1624 1747 // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
1625 - var React16 = __toESM(require_react(), 1);
1748 + var React15 = __toESM(require_react(), 1);
1626 1749 function useFocusableWhenDisabled(parameters) {
1627 1750 const {
1628 1751 focusableWhenDisabled,
1629 1752 disabled: disabled2,
@@ -1632,9 +1755,9 @@
1632 1755 isNativeButton
1633 1756 } = parameters;
1634 1757 const isFocusableComposite = composite && focusableWhenDisabled !== false;
1635 1758 const isNonFocusableComposite = composite && focusableWhenDisabled === false;
1636 - const props = React16.useMemo(() => {
1759 + const props = React15.useMemo(() => {
1637 1760 const additionalProps = {
1638 1761 // allow Tabbing away from focusableWhenDisabled elements
1639 1762 onKeyDown(event) {
1640 1763 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
@@ -1660,8 +1783,29 @@
1660 1783 props
1661 1784 };
1662 1785 }
1663 1786
1787 + // node_modules/@base-ui/utils/owner.mjs
1788 + function ownerDocument(node) {
1789 + return node?.ownerDocument || document;
1790 + }
1791 +
1792 + // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
1793 + function dispatchClickWithModifiers(target, sourceEvent, {
1794 + detail = 0
1795 + } = {}) {
1796 + target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
1797 + bubbles: true,
1798 + cancelable: true,
1799 + composed: true,
1800 + detail,
1801 + shiftKey: sourceEvent.shiftKey,
1802 + ctrlKey: sourceEvent.ctrlKey,
1803 + altKey: sourceEvent.altKey,
1804 + metaKey: sourceEvent.metaKey
1805 + }));
1806 + }
1807 +
1664 1808 // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1665 1809 function useButton(parameters = {}) {
1666 1810 const {
1667 1811 disabled: disabled2 = false,
@@ -1669,9 +1813,9 @@
1669 1813 tabIndex = 0,
1670 1814 native: isNativeButton = true,
1671 1815 composite: compositeProp
1672 1816 } = parameters;
1673 - const elementRef = React17.useRef(null);
1817 + const elementRef = React16.useRef(null);
1674 1818 const compositeRootContext = useCompositeRootContext(true);
1675 1819 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
1676 1820 const {
1677 1821 props: focusableWhenDisabledProps
@@ -1682,9 +1826,9 @@
1682 1826 tabIndex,
1683 1827 isNativeButton
1684 1828 });
1685 1829 if (true) {
1686 - React17.useEffect(() => {
1830 + React16.useEffect(() => {
1687 1831 if (!elementRef.current) {
1688 1832 return;
1689 1833 }
1690 1834 const isButtonTag = isButtonElement(elementRef.current);
@@ -1700,9 +1844,9 @@
1700 1844 error(`${message}${ownerStackMessage}`);
1701 1845 }
1702 1846 }, [isNativeButton]);
1703 1847 }
1704 - const updateDisabled = React17.useCallback(() => {
1848 + const updateDisabled = React16.useCallback(() => {
1705 1849 const element = elementRef.current;
1706 1850 if (!isButtonElement(element)) {
1707 1851 return;
1708 1852 }
@@ -1710,9 +1854,9 @@
1710 1854 element.disabled = false;
1711 1855 }
1712 1856 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
1713 1857 useIsoLayoutEffect(updateDisabled, [updateDisabled]);
1714 - const getButtonProps = React17.useCallback((externalProps = {}) => {
1858 + const getButtonProps = React16.useCallback((externalProps = {}) => {
1715 1859 const {
1716 1860 onClick: externalOnClick,
1717 1861 onMouseDown: externalOnMouseDown,
1718 1862 onKeyUp: externalOnKeyUp,
@@ -1755,25 +1899,28 @@
1755 1899 if (event.defaultPrevented && isTextNavigationRole) {
1756 1900 return;
1757 1901 }
1758 1902 event.preventDefault();
1759 - if (isLink || isNativeButton && isButton) {
1760 - currentTarget.click();
1903 + if (!isNativeButton || isButton) {
1761 1904 event.preventBaseUIHandler();
1762 - } else if (shouldClick) {
1763 - externalOnClick?.(event);
1764 - event.preventBaseUIHandler();
1905 + dispatchClickWithModifiers(currentTarget, event);
1765 1906 }
1766 1907 return;
1767 1908 }
1768 - if (shouldClick) {
1769 - if (!isNativeButton && (isSpaceKey || isEnterKey)) {
1909 + if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
1910 + if (isCurrentTarget && isLink && isSpaceKey) {
1770 1911 event.preventDefault();
1771 1912 }
1772 - if (!isNativeButton && isEnterKey) {
1773 - externalOnClick?.(event);
1774 - }
1913 + return;
1775 1914 }
1915 + if (event.defaultPrevented) {
1916 + return;
1917 + }
1918 + event.preventDefault();
1919 + if (isEnterKey) {
1920 + event.preventBaseUIHandler();
1921 + dispatchClickWithModifiers(currentTarget, event);
1922 + }
1776 1923 },
1777 1924 onKeyUp(event) {
1778 1925 if (disabled2) {
1779 1926 return;
@@ -1786,10 +1933,11 @@
1786 1933 }
1787 1934 if (event.baseUIHandlerPrevented) {
1788 1935 return;
1789 1936 }
1790 - if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") {
1791 - externalOnClick?.(event);
1937 + if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
1938 + event.preventBaseUIHandler();
1939 + dispatchClickWithModifiers(event.currentTarget, event);
1792 1940 }
1793 1941 },
1794 1942 onPointerDown(event) {
1795 1943 if (disabled2) {
@@ -1816,18 +1964,13 @@
1816 1964 function isButtonElement(elem) {
1817 1965 return isHTMLElement(elem) && elem.tagName === "BUTTON";
1818 1966 }
1819 1967 function isValidLinkElement(elem) {
1820 - return Boolean(elem?.tagName === "A" && elem?.href);
1968 + return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
1821 1969 }
1822 1970
1823 - // node_modules/@base-ui/utils/owner.mjs
1824 - function ownerDocument(node) {
1825 - return node?.ownerDocument || document;
1826 - }
1827 -
1828 1971 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
1829 - var React18 = __toESM(require_react(), 1);
1972 + var React17 = __toESM(require_react(), 1);
1830 1973
1831 1974 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1832 1975 var ReactDOM = __toESM(require_react_dom(), 1);
1833 1976
@@ -1839,9 +1982,25 @@
1839 1982 return "current" in maybeRef ? maybeRef.current : maybeRef;
1840 1983 }
1841 1984
1842 1985 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1843 - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {
1986 + var pendingCallbacks = null;
1987 + function flushBeforePaint(fn) {
1988 + if (!pendingCallbacks) {
1989 + const callbacks = [];
1990 + pendingCallbacks = callbacks;
1991 + queueMicrotask(() => {
1992 + pendingCallbacks = null;
1993 + ReactDOM.flushSync(() => {
1994 + for (const callback of callbacks) {
1995 + callback();
1996 + }
1997 + });
1998 + });
1999 + }
2000 + pendingCallbacks.push(fn);
2001 + }
2002 + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
1844 2003 const frame = useAnimationFrame();
1845 2004 return useStableCallback((fnToExecute, signal = null) => {
1846 2005 frame.cancel();
1847 2006 const element = resolveRef(elementOrRef);
@@ -1849,9 +2008,17 @@
1849 2008 return;
1850 2009 }
1851 2010 const resolvedElement = element;
1852 2011 const done = () => {
1853 - ReactDOM.flushSync(fnToExecute);
2012 + if (!batch) {
2013 + ReactDOM.flushSync(fnToExecute);
2014 + return;
2015 + }
2016 + flushBeforePaint(() => {
2017 + if (!signal?.aborted) {
2018 + fnToExecute();
2019 + }
2020 + });
1854 2021 };
1855 2022 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
1856 2023 fnToExecute();
1857 2024 return;
@@ -1860,23 +2027,22 @@
1860 2027 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
1861 2028 if (!signal?.aborted) {
1862 2029 done();
1863 2030 }
1864 - }).catch(() => {
1865 - if (treatAbortedAsFinished) {
1866 - if (!signal?.aborted) {
1867 - done();
1868 - }
2031 + }, () => {
2032 + if (signal?.aborted) {
1869 2033 return;
1870 2034 }
1871 2035 const currentAnimations = resolvedElement.getAnimations();
1872 - if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
2036 + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
1873 2037 exec();
2038 + return;
1874 2039 }
2040 + done();
1875 2041 });
1876 2042 }
1877 2043 if (waitForStartingStyleRemoved) {
1878 - const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;
2044 + const startingStyleAttribute = startingStyle;
1879 2045 if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
1880 2046 frame.request(exec);
1881 2047 return;
1882 2048 }
@@ -1904,13 +2070,14 @@
1904 2070 const {
1905 2071 enabled = true,
1906 2072 open,
1907 2073 ref,
2074 + batch = false,
1908 2075 onComplete: onCompleteParam
1909 2076 } = parameters;
1910 2077 const onComplete = useStableCallback(onCompleteParam);
1911 - const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);
1912 - React18.useEffect(() => {
2078 + const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);
2079 + React17.useEffect(() => {
1913 2080 if (!enabled) {
1914 2081 return void 0;
1915 2082 }
1916 2083 const abortController = new AbortController();
@@ -1920,9 +2087,45 @@
1920 2087 };
1921 2088 }, [enabled, open, onComplete, runOnceAnimationsFinish]);
1922 2089 }
1923 2090
1924 - // node_modules/@base-ui/react/internals/shadowDom.mjs
2091 + // node_modules/@base-ui/utils/useTimeout.mjs
2092 + var EMPTY2 = 0;
2093 + var Timeout = class _Timeout {
2094 + static create() {
2095 + return new _Timeout();
2096 + }
2097 + currentId = EMPTY2;
2098 + /**
2099 + * Executes `fn` after `delay`, clearing any previously scheduled call.
2100 + */
2101 + start(delay, fn) {
2102 + this.clear();
2103 + this.currentId = setTimeout(() => {
2104 + this.currentId = EMPTY2;
2105 + fn();
2106 + }, delay);
2107 + }
2108 + isStarted() {
2109 + return this.currentId !== EMPTY2;
2110 + }
2111 + clear = () => {
2112 + if (this.currentId !== EMPTY2) {
2113 + clearTimeout(this.currentId);
2114 + this.currentId = EMPTY2;
2115 + }
2116 + };
2117 + disposeEffect = () => {
2118 + return this.clear;
2119 + };
2120 + };
2121 + function useTimeout() {
2122 + const timeout = useRefWithInit(Timeout.create).current;
2123 + useOnMount(timeout.disposeEffect);
2124 + return timeout;
2125 + }
2126 +
2127 + // node_modules/@base-ui/utils/shadowDom.mjs
1925 2128 function activeElement(doc) {
1926 2129 let element = doc.activeElement;
1927 2130 while (element?.shadowRoot?.activeElement != null) {
1928 2131 element = element.shadowRoot.activeElement;
@@ -1949,9 +2152,9 @@
1949 2152 return false;
1950 2153 }
1951 2154 function getTarget(event) {
1952 2155 if ("composedPath" in event) {
1953 - return event.composedPath()[0];
2156 + return event.composedPath()[0] ?? event.target;
1954 2157 }
1955 2158 return event.target;
1956 2159 }
1957 2160
@@ -1958,10 +2161,10 @@
1958 2161 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1959 2162 var round = Math.round;
1960 2163
1961 2164 // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
1962 - function isIndexOutOfListBounds(list, index) {
1963 - return index < 0 || index >= list.length;
2165 + function isIndexOutOfListBounds(list, index2) {
2166 + return index2 < 0 || index2 >= list.length;
1964 2167 }
1965 2168 function getMinListIndex(listRef, disabledIndices) {
1966 2169 return findNonDisabledListIndex(listRef.current, {
1967 2170 disabledIndices
@@ -1979,20 +2182,20 @@
1979 2182 decrement = false,
1980 2183 disabledIndices,
1981 2184 amount = 1
1982 2185 } = {}) {
1983 - let index = startingIndex;
2186 + let index2 = startingIndex;
1984 2187 do {
1985 - index += decrement ? -amount : amount;
1986 - } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));
1987 - return index;
2188 + index2 += decrement ? -amount : amount;
2189 + } while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
2190 + return index2;
1988 2191 }
1989 - function isListIndexDisabled(list, index, disabledIndices) {
1990 - const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;
2192 + function isListIndexDisabled(list, index2, disabledIndices) {
2193 + const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index2) : disabledIndices?.includes(index2) ?? false;
1991 2194 if (isExplicitlyDisabled) {
1992 2195 return true;
1993 2196 }
1994 - const element = list[index];
2197 + const element = list[index2];
1995 2198 if (!element) {
1996 2199 return false;
1997 2200 }
1998 2201 if (!isElementVisible(element)) {
@@ -1997,8 +2200,11 @@
1997 2200 }
1998 2201 if (!isElementVisible(element)) {
1999 2202 return true;
2000 2203 }
2204 + if (element.matches(":disabled")) {
2205 + return true;
2206 + }
2001 2207 return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
2002 2208 }
2003 2209 function isHiddenByStyles(styles) {
2004 2210 return styles.visibility === "hidden" || styles.visibility === "collapse";
@@ -2013,12 +2219,12 @@
2013 2219 return styles.display !== "none" && styles.display !== "contents";
2014 2220 }
2015 2221
2016 2222 // node_modules/@base-ui/utils/useForcedRerendering.mjs
2017 - var React19 = __toESM(require_react(), 1);
2223 + var React18 = __toESM(require_react(), 1);
2018 2224 function useForcedRerendering() {
2019 - const [, setState] = React19.useState({});
2020 - return React19.useCallback(() => {
2225 + const [, setState] = React18.useState({});
2226 + return React18.useCallback(() => {
2021 2227 setState({});
2022 2228 }, []);
2023 2229 }
2024 2230
@@ -2028,19 +2234,11 @@
2028 2234 var ARROW_LEFT = "ArrowLeft";
2029 2235 var ARROW_RIGHT = "ArrowRight";
2030 2236 var HOME = "Home";
2031 2237 var END = "End";
2032 - var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT, ARROW_RIGHT]);
2033 - var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT, ARROW_RIGHT, HOME, END]);
2034 - var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN]);
2035 - var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, HOME, END]);
2036 - var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);
2037 - var COMPOSITE_KEYS = /* @__PURE__ */ new Set([...ARROW_KEYS, HOME, END]);
2238 + var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);
2038 2239 var SHIFT = "Shift";
2039 - var CONTROL = "Control";
2040 - var ALT = "Alt";
2041 - var META = "Meta";
2042 - var MODIFIER_KEYS = /* @__PURE__ */ new Set([SHIFT, CONTROL, ALT, META]);
2240 + var MODIFIER_KEYS = [SHIFT, "Control", "Alt", "Meta"];
2043 2241 function isInputElement(element) {
2044 2242 return isHTMLElement(element) && element.tagName === "INPUT";
2045 2243 }
2046 2244 function isNativeInput(element) {
@@ -2071,9 +2269,9 @@
2071 2269 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2072 2270 }
2073 2271 }
2074 2272 if (direction === "rtl") {
2075 - if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2273 + if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2076 2274 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2077 2275 } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
2078 2276 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
2079 2277 }
@@ -2128,10 +2326,583 @@
2128 2326 }
2129 2327 return value ? "true" : void 0;
2130 2328 }
2131 2329
2330 + // node_modules/@base-ui/react/internals/useValueChanged.mjs
2331 + var React19 = __toESM(require_react(), 1);
2332 + function useValueChanged(value, onChange) {
2333 + const valueRef = React19.useRef(value);
2334 + const onChangeCallback = useStableCallback(onChange);
2335 + useIsoLayoutEffect(() => {
2336 + if (valueRef.current !== value) {
2337 + onChangeCallback(valueRef.current);
2338 + }
2339 + valueRef.current = value;
2340 + }, [value, onChangeCallback]);
2341 + }
2342 +
2343 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2344 + var React20 = __toESM(require_react(), 1);
2345 +
2346 + // node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
2347 + var valid = "data-valid";
2348 + var invalid = "data-invalid";
2349 +
2350 + // node_modules/@base-ui/react/internals/field-constants/constants.mjs
2351 + var DEFAULT_VALIDITY_STATE = {
2352 + badInput: false,
2353 + customError: false,
2354 + patternMismatch: false,
2355 + rangeOverflow: false,
2356 + rangeUnderflow: false,
2357 + stepMismatch: false,
2358 + tooLong: false,
2359 + tooShort: false,
2360 + typeMismatch: false,
2361 + valid: null,
2362 + valueMissing: false
2363 + };
2364 + var DEFAULT_FIELD_STATE_ATTRIBUTES = {
2365 + valid: null,
2366 + touched: false,
2367 + dirty: false,
2368 + filled: false,
2369 + focused: false
2370 + };
2371 + var DEFAULT_FIELD_ROOT_STATE = {
2372 + disabled: false,
2373 + ...DEFAULT_FIELD_STATE_ATTRIBUTES
2374 + };
2375 + var fieldValidityMapping = {
2376 + valid(value) {
2377 + if (value === null) {
2378 + return null;
2379 + }
2380 + if (value) {
2381 + return {
2382 + [valid]: ""
2383 + };
2384 + }
2385 + return {
2386 + [invalid]: ""
2387 + };
2388 + }
2389 + };
2390 +
2391 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2392 + var DEFAULT_FIELD_ROOT_CONTEXT = {
2393 + invalid: void 0,
2394 + name: void 0,
2395 + validityData: {
2396 + state: DEFAULT_VALIDITY_STATE,
2397 + errors: [],
2398 + error: "",
2399 + value: "",
2400 + initialValue: null
2401 + },
2402 + setValidityData: NOOP,
2403 + disabled: void 0,
2404 + setTouched: NOOP,
2405 + setDirty: NOOP,
2406 + setFilled: NOOP,
2407 + setFocused: NOOP,
2408 + validationMode: "onSubmit",
2409 + shouldValidateOnChange: () => false,
2410 + state: DEFAULT_FIELD_ROOT_STATE,
2411 + registerFieldControl: NOOP,
2412 + validation: {
2413 + getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
2414 + inputRef: {
2415 + current: null
2416 + },
2417 + registeredInputs: /* @__PURE__ */ new Map(),
2418 + registerInput: NOOP,
2419 + getInputControl: () => null,
2420 + commit: async () => {
2421 + },
2422 + change: NOOP
2423 + }
2424 + };
2425 + var FieldRootContext = /* @__PURE__ */ React20.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2426 + if (true) FieldRootContext.displayName = "FieldRootContext";
2427 + function useFieldRootContext(optional = true) {
2428 + const context = React20.useContext(FieldRootContext);
2429 + if (context.setValidityData === NOOP && !optional) {
2430 + throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
2431 + }
2432 + return context;
2433 + }
2434 +
2435 + // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
2436 + function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name16) {
2437 + const {
2438 + registerFieldControl
2439 + } = useFieldRootContext();
2440 + const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2441 + useIsoLayoutEffect(() => {
2442 + const source = sourceRef.current;
2443 + if (!enabled) {
2444 + registerFieldControl(source, void 0);
2445 + return;
2446 + }
2447 + const registration = {
2448 + controlRef,
2449 + getValue: getFormValueOverride,
2450 + id,
2451 + name: name16,
2452 + value
2453 + };
2454 + registerFieldControl(source, registration);
2455 + }, [controlRef, enabled, getFormValueOverride, id, name16, registerFieldControl, sourceRef, value]);
2456 + useIsoLayoutEffect(() => {
2457 + const source = sourceRef.current;
2458 + return () => {
2459 + registerFieldControl(source, void 0);
2460 + };
2461 + }, [registerFieldControl, sourceRef]);
2462 + }
2463 +
2464 + // node_modules/@base-ui/react/internals/form-context/FormContext.mjs
2465 + var React21 = __toESM(require_react(), 1);
2466 + var FormContext = /* @__PURE__ */ React21.createContext({
2467 + elementRef: {
2468 + current: null
2469 + },
2470 + formRef: {
2471 + current: {
2472 + fields: /* @__PURE__ */ new Map()
2473 + }
2474 + },
2475 + errors: {},
2476 + clearErrors: NOOP,
2477 + validationMode: "onSubmit",
2478 + submitCountRef: {
2479 + current: 0
2480 + }
2481 + });
2482 + if (true) FormContext.displayName = "FormContext";
2483 + function useFormContext() {
2484 + return React21.useContext(FormContext);
2485 + }
2486 +
2487 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2488 + var React23 = __toESM(require_react(), 1);
2489 +
2490 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
2491 + var React22 = __toESM(require_react(), 1);
2492 + var LabelableContext = /* @__PURE__ */ React22.createContext({
2493 + controlId: void 0,
2494 + registerControlId: NOOP,
2495 + resetControlId: NOOP,
2496 + labelId: void 0,
2497 + setLabelId: NOOP,
2498 + messageIds: [],
2499 + setMessageIds: NOOP,
2500 + getDescriptionProps: (externalProps) => externalProps
2501 + });
2502 + if (true) LabelableContext.displayName = "LabelableContext";
2503 + function useLabelableContext() {
2504 + return React22.useContext(LabelableContext);
2505 + }
2506 +
2507 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2508 + function useLabelableId(params = {}) {
2509 + const {
2510 + id,
2511 + enabled = true
2512 + } = params;
2513 + const {
2514 + controlId,
2515 + registerControlId,
2516 + resetControlId
2517 + } = useLabelableContext();
2518 + const defaultId = useBaseUiId();
2519 + const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2520 + const hasRegisteredRef = React23.useRef(false);
2521 + const hadExplicitIdRef = React23.useRef(false);
2522 + const unregisterControlId = useStableCallback(() => {
2523 + if (!hasRegisteredRef.current || registerControlId === NOOP) {
2524 + return;
2525 + }
2526 + hasRegisteredRef.current = false;
2527 + registerControlId(controlSourceRef.current, void 0);
2528 + });
2529 + useIsoLayoutEffect(() => {
2530 + if (!enabled || registerControlId === NOOP) {
2531 + unregisterControlId();
2532 + return void 0;
2533 + }
2534 + let nextId;
2535 + if (id !== void 0) {
2536 + hadExplicitIdRef.current = true;
2537 + nextId = id;
2538 + } else if (hadExplicitIdRef.current) {
2539 + nextId = defaultId;
2540 + } else {
2541 + resetControlId();
2542 + return void 0;
2543 + }
2544 + if (nextId === void 0) {
2545 + unregisterControlId();
2546 + return void 0;
2547 + }
2548 + hasRegisteredRef.current = true;
2549 + registerControlId(controlSourceRef.current, nextId);
2550 + return void 0;
2551 + }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
2552 + useIsoLayoutEffect(() => {
2553 + return unregisterControlId;
2554 + }, [unregisterControlId]);
2555 + return (enabled ? controlId : void 0) ?? id ?? defaultId;
2556 + }
2557 +
2558 + // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
2559 + var React24 = __toESM(require_react(), 1);
2560 + var DirectionContext = /* @__PURE__ */ React24.createContext(void 0);
2561 + if (true) DirectionContext.displayName = "DirectionContext";
2562 + function useDirection() {
2563 + const context = React24.useContext(DirectionContext);
2564 + return context?.direction ?? "ltr";
2565 + }
2566 +
2567 + // node_modules/@base-ui/react/field/item/FieldItemContext.mjs
2568 + var React25 = __toESM(require_react(), 1);
2569 + var FieldItemContext = /* @__PURE__ */ React25.createContext({
2570 + disabled: false
2571 + });
2572 + if (true) FieldItemContext.displayName = "FieldItemContext";
2573 + function useFieldItemContext() {
2574 + const context = React25.useContext(FieldItemContext);
2575 + return context;
2576 + }
2577 +
2578 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2579 + var React26 = __toESM(require_react(), 1);
2580 +
2581 + // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
2582 + function getCombinedFieldValidityData(validityData, invalid2) {
2583 + return {
2584 + ...validityData,
2585 + state: {
2586 + ...validityData.state,
2587 + valid: !invalid2 && validityData.state.valid
2588 + }
2589 + };
2590 + }
2591 +
2592 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2593 + var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
2594 + function isEligibleInput(input, formElement) {
2595 + if (input.matches(":disabled")) {
2596 + return false;
2597 + }
2598 + if (!formElement || input.form === formElement) {
2599 + return true;
2600 + }
2601 + return input.form === null && !input.hasAttribute("form");
2602 + }
2603 + function findRepresentativeInput(inputs, formElement) {
2604 + let fallback = null;
2605 + for (const input of inputs.keys()) {
2606 + if (!isEligibleInput(input, formElement)) {
2607 + continue;
2608 + }
2609 + if (!input.validity.valid) {
2610 + return input;
2611 + }
2612 + fallback ??= input;
2613 + }
2614 + return fallback;
2615 + }
2616 + function makeState(customError) {
2617 + return {
2618 + ...DEFAULT_VALIDITY_STATE,
2619 + valid: !customError,
2620 + customError
2621 + };
2622 + }
2623 + function getNativeErrors(element) {
2624 + return element && element.validationMessage ? [element.validationMessage] : [];
2625 + }
2626 + function useFieldValidation(params) {
2627 + const {
2628 + elementRef,
2629 + formRef
2630 + } = useFormContext();
2631 + const {
2632 + setValidityData,
2633 + validate,
2634 + validityData,
2635 + validationDebounceTime,
2636 + invalid: invalid2,
2637 + markedDirtyRef,
2638 + state,
2639 + shouldValidateOnChange,
2640 + validationMode,
2641 + registeredFieldIdRef
2642 + } = params;
2643 + const {
2644 + controlId,
2645 + getDescriptionProps
2646 + } = useLabelableContext();
2647 + const timeout = useTimeout();
2648 + const inputRef = React26.useRef(null);
2649 + const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
2650 + const validationCommitIdRef = React26.useRef(0);
2651 + const customValidityRef = React26.useRef(null);
2652 + const registerInput = React26.useCallback((element, registration) => {
2653 + registeredInputs.set(element, registration);
2654 + return () => {
2655 + registeredInputs.delete(element);
2656 + };
2657 + }, [registeredInputs]);
2658 + const getInputControl = useStableCallback(() => {
2659 + const element = findRepresentativeInput(registeredInputs, elementRef.current);
2660 + return element && registeredInputs.get(element)?.controlRef.current || null;
2661 + });
2662 + const commit = useStableCallback(async (value, revalidate = false) => {
2663 + validationCommitIdRef.current += 1;
2664 + const validationCommitId = validationCommitIdRef.current;
2665 + function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
2666 + const fieldId = registeredFieldIdRef.current ?? controlId;
2667 + if (fieldId == null) {
2668 + return;
2669 + }
2670 + const currentFieldData = formRef.current.fields.get(fieldId);
2671 + if (!currentFieldData) {
2672 + return;
2673 + }
2674 + const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
2675 + formRef.current.fields.set(fieldId, {
2676 + ...currentFieldData,
2677 + validityData: validityDataWithFormErrors
2678 + });
2679 + }
2680 + function makeValidityData(validityState, errorMessages) {
2681 + const errors = validityState.valid === false ? errorMessages : [];
2682 + return {
2683 + value,
2684 + state: validityState,
2685 + error: errors[0] ?? "",
2686 + errors,
2687 + initialValue: validityData.initialValue
2688 + };
2689 + }
2690 + function setCustomValidity(element2, message) {
2691 + const displaced = element2.validity.customError ? element2.validationMessage : "";
2692 + const ownedMessage = message.replace(/\r\n?/g, "\n");
2693 + element2.setCustomValidity(ownedMessage);
2694 + customValidityRef.current = [element2, ownedMessage, displaced];
2695 + }
2696 + function clearCustomValidity() {
2697 + const record = customValidityRef.current;
2698 + customValidityRef.current = null;
2699 + if (record && (!record[0].willValidate || record[0].validationMessage === record[1])) {
2700 + record[0].setCustomValidity(record[2]);
2701 + }
2702 + }
2703 + function publish(validityState, errorMessages, externalInvalid) {
2704 + const nextValidityData = makeValidityData(validityState, errorMessages);
2705 + updateRegisteredFieldValidity(nextValidityData, externalInvalid);
2706 + setValidityData(nextValidityData);
2707 + }
2708 + function getState(el) {
2709 + const computedState = validityKeys.reduce((acc, key) => {
2710 + acc[key] = el.validity[key];
2711 + return acc;
2712 + }, {});
2713 + let hasOnlyValueMissingError = false;
2714 + for (const key of validityKeys) {
2715 + if (key === "valid") {
2716 + continue;
2717 + }
2718 + if (key === "valueMissing" && computedState[key]) {
2719 + hasOnlyValueMissingError = true;
2720 + } else if (computedState[key]) {
2721 + return computedState;
2722 + }
2723 + }
2724 + if (hasOnlyValueMissingError && !markedDirtyRef.current) {
2725 + computedState.valid = true;
2726 + computedState.valueMissing = false;
2727 + }
2728 + return computedState;
2729 + }
2730 + function resolveRepresentativeInput() {
2731 + return registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
2732 + }
2733 + let element = resolveRepresentativeInput();
2734 + function refreshState() {
2735 + element = resolveRepresentativeInput();
2736 + return element?.willValidate ? getState(element) : makeState(false);
2737 + }
2738 + if (revalidate) {
2739 + if (state.valid !== false || !element) {
2740 + return;
2741 + }
2742 + if (!element.validity.valueMissing) {
2743 + clearCustomValidity();
2744 + const currentElement = resolveRepresentativeInput();
2745 + const foreign = currentElement?.validity.customError ? getNativeErrors(currentElement) : [];
2746 + publish(makeState(foreign.length > 0), foreign, false);
2747 + return;
2748 + }
2749 + for (const key of validityKeys) {
2750 + if (key !== "valid" && key !== "valueMissing" && key !== "customError" && element.validity[key]) {
2751 + return;
2752 + }
2753 + }
2754 + }
2755 + timeout.clear();
2756 + clearCustomValidity();
2757 + let nextState = refreshState();
2758 + let validationErrors = getNativeErrors(element);
2759 + const isValidatingOnChange = shouldValidateOnChange();
2760 + if (validationErrors.length === 0 || isValidatingOnChange) {
2761 + const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
2762 + if (field.name) {
2763 + acc[field.name] = field.getValue();
2764 + }
2765 + return acc;
2766 + }, {});
2767 + const resultOrPromise = validate(value, formValues);
2768 + let result;
2769 + if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) {
2770 + if (nextState.valid === false) {
2771 + publish(nextState, validationErrors);
2772 + } else if (validationMode === "onSubmit" || !validityData.state.customError) {
2773 + nextState.valid = null;
2774 + publish(nextState, validationErrors);
2775 + }
2776 + result = await resultOrPromise;
2777 + if (validationCommitId !== validationCommitIdRef.current) {
2778 + return;
2779 + }
2780 + nextState = refreshState();
2781 + } else {
2782 + result = resultOrPromise;
2783 + }
2784 + validationErrors = result ? [].concat(result).filter(Boolean) : [];
2785 + if (validationErrors.length > 0) {
2786 + nextState.valid = false;
2787 + nextState.customError = true;
2788 + if (element?.willValidate) {
2789 + setCustomValidity(element, validationErrors.join("\n"));
2790 + }
2791 + } else {
2792 + validationErrors = getNativeErrors(element);
2793 + }
2794 + }
2795 + publish(nextState, validationErrors);
2796 + });
2797 + const change = useStableCallback((value, cancelPending = false) => {
2798 + timeout.clear();
2799 + validationCommitIdRef.current += 1;
2800 + if (cancelPending) {
2801 + return;
2802 + }
2803 + const validateOnChange = shouldValidateOnChange();
2804 + if (validateOnChange && value !== "" && validationDebounceTime) {
2805 + timeout.start(validationDebounceTime, () => {
2806 + commit(value);
2807 + });
2808 + } else {
2809 + commit(value, !validateOnChange);
2810 + }
2811 + });
2812 + const getValidationProps = React26.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
2813 + "aria-invalid": true
2814 + } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
2815 + return React26.useMemo(() => ({
2816 + getValidationProps,
2817 + inputRef,
2818 + registeredInputs,
2819 + registerInput,
2820 + getInputControl,
2821 + commit,
2822 + change
2823 + }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
2824 + }
2825 +
2826 + // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
2827 + function useRegisteredLabelId(idProp, setLabelId) {
2828 + const id = useBaseUiId(idProp);
2829 + useIsoLayoutEffect(() => {
2830 + setLabelId(id);
2831 + return () => {
2832 + setLabelId((currentId) => currentId === id ? void 0 : currentId);
2833 + };
2834 + }, [id, setLabelId]);
2835 + return id;
2836 + }
2837 +
2838 + // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
2839 + function useLabel(params = {}) {
2840 + const {
2841 + id: idProp,
2842 + fallbackControlId,
2843 + native = false,
2844 + setLabelId: setLabelIdProp,
2845 + focusControl: focusControlProp
2846 + } = params;
2847 + const {
2848 + controlId: contextControlId,
2849 + setLabelId: setContextLabelId
2850 + } = useLabelableContext();
2851 + const syncLabelId = useStableCallback((nextLabelId) => {
2852 + setContextLabelId(nextLabelId);
2853 + setLabelIdProp?.(nextLabelId);
2854 + });
2855 + const id = useRegisteredLabelId(idProp, syncLabelId);
2856 + const resolvedControlId = contextControlId ?? fallbackControlId;
2857 + function focusControl(event) {
2858 + if (focusControlProp) {
2859 + focusControlProp(event, resolvedControlId);
2860 + return;
2861 + }
2862 + if (!resolvedControlId) {
2863 + return;
2864 + }
2865 + const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
2866 + if (isHTMLElement(controlElement)) {
2867 + focusElementWithVisible(controlElement);
2868 + }
2869 + }
2870 + function handleInteraction(event) {
2871 + const target = getTarget(event.nativeEvent);
2872 + if (target?.closest("button,input,select,textarea")) {
2873 + return;
2874 + }
2875 + if (!event.defaultPrevented && event.detail > 1) {
2876 + event.preventDefault();
2877 + }
2878 + if (native) {
2879 + return;
2880 + }
2881 + focusControl(event);
2882 + }
2883 + return native ? {
2884 + id,
2885 + htmlFor: resolvedControlId,
2886 + onMouseDown: handleInteraction
2887 + } : {
2888 + id,
2889 + onClick: handleInteraction,
2890 + onPointerDown(event) {
2891 + event.preventDefault();
2892 + }
2893 + };
2894 + }
2895 + function focusElementWithVisible(element) {
2896 + element.focus({
2897 + // Available from Chrome 144+ (January 2026).
2898 + // Safari and Firefox already support it.
2899 + focusVisible: true
2900 + });
2901 + }
2902 +
2132 2903 // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
2133 - var React20 = __toESM(require_react(), 1);
2904 + var React27 = __toESM(require_react(), 1);
2134 2905 function useCompositeItem(params = {}) {
2135 2906 const {
2136 2907 highlightItemOnHover,
2137 2908 highlightedIndex,
@@ -2138,17 +2909,17 @@
2138 2909 onHighlightedIndexChange
2139 2910 } = useCompositeRootContext();
2140 2911 const {
2141 2912 ref,
2142 - index
2913 + index: index2
2143 2914 } = useCompositeListItem(params);
2144 - const isHighlighted = highlightedIndex === index;
2145 - const itemRef = React20.useRef(null);
2915 + const isHighlighted = highlightedIndex === index2;
2916 + const itemRef = React27.useRef(null);
2146 2917 const mergedRef = useMergedRefs(ref, itemRef);
2147 2918 const compositeProps = {
2148 2919 tabIndex: isHighlighted ? 0 : -1,
2149 2920 onFocus() {
2150 - onHighlightedIndexChange(index);
2921 + onHighlightedIndexChange(index2);
2151 2922 },
2152 2923 onMouseMove() {
2153 2924 const item = itemRef.current;
2154 2925 if (!highlightItemOnHover || !item) {
@@ -2162,9 +2933,9 @@
2162 2933 };
2163 2934 return {
2164 2935 compositeProps,
2165 2936 compositeRef: mergedRef,
2166 - index
2937 + index: index2
2167 2938 };
2168 2939 }
2169 2940
2170 2941 // node_modules/@base-ui/react/utils/getCssDimensions.mjs
@@ -2186,18 +2957,18 @@
2186 2957 };
2187 2958 }
2188 2959
2189 2960 // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
2190 - var React21 = __toESM(require_react(), 1);
2191 - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
2961 + var React28 = __toESM(require_react(), 1);
2962 + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2192 2963 var DirectionProvider = function DirectionProvider2(props) {
2193 2964 const {
2194 2965 direction = "ltr"
2195 2966 } = props;
2196 - const contextValue = React21.useMemo(() => ({
2967 + const contextValue = React28.useMemo(() => ({
2197 2968 direction
2198 2969 }), [direction]);
2199 - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DirectionContext.Provider, {
2970 + return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DirectionContext.Provider, {
2200 2971 value: contextValue,
2201 2972 children: props.children
2202 2973 });
2203 2974 };
@@ -2208,29 +2979,845 @@
2208 2979 return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
2209 2980 }
2210 2981
2211 2982 // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
2212 - var React22 = __toESM(require_react(), 1);
2213 - var CSPContext = /* @__PURE__ */ React22.createContext(void 0);
2983 + var React29 = __toESM(require_react(), 1);
2984 + var CSPContext = /* @__PURE__ */ React29.createContext(void 0);
2214 2985 if (true) CSPContext.displayName = "CSPContext";
2215 2986 var DEFAULT_CSP_CONTEXT_VALUE = {
2216 2987 disableStyleElements: false
2217 2988 };
2218 2989 function useCSPContext() {
2219 - return React22.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2990 + return React29.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2220 2991 }
2221 2992
2993 + // node_modules/@base-ui/react/utils/getElementTransform.mjs
2994 + function getElementTransform(element, computedStyle) {
2995 + const transform = (computedStyle ?? getWindow(element).getComputedStyle(element)).transform;
2996 + let translateX = 0;
2997 + let translateY = 0;
2998 + let scale = 1;
2999 + if (transform && transform !== "none") {
3000 + const matrix = transform.match(/matrix(?:3d)?\(([^)]+)\)/);
3001 + if (matrix) {
3002 + const values = matrix[1].split(", ").map(parseFloat);
3003 + if (values.length === 6) {
3004 + translateX = values[4];
3005 + translateY = values[5];
3006 + scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);
3007 + } else if (values.length === 16) {
3008 + translateX = values[12];
3009 + translateY = values[13];
3010 + scale = values[0];
3011 + }
3012 + }
3013 + }
3014 + return {
3015 + x: translateX,
3016 + y: translateY,
3017 + scale
3018 + };
3019 + }
3020 +
3021 + // node_modules/@base-ui/react/field/index.parts.mjs
3022 + var index_parts_exports = {};
3023 + __export(index_parts_exports, {
3024 + Control: () => FieldControl,
3025 + Description: () => FieldDescription,
3026 + Error: () => FieldError,
3027 + Item: () => FieldItem,
3028 + Label: () => FieldLabel,
3029 + Root: () => FieldRoot,
3030 + Validity: () => FieldValidity
3031 + });
3032 +
3033 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3034 + var React33 = __toESM(require_react(), 1);
3035 +
3036 + // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
3037 + var React30 = __toESM(require_react(), 1);
3038 + var FieldsetRootContext = /* @__PURE__ */ React30.createContext(void 0);
3039 + if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
3040 + function useFieldsetRootContext(optional = false) {
3041 + const context = React30.useContext(FieldsetRootContext);
3042 + if (!context && !optional) {
3043 + throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
3044 + }
3045 + return context;
3046 + }
3047 +
3048 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
3049 + var React31 = __toESM(require_react(), 1);
3050 + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
3051 + var LabelableProvider = function LabelableProvider2(props) {
3052 + const defaultId = useBaseUiId();
3053 + const [controlIdState, setControlIdState] = React31.useState(defaultId);
3054 + const [labelId, setLabelId] = React31.useState();
3055 + const [messageIds, setMessageIds] = React31.useState([]);
3056 + const controlId = controlIdState === void 0 ? defaultId : controlIdState;
3057 + const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
3058 + const {
3059 + messageIds: parentMessageIds
3060 + } = useLabelableContext();
3061 + const registerControlId = useStableCallback((source, nextId) => {
3062 + const registrations = registrationsRef.current;
3063 + if (nextId === void 0) {
3064 + registrations.delete(source);
3065 + } else {
3066 + registrations.set(source, nextId);
3067 + }
3068 + setControlIdState((prev) => {
3069 + if (registrations.size === 0) {
3070 + return prev;
3071 + }
3072 + let nextControlId;
3073 + for (const id of registrations.values()) {
3074 + if (id === prev) {
3075 + return prev;
3076 + }
3077 + if (nextControlId === void 0) {
3078 + nextControlId = id;
3079 + }
3080 + }
3081 + return nextControlId;
3082 + });
3083 + });
3084 + const resetControlId = useStableCallback(() => {
3085 + if (registrationsRef.current.size === 0) {
3086 + setControlIdState(defaultId);
3087 + }
3088 + });
3089 + const getDescriptionProps = React31.useCallback((externalProps) => {
3090 + const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
3091 + ids.push(...parentMessageIds, ...messageIds);
3092 + return {
3093 + ...externalProps,
3094 + "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
3095 + };
3096 + }, [parentMessageIds, messageIds]);
3097 + const contextValue = React31.useMemo(() => ({
3098 + controlId,
3099 + registerControlId,
3100 + resetControlId,
3101 + labelId,
3102 + setLabelId,
3103 + messageIds,
3104 + setMessageIds,
3105 + getDescriptionProps
3106 + }), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
3107 + return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LabelableContext.Provider, {
3108 + value: contextValue,
3109 + children: props.children
3110 + });
3111 + };
3112 + if (true) LabelableProvider.displayName = "LabelableProvider";
3113 +
3114 + // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
3115 + var React32 = __toESM(require_react(), 1);
3116 + function useFieldControlRegistration(params) {
3117 + const {
3118 + change,
3119 + commit,
3120 + invalid: invalid2,
3121 + markedDirtyRef,
3122 + name: name16,
3123 + setRegisteredFieldName,
3124 + registeredFieldIdRef,
3125 + setValidityData,
3126 + validityData
3127 + } = params;
3128 + const {
3129 + formRef
3130 + } = useFormContext();
3131 + const activeFieldControlSourceRef = React32.useRef(null);
3132 + const registrationRef = React32.useRef(null);
3133 + const initialValueCapturedRef = React32.useRef(false);
3134 + const getValueForForm = useStableCallback(() => {
3135 + const registration = registrationRef.current;
3136 + if (!registration) {
3137 + return void 0;
3138 + }
3139 + if (registration.getValue) {
3140 + return registration.getValue();
3141 + }
3142 + return registration.value;
3143 + });
3144 + function getRegistrationValue(registration) {
3145 + return registration.value === void 0 ? getValueForForm() : registration.value;
3146 + }
3147 + const validate = useStableCallback(() => {
3148 + const registration = registrationRef.current;
3149 + markedDirtyRef.current = true;
3150 + if (!registration) {
3151 + commit(validityData.value);
3152 + return;
3153 + }
3154 + commit(getRegistrationValue(registration));
3155 + });
3156 + function refreshRegistration() {
3157 + const registration = registrationRef.current;
3158 + if (!registration || !registration.id) {
3159 + return;
3160 + }
3161 + formRef.current.fields.set(registration.id, {
3162 + getValue: getValueForForm,
3163 + name: name16 ?? registration.name,
3164 + controlRef: registration.controlRef,
3165 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3166 + validate
3167 + });
3168 + }
3169 + function deleteRegistration(id = registrationRef.current?.id) {
3170 + if (id) {
3171 + formRef.current.fields.delete(id);
3172 + }
3173 + }
3174 + function captureInitialValue(registration) {
3175 + if (initialValueCapturedRef.current) {
3176 + return;
3177 + }
3178 + initialValueCapturedRef.current = true;
3179 + const initialValue = getRegistrationValue(registration);
3180 + setValidityData((prev) => prev.initialValue === initialValue ? prev : {
3181 + ...prev,
3182 + initialValue
3183 + });
3184 + }
3185 + useIsoLayoutEffect(() => {
3186 + const registration = registrationRef.current;
3187 + if (!registration || !registration.id) {
3188 + return;
3189 + }
3190 + setRegisteredFieldName(name16 ? void 0 : registration.name);
3191 + formRef.current.fields.set(registration.id, {
3192 + getValue: getValueForForm,
3193 + name: name16 ?? registration.name,
3194 + controlRef: registration.controlRef,
3195 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3196 + validate
3197 + });
3198 + }, [formRef, getValueForForm, invalid2, name16, setRegisteredFieldName, validate, validityData]);
3199 + useIsoLayoutEffect(() => {
3200 + const fields = formRef.current.fields;
3201 + return () => {
3202 + const id = registrationRef.current?.id;
3203 + if (id) {
3204 + fields.delete(id);
3205 + }
3206 + };
3207 + }, [formRef]);
3208 + const register = useStableCallback((source, registration) => {
3209 + if (!registration) {
3210 + if (activeFieldControlSourceRef.current === source) {
3211 + activeFieldControlSourceRef.current = null;
3212 + change(void 0, true);
3213 + deleteRegistration();
3214 + registrationRef.current = null;
3215 + setRegisteredFieldName(void 0);
3216 + registeredFieldIdRef.current = void 0;
3217 + }
3218 + return;
3219 + }
3220 + const previousId = registrationRef.current?.id;
3221 + const previousSource = activeFieldControlSourceRef.current;
3222 + if (previousSource && previousSource !== source) {
3223 + change(void 0, true);
3224 + }
3225 + activeFieldControlSourceRef.current = source;
3226 + registrationRef.current = registration;
3227 + if (!name16) {
3228 + setRegisteredFieldName(registration.name);
3229 + }
3230 + registeredFieldIdRef.current = registration.id;
3231 + if (previousId && previousId !== registration.id) {
3232 + deleteRegistration(previousId);
3233 + }
3234 + captureInitialValue(registration);
3235 + refreshRegistration();
3236 + });
3237 + return [validate, register];
3238 + }
3239 +
3240 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3241 + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
3242 + var FieldRootInner = /* @__PURE__ */ React33.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
3243 + const {
3244 + errors,
3245 + validationMode: formValidationMode,
3246 + submitCountRef
3247 + } = useFormContext();
3248 + const {
3249 + render,
3250 + className,
3251 + validate: validateProp,
3252 + validationDebounceTime = 0,
3253 + validationMode = formValidationMode,
3254 + name: name16,
3255 + disabled: disabledProp = false,
3256 + invalid: invalidProp,
3257 + dirty: dirtyProp,
3258 + touched: touchedProp,
3259 + actionsRef,
3260 + style,
3261 + ...elementProps
3262 + } = componentProps;
3263 + const disabledFieldset = useFieldsetRootContext(true)?.disabled;
3264 + const validate = useStableCallback(validateProp || (() => null));
3265 + const disabled2 = disabledFieldset || disabledProp;
3266 + const [touchedState, setTouchedUnwrapped] = React33.useState(false);
3267 + const [dirtyState, setDirtyUnwrapped] = React33.useState(false);
3268 + const [filled, setFilled] = React33.useState(false);
3269 + const [focused, setFocused] = React33.useState(false);
3270 + const dirty = dirtyProp ?? dirtyState;
3271 + const touched = touchedProp ?? touchedState;
3272 + const markedDirtyRef = React33.useRef(dirty);
3273 + const registeredFieldIdRef = React33.useRef(void 0);
3274 + const [registeredFieldName, setRegisteredFieldName] = React33.useState();
3275 + const effectiveName = name16 ?? registeredFieldName;
3276 + useIsoLayoutEffect(() => {
3277 + if (dirtyProp !== void 0) {
3278 + markedDirtyRef.current = dirtyProp;
3279 + }
3280 + }, [dirtyProp]);
3281 + const setDirty = useStableCallback((value) => {
3282 + if (dirtyProp !== void 0) {
3283 + return;
3284 + }
3285 + if (value) {
3286 + markedDirtyRef.current = true;
3287 + }
3288 + setDirtyUnwrapped(value);
3289 + });
3290 + const setTouched = useStableCallback((value) => {
3291 + if (touchedProp !== void 0) {
3292 + return;
3293 + }
3294 + setTouchedUnwrapped(value);
3295 + });
3296 + const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
3297 + const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
3298 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3299 + const invalid2 = invalidProp === true || hasFormError;
3300 + const [validityData, setValidityData] = React33.useState({
3301 + state: DEFAULT_VALIDITY_STATE,
3302 + error: "",
3303 + errors: [],
3304 + value: null,
3305 + initialValue: null
3306 + });
3307 + const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
3308 + const state = React33.useMemo(() => ({
3309 + disabled: disabled2,
3310 + touched,
3311 + dirty,
3312 + valid: valid2,
3313 + filled,
3314 + focused
3315 + }), [disabled2, touched, dirty, valid2, filled, focused]);
3316 + const validation = useFieldValidation({
3317 + setValidityData,
3318 + validate,
3319 + validityData,
3320 + validationDebounceTime,
3321 + invalid: invalid2,
3322 + markedDirtyRef,
3323 + state,
3324 + shouldValidateOnChange,
3325 + validationMode,
3326 + registeredFieldIdRef
3327 + });
3328 + const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
3329 + change: validation.change,
3330 + commit: validation.commit,
3331 + invalid: invalid2,
3332 + markedDirtyRef,
3333 + name: name16,
3334 + setRegisteredFieldName,
3335 + registeredFieldIdRef,
3336 + setValidityData,
3337 + validityData
3338 + });
3339 + React33.useImperativeHandle(actionsRef, () => ({
3340 + validate: validateFieldControl
3341 + }), [validateFieldControl]);
3342 + const contextValue = React33.useMemo(() => ({
3343 + invalid: invalid2,
3344 + name: effectiveName,
3345 + validityData,
3346 + setValidityData,
3347 + disabled: disabled2,
3348 + setTouched,
3349 + setDirty,
3350 + setFilled,
3351 + setFocused,
3352 + validationMode,
3353 + shouldValidateOnChange,
3354 + state,
3355 + registerFieldControl,
3356 + validation
3357 + }), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
3358 + const element = useRenderElement("div", componentProps, {
3359 + ref: forwardedRef,
3360 + state,
3361 + props: elementProps,
3362 + stateAttributesMapping: fieldValidityMapping
3363 + });
3364 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootContext.Provider, {
3365 + value: contextValue,
3366 + children: element
3367 + });
3368 + });
3369 + if (true) FieldRootInner.displayName = "FieldRootInner";
3370 + var FieldRoot = /* @__PURE__ */ React33.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
3371 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelableProvider, {
3372 + children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootInner, {
3373 + ...componentProps,
3374 + ref: forwardedRef
3375 + })
3376 + });
3377 + });
3378 + if (true) FieldRoot.displayName = "FieldRoot";
3379 +
3380 + // node_modules/@base-ui/react/field/label/FieldLabel.mjs
3381 + var React34 = __toESM(require_react(), 1);
3382 + var FieldLabel = /* @__PURE__ */ React34.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
3383 + const {
3384 + render,
3385 + className,
3386 + style,
3387 + id: idProp,
3388 + nativeLabel = true,
3389 + ...elementProps
3390 + } = componentProps;
3391 + const fieldRootContext = useFieldRootContext(false);
3392 + const fieldItemContext = useFieldItemContext();
3393 + const {
3394 + labelId
3395 + } = useLabelableContext();
3396 + const state = {
3397 + ...fieldRootContext.state,
3398 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3399 + };
3400 + const labelRef = React34.useRef(null);
3401 + const labelProps = useLabel({
3402 + id: labelId ?? idProp,
3403 + native: nativeLabel
3404 + });
3405 + if (true) {
3406 + React34.useEffect(() => {
3407 + if (!labelRef.current) {
3408 + return;
3409 + }
3410 + const isLabelTag = labelRef.current.tagName === "LABEL";
3411 + if (nativeLabel) {
3412 + if (!isLabelTag) {
3413 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3414 + const message = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`.";
3415 + error(`${message}${ownerStackMessage}`);
3416 + }
3417 + } else if (isLabelTag) {
3418 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3419 + const message = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`.";
3420 + error(`${message}${ownerStackMessage}`);
3421 + }
3422 + }, [nativeLabel]);
3423 + }
3424 + const element = useRenderElement("label", componentProps, {
3425 + ref: [forwardedRef, labelRef],
3426 + state,
3427 + props: [labelProps, elementProps],
3428 + stateAttributesMapping: fieldValidityMapping
3429 + });
3430 + return element;
3431 + });
3432 + if (true) FieldLabel.displayName = "FieldLabel";
3433 +
3434 + // node_modules/@base-ui/react/field/error/FieldError.mjs
3435 + var React35 = __toESM(require_react(), 1);
3436 + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3437 + var stateAttributesMapping = {
3438 + ...fieldValidityMapping,
3439 + ...transitionStatusMapping
3440 + };
3441 + var FieldError = /* @__PURE__ */ React35.forwardRef(function FieldError2(componentProps, forwardedRef) {
3442 + const {
3443 + render,
3444 + id: idProp,
3445 + className,
3446 + match,
3447 + style,
3448 + ...elementProps
3449 + } = componentProps;
3450 + const id = useBaseUiId(idProp);
3451 + const {
3452 + validityData,
3453 + state: fieldState,
3454 + name: name16
3455 + } = useFieldRootContext(false);
3456 + const {
3457 + setMessageIds
3458 + } = useLabelableContext();
3459 + const {
3460 + errors
3461 + } = useFormContext();
3462 + const formError = name16 && Object.hasOwn(errors, name16) ? errors[name16] : null;
3463 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3464 + const hasSpecificMatch = typeof match === "string";
3465 + let rendered = false;
3466 + if (match === true) {
3467 + rendered = true;
3468 + } else if (fieldState.disabled) {
3469 + rendered = false;
3470 + } else if (hasSpecificMatch) {
3471 + rendered = Boolean(validityData.state[match]);
3472 + } else {
3473 + rendered = hasFormError || validityData.state.valid === false;
3474 + }
3475 + const {
3476 + mounted,
3477 + transitionStatus,
3478 + setMounted
3479 + } = useTransitionStatus(rendered);
3480 + useIsoLayoutEffect(() => {
3481 + if (!rendered || !id) {
3482 + return void 0;
3483 + }
3484 + setMessageIds((v) => v.concat(id));
3485 + return () => {
3486 + setMessageIds((v) => v.filter((item) => item !== id));
3487 + };
3488 + }, [rendered, id, setMessageIds]);
3489 + const errorRef = React35.useRef(null);
3490 + const [lastRenderedMessage, setLastRenderedMessage] = React35.useState(null);
3491 + const [lastRenderedMessageKey, setLastRenderedMessageKey] = React35.useState(null);
3492 + let error2 = validityData.error;
3493 + if (!hasSpecificMatch && hasFormError) {
3494 + error2 = formError;
3495 + } else if (validityData.errors.length > 1) {
3496 + error2 = validityData.errors;
3497 + }
3498 + let errorMessage = error2;
3499 + if (Array.isArray(error2)) {
3500 + errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", {
3501 + children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", {
3502 + children: message
3503 + }, message))
3504 + }) : error2[0];
3505 + }
3506 + const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2;
3507 + if (rendered && errorKey !== lastRenderedMessageKey) {
3508 + setLastRenderedMessageKey(errorKey);
3509 + setLastRenderedMessage(errorMessage);
3510 + }
3511 + useOpenChangeComplete({
3512 + open: rendered,
3513 + ref: errorRef,
3514 + onComplete() {
3515 + if (!rendered) {
3516 + setMounted(false);
3517 + }
3518 + }
3519 + });
3520 + const state = {
3521 + ...fieldState,
3522 + transitionStatus
3523 + };
3524 + const element = useRenderElement("div", componentProps, {
3525 + ref: [forwardedRef, errorRef],
3526 + state,
3527 + props: [{
3528 + id,
3529 + children: rendered ? errorMessage : lastRenderedMessage
3530 + }, elementProps],
3531 + stateAttributesMapping,
3532 + enabled: mounted
3533 + });
3534 + if (!mounted) {
3535 + return null;
3536 + }
3537 + return element;
3538 + });
3539 + if (true) FieldError.displayName = "FieldError";
3540 +
3541 + // node_modules/@base-ui/react/field/description/FieldDescription.mjs
3542 + var React36 = __toESM(require_react(), 1);
3543 + var FieldDescription = /* @__PURE__ */ React36.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
3544 + const {
3545 + render,
3546 + id: idProp,
3547 + className,
3548 + style,
3549 + ...elementProps
3550 + } = componentProps;
3551 + const id = useBaseUiId(idProp);
3552 + const fieldRootContext = useFieldRootContext(false);
3553 + const fieldItemContext = useFieldItemContext();
3554 + const {
3555 + setMessageIds
3556 + } = useLabelableContext();
3557 + const state = {
3558 + ...fieldRootContext.state,
3559 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3560 + };
3561 + useIsoLayoutEffect(() => {
3562 + if (!id) {
3563 + return void 0;
3564 + }
3565 + setMessageIds((v) => v.concat(id));
3566 + return () => {
3567 + setMessageIds((v) => v.filter((item) => item !== id));
3568 + };
3569 + }, [id, setMessageIds]);
3570 + const element = useRenderElement("p", componentProps, {
3571 + ref: forwardedRef,
3572 + state,
3573 + props: [{
3574 + id
3575 + }, elementProps],
3576 + stateAttributesMapping: fieldValidityMapping
3577 + });
3578 + return element;
3579 + });
3580 + if (true) FieldDescription.displayName = "FieldDescription";
3581 +
3582 + // node_modules/@base-ui/react/field/control/FieldControl.mjs
3583 + var React37 = __toESM(require_react(), 1);
3584 + var FieldControl = /* @__PURE__ */ React37.forwardRef(function FieldControl2(componentProps, forwardedRef) {
3585 + const {
3586 + render,
3587 + className,
3588 + id: idProp,
3589 + name: nameProp,
3590 + value: valueProp,
3591 + disabled: disabledProp = false,
3592 + onValueChange,
3593 + defaultValue,
3594 + autoFocus = false,
3595 + style,
3596 + ...elementProps
3597 + } = componentProps;
3598 + const {
3599 + state: fieldState,
3600 + name: fieldName,
3601 + disabled: fieldDisabled,
3602 + setTouched,
3603 + setDirty,
3604 + validityData,
3605 + setFocused,
3606 + setFilled,
3607 + validationMode,
3608 + validation
3609 + } = useFieldRootContext();
3610 + const {
3611 + clearErrors,
3612 + elementRef: formElementRef,
3613 + submitCountRef
3614 + } = useFormContext();
3615 + const disabled2 = fieldDisabled || disabledProp;
3616 + const name16 = fieldName ?? nameProp;
3617 + const state = {
3618 + ...fieldState,
3619 + disabled: disabled2
3620 + };
3621 + const {
3622 + labelId
3623 + } = useLabelableContext();
3624 + const id = useLabelableId({
3625 + id: idProp
3626 + });
3627 + const [valueUnwrapped] = useControlled({
3628 + controlled: valueProp,
3629 + default: defaultValue,
3630 + name: "FieldControl",
3631 + state: "value"
3632 + });
3633 + const isControlled = valueProp !== void 0;
3634 + const value = isControlled ? valueUnwrapped : void 0;
3635 + const serializedValue = value == null ? void 0 : String(value);
3636 + const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
3637 + useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled2, nameProp);
3638 + useIsoLayoutEffect(() => {
3639 + const currentValue = serializedValue ?? validation.inputRef.current?.value;
3640 + if (currentValue !== void 0) {
3641 + setFilled(currentValue !== "");
3642 + }
3643 + }, [serializedValue, validation.inputRef, setFilled]);
3644 + useValueChanged(serializedValue, () => {
3645 + if (serializedValue === void 0) {
3646 + return;
3647 + }
3648 + clearErrors(name16);
3649 + setDirty(serializedValue !== (validityData.initialValue ?? ""));
3650 + validation.change(serializedValue);
3651 + });
3652 + const inputRef = React37.useRef(null);
3653 + const enterValidationTimeout = useTimeout();
3654 + useIsoLayoutEffect(() => {
3655 + if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {
3656 + setFocused(true);
3657 + }
3658 + }, [autoFocus, setFocused]);
3659 + const element = useRenderElement("input", componentProps, {
3660 + ref: [forwardedRef, inputRef],
3661 + state,
3662 + props: [{
3663 + id,
3664 + disabled: disabled2,
3665 + name: name16,
3666 + ref: validation.inputRef,
3667 + "aria-labelledby": labelId,
3668 + autoFocus,
3669 + ...isControlled ? {
3670 + value
3671 + } : {
3672 + defaultValue
3673 + },
3674 + onChange(event) {
3675 + const inputValue = event.currentTarget.value;
3676 + const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
3677 + onValueChange?.(inputValue, details);
3678 + if (isControlled) {
3679 + return;
3680 + }
3681 + setDirty(inputValue !== (validityData.initialValue ?? ""));
3682 + setFilled(inputValue !== "");
3683 + if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
3684 + clearErrors(name16);
3685 + validation.change(inputValue);
3686 + }
3687 + },
3688 + onFocus() {
3689 + setFocused(true);
3690 + },
3691 + onBlur(event) {
3692 + setTouched(true);
3693 + setFocused(false);
3694 + if (validationMode === "onBlur") {
3695 + const inputValue = event.currentTarget.value;
3696 + validation.commit(inputValue);
3697 + if (isControlled) {
3698 + queueMicrotask(() => {
3699 + const nextValue = validation.inputRef.current?.value;
3700 + if (nextValue !== void 0 && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? "")) {
3701 + validation.commit(nextValue);
3702 + }
3703 + });
3704 + }
3705 + }
3706 + },
3707 + onKeyDown(event) {
3708 + if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
3709 + setTouched(true);
3710 + const value2 = event.currentTarget.value;
3711 + const form = event.currentTarget.form;
3712 + if (form && form === formElementRef.current && !event.defaultPrevented) {
3713 + const input = event.currentTarget;
3714 + const submitCount = submitCountRef.current;
3715 + enterValidationTimeout.start(0, () => {
3716 + if (submitCountRef.current === submitCount) {
3717 + validation.commit(input.value);
3718 + }
3719 + });
3720 + } else {
3721 + validation.commit(value2);
3722 + }
3723 + }
3724 + }
3725 + }, elementProps, (props) => validation.getValidationProps(disabled2, props)],
3726 + stateAttributesMapping: fieldValidityMapping
3727 + });
3728 + return element;
3729 + });
3730 + if (true) FieldControl.displayName = "FieldControl";
3731 +
3732 + // node_modules/@base-ui/react/field/validity/FieldValidity.mjs
3733 + var React38 = __toESM(require_react(), 1);
3734 + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
3735 + var FieldValidity = function FieldValidity2(props) {
3736 + const {
3737 + children
3738 + } = props;
3739 + const {
3740 + validityData,
3741 + invalid: invalid2
3742 + } = useFieldRootContext(false);
3743 + const combinedFieldValidityData = React38.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
3744 + const isInvalid = combinedFieldValidityData.state.valid === false;
3745 + const {
3746 + transitionStatus
3747 + } = useTransitionStatus(isInvalid);
3748 + const fieldValidityState = React38.useMemo(() => {
3749 + return {
3750 + ...combinedFieldValidityData,
3751 + validity: combinedFieldValidityData.state,
3752 + transitionStatus
3753 + };
3754 + }, [combinedFieldValidityData, transitionStatus]);
3755 + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React38.Fragment, {
3756 + children: children(fieldValidityState)
3757 + });
3758 + };
3759 + if (true) FieldValidity.displayName = "FieldValidity";
3760 +
3761 + // node_modules/@base-ui/react/field/item/FieldItem.mjs
3762 + var React39 = __toESM(require_react(), 1);
3763 + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
3764 + var FieldItem = /* @__PURE__ */ React39.forwardRef(function FieldItem2(componentProps, forwardedRef) {
3765 + const {
3766 + render,
3767 + className,
3768 + style,
3769 + disabled: disabledProp = false,
3770 + ...elementProps
3771 + } = componentProps;
3772 + const {
3773 + state: fieldState,
3774 + disabled: rootDisabled
3775 + } = useFieldRootContext(false);
3776 + const disabled2 = rootDisabled || disabledProp;
3777 + const state = {
3778 + ...fieldState,
3779 + disabled: disabled2
3780 + };
3781 + const fieldItemContext = React39.useMemo(() => ({
3782 + disabled: disabled2
3783 + }), [disabled2]);
3784 + const element = useRenderElement("div", componentProps, {
3785 + ref: forwardedRef,
3786 + state,
3787 + props: elementProps,
3788 + stateAttributesMapping: fieldValidityMapping
3789 + });
3790 + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelableProvider, {
3791 + children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FieldItemContext.Provider, {
3792 + value: fieldItemContext,
3793 + children: element
3794 + })
3795 + });
3796 + });
3797 + if (true) FieldItem.displayName = "FieldItem";
3798 +
3799 + // node_modules/@base-ui/react/input/Input.mjs
3800 + var React40 = __toESM(require_react(), 1);
3801 + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
3802 + var Input = /* @__PURE__ */ React40.forwardRef(function Input2(props, forwardedRef) {
3803 + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Control, {
3804 + ref: forwardedRef,
3805 + ...props
3806 + });
3807 + });
3808 + if (true) Input.displayName = "Input";
3809 +
2222 3810 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
2223 - var React24 = __toESM(require_react(), 1);
3811 + var React42 = __toESM(require_react(), 1);
2224 3812
2225 3813 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
2226 - var React23 = __toESM(require_react(), 1);
3814 + var React41 = __toESM(require_react(), 1);
2227 3815
2228 3816 // node_modules/@base-ui/react/internals/composite/constants.mjs
2229 3817 var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
2230 3818
2231 3819 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
2232 - var EMPTY_ARRAY2 = [];
2233 3820 function useCompositeRoot(params) {
2234 3821 const {
2235 3822 loopFocus = true,
2236 3823 orientation = "both",
@@ -2240,34 +3827,51 @@
2240 3827 highlightedIndex: externalHighlightedIndex,
2241 3828 onHighlightedIndexChange: externalSetHighlightedIndex,
2242 3829 rootRef: externalRef,
2243 3830 enableHomeAndEndKeys = false,
2244 - stopEventPropagation = false,
3831 + stopEventPropagation,
2245 3832 disabledIndices,
2246 - modifierKeys = EMPTY_ARRAY2
3833 + modifierKeys = EMPTY_ARRAY
2247 3834 } = params;
2248 - const [internalHighlightedIndex, internalSetHighlightedIndex] = React23.useState(0);
3835 + const [internalHighlightedIndex, internalSetHighlightedIndex] = React41.useState(0);
2249 3836 const isGrid = grid != null;
2250 - const rootRef = React23.useRef(null);
3837 + const rootRef = React41.useRef(null);
2251 3838 const mergedRef = useMergedRefs(rootRef, externalRef);
2252 - const elementsRef = React23.useRef([]);
2253 - const hasSetDefaultIndexRef = React23.useRef(false);
3839 + const elementsRef = React41.useRef([]);
3840 + const hasSetDefaultIndexRef = React41.useRef(false);
3841 + const highlightedElementRef = React41.useRef(null);
2254 3842 const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
2255 - const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
2256 - (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
3843 + const onHighlightedIndexChange = useStableCallback((index2, shouldScrollIntoView = false) => {
3844 + highlightedElementRef.current = elementsRef.current[index2] ?? null;
3845 + (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index2);
2257 3846 if (shouldScrollIntoView) {
2258 - const newActiveItem = elementsRef.current[index];
3847 + const newActiveItem = elementsRef.current[index2];
2259 3848 scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
2260 3849 }
2261 3850 });
2262 3851 const onMapChange = useStableCallback((map) => {
2263 - if (map.size === 0 || hasSetDefaultIndexRef.current) {
3852 + if (map.size === 0) {
2264 3853 return;
2265 3854 }
3855 + if (hasSetDefaultIndexRef.current) {
3856 + const elements = elementsRef.current;
3857 + const nextIndex = elements.indexOf(highlightedElementRef.current);
3858 + if (nextIndex === -1) {
3859 + const replacement = elements[highlightedIndex];
3860 + if (!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
3861 + onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices));
3862 + } else {
3863 + highlightedElementRef.current = replacement;
3864 + }
3865 + } else if (nextIndex !== highlightedIndex) {
3866 + onHighlightedIndexChange(nextIndex);
3867 + }
3868 + return;
3869 + }
2266 3870 hasSetDefaultIndexRef.current = true;
2267 3871 const sortedElements = Array.from(map.keys());
2268 3872 const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
2269 - const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
3873 + const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
2270 3874 if (activeIndex !== -1) {
2271 3875 onHighlightedIndexChange(activeIndex);
2272 3876 } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {
2273 3877 const firstEnabledIndex = findNonDisabledListIndex(sortedElements, {
@@ -2299,10 +3903,10 @@
2299 3903 }
2300 3904 return onLoop(event, prevIndex, nextIndex, elementsRef);
2301 3905 });
2302 3906 const onKeyDown = useStableCallback((event) => {
2303 - const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS;
2304 - if (!RELEVANT_KEYS.has(event.key)) {
3907 + const isHomeOrEnd = event.key === HOME || event.key === END;
3908 + if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) {
2305 3909 return;
2306 3910 }
2307 3911 if (isModifierKeySet(event, modifierKeys)) {
2308 3912 return;
@@ -2312,24 +3916,16 @@
2312 3916 return;
2313 3917 }
2314 3918 const isRtl = direction === "rtl";
2315 3919 const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
2316 - const forwardKey = {
2317 - horizontal: horizontalForwardKey,
2318 - vertical: ARROW_DOWN,
2319 - both: horizontalForwardKey
2320 - }[orientation];
2321 3920 const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
2322 - const backwardKey = {
2323 - horizontal: horizontalBackwardKey,
2324 - vertical: ARROW_UP,
2325 - both: horizontalBackwardKey
2326 - }[orientation];
3921 + const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey;
3922 + const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey;
2327 3923 const target = getTarget(event.nativeEvent);
2328 3924 if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
2329 3925 const selectionStart = target.selectionStart;
2330 3926 const selectionEnd = target.selectionEnd;
2331 - const textContent = target.value ?? "";
3927 + const textContent = target.value;
2332 3928 if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
2333 3929 return;
2334 3930 }
2335 3931 if (event.key !== backwardKey && selectionStart < textContent.length) {
@@ -2355,23 +3951,10 @@
2355 3951 orientation,
2356 3952 rtl: isRtl
2357 3953 });
2358 3954 }
2359 - const forwardKeys = {
2360 - horizontal: [horizontalForwardKey],
2361 - vertical: [ARROW_DOWN],
2362 - both: [horizontalForwardKey, ARROW_DOWN]
2363 - }[orientation];
2364 - const backwardKeys = {
2365 - horizontal: [horizontalBackwardKey],
2366 - vertical: [ARROW_UP],
2367 - both: [horizontalBackwardKey, ARROW_UP]
2368 - }[orientation];
2369 - const preventedKeys = isGrid ? RELEVANT_KEYS : {
2370 - horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
2371 - vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
2372 - both: RELEVANT_KEYS
2373 - }[orientation];
3955 + const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN;
3956 + const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP;
2374 3957 if (enableHomeAndEndKeys) {
2375 3958 if (event.key === HOME) {
2376 3959 nextIndex = minIndex;
2377 3960 } else if (event.key === END) {
@@ -2377,15 +3960,15 @@
2377 3960 } else if (event.key === END) {
2378 3961 nextIndex = maxIndex;
2379 3962 }
2380 3963 }
2381 - if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
2382 - if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
3964 + if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {
3965 + if (loopFocus && nextIndex === maxIndex && isForwardKey) {
2383 3966 nextIndex = minIndex;
2384 3967 if (onLoop) {
2385 3968 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2386 3969 }
2387 - } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
3970 + } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {
2388 3971 nextIndex = maxIndex;
2389 3972 if (onLoop) {
2390 3973 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2391 3974 }
@@ -2391,9 +3974,9 @@
2391 3974 }
2392 3975 } else {
2393 3976 nextIndex = findNonDisabledListIndex(elementsRef.current, {
2394 3977 startingIndex: nextIndex,
2395 - decrement: backwardKeys.includes(event.key),
3978 + decrement: isBackwardKey,
2396 3979 disabledIndices
2397 3980 });
2398 3981 }
2399 3982 }
@@ -2400,9 +3983,9 @@
2400 3983 if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
2401 3984 if (stopEventPropagation) {
2402 3985 event.stopPropagation();
2403 3986 }
2404 - if (preventedKeys.has(event.key)) {
3987 + if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) {
2405 3988 event.preventDefault();
2406 3989 }
2407 3990 onHighlightedIndexChange(nextIndex, true);
2408 3991 queueMicrotask(() => {
@@ -2417,9 +4000,9 @@
2417 4000 const target = getTarget(event.nativeEvent);
2418 4001 if (!element || target == null || !isNativeInput(target)) {
2419 4002 return;
2420 4003 }
2421 - target.setSelectionRange(0, target.value.length ?? 0);
4004 + target.setSelectionRange(0, target.value.length);
2422 4005 },
2423 4006 onKeyDown
2424 4007 };
2425 4008 return {
@@ -2426,15 +4009,30 @@
2426 4009 props,
2427 4010 highlightedIndex,
2428 4011 onHighlightedIndexChange,
2429 4012 elementsRef,
2430 - disabledIndices,
2431 4013 onMapChange,
2432 4014 relayKeyboardEvent: onKeyDown
2433 4015 };
2434 4016 }
4017 + function getFallbackIndex(elements, disabledIndices) {
4018 + let fallbackIndex = -1;
4019 + for (let index2 = 0; index2 < elements.length; index2 += 1) {
4020 + const element = elements[index2];
4021 + if (!element || isListIndexDisabled(elements, index2, disabledIndices)) {
4022 + continue;
4023 + }
4024 + if (element.hasAttribute(ACTIVE_COMPOSITE_ITEM)) {
4025 + return index2;
4026 + }
4027 + if (fallbackIndex === -1) {
4028 + fallbackIndex = index2;
4029 + }
4030 + }
4031 + return Math.max(fallbackIndex, 0);
4032 + }
2435 4033 function isModifierKeySet(event, ignoredModifierKeys) {
2436 - for (const key of MODIFIER_KEYS.values()) {
4034 + for (const key of MODIFIER_KEYS) {
2437 4035 if (ignoredModifierKeys.includes(key)) {
2438 4036 continue;
2439 4037 }
2440 4038 if (event.getModifierState(key)) {
@@ -2444,9 +4042,9 @@
2444 4042 return false;
2445 4043 }
2446 4044
2447 4045 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
2448 - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
4046 + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2449 4047 function CompositeRoot(componentProps) {
2450 4048 const {
2451 4049 render,
2452 4050 className,
@@ -2453,9 +4051,9 @@
2453 4051 style,
2454 4052 refs = EMPTY_ARRAY,
2455 4053 props = EMPTY_ARRAY,
2456 4054 state = EMPTY_OBJECT,
2457 - stateAttributesMapping: stateAttributesMapping3,
4055 + stateAttributesMapping: stateAttributesMapping4,
2458 4056 highlightedIndex: highlightedIndexProp,
2459 4057 onHighlightedIndexChange: onHighlightedIndexChangeProp,
2460 4058 orientation,
2461 4059 grid,
@@ -2496,19 +4094,19 @@
2496 4094 const element = useRenderElement(tag, componentProps, {
2497 4095 state,
2498 4096 ref: refs,
2499 4097 props: [defaultProps, ...props, elementProps],
2500 - stateAttributesMapping: stateAttributesMapping3
4098 + stateAttributesMapping: stateAttributesMapping4
2501 4099 });
2502 - const contextValue = React24.useMemo(() => ({
4100 + const contextValue = React42.useMemo(() => ({
2503 4101 highlightedIndex,
2504 4102 onHighlightedIndexChange,
2505 4103 highlightItemOnHover,
2506 4104 relayKeyboardEvent
2507 4105 }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
2508 - return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeRootContext.Provider, {
4106 + return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeRootContext.Provider, {
2509 4107 value: contextValue,
2510 - children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeList, {
4108 + children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeList, {
2511 4109 elementsRef,
2512 4110 onMapChange: (newMap) => {
2513 4111 onMapChangeProp?.(newMap);
2514 4112 onMapChangeUnwrapped(newMap);
@@ -2517,8 +4115,11 @@
2517 4115 })
2518 4116 });
2519 4117 }
2520 4118
4119 + // node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs
4120 + var script = "";
4121 +
2521 4122 // node_modules/@base-ui/react/utils/useIsHydrating.mjs
2522 4123 var import_shim = __toESM(require_shim(), 1);
2523 4124 function subscribe() {
2524 4125 return NOOP;
@@ -2532,11 +4133,34 @@
2532 4133 function useIsHydrating() {
2533 4134 return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
2534 4135 }
2535 4136
4137 + // node_modules/@base-ui/react/internals/PrehydrationScript.mjs
4138 + var React43 = __toESM(require_react(), 1);
4139 + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
4140 + function PrehydrationScript(props) {
4141 + const {
4142 + script: script2
4143 + } = props;
4144 + const {
4145 + nonce
4146 + } = useCSPContext();
4147 + const isHydrating = useIsHydrating();
4148 + if (!isHydrating) {
4149 + return null;
4150 + }
4151 + return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("script", {
4152 + nonce,
4153 + dangerouslySetInnerHTML: {
4154 + __html: script2
4155 + },
4156 + suppressHydrationWarning: true
4157 + });
4158 + }
4159 +
2536 4160 // node_modules/@base-ui/react/tabs/index.parts.mjs
2537 - var index_parts_exports = {};
2538 - __export(index_parts_exports, {
4161 + var index_parts_exports2 = {};
4162 + __export(index_parts_exports2, {
2539 4163 Indicator: () => TabsIndicator,
2540 4164 List: () => TabsList,
2541 4165 Panel: () => TabsPanel,
2542 4166 Root: () => TabsRoot,
@@ -2543,16 +4167,16 @@
2543 4167 Tab: () => TabsTab
2544 4168 });
2545 4169
2546 4170 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
2547 - var React26 = __toESM(require_react(), 1);
4171 + var React45 = __toESM(require_react(), 1);
2548 4172
2549 4173 // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
2550 - var React25 = __toESM(require_react(), 1);
2551 - var TabsRootContext = /* @__PURE__ */ React25.createContext(void 0);
4174 + var React44 = __toESM(require_react(), 1);
4175 + var TabsRootContext = /* @__PURE__ */ React44.createContext(void 0);
2552 4176 if (true) TabsRootContext.displayName = "TabsRootContext";
2553 4177 function useTabsRootContext() {
2554 - const context = React25.useContext(TabsRootContext);
4178 + const context = React44.useContext(TabsRootContext);
2555 4179 if (context === void 0) {
2556 4180 throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
2557 4181 }
2558 4182 return context;
@@ -2558,24 +4182,20 @@
2558 4182 return context;
2559 4183 }
2560 4184
2561 4185 // node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
2562 - var TabsRootDataAttributes = /* @__PURE__ */ (function(TabsRootDataAttributes2) {
2563 - TabsRootDataAttributes2["activationDirection"] = "data-activation-direction";
2564 - TabsRootDataAttributes2["orientation"] = "data-orientation";
2565 - return TabsRootDataAttributes2;
2566 - })({});
4186 + var activationDirection = "data-activation-direction";
2567 4187
2568 4188 // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs
2569 4189 var tabsStateAttributesMapping = {
2570 4190 tabActivationDirection: (dir) => ({
2571 - [TabsRootDataAttributes.activationDirection]: dir
4191 + [activationDirection]: dir
2572 4192 })
2573 4193 };
2574 4194
2575 4195 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
2576 - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2577 - var TabsRoot = /* @__PURE__ */ React26.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
4196 + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
4197 + var TabsRoot = /* @__PURE__ */ React45.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
2578 4198 const {
2579 4199 className,
2580 4200 defaultValue: defaultValueProp = 0,
2581 4201 onValueChange: onValueChangeProp,
@@ -2585,10 +4205,10 @@
2585 4205 style,
2586 4206 ...elementProps
2587 4207 } = componentProps;
2588 4208 const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0;
2589 - const tabPanelRefs = React26.useRef([]);
2590 - const [mountedTabPanels, setMountedTabPanels] = React26.useState(() => /* @__PURE__ */ new Map());
4209 + const tabPanelRefs = React45.useRef([]);
4210 + const [mountedTabPanels, setMountedTabPanels] = React45.useState(() => /* @__PURE__ */ new Map());
2591 4211 const [value, setValue] = useControlled({
2592 4212 controlled: valueProp,
2593 4213 default: defaultValueProp,
2594 4214 name: "Tabs",
@@ -2594,22 +4214,12 @@
2594 4214 name: "Tabs",
2595 4215 state: "value"
2596 4216 });
2597 4217 const isControlled = valueProp !== void 0;
2598 - const [tabMap, setTabMap] = React26.useState(() => /* @__PURE__ */ new Map());
2599 - const lastKnownTabElementRef = React26.useRef(void 0);
2600 - const getTabElementBySelectedValue = React26.useCallback((selectedValue) => {
2601 - if (selectedValue === void 0) {
2602 - return null;
2603 - }
2604 - for (const [tabElement, tabMetadata] of tabMap.entries()) {
2605 - if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) {
2606 - return tabElement;
2607 - }
2608 - }
2609 - return null;
2610 - }, [tabMap]);
2611 - const [activationDirectionState, setActivationDirectionState] = React26.useState(() => ({
4218 + const [tabMap, setTabMap] = React45.useState(() => /* @__PURE__ */ new Map());
4219 + const lastKnownTabElementRef = React45.useRef(void 0);
4220 + const getTabElementBySelectedValue = React45.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]);
4221 + const [activationDirectionState, setActivationDirectionState] = React45.useState(() => ({
2612 4222 previousValue: value,
2613 4223 tabActivationDirection: "none"
2614 4224 }));
2615 4225 const {
@@ -2633,10 +4243,10 @@
2633 4243 tabActivationDirection
2634 4244 });
2635 4245 }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);
2636 4246 const onValueChange = useStableCallback((newValue, eventDetails) => {
2637 - const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
2638 - eventDetails.activationDirection = activationDirection;
4247 + const activationDirection2 = computeActivationDirection(value, newValue, orientation, tabMap);
4248 + eventDetails.activationDirection = activationDirection2;
2639 4249 onValueChangeProp?.(newValue, eventDetails);
2640 4250 if (eventDetails.isCanceled) {
2641 4251 return;
2642 4252 }
@@ -2648,38 +4258,35 @@
2648 4258 }));
2649 4259 });
2650 4260 const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
2651 4261 setMountedTabPanels((prev) => {
2652 - if (prev.get(panelValue) === panelId) {
2653 - return prev;
2654 - }
2655 4262 const next = new Map(prev);
2656 4263 next.set(panelValue, panelId);
2657 4264 return next;
2658 4265 });
4266 + return () => {
4267 + setMountedTabPanels((prev) => {
4268 + if (prev.get(panelValue) !== panelId) {
4269 + return prev;
4270 + }
4271 + const next = new Map(prev);
4272 + next.delete(panelValue);
4273 + return next;
4274 + });
4275 + };
2659 4276 });
2660 - const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
2661 - setMountedTabPanels((prev) => {
2662 - if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) {
2663 - return prev;
2664 - }
2665 - const next = new Map(prev);
2666 - next.delete(panelValue);
2667 - return next;
2668 - });
2669 - });
2670 - const getTabPanelIdByValue = React26.useCallback((tabValue) => {
4277 + const getTabPanelIdByValue = React45.useCallback((tabValue) => {
2671 4278 return mountedTabPanels.get(tabValue);
2672 4279 }, [mountedTabPanels]);
2673 - const getTabIdByPanelValue = React26.useCallback((tabPanelValue) => {
4280 + const getTabIdByPanelValue = React45.useCallback((tabPanelValue) => {
2674 4281 for (const tabMetadata of tabMap.values()) {
2675 - if (tabPanelValue === tabMetadata?.value) {
2676 - return tabMetadata?.id;
4282 + if (tabPanelValue === tabMetadata.value) {
4283 + return tabMetadata.id;
2677 4284 }
2678 4285 }
2679 4286 return void 0;
2680 4287 }, [tabMap]);
2681 - const tabsContextValue = React26.useMemo(() => ({
4288 + const tabsContextValue = React45.useMemo(() => ({
2682 4289 getTabElementBySelectedValue,
2683 4290 getTabIdByPanelValue,
2684 4291 getTabPanelIdByValue,
2685 4292 onValueChange,
@@ -2685,32 +4292,31 @@
2685 4292 onValueChange,
2686 4293 orientation,
2687 4294 registerMountedTabPanel,
2688 4295 setTabMap,
2689 - unregisterMountedTabPanel,
2690 4296 tabActivationDirection,
2691 4297 value
2692 - }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]);
2693 - const selectedTabMetadata = React26.useMemo(() => {
4298 + }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]);
4299 + const selectedTabMetadata = React45.useMemo(() => {
2694 4300 for (const tabMetadata of tabMap.values()) {
2695 - if (tabMetadata != null && tabMetadata.value === value) {
4301 + if (tabMetadata.value === value) {
2696 4302 return tabMetadata;
2697 4303 }
2698 4304 }
2699 4305 return void 0;
2700 4306 }, [tabMap, value]);
2701 - const firstEnabledTabValue = React26.useMemo(() => {
4307 + const firstEnabledTabValue = React45.useMemo(() => {
2702 4308 for (const tabMetadata of tabMap.values()) {
2703 - if (tabMetadata != null && !tabMetadata.disabled) {
4309 + if (!tabMetadata.disabled) {
2704 4310 return tabMetadata.value;
2705 4311 }
2706 4312 }
2707 4313 return void 0;
2708 4314 }, [tabMap]);
2709 - const shouldNotifyInitialValueChangeRef = React26.useRef(!hasExplicitDefaultValueProp);
2710 - const initialDefaultValueRef = React26.useRef(defaultValueProp);
2711 - const shouldHonorDisabledDefaultValueRef = React26.useRef(hasExplicitDefaultValueProp);
2712 - const didRegisterTabsRef = React26.useRef(false);
4315 + const shouldNotifyInitialValueChangeRef = React45.useRef(!hasExplicitDefaultValueProp);
4316 + const initialDefaultValueRef = React45.useRef(defaultValueProp);
4317 + const shouldHonorDisabledDefaultValueRef = React45.useRef(hasExplicitDefaultValueProp);
4318 + const didRegisterTabsRef = React45.useRef(false);
2713 4319 useIsoLayoutEffect(() => {
2714 4320 if (isControlled) {
2715 4321 return;
2716 4322 }
@@ -2715,16 +4321,11 @@
2715 4321 return;
2716 4322 }
2717 4323 function commitAutomaticValueChange(fallbackValue, fallbackReason) {
2718 4324 setValue(fallbackValue);
2719 - setActivationDirectionState((prev) => {
2720 - if (prev.previousValue === fallbackValue && prev.tabActivationDirection === "none") {
2721 - return prev;
2722 - }
2723 - return {
2724 - previousValue: fallbackValue,
2725 - tabActivationDirection: "none"
2726 - };
4325 + setActivationDirectionState({
4326 + previousValue: fallbackValue,
4327 + tabActivationDirection: "none"
2727 4328 });
2728 4329 notifyAutomaticValueChange(fallbackValue, fallbackReason);
2729 4330 shouldNotifyInitialValueChangeRef.current = false;
2730 4331 }
@@ -2774,11 +4375,11 @@
2774 4375 ref: forwardedRef,
2775 4376 props: elementProps,
2776 4377 stateAttributesMapping: tabsStateAttributesMapping
2777 4378 });
2778 - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabsRootContext.Provider, {
4379 + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsRootContext.Provider, {
2779 4380 value: tabsContextValue,
2780 - children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CompositeList, {
4381 + children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CompositeList, {
2781 4382 elementsRef: tabPanelRefs,
2782 4383 children: element
2783 4384 })
2784 4385 });
@@ -2783,67 +4384,49 @@
2783 4384 })
2784 4385 });
2785 4386 });
2786 4387 if (true) TabsRoot.displayName = "TabsRoot";
4388 + function findTabElement(tabMap, value) {
4389 + for (const [tabElement, tabMetadata] of tabMap.entries()) {
4390 + if (value === tabMetadata.value) {
4391 + return tabElement;
4392 + }
4393 + }
4394 + return null;
4395 + }
2787 4396 function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
2788 4397 if (oldValue == null || newValue == null) {
2789 4398 return "none";
2790 4399 }
2791 - let oldTab = null;
2792 - let newTab = null;
2793 - for (const [tabElement, tabMetadata] of tabMap.entries()) {
2794 - if (tabMetadata == null) {
2795 - continue;
2796 - }
2797 - const tabValue = tabMetadata.value ?? tabMetadata.index;
2798 - if (oldValue === tabValue) {
2799 - oldTab = tabElement;
2800 - }
2801 - if (newValue === tabValue) {
2802 - newTab = tabElement;
2803 - }
2804 - if (oldTab != null && newTab != null) {
2805 - break;
2806 - }
2807 - }
4400 + const [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"];
4401 + const oldTab = findTabElement(tabMap, oldValue);
4402 + const newTab = findTabElement(tabMap, newValue);
2808 4403 if (oldTab == null || newTab == null) {
2809 4404 if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
2810 - if (orientation === "horizontal") {
2811 - return newValue > oldValue ? "right" : "left";
2812 - }
2813 - return newValue > oldValue ? "down" : "up";
4405 + return newValue > oldValue ? forward : backward;
2814 4406 }
2815 4407 return "none";
2816 4408 }
2817 - const oldRect = oldTab.getBoundingClientRect();
2818 - const newRect = newTab.getBoundingClientRect();
2819 - if (orientation === "horizontal") {
2820 - if (newRect.left < oldRect.left) {
2821 - return "left";
2822 - }
2823 - if (newRect.left > oldRect.left) {
2824 - return "right";
2825 - }
2826 - } else {
2827 - if (newRect.top < oldRect.top) {
2828 - return "up";
2829 - }
2830 - if (newRect.top > oldRect.top) {
2831 - return "down";
2832 - }
4409 + const oldPosition = oldTab.getBoundingClientRect()[positionProp];
4410 + const newPosition = newTab.getBoundingClientRect()[positionProp];
4411 + if (newPosition < oldPosition) {
4412 + return backward;
2833 4413 }
4414 + if (newPosition > oldPosition) {
4415 + return forward;
4416 + }
2834 4417 return "none";
2835 4418 }
2836 4419
2837 4420 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
2838 - var React28 = __toESM(require_react(), 1);
4421 + var React47 = __toESM(require_react(), 1);
2839 4422
2840 4423 // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
2841 - var React27 = __toESM(require_react(), 1);
2842 - var TabsListContext = /* @__PURE__ */ React27.createContext(void 0);
4424 + var React46 = __toESM(require_react(), 1);
4425 + var TabsListContext = /* @__PURE__ */ React46.createContext(void 0);
2843 4426 if (true) TabsListContext.displayName = "TabsListContext";
2844 4427 function useTabsListContext() {
2845 - const context = React27.useContext(TabsListContext);
4428 + const context = React46.useContext(TabsListContext);
2846 4429 if (context === void 0) {
2847 4430 throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
2848 4431 }
2849 4432 return context;
@@ -2849,9 +4432,9 @@
2849 4432 return context;
2850 4433 }
2851 4434
2852 4435 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
2853 - var TabsTab = /* @__PURE__ */ React28.forwardRef(function TabsTab2(componentProps, forwardedRef) {
4436 + var TabsTab = /* @__PURE__ */ React47.forwardRef(function TabsTab2(componentProps, forwardedRef) {
2854 4437 const {
2855 4438 className,
2856 4439 disabled: disabled2 = false,
2857 4440 render,
@@ -2863,21 +4446,23 @@
2863 4446 } = componentProps;
2864 4447 const {
2865 4448 value: activeTabValue,
2866 4449 getTabPanelIdByValue,
4450 + onValueChange,
2867 4451 orientation,
2868 4452 tabActivationDirection
2869 4453 } = useTabsRootContext();
2870 4454 const {
2871 4455 activateOnFocus,
2872 - highlightedTabIndex,
2873 - onTabActivation,
2874 4456 registerTabResizeObserverElement,
2875 - setHighlightedTabIndex,
2876 4457 tabsListElement
2877 4458 } = useTabsListContext();
4459 + const {
4460 + highlightedIndex,
4461 + onHighlightedIndexChange
4462 + } = useCompositeRootContext();
2878 4463 const id = useBaseUiId(idProp);
2879 - const tabMetadata = React28.useMemo(() => ({
4464 + const tabMetadata = React47.useMemo(() => ({
2880 4465 disabled: disabled2,
2881 4466 id,
2882 4467 value
2883 4468 }), [disabled2, id, value]);
@@ -2883,9 +4468,9 @@
2883 4468 }), [disabled2, id, value]);
2884 4469 const {
2885 4470 compositeProps,
2886 4471 compositeRef,
2887 - index
4472 + index: index2
2888 4473 // hook is used instead of the CompositeItem component
2889 4474 // because the index is needed for Tab internals
2890 4475 } = useCompositeItem({
2891 4476 metadata: tabMetadata
@@ -2890,23 +4475,20 @@
2890 4475 } = useCompositeItem({
2891 4476 metadata: tabMetadata
2892 4477 });
2893 4478 const active = value === activeTabValue;
2894 - const isNavigatingRef = React28.useRef(false);
2895 - const tabElementRef = React28.useRef(null);
4479 + const isNavigatingRef = React47.useRef(false);
4480 + const unobserveTabElementRef = React47.useRef(null);
4481 + const observeTabElement = useStableCallback((element2) => {
4482 + unobserveTabElementRef.current?.();
4483 + unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null;
4484 + });
2896 4485 useIsoLayoutEffect(() => {
2897 - const tabElement = tabElementRef.current;
2898 - if (!tabElement) {
2899 - return void 0;
2900 - }
2901 - return registerTabResizeObserverElement(tabElement);
2902 - }, [registerTabResizeObserverElement]);
2903 - useIsoLayoutEffect(() => {
2904 4486 if (isNavigatingRef.current) {
2905 4487 isNavigatingRef.current = false;
2906 4488 return;
2907 4489 }
2908 - if (!(active && index > -1 && highlightedTabIndex !== index)) {
4490 + if (!(active && index2 > -1 && highlightedIndex !== index2)) {
2909 4491 return;
2910 4492 }
2911 4493 const listElement = tabsListElement;
2912 4494 if (listElement != null) {
@@ -2915,11 +4497,11 @@
2915 4497 return;
2916 4498 }
2917 4499 }
2918 4500 if (!disabled2) {
2919 - setHighlightedTabIndex(index);
4501 + onHighlightedIndexChange(index2);
2920 4502 }
2921 - }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled2, tabsListElement]);
4503 + }, [active, index2, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]);
2922 4504 const {
2923 4505 getButtonProps,
2924 4506 buttonRef
2925 4507 } = useButton({
@@ -2927,33 +4509,28 @@
2927 4509 native: nativeButton,
2928 4510 focusableWhenDisabled: true
2929 4511 });
2930 4512 const tabPanelId = getTabPanelIdByValue(value);
2931 - const isPressingRef = React28.useRef(false);
2932 - const isMainButtonRef = React28.useRef(false);
4513 + const isPressingRef = React47.useRef(false);
4514 + const isMainButtonRef = React47.useRef(false);
4515 + function activate(event) {
4516 + onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
4517 + activationDirection: "none"
4518 + }));
4519 + }
2933 4520 function onClick(event) {
2934 4521 if (active || disabled2) {
2935 4522 return;
2936 4523 }
2937 - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
2938 - activationDirection: "none"
2939 - }));
4524 + activate(event);
2940 4525 }
2941 4526 function onFocus(event) {
2942 - if (active) {
4527 + if (active || disabled2) {
2943 4528 return;
2944 4529 }
2945 - if (index > -1 && !disabled2) {
2946 - setHighlightedTabIndex(index);
2947 - }
2948 - if (disabled2) {
2949 - return;
2950 - }
2951 4530 if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
2952 - isPressingRef.current && isMainButtonRef.current)) {
2953 - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
2954 - activationDirection: "none"
2955 - }));
4531 + isMainButtonRef.current)) {
4532 + activate(event);
2956 4533 }
2957 4534 }
2958 4535 function onPointerDown(event) {
2959 4536 if (active || disabled2) {
@@ -2959,19 +4536,18 @@
2959 4536 if (active || disabled2) {
2960 4537 return;
2961 4538 }
2962 4539 isPressingRef.current = true;
2963 - function handlePointerUp() {
4540 + isMainButtonRef.current = event.button === 0;
4541 + const doc = ownerDocument(event.currentTarget);
4542 + function handlePointerEnd() {
2964 4543 isPressingRef.current = false;
2965 4544 isMainButtonRef.current = false;
4545 + doc.removeEventListener("pointerup", handlePointerEnd);
4546 + doc.removeEventListener("pointercancel", handlePointerEnd);
2966 4547 }
2967 - if (!event.button || event.button === 0) {
2968 - isMainButtonRef.current = true;
2969 - const doc = ownerDocument(event.currentTarget);
2970 - doc.addEventListener("pointerup", handlePointerUp, {
2971 - once: true
2972 - });
2973 - }
4548 + doc.addEventListener("pointerup", handlePointerEnd);
4549 + doc.addEventListener("pointercancel", handlePointerEnd);
2974 4550 }
2975 4551 const state = {
2976 4552 disabled: disabled2,
2977 4553 active,
@@ -2979,9 +4555,9 @@
2979 4555 tabActivationDirection
2980 4556 };
2981 4557 const element = useRenderElement("button", componentProps, {
2982 4558 state,
2983 - ref: [forwardedRef, buttonRef, compositeRef, tabElementRef],
4559 + ref: [forwardedRef, buttonRef, compositeRef, observeTabElement],
2984 4560 props: [compositeProps, {
2985 4561 role: "tab",
2986 4562 "aria-controls": tabPanelId,
2987 4563 "aria-selected": active,
@@ -3000,32 +4576,28 @@
3000 4576 });
3001 4577 if (true) TabsTab.displayName = "TabsTab";
3002 4578
3003 4579 // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
3004 - var React29 = __toESM(require_react(), 1);
4580 + var React48 = __toESM(require_react(), 1);
3005 4581
3006 - // node_modules/@base-ui/react/tabs/indicator/prehydrationScript.min.mjs
3007 - var script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';
3008 -
3009 4582 // node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
3010 - var TabsIndicatorCssVars = /* @__PURE__ */ (function(TabsIndicatorCssVars2) {
3011 - TabsIndicatorCssVars2["activeTabLeft"] = "--active-tab-left";
3012 - TabsIndicatorCssVars2["activeTabRight"] = "--active-tab-right";
3013 - TabsIndicatorCssVars2["activeTabTop"] = "--active-tab-top";
3014 - TabsIndicatorCssVars2["activeTabBottom"] = "--active-tab-bottom";
3015 - TabsIndicatorCssVars2["activeTabWidth"] = "--active-tab-width";
3016 - TabsIndicatorCssVars2["activeTabHeight"] = "--active-tab-height";
3017 - return TabsIndicatorCssVars2;
3018 - })({});
4583 + var activeTabLeft = "--active-tab-left";
4584 + var activeTabRight = "--active-tab-right";
4585 + var activeTabTop = "--active-tab-top";
4586 + var activeTabBottom = "--active-tab-bottom";
4587 + var activeTabWidth = "--active-tab-width";
4588 + var activeTabHeight = "--active-tab-height";
3019 4589
3020 4590 // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
3021 - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
3022 - var stateAttributesMapping = {
4591 + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4592 + var _PrehydrationScript;
4593 + var stateAttributesMapping2 = {
3023 4594 ...tabsStateAttributesMapping,
3024 4595 activeTabPosition: () => null,
3025 4596 activeTabSize: () => null
3026 4597 };
3027 - var TabsIndicator = /* @__PURE__ */ React29.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
4598 + var MAX_LAYOUT_ROUNDING_ERROR = 2;
4599 + var TabsIndicator = /* @__PURE__ */ React48.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
3028 4600 const {
3029 4601 className,
3030 4602 render,
3031 4603 renderBeforeHydration = false,
@@ -3032,11 +4604,8 @@
3032 4604 style: styleProp,
3033 4605 ...elementProps
3034 4606 } = componentProps;
3035 4607 const {
3036 - nonce
3037 - } = useCSPContext();
3038 - const {
3039 4608 getTabElementBySelectedValue,
3040 4609 orientation,
3041 4610 tabActivationDirection,
3042 4611 value
@@ -3044,11 +4613,10 @@
3044 4613 const {
3045 4614 tabsListElement,
3046 4615 registerIndicatorUpdateListener
3047 4616 } = useTabsListContext();
3048 - const isHydrating = useIsHydrating();
3049 4617 const rerender = useForcedRerendering();
3050 - React29.useEffect(() => {
4618 + React48.useEffect(() => {
3051 4619 return registerIndicatorUpdateListener(rerender);
3052 4620 }, [registerIndicatorUpdateListener, rerender]);
3053 4621 let left = 0;
3054 4622 let right = 0;
@@ -3072,17 +4640,17 @@
3072 4640 const tabRect = activeTab.getBoundingClientRect();
3073 4641 const tabsListRect = tabsListElement.getBoundingClientRect();
3074 4642 const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
3075 4643 const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
3076 - const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON;
3077 - if (hasNonZeroScale) {
3078 - const tabLeftDelta = tabRect.left - tabsListRect.left;
3079 - const tabTopDelta = tabRect.top - tabsListRect.top;
3080 - left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
3081 - top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
3082 - } else {
3083 - left = activeTab.offsetLeft;
3084 - top = activeTab.offsetTop;
4644 + const layoutOffset = getLayoutOffset(activeTab, tabsListElement);
4645 + left = layoutOffset.left;
4646 + top = layoutOffset.top;
4647 + const rectLeft = (tabRect.left - tabsListRect.left) / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
4648 + const rectTop = (tabRect.top - tabsListRect.top) / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
4649 + const tabTranslation = getActiveTabTranslation(activeTab);
4650 + if (Math.abs(rectLeft - tabTranslation.x - left) <= MAX_LAYOUT_ROUNDING_ERROR && Math.abs(rectTop - tabTranslation.y - top) <= MAX_LAYOUT_ROUNDING_ERROR) {
4651 + left = rectLeft;
4652 + top = rectTop;
3085 4653 }
3086 4654 width = computedWidth;
3087 4655 height = computedHeight;
3088 4656 right = tabsListElement.scrollWidth - left - width;
@@ -3099,14 +4667,14 @@
3099 4667 width,
3100 4668 height
3101 4669 } : null;
3102 4670 const style = isTabSelected ? {
3103 - [TabsIndicatorCssVars.activeTabLeft]: `${left}px`,
3104 - [TabsIndicatorCssVars.activeTabRight]: `${right}px`,
3105 - [TabsIndicatorCssVars.activeTabTop]: `${top}px`,
3106 - [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`,
3107 - [TabsIndicatorCssVars.activeTabWidth]: `${width}px`,
3108 - [TabsIndicatorCssVars.activeTabHeight]: `${height}px`
4671 + [activeTabLeft]: `${left}px`,
4672 + [activeTabRight]: `${right}px`,
4673 + [activeTabTop]: `${top}px`,
4674 + [activeTabBottom]: `${bottom}px`,
4675 + [activeTabWidth]: `${width}px`,
4676 + [activeTabHeight]: `${height}px`
3109 4677 } : void 0;
3110 4678 const displayIndicator = isTabSelected && width > 0 && height > 0;
3111 4679 const state = {
3112 4680 orientation,
@@ -3124,45 +4692,101 @@
3124 4692 // do not display the indicator before the layout is settled
3125 4693 }, elementProps, {
3126 4694 suppressHydrationWarning: true
3127 4695 }],
3128 - stateAttributesMapping
4696 + stateAttributesMapping: stateAttributesMapping2
3129 4697 });
3130 4698 if (value == null) {
3131 4699 return null;
3132 4700 }
3133 - return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(React29.Fragment, {
3134 - children: [element, isHydrating && renderBeforeHydration && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("script", {
3135 - nonce,
3136 - dangerouslySetInnerHTML: {
3137 - __html: script
3138 - },
3139 - suppressHydrationWarning: true
3140 - })]
4701 + return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React48.Fragment, {
4702 + children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrehydrationScript, {
4703 + script
4704 + })))]
3141 4705 });
3142 4706 });
3143 4707 if (true) TabsIndicator.displayName = "TabsIndicator";
4708 + function getLayoutOffset(element, ancestor) {
4709 + const elementOffset = getCumulativeOffset(element);
4710 + const ancestorOffset = getCumulativeOffset(ancestor);
4711 + let left = elementOffset.left - ancestorOffset.left - ancestor.clientLeft;
4712 + let top = elementOffset.top - ancestorOffset.top - ancestor.clientTop;
4713 + let node = getParentNode(element);
4714 + while (isHTMLElement(node) && node !== ancestor && !isLastTraversableNode(node)) {
4715 + left -= node.scrollLeft;
4716 + top -= node.scrollTop;
4717 + node = getParentNode(node);
4718 + }
4719 + return {
4720 + left,
4721 + top
4722 + };
4723 + }
4724 + function getCumulativeOffset(element) {
4725 + let left = 0;
4726 + let top = 0;
4727 + let currentElement = element;
4728 + while (currentElement != null) {
4729 + left += currentElement.offsetLeft;
4730 + top += currentElement.offsetTop;
4731 + const offsetParent = currentElement.offsetParent;
4732 + if (offsetParent != null) {
4733 + left += offsetParent.clientLeft;
4734 + top += offsetParent.clientTop;
4735 + }
4736 + currentElement = offsetParent;
4737 + }
4738 + return {
4739 + left,
4740 + top
4741 + };
4742 + }
4743 + function getActiveTabTranslation(element) {
4744 + const computedStyle = getWindow(element).getComputedStyle(element);
4745 + const {
4746 + x,
4747 + y
4748 + } = getElementTransform(element, computedStyle);
4749 + let translateX = x;
4750 + let translateY = y;
4751 + const {
4752 + translate
4753 + } = computedStyle;
4754 + if (translate && translate !== "none") {
4755 + const parts = translate.split(" ");
4756 + translateX += resolveTranslateLength(parts[0], element.offsetWidth);
4757 + translateY += resolveTranslateLength(parts[1], element.offsetHeight);
4758 + }
4759 + return {
4760 + x: translateX,
4761 + y: translateY
4762 + };
4763 + }
4764 + function resolveTranslateLength(value, referenceSize) {
4765 + if (!value) {
4766 + return 0;
4767 + }
4768 + const numeric = parseFloat(value);
4769 + if (!Number.isFinite(numeric)) {
4770 + return 0;
4771 + }
4772 + return value.endsWith("%") ? numeric / 100 * referenceSize : numeric;
4773 + }
3144 4774
3145 4775 // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
3146 - var React30 = __toESM(require_react(), 1);
4776 + var React49 = __toESM(require_react(), 1);
3147 4777
3148 4778 // node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
3149 - var TabsPanelDataAttributes = (function(TabsPanelDataAttributes2) {
3150 - TabsPanelDataAttributes2["index"] = "data-index";
3151 - TabsPanelDataAttributes2["activationDirection"] = "data-activation-direction";
3152 - TabsPanelDataAttributes2["orientation"] = "data-orientation";
3153 - TabsPanelDataAttributes2["hidden"] = "data-hidden";
3154 - TabsPanelDataAttributes2[TabsPanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
3155 - TabsPanelDataAttributes2[TabsPanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
3156 - return TabsPanelDataAttributes2;
3157 - })({});
4779 + var index = "data-index";
4780 + var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle;
4781 + var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle;
3158 4782
3159 4783 // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
3160 - var stateAttributesMapping2 = {
4784 + var stateAttributesMapping3 = {
3161 4785 ...tabsStateAttributesMapping,
3162 4786 ...transitionStatusMapping
3163 4787 };
3164 - var TabsPanel = /* @__PURE__ */ React30.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
4788 + var TabsPanel = /* @__PURE__ */ React49.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
3165 4789 const {
3166 4790 className,
3167 4791 value,
3168 4792 render,
@@ -3174,22 +4798,15 @@
3174 4798 value: selectedValue,
3175 4799 getTabIdByPanelValue,
3176 4800 orientation,
3177 4801 tabActivationDirection,
3178 - registerMountedTabPanel,
3179 - unregisterMountedTabPanel
4802 + registerMountedTabPanel
3180 4803 } = useTabsRootContext();
3181 4804 const id = useBaseUiId();
3182 - const metadata = React30.useMemo(() => ({
3183 - id,
3184 - value
3185 - }), [id, value]);
3186 4805 const {
3187 4806 ref: listItemRef,
3188 - index
3189 - } = useCompositeListItem({
3190 - metadata
3191 - });
4807 + index: index2
4808 + } = useCompositeListItem();
3192 4809 const open = value === selectedValue;
3193 4810 const {
3194 4811 mounted,
3195 4812 transitionStatus,
@@ -3202,9 +4819,9 @@
3202 4819 orientation,
3203 4820 tabActivationDirection,
3204 4821 transitionStatus
3205 4822 };
3206 - const panelRef = React30.useRef(null);
4823 + const panelRef = React49.useRef(null);
3207 4824 const element = useRenderElement("div", componentProps, {
3208 4825 state,
3209 4826 ref: [forwardedRef, listItemRef, panelRef],
3210 4827 props: [{
@@ -3213,11 +4830,12 @@
3213 4830 id,
3214 4831 role: "tabpanel",
3215 4832 tabIndex: open ? 0 : -1,
3216 4833 inert: inertValue(!open),
3217 - [TabsPanelDataAttributes.index]: index
4834 + // Computed key: a plain literal key fails the DOM-props excess property check.
4835 + [index]: index2
3218 4836 }, elementProps],
3219 - stateAttributesMapping: stateAttributesMapping2
4837 + stateAttributesMapping: stateAttributesMapping3
3220 4838 });
3221 4839 useOpenChangeComplete({
3222 4840 open,
3223 4841 ref: panelRef,
@@ -3227,19 +4845,13 @@
3227 4845 }
3228 4846 }
3229 4847 });
3230 4848 useIsoLayoutEffect(() => {
3231 - if (hidden && !keepMounted) {
4849 + if (id == null || hidden && !keepMounted) {
3232 4850 return void 0;
3233 4851 }
3234 - if (id == null) {
3235 - return void 0;
3236 - }
3237 - registerMountedTabPanel(value, id);
3238 - return () => {
3239 - unregisterMountedTabPanel(value, id);
3240 - };
3241 - }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]);
4852 + return registerMountedTabPanel(value, id);
4853 + }, [hidden, keepMounted, value, id, registerMountedTabPanel]);
3242 4854 const shouldRender = keepMounted || mounted;
3243 4855 if (!shouldRender) {
3244 4856 return null;
3245 4857 }
@@ -3247,11 +4859,11 @@
3247 4859 });
3248 4860 if (true) TabsPanel.displayName = "TabsPanel";
3249 4861
3250 4862 // node_modules/@base-ui/react/tabs/list/TabsList.mjs
3251 - var React31 = __toESM(require_react(), 1);
3252 - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
3253 - var TabsList = /* @__PURE__ */ React31.forwardRef(function TabsList2(componentProps, forwardedRef) {
4863 + var React50 = __toESM(require_react(), 1);
4864 + var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
4865 + var TabsList = /* @__PURE__ */ React50.forwardRef(function TabsList2(componentProps, forwardedRef) {
3254 4866 const {
3255 4867 activateOnFocus = false,
3256 4868 className,
3257 4869 loopFocus = true,
@@ -3259,19 +4871,17 @@
3259 4871 style,
3260 4872 ...elementProps
3261 4873 } = componentProps;
3262 4874 const {
3263 - onValueChange,
3264 4875 orientation,
3265 - value,
3266 4876 setTabMap,
3267 4877 tabActivationDirection
3268 4878 } = useTabsRootContext();
3269 - const [highlightedTabIndex, setHighlightedTabIndex] = React31.useState(0);
3270 - const [tabsListElement, setTabsListElement] = React31.useState(null);
3271 - const indicatorUpdateListenersRef = React31.useRef(/* @__PURE__ */ new Set());
3272 - const tabResizeObserverElementsRef = React31.useRef(/* @__PURE__ */ new Set());
3273 - const resizeObserverRef = React31.useRef(null);
4879 + const [highlightedTabIndex, setHighlightedTabIndex] = React50.useState(0);
4880 + const [tabsListElement, setTabsListElement] = React50.useState(null);
4881 + const indicatorUpdateListenersRef = React50.useRef(/* @__PURE__ */ new Set());
4882 + const tabResizeObserverElementsRef = React50.useRef(/* @__PURE__ */ new Set());
4883 + const resizeObserverRef = React50.useRef(null);
3274 4884 useIsoLayoutEffect(() => {
3275 4885 if (typeof ResizeObserver === "undefined") {
3276 4886 return void 0;
3277 4887 }
@@ -3305,13 +4915,8 @@
3305 4915 tabResizeObserverElementsRef.current.delete(element);
3306 4916 resizeObserverRef.current?.unobserve(element);
3307 4917 };
3308 4918 });
3309 - const onTabActivation = useStableCallback((newValue, eventDetails) => {
3310 - if (newValue !== value) {
3311 - onValueChange(newValue, eventDetails);
3312 - }
3313 - });
3314 4919 const state = {
3315 4920 orientation,
3316 4921 tabActivationDirection
3317 4922 };
@@ -3318,20 +4923,17 @@
3318 4923 const defaultProps = {
3319 4924 "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
3320 4925 role: "tablist"
3321 4926 };
3322 - const tabsListContextValue = React31.useMemo(() => ({
4927 + const tabsListContextValue = React50.useMemo(() => ({
3323 4928 activateOnFocus,
3324 - highlightedTabIndex,
3325 4929 registerIndicatorUpdateListener,
3326 4930 registerTabResizeObserverElement,
3327 - onTabActivation,
3328 - setHighlightedTabIndex,
3329 4931 tabsListElement
3330 - }), [activateOnFocus, highlightedTabIndex, registerIndicatorUpdateListener, registerTabResizeObserverElement, onTabActivation, setHighlightedTabIndex, tabsListElement]);
3331 - return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TabsListContext.Provider, {
4932 + }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]);
4933 + return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsListContext.Provider, {
3332 4934 value: tabsListContextValue,
3333 - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CompositeRoot, {
4935 + children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CompositeRoot, {
3334 4936 render,
3335 4937 className,
3336 4938 style,
3337 4939 state,
@@ -3354,27 +4956,19 @@
3354 4956 function useRender(params) {
3355 4957 return useRenderElement(params.defaultTagName ?? "div", params, params);
3356 4958 }
3357 4959
3358 - // packages/ui/build-module/icon/icon.mjs
4960 + // packages/ui/build-module/utils/direction-provider.mjs
4961 + var import_i18n3 = __toESM(require_i18n(), 1);
4962 + var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
4963 + function DirectionProvider3({ children }) {
4964 + return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children });
4965 + }
4966 +
4967 + // packages/ui/build-module/link/link.mjs
3359 4968 var import_element2 = __toESM(require_element(), 1);
3360 - var import_primitives16 = __toESM(require_primitives(), 1);
3361 - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3362 - var Icon = (0, import_element2.forwardRef)(function Icon2({ icon, size = 24, ...restProps }, ref) {
3363 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3364 - import_primitives16.SVG,
3365 - {
3366 - ref,
3367 - ...icon.props,
3368 - ...restProps,
3369 - width: size,
3370 - height: size
3371 - }
3372 - );
3373 - });
3374 -
3375 - // packages/ui/build-module/stack/stack.mjs
3376 - var import_element3 = __toESM(require_element(), 1);
4969 + var import_i18n4 = __toESM(require_i18n(), 1);
4970 + var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
3377 4971 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
3378 4972 function getRuntime() {
3379 4973 const globalScope = globalThis;
3380 4974 if (globalScope.__wpStyleRuntime) {
@@ -3454,42 +5048,86 @@
3454 5048 injectStyle(targetDocument, hash, css);
3455 5049 }
3456 5050 }
3457 5051 if (typeof process === "undefined" || true) {
3458 - registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
5052 + registerStyle("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
3459 5053 }
3460 - var style_default = { "stack": "_19ce0419607e1896__stack" };
3461 - var gapTokens = {
3462 - xs: "var(--wpds-dimension-gap-xs, 4px)",
3463 - sm: "var(--wpds-dimension-gap-sm, 8px)",
3464 - md: "var(--wpds-dimension-gap-md, 12px)",
3465 - lg: "var(--wpds-dimension-gap-lg, 16px)",
3466 - xl: "var(--wpds-dimension-gap-xl, 24px)",
3467 - "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
3468 - "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
3469 - };
3470 - var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
3471 - const style = {
3472 - gap: gap && gapTokens[gap],
3473 - alignItems: align,
3474 - justifyContent: justify,
3475 - flexDirection: direction,
3476 - flexWrap: wrap
3477 - };
5054 + var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5055 + if (typeof process === "undefined" || true) {
5056 + registerStyle("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5057 + }
5058 + var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5059 + if (typeof process === "undefined" || true) {
5060 + registerStyle("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
5061 + }
5062 + var style_default = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
5063 + if (typeof process === "undefined" || true) {
5064 + registerStyle("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5065 + }
5066 + 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", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5067 + var Link = (0, import_element2.forwardRef)(function Link2({
5068 + children,
5069 + variant = "default",
5070 + tone = "brand",
5071 + openInNewTab = false,
5072 + target,
5073 + render,
5074 + className,
5075 + ...props
5076 + }, ref) {
5077 + const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
3478 5078 const element = useRender({
3479 5079 render,
5080 + defaultTagName: "a",
3480 5081 ref,
3481 - props: mergeProps(props, { style, className: style_default.stack })
5082 + props: mergeProps(props, {
5083 + className: clsx_default(
5084 + global_css_defense_default.a,
5085 + resets_default["box-sizing"],
5086 + focus_module_default["outset-ring--focus-except-active"],
5087 + variant !== "unstyled" && style_default.link,
5088 + variant !== "unstyled" && style_default[`is-${tone}`],
5089 + variant === "unstyled" && style_default["is-unstyled"],
5090 + className
5091 + ),
5092 + target: target ?? (openInNewTab ? "_blank" : void 0),
5093 + children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
5094 + children,
5095 + shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5096 + "span",
5097 + {
5098 + className: style_default["link-icon"],
5099 + role: "img",
5100 + "aria-label": (
5101 + /* translators: accessibility text appended to link text */
5102 + (0, import_i18n4.__)("(opens in a new tab)")
5103 + )
5104 + }
5105 + )
5106 + ] })
5107 + })
3482 5108 });
3483 5109 return element;
3484 5110 });
3485 5111
3486 - // packages/ui/build-module/utils/direction-provider.mjs
3487 - var import_i18n3 = __toESM(require_i18n(), 1);
3488 - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
3489 - function DirectionProvider3({ children }) {
3490 - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children });
3491 - }
5112 + // packages/ui/build-module/icon/icon.mjs
5113 + var import_element3 = __toESM(require_element(), 1);
5114 + var import_primitives18 = __toESM(require_primitives(), 1);
5115 + var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
5116 + var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, style, ...restProps }, ref) {
5117 + const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0;
5118 + return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5119 + import_primitives18.SVG,
5120 + {
5121 + ref,
5122 + ...icon.props,
5123 + ...restProps,
5124 + ...mergedStyle ? { style: mergedStyle } : {},
5125 + width: size,
5126 + height: size
5127 + }
5128 + );
5129 + });
3492 5130
3493 5131 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
3494 5132 var import_element4 = __toESM(require_element(), 1);
3495 5133 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
@@ -3572,9 +5210,9 @@
3572 5210 injectStyle2(targetDocument, hash, css);
3573 5211 }
3574 5212 }
3575 5213 if (typeof process === "undefined" || true) {
3576 - registerStyle2("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");
5214 + registerStyle2("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");
3577 5215 }
3578 5216 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
3579 5217 var VisuallyHidden = (0, import_element4.forwardRef)(
3580 5218 function VisuallyHidden2({ render, ...restProps }, ref) {
@@ -3593,16 +5231,127 @@
3593 5231 return element;
3594 5232 }
3595 5233 );
3596 5234
5235 + // packages/ui/build-module/stack/stack.mjs
5236 + var import_element5 = __toESM(require_element(), 1);
5237 + var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
5238 + function getRuntime3() {
5239 + const globalScope = globalThis;
5240 + if (globalScope.__wpStyleRuntime) {
5241 + return globalScope.__wpStyleRuntime;
5242 + }
5243 + globalScope.__wpStyleRuntime = {
5244 + documents: /* @__PURE__ */ new Map(),
5245 + styles: /* @__PURE__ */ new Map(),
5246 + injectedStyles: /* @__PURE__ */ new WeakMap()
5247 + };
5248 + if (typeof document !== "undefined") {
5249 + registerDocument3(document);
5250 + }
5251 + return globalScope.__wpStyleRuntime;
5252 + }
5253 + function documentContainsStyleHash3(targetDocument, hash) {
5254 + if (!targetDocument.head) {
5255 + return false;
5256 + }
5257 + for (const style of targetDocument.head.querySelectorAll(
5258 + `style[${STYLE_HASH_ATTRIBUTE3}]`
5259 + )) {
5260 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
5261 + return true;
5262 + }
5263 + }
5264 + return false;
5265 + }
5266 + function injectStyle3(targetDocument, hash, css) {
5267 + if (!targetDocument.head) {
5268 + return;
5269 + }
5270 + const runtime = getRuntime3();
5271 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5272 + if (!injectedStyles) {
5273 + injectedStyles = /* @__PURE__ */ new Set();
5274 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5275 + }
5276 + if (injectedStyles.has(hash)) {
5277 + return;
5278 + }
5279 + if (documentContainsStyleHash3(targetDocument, hash)) {
5280 + injectedStyles.add(hash);
5281 + return;
5282 + }
5283 + const style = targetDocument.createElement("style");
5284 + style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
5285 + style.appendChild(targetDocument.createTextNode(css));
5286 + targetDocument.head.appendChild(style);
5287 + injectedStyles.add(hash);
5288 + }
5289 + function registerDocument3(targetDocument) {
5290 + const runtime = getRuntime3();
5291 + runtime.documents.set(
5292 + targetDocument,
5293 + (runtime.documents.get(targetDocument) ?? 0) + 1
5294 + );
5295 + for (const [hash, css] of runtime.styles) {
5296 + injectStyle3(targetDocument, hash, css);
5297 + }
5298 + return () => {
5299 + const count = runtime.documents.get(targetDocument);
5300 + if (count === void 0) {
5301 + return;
5302 + }
5303 + if (count <= 1) {
5304 + runtime.documents.delete(targetDocument);
5305 + return;
5306 + }
5307 + runtime.documents.set(targetDocument, count - 1);
5308 + };
5309 + }
5310 + function registerStyle3(hash, css) {
5311 + const runtime = getRuntime3();
5312 + runtime.styles.set(hash, css);
5313 + for (const targetDocument of runtime.documents.keys()) {
5314 + injectStyle3(targetDocument, hash, css);
5315 + }
5316 + }
5317 + if (typeof process === "undefined" || true) {
5318 + registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
5319 + }
5320 + var style_default3 = { "stack": "_19ce0419607e1896__stack" };
5321 + var gapTokens = {
5322 + xs: "var(--wpds-dimension-gap-xs, 4px)",
5323 + sm: "var(--wpds-dimension-gap-sm, 8px)",
5324 + md: "var(--wpds-dimension-gap-md, 12px)",
5325 + lg: "var(--wpds-dimension-gap-lg, 16px)",
5326 + xl: "var(--wpds-dimension-gap-xl, 24px)",
5327 + "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
5328 + "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
5329 + };
5330 + var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
5331 + const style = {
5332 + gap: gap && gapTokens[gap],
5333 + alignItems: align,
5334 + justifyContent: justify,
5335 + flexDirection: direction,
5336 + flexWrap: wrap
5337 + };
5338 + const element = useRender({
5339 + render,
5340 + ref,
5341 + props: mergeProps(props, { style, className: style_default3.stack })
5342 + });
5343 + return element;
5344 + });
5345 +
3597 5346 // packages/ui/build-module/utils/use-schedule-validation.mjs
3598 - var import_element5 = __toESM(require_element(), 1);
5347 + var import_compose = __toESM(require_compose(), 1);
5348 + var import_element6 = __toESM(require_element(), 1);
3599 5349 function useScheduleValidation(validate) {
3600 - const validateRef = (0, import_element5.useRef)(validate);
3601 - validateRef.current = validate;
3602 - const timerRef = (0, import_element5.useRef)(null);
3603 - const unmountedRef = (0, import_element5.useRef)(false);
3604 - const scheduleValidation = (0, import_element5.useCallback)(() => {
5350 + const validateEvent = (0, import_compose.useEvent)(validate);
5351 + const timerRef = (0, import_element6.useRef)(null);
5352 + const unmountedRef = (0, import_element6.useRef)(false);
5353 + const scheduleValidation = (0, import_element6.useCallback)(() => {
3605 5354 if (unmountedRef.current) {
3606 5355 return;
3607 5356 }
3608 5357 if (timerRef.current) {
@@ -3608,13 +5357,13 @@
3608 5357 if (timerRef.current) {
3609 5358 clearTimeout(timerRef.current);
3610 5359 }
3611 5360 timerRef.current = setTimeout(() => {
3612 - validateRef.current();
5361 + validateEvent();
3613 5362 timerRef.current = null;
3614 5363 }, 0);
3615 - }, []);
3616 - (0, import_element5.useEffect)(() => {
5364 + }, [validateEvent]);
5365 + (0, import_element6.useEffect)(() => {
3617 5366 unmountedRef.current = false;
3618 5367 return () => {
3619 5368 unmountedRef.current = true;
3620 5369 if (timerRef.current) {
@@ -3624,14 +5373,16 @@
3624 5373 }, []);
3625 5374 return scheduleValidation;
3626 5375 }
3627 5376
3628 - // packages/ui/build-module/link/link.mjs
3629 - var import_element6 = __toESM(require_element(), 1);
3630 - var import_i18n4 = __toESM(require_i18n(), 1);
3631 - var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
3632 - var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
3633 - function getRuntime3() {
5377 + // packages/ui/build-module/form/primitives/input/input.mjs
5378 + var import_element9 = __toESM(require_element(), 1);
5379 +
5380 + // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs
5381 + var import_element7 = __toESM(require_element(), 1);
5382 + var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
5383 + var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
5384 + function getRuntime4() {
3634 5385 const globalScope = globalThis;
3635 5386 if (globalScope.__wpStyleRuntime) {
3636 5387 return globalScope.__wpStyleRuntime;
3637 5388 }
@@ -3640,30 +5391,30 @@
3640 5391 styles: /* @__PURE__ */ new Map(),
3641 5392 injectedStyles: /* @__PURE__ */ new WeakMap()
3642 5393 };
3643 5394 if (typeof document !== "undefined") {
3644 - registerDocument3(document);
5395 + registerDocument4(document);
3645 5396 }
3646 5397 return globalScope.__wpStyleRuntime;
3647 5398 }
3648 - function documentContainsStyleHash3(targetDocument, hash) {
5399 + function documentContainsStyleHash4(targetDocument, hash) {
3649 5400 if (!targetDocument.head) {
3650 5401 return false;
3651 5402 }
3652 5403 for (const style of targetDocument.head.querySelectorAll(
3653 - `style[${STYLE_HASH_ATTRIBUTE3}]`
5404 + `style[${STYLE_HASH_ATTRIBUTE4}]`
3654 5405 )) {
3655 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
5406 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
3656 5407 return true;
3657 5408 }
3658 5409 }
3659 5410 return false;
3660 5411 }
3661 - function injectStyle3(targetDocument, hash, css) {
5412 + function injectStyle4(targetDocument, hash, css) {
3662 5413 if (!targetDocument.head) {
3663 5414 return;
3664 5415 }
3665 - const runtime = getRuntime3();
5416 + const runtime = getRuntime4();
3666 5417 let injectedStyles = runtime.injectedStyles.get(targetDocument);
3667 5418 if (!injectedStyles) {
3668 5419 injectedStyles = /* @__PURE__ */ new Set();
3669 5420 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -3670,26 +5421,26 @@
3670 5421 }
3671 5422 if (injectedStyles.has(hash)) {
3672 5423 return;
3673 5424 }
3674 - if (documentContainsStyleHash3(targetDocument, hash)) {
5425 + if (documentContainsStyleHash4(targetDocument, hash)) {
3675 5426 injectedStyles.add(hash);
3676 5427 return;
3677 5428 }
3678 5429 const style = targetDocument.createElement("style");
3679 - style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
5430 + style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
3680 5431 style.appendChild(targetDocument.createTextNode(css));
3681 5432 targetDocument.head.appendChild(style);
3682 5433 injectedStyles.add(hash);
3683 5434 }
3684 - function registerDocument3(targetDocument) {
3685 - const runtime = getRuntime3();
5435 + function registerDocument4(targetDocument) {
5436 + const runtime = getRuntime4();
3686 5437 runtime.documents.set(
3687 5438 targetDocument,
3688 5439 (runtime.documents.get(targetDocument) ?? 0) + 1
3689 5440 );
3690 5441 for (const [hash, css] of runtime.styles) {
3691 - injectStyle3(targetDocument, hash, css);
5442 + injectStyle4(targetDocument, hash, css);
3692 5443 }
3693 5444 return () => {
3694 5445 const count = runtime.documents.get(targetDocument);
3695 5446 if (count === void 0) {
@@ -3701,89 +5452,1456 @@
3701 5452 }
3702 5453 runtime.documents.set(targetDocument, count - 1);
3703 5454 };
3704 5455 }
3705 - function registerStyle3(hash, css) {
3706 - const runtime = getRuntime3();
5456 + function registerStyle4(hash, css) {
5457 + const runtime = getRuntime4();
3707 5458 runtime.styles.set(hash, css);
3708 5459 for (const targetDocument of runtime.documents.keys()) {
3709 - injectStyle3(targetDocument, hash, css);
5460 + injectStyle4(targetDocument, hash, css);
3710 5461 }
3711 5462 }
3712 5463 if (typeof process === "undefined" || true) {
3713 - registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
5464 + registerStyle4("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
3714 5465 }
3715 - var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5466 + var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
3716 5467 if (typeof process === "undefined" || true) {
3717 - registerStyle3("2ffedd8246", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._64de9947bf305b7a__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--focus-color:var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color);outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--focus-color:var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color);outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5468 + registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
3718 5469 }
3719 - var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-within-visible": "_64de9947bf305b7a__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5470 + var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
3720 5471 if (typeof process === "undefined" || true) {
3721 - registerStyle3("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
5472 + registerStyle4("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
3722 5473 }
3723 - var style_default3 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
5474 + var style_default4 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5475 + var InputLayout = (0, import_element7.forwardRef)(
5476 + function InputLayout2({
5477 + className,
5478 + children,
5479 + visuallyDisabled,
5480 + size = "default",
5481 + isBorderless,
5482 + prefix,
5483 + suffix,
5484 + ...restProps
5485 + }, ref) {
5486 + return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5487 + "div",
5488 + {
5489 + ref,
5490 + className: clsx_default(
5491 + global_css_defense_default2.div,
5492 + resets_default2["box-sizing"],
5493 + style_default4["input-layout"],
5494 + style_default4[`is-size-${size}`],
5495 + visuallyDisabled && style_default4["is-disabled"],
5496 + isBorderless && style_default4["is-borderless"],
5497 + className
5498 + ),
5499 + ...restProps,
5500 + children: [
5501 + import_element7.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5502 + "div",
5503 + {
5504 + className: style_default4["slot-wrapper"],
5505 + "data-slot-type": "prefix",
5506 + children: prefix
5507 + }
5508 + ),
5509 + children,
5510 + import_element7.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5511 + "div",
5512 + {
5513 + className: style_default4["slot-wrapper"],
5514 + "data-slot-type": "suffix",
5515 + children: suffix
5516 + }
5517 + )
5518 + ]
5519 + }
5520 + );
5521 + }
5522 + );
5523 +
5524 + // packages/ui/build-module/form/primitives/input-layout/slot.mjs
5525 + var import_element8 = __toESM(require_element(), 1);
5526 + var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
5527 + var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
5528 + function getRuntime5() {
5529 + const globalScope = globalThis;
5530 + if (globalScope.__wpStyleRuntime) {
5531 + return globalScope.__wpStyleRuntime;
5532 + }
5533 + globalScope.__wpStyleRuntime = {
5534 + documents: /* @__PURE__ */ new Map(),
5535 + styles: /* @__PURE__ */ new Map(),
5536 + injectedStyles: /* @__PURE__ */ new WeakMap()
5537 + };
5538 + if (typeof document !== "undefined") {
5539 + registerDocument5(document);
5540 + }
5541 + return globalScope.__wpStyleRuntime;
5542 + }
5543 + function documentContainsStyleHash5(targetDocument, hash) {
5544 + if (!targetDocument.head) {
5545 + return false;
5546 + }
5547 + for (const style of targetDocument.head.querySelectorAll(
5548 + `style[${STYLE_HASH_ATTRIBUTE5}]`
5549 + )) {
5550 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
5551 + return true;
5552 + }
5553 + }
5554 + return false;
5555 + }
5556 + function injectStyle5(targetDocument, hash, css) {
5557 + if (!targetDocument.head) {
5558 + return;
5559 + }
5560 + const runtime = getRuntime5();
5561 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5562 + if (!injectedStyles) {
5563 + injectedStyles = /* @__PURE__ */ new Set();
5564 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5565 + }
5566 + if (injectedStyles.has(hash)) {
5567 + return;
5568 + }
5569 + if (documentContainsStyleHash5(targetDocument, hash)) {
5570 + injectedStyles.add(hash);
5571 + return;
5572 + }
5573 + const style = targetDocument.createElement("style");
5574 + style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
5575 + style.appendChild(targetDocument.createTextNode(css));
5576 + targetDocument.head.appendChild(style);
5577 + injectedStyles.add(hash);
5578 + }
5579 + function registerDocument5(targetDocument) {
5580 + const runtime = getRuntime5();
5581 + runtime.documents.set(
5582 + targetDocument,
5583 + (runtime.documents.get(targetDocument) ?? 0) + 1
5584 + );
5585 + for (const [hash, css] of runtime.styles) {
5586 + injectStyle5(targetDocument, hash, css);
5587 + }
5588 + return () => {
5589 + const count = runtime.documents.get(targetDocument);
5590 + if (count === void 0) {
5591 + return;
5592 + }
5593 + if (count <= 1) {
5594 + runtime.documents.delete(targetDocument);
5595 + return;
5596 + }
5597 + runtime.documents.set(targetDocument, count - 1);
5598 + };
5599 + }
5600 + function registerStyle5(hash, css) {
5601 + const runtime = getRuntime5();
5602 + runtime.styles.set(hash, css);
5603 + for (const targetDocument of runtime.documents.keys()) {
5604 + injectStyle5(targetDocument, hash, css);
5605 + }
5606 + }
3724 5607 if (typeof process === "undefined" || true) {
3725 - registerStyle3("af6d9984a6", "._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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}");
5608 + registerStyle5("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
3726 5609 }
3727 - 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" };
3728 - var Link = (0, import_element6.forwardRef)(function Link2({
3729 - children,
3730 - variant = "default",
3731 - tone = "brand",
3732 - openInNewTab = false,
3733 - render,
3734 - className,
3735 - ...props
3736 - }, ref) {
3737 - const element = useRender({
3738 - render,
3739 - defaultTagName: "a",
3740 - ref,
3741 - props: mergeProps(props, {
5610 + var style_default5 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5611 + var InputLayoutSlot = (0, import_element8.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) {
5612 + return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5613 + "div",
5614 + {
5615 + ref,
3742 5616 className: clsx_default(
3743 - global_css_defense_default.a,
3744 - resets_default["box-sizing"],
3745 - focus_module_default["outset-ring--focus-except-active"],
3746 - variant !== "unstyled" && style_default3.link,
3747 - variant !== "unstyled" && style_default3[`is-${tone}`],
3748 - variant === "unstyled" && style_default3["is-unstyled"],
5617 + style_default5["input-layout-slot"],
5618 + style_default5[`is-padding-${padding}`],
3749 5619 className
3750 5620 ),
3751 - target: openInNewTab ? "_blank" : void 0,
3752 - children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
3753 - children,
3754 - openInNewTab && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3755 - "span",
5621 + ...restProps
5622 + }
5623 + );
5624 + });
5625 + InputLayoutSlot.displayName = "InputLayout.Slot";
5626 +
5627 + // packages/ui/build-module/form/primitives/input-layout/index.mjs
5628 + var InputLayout3 = Object.assign(InputLayout, {
5629 + Slot: InputLayoutSlot
5630 + });
5631 +
5632 + // packages/ui/build-module/form/primitives/input/input.mjs
5633 + var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
5634 + var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
5635 + function getRuntime6() {
5636 + const globalScope = globalThis;
5637 + if (globalScope.__wpStyleRuntime) {
5638 + return globalScope.__wpStyleRuntime;
5639 + }
5640 + globalScope.__wpStyleRuntime = {
5641 + documents: /* @__PURE__ */ new Map(),
5642 + styles: /* @__PURE__ */ new Map(),
5643 + injectedStyles: /* @__PURE__ */ new WeakMap()
5644 + };
5645 + if (typeof document !== "undefined") {
5646 + registerDocument6(document);
5647 + }
5648 + return globalScope.__wpStyleRuntime;
5649 + }
5650 + function documentContainsStyleHash6(targetDocument, hash) {
5651 + if (!targetDocument.head) {
5652 + return false;
5653 + }
5654 + for (const style of targetDocument.head.querySelectorAll(
5655 + `style[${STYLE_HASH_ATTRIBUTE6}]`
5656 + )) {
5657 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
5658 + return true;
5659 + }
5660 + }
5661 + return false;
5662 + }
5663 + function injectStyle6(targetDocument, hash, css) {
5664 + if (!targetDocument.head) {
5665 + return;
5666 + }
5667 + const runtime = getRuntime6();
5668 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5669 + if (!injectedStyles) {
5670 + injectedStyles = /* @__PURE__ */ new Set();
5671 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5672 + }
5673 + if (injectedStyles.has(hash)) {
5674 + return;
5675 + }
5676 + if (documentContainsStyleHash6(targetDocument, hash)) {
5677 + injectedStyles.add(hash);
5678 + return;
5679 + }
5680 + const style = targetDocument.createElement("style");
5681 + style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
5682 + style.appendChild(targetDocument.createTextNode(css));
5683 + targetDocument.head.appendChild(style);
5684 + injectedStyles.add(hash);
5685 + }
5686 + function registerDocument6(targetDocument) {
5687 + const runtime = getRuntime6();
5688 + runtime.documents.set(
5689 + targetDocument,
5690 + (runtime.documents.get(targetDocument) ?? 0) + 1
5691 + );
5692 + for (const [hash, css] of runtime.styles) {
5693 + injectStyle6(targetDocument, hash, css);
5694 + }
5695 + return () => {
5696 + const count = runtime.documents.get(targetDocument);
5697 + if (count === void 0) {
5698 + return;
5699 + }
5700 + if (count <= 1) {
5701 + runtime.documents.delete(targetDocument);
5702 + return;
5703 + }
5704 + runtime.documents.set(targetDocument, count - 1);
5705 + };
5706 + }
5707 + function registerStyle6(hash, css) {
5708 + const runtime = getRuntime6();
5709 + runtime.styles.set(hash, css);
5710 + for (const targetDocument of runtime.documents.keys()) {
5711 + injectStyle6(targetDocument, hash, css);
5712 + }
5713 + }
5714 + if (typeof process === "undefined" || true) {
5715 + registerStyle6("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5716 + }
5717 + var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5718 + if (typeof process === "undefined" || true) {
5719 + registerStyle6("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5720 + }
5721 + var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5722 + if (typeof process === "undefined" || true) {
5723 + registerStyle6("1a25f6a232", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}}");
5724 + }
5725 + var style_default6 = { "input": "_2ae7be2fc1bb17a3__input" };
5726 + var Input3 = (0, import_element9.forwardRef)(function Input22({ className, size = "default", prefix, suffix, style, ...restProps }, ref) {
5727 + return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5728 + InputLayout3,
5729 + {
5730 + className: clsx_default(
5731 + focus_module_default2["outset-ring--focus-within"],
5732 + className
5733 + ),
5734 + style,
5735 + size,
5736 + visuallyDisabled: restProps.disabled,
5737 + prefix,
5738 + suffix,
5739 + children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5740 + Input,
5741 + {
5742 + ref,
5743 + className: clsx_default(global_css_defense_default3.input, style_default6.input),
5744 + ...restProps
5745 + }
5746 + )
5747 + }
5748 + );
5749 + });
5750 +
5751 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
5752 + var import_i18n5 = __toESM(require_i18n(), 1);
5753 + var import_element11 = __toESM(require_element(), 1);
5754 +
5755 + // packages/ui/build-module/spinner/spinner.mjs
5756 + var import_element10 = __toESM(require_element(), 1);
5757 + var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
5758 + var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
5759 + function getRuntime7() {
5760 + const globalScope = globalThis;
5761 + if (globalScope.__wpStyleRuntime) {
5762 + return globalScope.__wpStyleRuntime;
5763 + }
5764 + globalScope.__wpStyleRuntime = {
5765 + documents: /* @__PURE__ */ new Map(),
5766 + styles: /* @__PURE__ */ new Map(),
5767 + injectedStyles: /* @__PURE__ */ new WeakMap()
5768 + };
5769 + if (typeof document !== "undefined") {
5770 + registerDocument7(document);
5771 + }
5772 + return globalScope.__wpStyleRuntime;
5773 + }
5774 + function documentContainsStyleHash7(targetDocument, hash) {
5775 + if (!targetDocument.head) {
5776 + return false;
5777 + }
5778 + for (const style of targetDocument.head.querySelectorAll(
5779 + `style[${STYLE_HASH_ATTRIBUTE7}]`
5780 + )) {
5781 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
5782 + return true;
5783 + }
5784 + }
5785 + return false;
5786 + }
5787 + function injectStyle7(targetDocument, hash, css) {
5788 + if (!targetDocument.head) {
5789 + return;
5790 + }
5791 + const runtime = getRuntime7();
5792 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5793 + if (!injectedStyles) {
5794 + injectedStyles = /* @__PURE__ */ new Set();
5795 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5796 + }
5797 + if (injectedStyles.has(hash)) {
5798 + return;
5799 + }
5800 + if (documentContainsStyleHash7(targetDocument, hash)) {
5801 + injectedStyles.add(hash);
5802 + return;
5803 + }
5804 + const style = targetDocument.createElement("style");
5805 + style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
5806 + style.appendChild(targetDocument.createTextNode(css));
5807 + targetDocument.head.appendChild(style);
5808 + injectedStyles.add(hash);
5809 + }
5810 + function registerDocument7(targetDocument) {
5811 + const runtime = getRuntime7();
5812 + runtime.documents.set(
5813 + targetDocument,
5814 + (runtime.documents.get(targetDocument) ?? 0) + 1
5815 + );
5816 + for (const [hash, css] of runtime.styles) {
5817 + injectStyle7(targetDocument, hash, css);
5818 + }
5819 + return () => {
5820 + const count = runtime.documents.get(targetDocument);
5821 + if (count === void 0) {
5822 + return;
5823 + }
5824 + if (count <= 1) {
5825 + runtime.documents.delete(targetDocument);
5826 + return;
5827 + }
5828 + runtime.documents.set(targetDocument, count - 1);
5829 + };
5830 + }
5831 + function registerStyle7(hash, css) {
5832 + const runtime = getRuntime7();
5833 + runtime.styles.set(hash, css);
5834 + for (const targetDocument of runtime.documents.keys()) {
5835 + injectStyle7(targetDocument, hash, css);
5836 + }
5837 + }
5838 + if (typeof process === "undefined" || true) {
5839 + registerStyle7("bbbecfe373", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator,.dc51f80c84b35fe2__track{fill:transparent;stroke-width:1.5px}.dc51f80c84b35fe2__track{stroke:var(--wpds-color-background-track-neutral,#dbdbdb)}.a7654e10245bb7d2__indicator{stroke:var(--wpds-color-background-thumb-brand,var(--wp-admin-theme-color,#3858e9));stroke-linecap:round;animation:_02322d973909703c__spinner-spin 1.4s linear infinite both;transform-origin:50% 50%}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}");
5840 + }
5841 + var style_default7 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" };
5842 + var Spinner = (0, import_element10.forwardRef)(
5843 + function Spinner2({ className, ...props }, ref) {
5844 + return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5845 + "svg",
5846 + {
5847 + className: clsx_default(style_default7.spinner, className),
5848 + viewBox: "0 0 100 100",
5849 + xmlns: "http://www.w3.org/2000/svg",
5850 + role: "presentation",
5851 + focusable: "false",
5852 + ...props,
5853 + ref,
5854 + children: [
5855 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5856 + "circle",
5857 + {
5858 + className: style_default7.track,
5859 + cx: "50",
5860 + cy: "50",
5861 + r: "50",
5862 + vectorEffect: "non-scaling-stroke"
5863 + }
5864 + ),
5865 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5866 + "path",
5867 + {
5868 + className: style_default7.indicator,
5869 + d: "m 50 0 a 50 50 0 0 1 50 50",
5870 + vectorEffect: "non-scaling-stroke"
5871 + }
5872 + )
5873 + ]
5874 + }
5875 + );
5876 + }
5877 + );
5878 +
5879 + // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs
5880 + var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
5881 + var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
5882 + function getRuntime8() {
5883 + const globalScope = globalThis;
5884 + if (globalScope.__wpStyleRuntime) {
5885 + return globalScope.__wpStyleRuntime;
5886 + }
5887 + globalScope.__wpStyleRuntime = {
5888 + documents: /* @__PURE__ */ new Map(),
5889 + styles: /* @__PURE__ */ new Map(),
5890 + injectedStyles: /* @__PURE__ */ new WeakMap()
5891 + };
5892 + if (typeof document !== "undefined") {
5893 + registerDocument8(document);
5894 + }
5895 + return globalScope.__wpStyleRuntime;
5896 + }
5897 + function documentContainsStyleHash8(targetDocument, hash) {
5898 + if (!targetDocument.head) {
5899 + return false;
5900 + }
5901 + for (const style of targetDocument.head.querySelectorAll(
5902 + `style[${STYLE_HASH_ATTRIBUTE8}]`
5903 + )) {
5904 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
5905 + return true;
5906 + }
5907 + }
5908 + return false;
5909 + }
5910 + function injectStyle8(targetDocument, hash, css) {
5911 + if (!targetDocument.head) {
5912 + return;
5913 + }
5914 + const runtime = getRuntime8();
5915 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5916 + if (!injectedStyles) {
5917 + injectedStyles = /* @__PURE__ */ new Set();
5918 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5919 + }
5920 + if (injectedStyles.has(hash)) {
5921 + return;
5922 + }
5923 + if (documentContainsStyleHash8(targetDocument, hash)) {
5924 + injectedStyles.add(hash);
5925 + return;
5926 + }
5927 + const style = targetDocument.createElement("style");
5928 + style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
5929 + style.appendChild(targetDocument.createTextNode(css));
5930 + targetDocument.head.appendChild(style);
5931 + injectedStyles.add(hash);
5932 + }
5933 + function registerDocument8(targetDocument) {
5934 + const runtime = getRuntime8();
5935 + runtime.documents.set(
5936 + targetDocument,
5937 + (runtime.documents.get(targetDocument) ?? 0) + 1
5938 + );
5939 + for (const [hash, css] of runtime.styles) {
5940 + injectStyle8(targetDocument, hash, css);
5941 + }
5942 + return () => {
5943 + const count = runtime.documents.get(targetDocument);
5944 + if (count === void 0) {
5945 + return;
5946 + }
5947 + if (count <= 1) {
5948 + runtime.documents.delete(targetDocument);
5949 + return;
5950 + }
5951 + runtime.documents.set(targetDocument, count - 1);
5952 + };
5953 + }
5954 + function registerStyle8(hash, css) {
5955 + const runtime = getRuntime8();
5956 + runtime.styles.set(hash, css);
5957 + for (const targetDocument of runtime.documents.keys()) {
5958 + injectStyle8(targetDocument, hash, css);
5959 + }
5960 + }
5961 + if (typeof process === "undefined" || true) {
5962 + registerStyle8("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5963 + }
5964 + var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5965 + if (typeof process === "undefined" || true) {
5966 + registerStyle8("d11816833c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7a7ac88e306348e7__indicator{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);align-items:flex-start;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);gap:var(--wpds-dimension-gap-xs,4px);line-height:var(--wpds-typography-line-height-xs,16px);@media not (prefers-reduced-motion){animation:_48722cc5dd090ce4__indicator-jump var(--wpds-motion-duration-md,.2s) cubic-bezier(.68,-.55,.27,1.55)}}._57a3bbbfbe38a5c6__is-invalid{color:var(--wpds-color-foreground-content-error-weak,#cc1818)}._9e944dc198aac10b__is-valid{color:var(--wpds-color-foreground-content-success-weak,#008030)}.e482806667437c6a__indicator-icon{flex-shrink:0}._6e46434cc23019d2__indicator-spinner{height:var(--wpds-dimension-size-3xs,12px);margin:2px;width:var(--wpds-dimension-size-3xs,12px)}@keyframes _48722cc5dd090ce4__indicator-jump{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}}');
5967 + }
5968 + var style_default8 = { "indicator": "_7a7ac88e306348e7__indicator", "indicator-jump": "_48722cc5dd090ce4__indicator-jump", "is-invalid": "_57a3bbbfbe38a5c6__is-invalid", "is-valid": "_9e944dc198aac10b__is-valid", "indicator-icon": "e482806667437c6a__indicator-icon", "indicator-spinner": "_6e46434cc23019d2__indicator-spinner" };
5969 + var ICON = {
5970 + valid: published_default,
5971 + invalid: error_default
5972 + };
5973 + function ValidityIndicator({
5974 + id,
5975 + type,
5976 + message
5977 + }) {
5978 + return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
5979 + "p",
5980 + {
5981 + id,
5982 + className: clsx_default(
5983 + global_css_defense_default4.p,
5984 + style_default8.indicator,
5985 + style_default8[`is-${type}`]
5986 + ),
5987 + children: [
5988 + type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: style_default8["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5989 + Icon,
3756 5990 {
3757 - className: style_default3["link-icon"],
3758 - role: "img",
3759 - "aria-label": (
3760 - /* translators: accessibility text appended to link text */
3761 - (0, import_i18n4.__)("(opens in a new tab)")
3762 - )
5991 + className: style_default8["indicator-icon"],
5992 + icon: ICON[type],
5993 + size: 16,
5994 + fill: "currentColor"
3763 5995 }
3764 - )
5996 + ),
5997 + message
5998 + ]
5999 + }
6000 + );
6001 + }
6002 +
6003 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
6004 + var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
6005 + var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6006 + function appendRequiredIndicator(label, required, markWhenOptional) {
6007 + let suffix;
6008 + if (required && !markWhenOptional) {
6009 + suffix = `(${(0, import_i18n5.__)("Required")})`;
6010 + } else if (!required && markWhenOptional) {
6011 + suffix = `(${(0, import_i18n5.__)("Optional")})`;
6012 + }
6013 + if (!suffix) {
6014 + return label;
6015 + }
6016 + if (typeof label === "string") {
6017 + return `${label} ${suffix}`;
6018 + }
6019 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6020 + label,
6021 + " ",
6022 + suffix
6023 + ] });
6024 + }
6025 + var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible";
6026 + var ControlWithError = (0, import_element11.forwardRef)(function ControlWithError2({
6027 + required,
6028 + markWhenOptional,
6029 + customValidity,
6030 + getValidityTarget,
6031 + children,
6032 + render = DEFAULT_RENDER,
6033 + ...restProps
6034 + }, forwardedRef) {
6035 + const [errorMessage, setErrorMessage] = (0, import_element11.useState)();
6036 + const [statusMessage, setStatusMessage] = (0, import_element11.useState)();
6037 + const [showMessage, setShowMessage] = (0, import_element11.useState)(false);
6038 + const [isTouched, setIsTouched] = (0, import_element11.useState)(false);
6039 + const wrapperRef = (0, import_element11.useRef)(null);
6040 + (0, import_element11.useEffect)(() => {
6041 + const validityTarget = getValidityTarget();
6042 + const handler = () => {
6043 + if (customValidity?.type !== "validating") {
6044 + setErrorMessage(validityTarget?.validationMessage);
6045 + }
6046 + setShowMessage(true);
6047 + validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6048 + };
6049 + validityTarget?.addEventListener("invalid", handler);
6050 + return () => validityTarget?.removeEventListener("invalid", handler);
6051 + }, [customValidity?.type, getValidityTarget]);
6052 + (0, import_element11.useEffect)(() => {
6053 + const validityTarget = getValidityTarget();
6054 + const suppressNativePopover = (event) => {
6055 + event.preventDefault();
6056 + if (!event.isTrusted) {
6057 + return;
6058 + }
6059 + const target = event.target;
6060 + const firstErrorInForm = Array.from(
6061 + target.form?.elements ?? []
6062 + ).find((el) => !el.validity.valid);
6063 + if (!target.form || firstErrorInForm === target) {
6064 + target.focus();
6065 + }
6066 + };
6067 + const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from(
6068 + wrapperRef.current?.querySelectorAll(
6069 + `input[type="radio"][name="${validityTarget?.name}"]`
6070 + ) ?? []
6071 + ).filter((sibling) => sibling !== validityTarget) : [];
6072 + validityTarget?.addEventListener("invalid", suppressNativePopover);
6073 + radioSiblings.forEach(
6074 + (sibling) => sibling.addEventListener("invalid", suppressNativePopover)
6075 + );
6076 + return () => {
6077 + validityTarget?.removeEventListener(
6078 + "invalid",
6079 + suppressNativePopover
6080 + );
6081 + radioSiblings.forEach(
6082 + (sibling) => sibling.removeEventListener("invalid", suppressNativePopover)
6083 + );
6084 + };
6085 + }, [getValidityTarget]);
6086 + (0, import_element11.useEffect)(() => {
6087 + const validityTarget = getValidityTarget();
6088 + if (!customValidity?.type) {
6089 + validityTarget?.setCustomValidity("");
6090 + setErrorMessage(validityTarget?.validationMessage);
6091 + setStatusMessage(void 0);
6092 + return;
6093 + }
6094 + switch (customValidity.type) {
6095 + case "validating": {
6096 + validityTarget?.setCustomValidity("");
6097 + setErrorMessage(void 0);
6098 + setStatusMessage({
6099 + type: "validating",
6100 + message: customValidity.message
6101 + });
6102 + break;
6103 + }
6104 + case "valid": {
6105 + validityTarget?.setCustomValidity("");
6106 + setErrorMessage(validityTarget?.validationMessage);
6107 + setStatusMessage({
6108 + type: "valid",
6109 + message: customValidity.message
6110 + });
6111 + break;
6112 + }
6113 + case "invalid": {
6114 + validityTarget?.setCustomValidity(
6115 + customValidity.message ?? ""
6116 + );
6117 + setErrorMessage(validityTarget?.validationMessage);
6118 + setStatusMessage(void 0);
6119 + break;
6120 + }
6121 + }
6122 + }, [customValidity, getValidityTarget]);
6123 + (0, import_element11.useEffect)(() => {
6124 + if (!isTouched || showMessage) {
6125 + return;
6126 + }
6127 + if (customValidity?.type === "validating") {
6128 + const timer = setTimeout(() => {
6129 + setShowMessage(true);
6130 + }, 1e3);
6131 + return () => clearTimeout(timer);
6132 + }
6133 + setShowMessage(true);
6134 + }, [isTouched, customValidity?.type, showMessage]);
6135 + const onBlur = (event) => {
6136 + if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) {
6137 + return;
6138 + }
6139 + if (!isTouched) {
6140 + setIsTouched(true);
6141 + getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6142 + }
6143 + const validityTarget = getValidityTarget();
6144 + const isValidating = customValidity?.type === "validating";
6145 + window.queueMicrotask(() => {
6146 + if (!isValidating) {
6147 + setErrorMessage(validityTarget?.validationMessage);
6148 + }
6149 + });
6150 + };
6151 + const messageId = (0, import_element11.useId)();
6152 + const message = (() => {
6153 + if (errorMessage) {
6154 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6155 + ValidityIndicator,
6156 + {
6157 + id: messageId,
6158 + type: "invalid",
6159 + message: errorMessage
6160 + }
6161 + );
6162 + }
6163 + if (statusMessage?.type) {
6164 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6165 + ValidityIndicator,
6166 + {
6167 + id: messageId,
6168 + type: statusMessage.type,
6169 + message: statusMessage.message
6170 + }
6171 + );
6172 + }
6173 + return null;
6174 + })();
6175 + const visibleMessage = showMessage ? message : null;
6176 + (0, import_element11.useEffect)(() => {
6177 + const target = getValidityTarget();
6178 + if (!target) {
6179 + return;
6180 + }
6181 + function setDescribedBy(el, shouldAdd) {
6182 + const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId);
6183 + if (shouldAdd) {
6184 + ids.push(messageId);
6185 + }
6186 + if (ids.length) {
6187 + el.setAttribute("aria-describedby", ids.join(" "));
6188 + } else {
6189 + el.removeAttribute("aria-describedby");
6190 + }
6191 + }
6192 + setDescribedBy(target, !!visibleMessage);
6193 + return () => setDescribedBy(target, false);
6194 + }, [visibleMessage, messageId, getValidityTarget]);
6195 + return useRender({
6196 + render,
6197 + ref: [forwardedRef, wrapperRef],
6198 + props: mergeProps(restProps, {
6199 + onBlur,
6200 + children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6201 + (0, import_element11.cloneElement)(children, {
6202 + label: appendRequiredIndicator(
6203 + children.props.label,
6204 + required,
6205 + markWhenOptional
6206 + ),
6207 + required
6208 + }),
6209 + visibleMessage
3765 6210 ] })
3766 6211 })
3767 6212 });
3768 - return element;
3769 6213 });
3770 6214
6215 + // packages/ui/build-module/form/primitives/field/index.mjs
6216 + var field_exports = {};
6217 + __export(field_exports, {
6218 + Control: () => Control,
6219 + Description: () => Description,
6220 + Details: () => Details,
6221 + Item: () => Item,
6222 + Label: () => Label,
6223 + Root: () => Root,
6224 + VisualLabel: () => VisualLabel
6225 + });
6226 +
6227 + // packages/ui/build-module/form/primitives/field/root.mjs
6228 + var import_element12 = __toESM(require_element(), 1);
6229 + var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
6230 + var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash";
6231 + function getRuntime9() {
6232 + const globalScope = globalThis;
6233 + if (globalScope.__wpStyleRuntime) {
6234 + return globalScope.__wpStyleRuntime;
6235 + }
6236 + globalScope.__wpStyleRuntime = {
6237 + documents: /* @__PURE__ */ new Map(),
6238 + styles: /* @__PURE__ */ new Map(),
6239 + injectedStyles: /* @__PURE__ */ new WeakMap()
6240 + };
6241 + if (typeof document !== "undefined") {
6242 + registerDocument9(document);
6243 + }
6244 + return globalScope.__wpStyleRuntime;
6245 + }
6246 + function documentContainsStyleHash9(targetDocument, hash) {
6247 + if (!targetDocument.head) {
6248 + return false;
6249 + }
6250 + for (const style of targetDocument.head.querySelectorAll(
6251 + `style[${STYLE_HASH_ATTRIBUTE9}]`
6252 + )) {
6253 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) {
6254 + return true;
6255 + }
6256 + }
6257 + return false;
6258 + }
6259 + function injectStyle9(targetDocument, hash, css) {
6260 + if (!targetDocument.head) {
6261 + return;
6262 + }
6263 + const runtime = getRuntime9();
6264 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6265 + if (!injectedStyles) {
6266 + injectedStyles = /* @__PURE__ */ new Set();
6267 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6268 + }
6269 + if (injectedStyles.has(hash)) {
6270 + return;
6271 + }
6272 + if (documentContainsStyleHash9(targetDocument, hash)) {
6273 + injectedStyles.add(hash);
6274 + return;
6275 + }
6276 + const style = targetDocument.createElement("style");
6277 + style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash);
6278 + style.appendChild(targetDocument.createTextNode(css));
6279 + targetDocument.head.appendChild(style);
6280 + injectedStyles.add(hash);
6281 + }
6282 + function registerDocument9(targetDocument) {
6283 + const runtime = getRuntime9();
6284 + runtime.documents.set(
6285 + targetDocument,
6286 + (runtime.documents.get(targetDocument) ?? 0) + 1
6287 + );
6288 + for (const [hash, css] of runtime.styles) {
6289 + injectStyle9(targetDocument, hash, css);
6290 + }
6291 + return () => {
6292 + const count = runtime.documents.get(targetDocument);
6293 + if (count === void 0) {
6294 + return;
6295 + }
6296 + if (count <= 1) {
6297 + runtime.documents.delete(targetDocument);
6298 + return;
6299 + }
6300 + runtime.documents.set(targetDocument, count - 1);
6301 + };
6302 + }
6303 + function registerStyle9(hash, css) {
6304 + const runtime = getRuntime9();
6305 + runtime.styles.set(hash, css);
6306 + for (const targetDocument of runtime.documents.keys()) {
6307 + injectStyle9(targetDocument, hash, css);
6308 + }
6309 + }
6310 + if (typeof process === "undefined" || true) {
6311 + registerStyle9("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
6312 + }
6313 + var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
6314 + var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6315 + var Root = (0, import_element12.forwardRef)(function Root2({ className, render = DEFAULT_RENDER2, ...restProps }, ref) {
6316 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6317 + index_parts_exports.Root,
6318 + {
6319 + ref,
6320 + className: clsx_default(resets_default3["box-sizing"], className),
6321 + render,
6322 + ...restProps
6323 + }
6324 + );
6325 + });
6326 +
6327 + // packages/ui/build-module/form/primitives/field/item.mjs
6328 + var import_element13 = __toESM(require_element(), 1);
6329 + var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
6330 + var Item = (0, import_element13.forwardRef)(function Item2(props, ref) {
6331 + return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(index_parts_exports.Item, { ref, ...props });
6332 + });
6333 +
6334 + // packages/ui/build-module/form/primitives/field/label.mjs
6335 + var import_element14 = __toESM(require_element(), 1);
6336 + var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
6337 + var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash";
6338 + function getRuntime10() {
6339 + const globalScope = globalThis;
6340 + if (globalScope.__wpStyleRuntime) {
6341 + return globalScope.__wpStyleRuntime;
6342 + }
6343 + globalScope.__wpStyleRuntime = {
6344 + documents: /* @__PURE__ */ new Map(),
6345 + styles: /* @__PURE__ */ new Map(),
6346 + injectedStyles: /* @__PURE__ */ new WeakMap()
6347 + };
6348 + if (typeof document !== "undefined") {
6349 + registerDocument10(document);
6350 + }
6351 + return globalScope.__wpStyleRuntime;
6352 + }
6353 + function documentContainsStyleHash10(targetDocument, hash) {
6354 + if (!targetDocument.head) {
6355 + return false;
6356 + }
6357 + for (const style of targetDocument.head.querySelectorAll(
6358 + `style[${STYLE_HASH_ATTRIBUTE10}]`
6359 + )) {
6360 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) {
6361 + return true;
6362 + }
6363 + }
6364 + return false;
6365 + }
6366 + function injectStyle10(targetDocument, hash, css) {
6367 + if (!targetDocument.head) {
6368 + return;
6369 + }
6370 + const runtime = getRuntime10();
6371 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6372 + if (!injectedStyles) {
6373 + injectedStyles = /* @__PURE__ */ new Set();
6374 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6375 + }
6376 + if (injectedStyles.has(hash)) {
6377 + return;
6378 + }
6379 + if (documentContainsStyleHash10(targetDocument, hash)) {
6380 + injectedStyles.add(hash);
6381 + return;
6382 + }
6383 + const style = targetDocument.createElement("style");
6384 + style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash);
6385 + style.appendChild(targetDocument.createTextNode(css));
6386 + targetDocument.head.appendChild(style);
6387 + injectedStyles.add(hash);
6388 + }
6389 + function registerDocument10(targetDocument) {
6390 + const runtime = getRuntime10();
6391 + runtime.documents.set(
6392 + targetDocument,
6393 + (runtime.documents.get(targetDocument) ?? 0) + 1
6394 + );
6395 + for (const [hash, css] of runtime.styles) {
6396 + injectStyle10(targetDocument, hash, css);
6397 + }
6398 + return () => {
6399 + const count = runtime.documents.get(targetDocument);
6400 + if (count === void 0) {
6401 + return;
6402 + }
6403 + if (count <= 1) {
6404 + runtime.documents.delete(targetDocument);
6405 + return;
6406 + }
6407 + runtime.documents.set(targetDocument, count - 1);
6408 + };
6409 + }
6410 + function registerStyle10(hash, css) {
6411 + const runtime = getRuntime10();
6412 + runtime.styles.set(hash, css);
6413 + for (const targetDocument of runtime.documents.keys()) {
6414 + injectStyle10(targetDocument, hash, css);
6415 + }
6416 + }
6417 + if (typeof process === "undefined" || true) {
6418 + registerStyle10("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-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-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6419 + }
6420 + var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6421 + var Label = (0, import_element14.forwardRef)(
6422 + function Label2({ className, hideFromVision, variant, ...restProps }, ref) {
6423 + const label = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6424 + index_parts_exports.Label,
6425 + {
6426 + ref,
6427 + className: clsx_default(
6428 + field_default.label,
6429 + variant && field_default[`is-${variant}`],
6430 + className
6431 + ),
6432 + ...restProps
6433 + }
6434 + );
6435 + if (hideFromVision) {
6436 + return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(VisuallyHidden, { render: label });
6437 + }
6438 + return label;
6439 + }
6440 + );
6441 +
6442 + // packages/ui/build-module/form/primitives/field/description.mjs
6443 + var import_element15 = __toESM(require_element(), 1);
6444 + var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
6445 + var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash";
6446 + function getRuntime11() {
6447 + const globalScope = globalThis;
6448 + if (globalScope.__wpStyleRuntime) {
6449 + return globalScope.__wpStyleRuntime;
6450 + }
6451 + globalScope.__wpStyleRuntime = {
6452 + documents: /* @__PURE__ */ new Map(),
6453 + styles: /* @__PURE__ */ new Map(),
6454 + injectedStyles: /* @__PURE__ */ new WeakMap()
6455 + };
6456 + if (typeof document !== "undefined") {
6457 + registerDocument11(document);
6458 + }
6459 + return globalScope.__wpStyleRuntime;
6460 + }
6461 + function documentContainsStyleHash11(targetDocument, hash) {
6462 + if (!targetDocument.head) {
6463 + return false;
6464 + }
6465 + for (const style of targetDocument.head.querySelectorAll(
6466 + `style[${STYLE_HASH_ATTRIBUTE11}]`
6467 + )) {
6468 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) {
6469 + return true;
6470 + }
6471 + }
6472 + return false;
6473 + }
6474 + function injectStyle11(targetDocument, hash, css) {
6475 + if (!targetDocument.head) {
6476 + return;
6477 + }
6478 + const runtime = getRuntime11();
6479 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6480 + if (!injectedStyles) {
6481 + injectedStyles = /* @__PURE__ */ new Set();
6482 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6483 + }
6484 + if (injectedStyles.has(hash)) {
6485 + return;
6486 + }
6487 + if (documentContainsStyleHash11(targetDocument, hash)) {
6488 + injectedStyles.add(hash);
6489 + return;
6490 + }
6491 + const style = targetDocument.createElement("style");
6492 + style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash);
6493 + style.appendChild(targetDocument.createTextNode(css));
6494 + targetDocument.head.appendChild(style);
6495 + injectedStyles.add(hash);
6496 + }
6497 + function registerDocument11(targetDocument) {
6498 + const runtime = getRuntime11();
6499 + runtime.documents.set(
6500 + targetDocument,
6501 + (runtime.documents.get(targetDocument) ?? 0) + 1
6502 + );
6503 + for (const [hash, css] of runtime.styles) {
6504 + injectStyle11(targetDocument, hash, css);
6505 + }
6506 + return () => {
6507 + const count = runtime.documents.get(targetDocument);
6508 + if (count === void 0) {
6509 + return;
6510 + }
6511 + if (count <= 1) {
6512 + runtime.documents.delete(targetDocument);
6513 + return;
6514 + }
6515 + runtime.documents.set(targetDocument, count - 1);
6516 + };
6517 + }
6518 + function registerStyle11(hash, css) {
6519 + const runtime = getRuntime11();
6520 + runtime.styles.set(hash, css);
6521 + for (const targetDocument of runtime.documents.keys()) {
6522 + injectStyle11(targetDocument, hash, css);
6523 + }
6524 + }
6525 + if (typeof process === "undefined" || true) {
6526 + registerStyle11("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
6527 + }
6528 + var global_css_defense_default5 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
6529 + if (typeof process === "undefined" || true) {
6530 + registerStyle11("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-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-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6531 + }
6532 + var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6533 + var Description = (0, import_element15.forwardRef)(function Description2({ className, ...restProps }, ref) {
6534 + return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
6535 + index_parts_exports.Description,
6536 + {
6537 + ref,
6538 + className: clsx_default(
6539 + global_css_defense_default5.p,
6540 + field_default2.description,
6541 + className
6542 + ),
6543 + ...restProps
6544 + }
6545 + );
6546 + });
6547 +
6548 + // packages/ui/build-module/form/primitives/field/details.mjs
6549 + var import_element16 = __toESM(require_element(), 1);
6550 + var import_i18n6 = __toESM(require_i18n(), 1);
6551 + var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
6552 + var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash";
6553 + function getRuntime12() {
6554 + const globalScope = globalThis;
6555 + if (globalScope.__wpStyleRuntime) {
6556 + return globalScope.__wpStyleRuntime;
6557 + }
6558 + globalScope.__wpStyleRuntime = {
6559 + documents: /* @__PURE__ */ new Map(),
6560 + styles: /* @__PURE__ */ new Map(),
6561 + injectedStyles: /* @__PURE__ */ new WeakMap()
6562 + };
6563 + if (typeof document !== "undefined") {
6564 + registerDocument12(document);
6565 + }
6566 + return globalScope.__wpStyleRuntime;
6567 + }
6568 + function documentContainsStyleHash12(targetDocument, hash) {
6569 + if (!targetDocument.head) {
6570 + return false;
6571 + }
6572 + for (const style of targetDocument.head.querySelectorAll(
6573 + `style[${STYLE_HASH_ATTRIBUTE12}]`
6574 + )) {
6575 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) {
6576 + return true;
6577 + }
6578 + }
6579 + return false;
6580 + }
6581 + function injectStyle12(targetDocument, hash, css) {
6582 + if (!targetDocument.head) {
6583 + return;
6584 + }
6585 + const runtime = getRuntime12();
6586 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6587 + if (!injectedStyles) {
6588 + injectedStyles = /* @__PURE__ */ new Set();
6589 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6590 + }
6591 + if (injectedStyles.has(hash)) {
6592 + return;
6593 + }
6594 + if (documentContainsStyleHash12(targetDocument, hash)) {
6595 + injectedStyles.add(hash);
6596 + return;
6597 + }
6598 + const style = targetDocument.createElement("style");
6599 + style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash);
6600 + style.appendChild(targetDocument.createTextNode(css));
6601 + targetDocument.head.appendChild(style);
6602 + injectedStyles.add(hash);
6603 + }
6604 + function registerDocument12(targetDocument) {
6605 + const runtime = getRuntime12();
6606 + runtime.documents.set(
6607 + targetDocument,
6608 + (runtime.documents.get(targetDocument) ?? 0) + 1
6609 + );
6610 + for (const [hash, css] of runtime.styles) {
6611 + injectStyle12(targetDocument, hash, css);
6612 + }
6613 + return () => {
6614 + const count = runtime.documents.get(targetDocument);
6615 + if (count === void 0) {
6616 + return;
6617 + }
6618 + if (count <= 1) {
6619 + runtime.documents.delete(targetDocument);
6620 + return;
6621 + }
6622 + runtime.documents.set(targetDocument, count - 1);
6623 + };
6624 + }
6625 + function registerStyle12(hash, css) {
6626 + const runtime = getRuntime12();
6627 + runtime.styles.set(hash, css);
6628 + for (const targetDocument of runtime.documents.keys()) {
6629 + injectStyle12(targetDocument, hash, css);
6630 + }
6631 + }
6632 + if (typeof process === "undefined" || true) {
6633 + registerStyle12("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-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-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6634 + }
6635 + var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6636 + var Details = (0, import_element16.forwardRef)(
6637 + function Details2({ className, ...restProps }, ref) {
6638 + return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
6639 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(index_parts_exports.Description, {}), children: (0, import_i18n6.__)("More details follow the field.") }),
6640 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6641 + "div",
6642 + {
6643 + ref,
6644 + className: clsx_default(field_default3.description, className),
6645 + ...restProps
6646 + }
6647 + )
6648 + ] });
6649 + }
6650 + );
6651 +
6652 + // packages/ui/build-module/form/primitives/field/control.mjs
6653 + var import_element17 = __toESM(require_element(), 1);
6654 + var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
6655 + var Control = (0, import_element17.forwardRef)(
6656 + function Control2(props, ref) {
6657 + return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports.Control, { ref, ...props });
6658 + }
6659 + );
6660 +
6661 + // packages/ui/build-module/form/primitives/field/visual-label.mjs
6662 + var import_element18 = __toESM(require_element(), 1);
6663 + var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash";
6664 + function getRuntime13() {
6665 + const globalScope = globalThis;
6666 + if (globalScope.__wpStyleRuntime) {
6667 + return globalScope.__wpStyleRuntime;
6668 + }
6669 + globalScope.__wpStyleRuntime = {
6670 + documents: /* @__PURE__ */ new Map(),
6671 + styles: /* @__PURE__ */ new Map(),
6672 + injectedStyles: /* @__PURE__ */ new WeakMap()
6673 + };
6674 + if (typeof document !== "undefined") {
6675 + registerDocument13(document);
6676 + }
6677 + return globalScope.__wpStyleRuntime;
6678 + }
6679 + function documentContainsStyleHash13(targetDocument, hash) {
6680 + if (!targetDocument.head) {
6681 + return false;
6682 + }
6683 + for (const style of targetDocument.head.querySelectorAll(
6684 + `style[${STYLE_HASH_ATTRIBUTE13}]`
6685 + )) {
6686 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) {
6687 + return true;
6688 + }
6689 + }
6690 + return false;
6691 + }
6692 + function injectStyle13(targetDocument, hash, css) {
6693 + if (!targetDocument.head) {
6694 + return;
6695 + }
6696 + const runtime = getRuntime13();
6697 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6698 + if (!injectedStyles) {
6699 + injectedStyles = /* @__PURE__ */ new Set();
6700 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6701 + }
6702 + if (injectedStyles.has(hash)) {
6703 + return;
6704 + }
6705 + if (documentContainsStyleHash13(targetDocument, hash)) {
6706 + injectedStyles.add(hash);
6707 + return;
6708 + }
6709 + const style = targetDocument.createElement("style");
6710 + style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash);
6711 + style.appendChild(targetDocument.createTextNode(css));
6712 + targetDocument.head.appendChild(style);
6713 + injectedStyles.add(hash);
6714 + }
6715 + function registerDocument13(targetDocument) {
6716 + const runtime = getRuntime13();
6717 + runtime.documents.set(
6718 + targetDocument,
6719 + (runtime.documents.get(targetDocument) ?? 0) + 1
6720 + );
6721 + for (const [hash, css] of runtime.styles) {
6722 + injectStyle13(targetDocument, hash, css);
6723 + }
6724 + return () => {
6725 + const count = runtime.documents.get(targetDocument);
6726 + if (count === void 0) {
6727 + return;
6728 + }
6729 + if (count <= 1) {
6730 + runtime.documents.delete(targetDocument);
6731 + return;
6732 + }
6733 + runtime.documents.set(targetDocument, count - 1);
6734 + };
6735 + }
6736 + function registerStyle13(hash, css) {
6737 + const runtime = getRuntime13();
6738 + runtime.styles.set(hash, css);
6739 + for (const targetDocument of runtime.documents.keys()) {
6740 + injectStyle13(targetDocument, hash, css);
6741 + }
6742 + }
6743 + if (typeof process === "undefined" || true) {
6744 + registerStyle13("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-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-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6745 + }
6746 + var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6747 + var VisualLabel = (0, import_element18.forwardRef)(
6748 + function VisualLabel2({ className, render, variant, ...restProps }, ref) {
6749 + return useRender({
6750 + defaultTagName: "span",
6751 + render,
6752 + ref,
6753 + props: mergeProps(restProps, {
6754 + className: clsx_default(
6755 + field_default4.label,
6756 + variant && field_default4[`is-${variant}`],
6757 + className
6758 + )
6759 + })
6760 + });
6761 + }
6762 + );
6763 + VisualLabel.displayName = "Field.VisualLabel";
6764 +
6765 + // packages/ui/build-module/form/input-control/input-control.mjs
6766 + var import_element19 = __toESM(require_element(), 1);
6767 + var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
6768 + var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash";
6769 + function getRuntime14() {
6770 + const globalScope = globalThis;
6771 + if (globalScope.__wpStyleRuntime) {
6772 + return globalScope.__wpStyleRuntime;
6773 + }
6774 + globalScope.__wpStyleRuntime = {
6775 + documents: /* @__PURE__ */ new Map(),
6776 + styles: /* @__PURE__ */ new Map(),
6777 + injectedStyles: /* @__PURE__ */ new WeakMap()
6778 + };
6779 + if (typeof document !== "undefined") {
6780 + registerDocument14(document);
6781 + }
6782 + return globalScope.__wpStyleRuntime;
6783 + }
6784 + function documentContainsStyleHash14(targetDocument, hash) {
6785 + if (!targetDocument.head) {
6786 + return false;
6787 + }
6788 + for (const style of targetDocument.head.querySelectorAll(
6789 + `style[${STYLE_HASH_ATTRIBUTE14}]`
6790 + )) {
6791 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) {
6792 + return true;
6793 + }
6794 + }
6795 + return false;
6796 + }
6797 + function injectStyle14(targetDocument, hash, css) {
6798 + if (!targetDocument.head) {
6799 + return;
6800 + }
6801 + const runtime = getRuntime14();
6802 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6803 + if (!injectedStyles) {
6804 + injectedStyles = /* @__PURE__ */ new Set();
6805 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6806 + }
6807 + if (injectedStyles.has(hash)) {
6808 + return;
6809 + }
6810 + if (documentContainsStyleHash14(targetDocument, hash)) {
6811 + injectedStyles.add(hash);
6812 + return;
6813 + }
6814 + const style = targetDocument.createElement("style");
6815 + style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash);
6816 + style.appendChild(targetDocument.createTextNode(css));
6817 + targetDocument.head.appendChild(style);
6818 + injectedStyles.add(hash);
6819 + }
6820 + function registerDocument14(targetDocument) {
6821 + const runtime = getRuntime14();
6822 + runtime.documents.set(
6823 + targetDocument,
6824 + (runtime.documents.get(targetDocument) ?? 0) + 1
6825 + );
6826 + for (const [hash, css] of runtime.styles) {
6827 + injectStyle14(targetDocument, hash, css);
6828 + }
6829 + return () => {
6830 + const count = runtime.documents.get(targetDocument);
6831 + if (count === void 0) {
6832 + return;
6833 + }
6834 + if (count <= 1) {
6835 + runtime.documents.delete(targetDocument);
6836 + return;
6837 + }
6838 + runtime.documents.set(targetDocument, count - 1);
6839 + };
6840 + }
6841 + function registerStyle14(hash, css) {
6842 + const runtime = getRuntime14();
6843 + runtime.styles.set(hash, css);
6844 + for (const targetDocument of runtime.documents.keys()) {
6845 + injectStyle14(targetDocument, hash, css);
6846 + }
6847 + }
6848 + if (typeof process === "undefined" || true) {
6849 + registerStyle14("0c752c3d08", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a9211a7e6af24bed__root input[type=date]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=datetime-local]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=time]:not([data-filled]):not(:focus){--_gcd-input-color:transparent;--_gcd-input-color-disabled:transparent;color:transparent;&:disabled::-webkit-datetime-edit-text{color:transparent}}}}}");
6850 + }
6851 + var style_default9 = { "root": "a9211a7e6af24bed__root" };
6852 + var InputControl = (0, import_element19.forwardRef)(
6853 + function InputControl2({
6854 + className,
6855 + label,
6856 + description,
6857 + details,
6858 + hideLabelFromVision,
6859 + ...restProps
6860 + }, ref) {
6861 + return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(field_exports.Root, { className: clsx_default(style_default9.root, className), children: [
6862 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }),
6863 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Input3, { ref, ...restProps }),
6864 + description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Description, { children: description }),
6865 + details && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Details, { children: details })
6866 + ] });
6867 + }
6868 + );
6869 +
6870 + // packages/ui/build-module/form/with-validation/validated-input-control/validated-input-control.mjs
6871 + var import_element20 = __toESM(require_element(), 1);
6872 + var import_compose2 = __toESM(require_compose(), 1);
6873 + var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
6874 + var ValidatedInputControl = (0, import_element20.forwardRef)(function ValidatedInputControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) {
6875 + const validityTargetRef = (0, import_element20.useRef)(null);
6876 + const mergedRefs = (0, import_compose2.useMergeRefs)([forwardedRef, validityTargetRef]);
6877 + return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6878 + ControlWithError,
6879 + {
6880 + required,
6881 + markWhenOptional,
6882 + customValidity,
6883 + getValidityTarget: () => validityTargetRef.current,
6884 + children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputControl, { ref: mergedRefs, ...restProps })
6885 + }
6886 + );
6887 + });
6888 +
3771 6889 // packages/ui/build-module/tabs/index.mjs
3772 6890 var tabs_exports = {};
3773 6891 __export(tabs_exports, {
3774 6892 List: () => List,
3775 6893 Panel: () => Panel,
3776 - Root: () => Root,
6894 + Root: () => Root3,
3777 6895 Tab: () => Tab
3778 6896 });
3779 6897
3780 6898 // packages/ui/build-module/tabs/list.mjs
3781 - var import_element7 = __toESM(require_element(), 1);
3782 - var import_compose = __toESM(require_compose(), 1);
3783 - var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
3784 - var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
3785 - function getRuntime4() {
6899 + var import_element21 = __toESM(require_element(), 1);
6900 + var import_compose3 = __toESM(require_compose(), 1);
6901 + var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
6902 + var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash";
6903 + function getRuntime15() {
3786 6904 const globalScope = globalThis;
3787 6905 if (globalScope.__wpStyleRuntime) {
3788 6906 return globalScope.__wpStyleRuntime;
3789 6907 }
@@ -3792,30 +6910,30 @@
3792 6910 styles: /* @__PURE__ */ new Map(),
3793 6911 injectedStyles: /* @__PURE__ */ new WeakMap()
3794 6912 };
3795 6913 if (typeof document !== "undefined") {
3796 - registerDocument4(document);
6914 + registerDocument15(document);
3797 6915 }
3798 6916 return globalScope.__wpStyleRuntime;
3799 6917 }
3800 - function documentContainsStyleHash4(targetDocument, hash) {
6918 + function documentContainsStyleHash15(targetDocument, hash) {
3801 6919 if (!targetDocument.head) {
3802 6920 return false;
3803 6921 }
3804 6922 for (const style of targetDocument.head.querySelectorAll(
3805 - `style[${STYLE_HASH_ATTRIBUTE4}]`
6923 + `style[${STYLE_HASH_ATTRIBUTE15}]`
3806 6924 )) {
3807 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
6925 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) {
3808 6926 return true;
3809 6927 }
3810 6928 }
3811 6929 return false;
3812 6930 }
3813 - function injectStyle4(targetDocument, hash, css) {
6931 + function injectStyle15(targetDocument, hash, css) {
3814 6932 if (!targetDocument.head) {
3815 6933 return;
3816 6934 }
3817 - const runtime = getRuntime4();
6935 + const runtime = getRuntime15();
3818 6936 let injectedStyles = runtime.injectedStyles.get(targetDocument);
3819 6937 if (!injectedStyles) {
3820 6938 injectedStyles = /* @__PURE__ */ new Set();
3821 6939 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -3822,26 +6940,26 @@
3822 6940 }
3823 6941 if (injectedStyles.has(hash)) {
3824 6942 return;
3825 6943 }
3826 - if (documentContainsStyleHash4(targetDocument, hash)) {
6944 + if (documentContainsStyleHash15(targetDocument, hash)) {
3827 6945 injectedStyles.add(hash);
3828 6946 return;
3829 6947 }
3830 6948 const style = targetDocument.createElement("style");
3831 - style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
6949 + style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash);
3832 6950 style.appendChild(targetDocument.createTextNode(css));
3833 6951 targetDocument.head.appendChild(style);
3834 6952 injectedStyles.add(hash);
3835 6953 }
3836 - function registerDocument4(targetDocument) {
3837 - const runtime = getRuntime4();
6954 + function registerDocument15(targetDocument) {
6955 + const runtime = getRuntime15();
3838 6956 runtime.documents.set(
3839 6957 targetDocument,
3840 6958 (runtime.documents.get(targetDocument) ?? 0) + 1
3841 6959 );
3842 6960 for (const [hash, css] of runtime.styles) {
3843 - injectStyle4(targetDocument, hash, css);
6961 + injectStyle15(targetDocument, hash, css);
3844 6962 }
3845 6963 return () => {
3846 6964 const count = runtime.documents.get(targetDocument);
3847 6965 if (count === void 0) {
@@ -3853,21 +6971,21 @@
3853 6971 }
3854 6972 runtime.documents.set(targetDocument, count - 1);
3855 6973 };
3856 6974 }
3857 - function registerStyle4(hash, css) {
3858 - const runtime = getRuntime4();
6975 + function registerStyle15(hash, css) {
6976 + const runtime = getRuntime15();
3859 6977 runtime.styles.set(hash, css);
3860 6978 for (const targetDocument of runtime.documents.keys()) {
3861 - injectStyle4(targetDocument, hash, css);
6979 + injectStyle15(targetDocument, hash, css);
3862 6980 }
3863 6981 }
3864 6982 if (typeof process === "undefined" || true) {
3865 - registerStyle4("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
6983 + registerStyle15("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
3866 6984 }
3867 - var style_default4 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
6985 + var style_default10 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
3868 6986 var SCROLL_EPSILON = 1;
3869 - var List = (0, import_element7.forwardRef)(
6987 + var List = (0, import_element21.forwardRef)(
3870 6988 function TabList({
3871 6989 children,
3872 6990 variant = "default",
3873 6991 className,
@@ -3873,15 +6991,15 @@
3873 6991 className,
3874 6992 activateOnFocus,
3875 6993 ...otherProps
3876 6994 }, forwardedRef) {
3877 - const [listEl, setListEl] = (0, import_element7.useState)(null);
3878 - const [overflow, setOverflow] = (0, import_element7.useState)({
6995 + const [listEl, setListEl] = (0, import_element21.useState)(null);
6996 + const [overflow, setOverflow] = (0, import_element21.useState)({
3879 6997 first: false,
3880 6998 last: false,
3881 6999 isScrolling: false
3882 7000 });
3883 - (0, import_element7.useEffect)(() => {
7001 + (0, import_element21.useEffect)(() => {
3884 7002 if (!listEl) {
3885 7003 return;
3886 7004 }
3887 7005 const measureOverflow = () => {
@@ -3939,23 +7057,23 @@
3939 7057 resizeObserver.disconnect();
3940 7058 mutationObserver.disconnect();
3941 7059 };
3942 7060 }, [listEl]);
3943 - const mergedListRef = (0, import_compose.useMergeRefs)([
7061 + const mergedListRef = (0, import_compose3.useMergeRefs)([
3944 7062 forwardedRef,
3945 7063 (el) => setListEl(el)
3946 7064 ]);
3947 - return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3948 - index_parts_exports.List,
7065 + return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
7066 + index_parts_exports2.List,
3949 7067 {
3950 7068 ref: mergedListRef,
3951 7069 activateOnFocus,
3952 7070 "data-select-on-move": activateOnFocus ? "true" : "false",
3953 7071 className: clsx_default(
3954 - style_default4.tablist,
3955 - overflow.first && style_default4["is-overflowing-first"],
3956 - overflow.last && style_default4["is-overflowing-last"],
3957 - style_default4[`is-${variant}-variant`],
7072 + style_default10.tablist,
7073 + overflow.first && style_default10["is-overflowing-first"],
7074 + overflow.last && style_default10["is-overflowing-last"],
7075 + style_default10[`is-${variant}-variant`],
3958 7076 className
3959 7077 ),
3960 7078 ...otherProps,
3961 7079 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
@@ -3960,9 +7078,9 @@
3960 7078 ...otherProps,
3961 7079 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
3962 7080 children: [
3963 7081 children,
3964 - /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Indicator, { className: style_default4.indicator })
7082 + /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(index_parts_exports2.Indicator, { className: style_default10.indicator })
3965 7083 ]
3966 7084 }
3967 7085 );
3968 7086 }
@@ -3968,18 +7086,18 @@
3968 7086 }
3969 7087 );
3970 7088
3971 7089 // packages/ui/build-module/tabs/panel.mjs
3972 - var import_element9 = __toESM(require_element(), 1);
7090 + var import_element23 = __toESM(require_element(), 1);
3973 7091
3974 7092 // packages/ui/build-module/tabs/context.mjs
3975 - var import_element8 = __toESM(require_element(), 1);
3976 - var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
7093 + var import_element22 = __toESM(require_element(), 1);
7094 + var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
3977 7095 var VALIDATION_ENABLED = true;
3978 - var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element8.createContext)(null) : null;
7096 + var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element22.createContext)(null) : null;
3979 7097 function useRegisterTabDev() {
3980 - const context = (0, import_element8.useContext)(TabsValidationContext);
3981 - (0, import_element8.useEffect)(() => {
7098 + const context = (0, import_element22.useContext)(TabsValidationContext);
7099 + (0, import_element22.useEffect)(() => {
3982 7100 if (context) {
3983 7101 return context.registerTab();
3984 7102 }
3985 7103 return void 0;
@@ -3988,10 +7106,10 @@
3988 7106 function useRegisterTabProd() {
3989 7107 }
3990 7108 var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd;
3991 7109 function useRegisterPanelDev() {
3992 - const context = (0, import_element8.useContext)(TabsValidationContext);
3993 - (0, import_element8.useEffect)(() => {
7110 + const context = (0, import_element22.useContext)(TabsValidationContext);
7111 + (0, import_element22.useEffect)(() => {
3994 7112 if (context) {
3995 7113 return context.registerPanel();
3996 7114 }
3997 7115 return void 0;
@@ -4002,10 +7120,10 @@
4002 7120 var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd;
4003 7121 function TabsValidationProviderDev({
4004 7122 children
4005 7123 }) {
4006 - const tabCountRef = (0, import_element8.useRef)(0);
4007 - const panelCountRef = (0, import_element8.useRef)(0);
7124 + const tabCountRef = (0, import_element22.useRef)(0);
7125 + const panelCountRef = (0, import_element22.useRef)(0);
4008 7126 const scheduleValidation = useScheduleValidation(() => {
4009 7127 const tabCount = tabCountRef.current;
4010 7128 const panelCount = panelCountRef.current;
4011 7129 if (tabCount !== panelCount) {
@@ -4013,9 +7131,9 @@
4013 7131 `Tabs: Tab/Panel count mismatch (${tabCount} Tabs, ${panelCount} Panels). Each Tab must be associated with exactly one Panel. Mismatched or missing associations can break screen reader navigation and violate WAI-ARIA Tabs pattern requirements.`
4014 7132 );
4015 7133 }
4016 7134 });
4017 - const registerTab = (0, import_element8.useCallback)(() => {
7135 + const registerTab = (0, import_element22.useCallback)(() => {
4018 7136 tabCountRef.current += 1;
4019 7137 scheduleValidation();
4020 7138 return () => {
4021 7139 tabCountRef.current -= 1;
@@ -4021,9 +7139,9 @@
4021 7139 tabCountRef.current -= 1;
4022 7140 scheduleValidation();
4023 7141 };
4024 7142 }, [scheduleValidation]);
4025 - const registerPanel = (0, import_element8.useCallback)(() => {
7143 + const registerPanel = (0, import_element22.useCallback)(() => {
4026 7144 panelCountRef.current += 1;
4027 7145 scheduleValidation();
4028 7146 return () => {
4029 7147 panelCountRef.current -= 1;
@@ -4029,9 +7147,9 @@
4029 7147 panelCountRef.current -= 1;
4030 7148 scheduleValidation();
4031 7149 };
4032 7150 }, [scheduleValidation]);
4033 - const contextValue = (0, import_element8.useMemo)(
7151 + const contextValue = (0, import_element22.useMemo)(
4034 7152 () => ({
4035 7153 registerTab,
4036 7154 registerPanel
4037 7155 }),
@@ -4036,21 +7154,21 @@
4036 7154 registerPanel
4037 7155 }),
4038 7156 [registerTab, registerPanel]
4039 7157 );
4040 - return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
7158 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
4041 7159 }
4042 7160 function TabsValidationProviderProd({
4043 7161 children
4044 7162 }) {
4045 - return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
7163 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
4046 7164 }
4047 7165 var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd;
4048 7166
4049 7167 // packages/ui/build-module/tabs/panel.mjs
4050 - var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
4051 - var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
4052 - function getRuntime5() {
7168 + var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
7169 + var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash";
7170 + function getRuntime16() {
4053 7171 const globalScope = globalThis;
4054 7172 if (globalScope.__wpStyleRuntime) {
4055 7173 return globalScope.__wpStyleRuntime;
4056 7174 }
@@ -4059,30 +7177,30 @@
4059 7177 styles: /* @__PURE__ */ new Map(),
4060 7178 injectedStyles: /* @__PURE__ */ new WeakMap()
4061 7179 };
4062 7180 if (typeof document !== "undefined") {
4063 - registerDocument5(document);
7181 + registerDocument16(document);
4064 7182 }
4065 7183 return globalScope.__wpStyleRuntime;
4066 7184 }
4067 - function documentContainsStyleHash5(targetDocument, hash) {
7185 + function documentContainsStyleHash16(targetDocument, hash) {
4068 7186 if (!targetDocument.head) {
4069 7187 return false;
4070 7188 }
4071 7189 for (const style of targetDocument.head.querySelectorAll(
4072 - `style[${STYLE_HASH_ATTRIBUTE5}]`
7190 + `style[${STYLE_HASH_ATTRIBUTE16}]`
4073 7191 )) {
4074 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
7192 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) {
4075 7193 return true;
4076 7194 }
4077 7195 }
4078 7196 return false;
4079 7197 }
4080 - function injectStyle5(targetDocument, hash, css) {
7198 + function injectStyle16(targetDocument, hash, css) {
4081 7199 if (!targetDocument.head) {
4082 7200 return;
4083 7201 }
4084 - const runtime = getRuntime5();
7202 + const runtime = getRuntime16();
4085 7203 let injectedStyles = runtime.injectedStyles.get(targetDocument);
4086 7204 if (!injectedStyles) {
4087 7205 injectedStyles = /* @__PURE__ */ new Set();
4088 7206 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -4089,26 +7207,26 @@
4089 7207 }
4090 7208 if (injectedStyles.has(hash)) {
4091 7209 return;
4092 7210 }
4093 - if (documentContainsStyleHash5(targetDocument, hash)) {
7211 + if (documentContainsStyleHash16(targetDocument, hash)) {
4094 7212 injectedStyles.add(hash);
4095 7213 return;
4096 7214 }
4097 7215 const style = targetDocument.createElement("style");
4098 - style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
7216 + style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash);
4099 7217 style.appendChild(targetDocument.createTextNode(css));
4100 7218 targetDocument.head.appendChild(style);
4101 7219 injectedStyles.add(hash);
4102 7220 }
4103 - function registerDocument5(targetDocument) {
4104 - const runtime = getRuntime5();
7221 + function registerDocument16(targetDocument) {
7222 + const runtime = getRuntime16();
4105 7223 runtime.documents.set(
4106 7224 targetDocument,
4107 7225 (runtime.documents.get(targetDocument) ?? 0) + 1
4108 7226 );
4109 7227 for (const [hash, css] of runtime.styles) {
4110 - injectStyle5(targetDocument, hash, css);
7228 + injectStyle16(targetDocument, hash, css);
4111 7229 }
4112 7230 return () => {
4113 7231 const count = runtime.documents.get(targetDocument);
4114 7232 if (count === void 0) {
@@ -4120,33 +7238,33 @@
4120 7238 }
4121 7239 runtime.documents.set(targetDocument, count - 1);
4122 7240 };
4123 7241 }
4124 - function registerStyle5(hash, css) {
4125 - const runtime = getRuntime5();
7242 + function registerStyle16(hash, css) {
7243 + const runtime = getRuntime16();
4126 7244 runtime.styles.set(hash, css);
4127 7245 for (const targetDocument of runtime.documents.keys()) {
4128 - injectStyle5(targetDocument, hash, css);
7246 + injectStyle16(targetDocument, hash, css);
4129 7247 }
4130 7248 }
4131 7249 if (typeof process === "undefined" || true) {
4132 - registerStyle5("af6d9984a6", "._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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}");
7250 + registerStyle16("e8e31009f5", "._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);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&: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,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-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,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-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 transparent)}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-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));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 transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
4133 7251 }
4134 - var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
7252 + var global_css_defense_default6 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
4135 7253 if (typeof process === "undefined" || true) {
4136 - registerStyle5("2ffedd8246", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._64de9947bf305b7a__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--focus-color:var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color);outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--focus-color:var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color);outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
7254 + registerStyle16("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
4137 7255 }
4138 - var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-within-visible": "_64de9947bf305b7a__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
4139 - var Panel = (0, import_element9.forwardRef)(
7256 + var focus_module_default3 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
7257 + var Panel = (0, import_element23.forwardRef)(
4140 7258 function TabPanel({ className, ...otherProps }, forwardedRef) {
4141 7259 useRegisterPanel();
4142 - return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4143 - index_parts_exports.Panel,
7260 + return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
7261 + index_parts_exports2.Panel,
4144 7262 {
4145 7263 ref: forwardedRef,
4146 7264 className: clsx_default(
4147 - global_css_defense_default2.div,
4148 - focus_module_default2["outset-ring--focus-visible"],
7265 + global_css_defense_default6.div,
7266 + focus_module_default3["outset-ring--focus-visible"],
4149 7267 className
4150 7268 ),
4151 7269 ...otherProps
4152 7270 }
@@ -4154,21 +7272,21 @@
4154 7272 }
4155 7273 );
4156 7274
4157 7275 // packages/ui/build-module/tabs/root.mjs
4158 - var import_element10 = __toESM(require_element(), 1);
4159 - var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
4160 - var Root = (0, import_element10.forwardRef)(
7276 + var import_element24 = __toESM(require_element(), 1);
7277 + var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
7278 + var Root3 = (0, import_element24.forwardRef)(
4161 7279 function TabsRoot3({ ...otherProps }, forwardedRef) {
4162 - return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...otherProps }) }) });
7280 + return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(index_parts_exports2.Root, { ref: forwardedRef, ...otherProps }) }) });
4163 7281 }
4164 7282 );
4165 7283
4166 7284 // packages/ui/build-module/tabs/tab.mjs
4167 - var import_element11 = __toESM(require_element(), 1);
4168 - var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4169 - var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
4170 - function getRuntime6() {
7285 + var import_element25 = __toESM(require_element(), 1);
7286 + var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
7287 + var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash";
7288 + function getRuntime17() {
4171 7289 const globalScope = globalThis;
4172 7290 if (globalScope.__wpStyleRuntime) {
4173 7291 return globalScope.__wpStyleRuntime;
4174 7292 }
@@ -4177,30 +7295,30 @@
4177 7295 styles: /* @__PURE__ */ new Map(),
4178 7296 injectedStyles: /* @__PURE__ */ new WeakMap()
4179 7297 };
4180 7298 if (typeof document !== "undefined") {
4181 - registerDocument6(document);
7299 + registerDocument17(document);
4182 7300 }
4183 7301 return globalScope.__wpStyleRuntime;
4184 7302 }
4185 - function documentContainsStyleHash6(targetDocument, hash) {
7303 + function documentContainsStyleHash17(targetDocument, hash) {
4186 7304 if (!targetDocument.head) {
4187 7305 return false;
4188 7306 }
4189 7307 for (const style of targetDocument.head.querySelectorAll(
4190 - `style[${STYLE_HASH_ATTRIBUTE6}]`
7308 + `style[${STYLE_HASH_ATTRIBUTE17}]`
4191 7309 )) {
4192 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
7310 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) {
4193 7311 return true;
4194 7312 }
4195 7313 }
4196 7314 return false;
4197 7315 }
4198 - function injectStyle6(targetDocument, hash, css) {
7316 + function injectStyle17(targetDocument, hash, css) {
4199 7317 if (!targetDocument.head) {
4200 7318 return;
4201 7319 }
4202 - const runtime = getRuntime6();
7320 + const runtime = getRuntime17();
4203 7321 let injectedStyles = runtime.injectedStyles.get(targetDocument);
4204 7322 if (!injectedStyles) {
4205 7323 injectedStyles = /* @__PURE__ */ new Set();
4206 7324 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -4207,26 +7325,26 @@
4207 7325 }
4208 7326 if (injectedStyles.has(hash)) {
4209 7327 return;
4210 7328 }
4211 - if (documentContainsStyleHash6(targetDocument, hash)) {
7329 + if (documentContainsStyleHash17(targetDocument, hash)) {
4212 7330 injectedStyles.add(hash);
4213 7331 return;
4214 7332 }
4215 7333 const style = targetDocument.createElement("style");
4216 - style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
7334 + style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash);
4217 7335 style.appendChild(targetDocument.createTextNode(css));
4218 7336 targetDocument.head.appendChild(style);
4219 7337 injectedStyles.add(hash);
4220 7338 }
4221 - function registerDocument6(targetDocument) {
4222 - const runtime = getRuntime6();
7339 + function registerDocument17(targetDocument) {
7340 + const runtime = getRuntime17();
4223 7341 runtime.documents.set(
4224 7342 targetDocument,
4225 7343 (runtime.documents.get(targetDocument) ?? 0) + 1
4226 7344 );
4227 7345 for (const [hash, css] of runtime.styles) {
4228 - injectStyle6(targetDocument, hash, css);
7346 + injectStyle17(targetDocument, hash, css);
4229 7347 }
4230 7348 return () => {
4231 7349 const count = runtime.documents.get(targetDocument);
4232 7350 if (count === void 0) {
@@ -4238,30 +7356,30 @@
4238 7356 }
4239 7357 runtime.documents.set(targetDocument, count - 1);
4240 7358 };
4241 7359 }
4242 - function registerStyle6(hash, css) {
4243 - const runtime = getRuntime6();
7360 + function registerStyle17(hash, css) {
7361 + const runtime = getRuntime17();
4244 7362 runtime.styles.set(hash, css);
4245 7363 for (const targetDocument of runtime.documents.keys()) {
4246 - injectStyle6(targetDocument, hash, css);
7364 + injectStyle17(targetDocument, hash, css);
4247 7365 }
4248 7366 }
4249 7367 if (typeof process === "undefined" || true) {
4250 - registerStyle6("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
7368 + registerStyle17("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
4251 7369 }
4252 - var style_default5 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
4253 - var Tab = (0, import_element11.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
7370 + var style_default11 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
7371 + var Tab = (0, import_element25.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
4254 7372 useRegisterTab();
4255 - return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4256 - index_parts_exports.Tab,
7373 + return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
7374 + index_parts_exports2.Tab,
4257 7375 {
4258 7376 ref: forwardedRef,
4259 - className: clsx_default(style_default5.tab, className),
7377 + className: clsx_default(style_default11.tab, className),
4260 7378 ...otherProps,
4261 7379 children: [
4262 - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: style_default5["tab-children"], children }),
4263 - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { icon: chevron_right_default, className: style_default5["tab-chevron"] })
7380 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: style_default11["tab-children"], children }),
7381 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: chevron_right_default, className: style_default11["tab-chevron"] })
4264 7382 ]
4265 7383 }
4266 7384 );
4267 7385 });
@@ -4266,16 +7384,16 @@
4266 7384 );
4267 7385 });
4268 7386
4269 7387 // packages/format-library/build-module/image/index.mjs
4270 - var import_i18n5 = __toESM(require_i18n(), 1);
4271 - var import_element12 = __toESM(require_element(), 1);
7388 + var import_i18n7 = __toESM(require_i18n(), 1);
7389 + var import_element26 = __toESM(require_element(), 1);
4272 7390 var import_rich_text3 = __toESM(require_rich_text(), 1);
4273 7391 var import_block_editor3 = __toESM(require_block_editor(), 1);
4274 - var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
7392 + var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
4275 7393 var ALLOWED_MEDIA_TYPES = ["image"];
4276 7394 var name3 = "core/image";
4277 - var title3 = (0, import_i18n5.__)("Inline image");
7395 + var title3 = (0, import_i18n7.__)("Inline image");
4278 7396 function getCurrentImageId(activeObjectAttributes) {
4279 7397 if (!activeObjectAttributes?.className) {
4280 7398 return void 0;
4281 7399 }
@@ -4284,9 +7402,9 @@
4284 7402 }
4285 7403 var image = {
4286 7404 name: name3,
4287 7405 title: title3,
4288 - keywords: [(0, import_i18n5.__)("photo"), (0, import_i18n5.__)("media")],
7406 + keywords: [(0, import_i18n7.__)("photo"), (0, import_i18n7.__)("media")],
4289 7407 object: true,
4290 7408 tagName: "img",
4291 7409 className: null,
4292 7410 attributes: {
@@ -4296,25 +7414,32 @@
4296 7414 alt: "alt"
4297 7415 },
4298 7416 edit: Edit
4299 7417 };
4300 - function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) {
4301 - const { style, alt } = activeObjectAttributes;
7418 + function InlineUI({
7419 + value,
7420 + onChange,
7421 + activeObjectAttributes,
7422 + contentRef
7423 + }) {
7424 + const style = activeObjectAttributes?.style;
7425 + const alt = activeObjectAttributes?.alt;
4302 7426 const width = style?.replace(/\D/g, "");
4303 - const [editedWidth, setEditedWidth] = (0, import_element12.useState)(width);
4304 - const [editedAlt, setEditedAlt] = (0, import_element12.useState)(alt);
7427 + const [editedWidth, setEditedWidth] = (0, import_element26.useState)(width);
7428 + const [editedAlt, setEditedAlt] = (0, import_element26.useState)(alt);
4305 7429 const hasChanged = editedWidth !== width || editedAlt !== alt;
4306 7430 const popoverAnchor = (0, import_rich_text3.useAnchor)({
7431 + // eslint-disable-next-line react-hooks/refs
4307 7432 editableContentElement: contentRef.current,
4308 7433 settings: image
4309 7434 });
4310 - return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7435 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4311 7436 import_components.Popover,
4312 7437 {
4313 7438 focusOnMount: false,
4314 7439 anchor: popoverAnchor,
4315 7440 className: "block-editor-format-toolbar__image-popover",
4316 - children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7441 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4317 7442 "form",
4318 7443 {
4319 7444 className: "block-editor-format-toolbar__image-container-content",
4320 7445 onSubmit: (event) => {
@@ -4323,9 +7448,9 @@
4323 7448 type: name3,
4324 7449 attributes: {
4325 7450 ...activeObjectAttributes,
4326 7451 style: editedWidth ? `width: ${editedWidth}px;` : "",
4327 - alt: editedAlt
7452 + alt: editedAlt ?? ""
4328 7453 }
4329 7454 };
4330 7455 onChange({
4331 7456 ...value,
@@ -4332,13 +7457,13 @@
4332 7457 replacements: newReplacements
4333 7458 });
4334 7459 event.preventDefault();
4335 7460 },
4336 - children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Stack, { direction: "column", gap: "lg", children: [
4337 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7461 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { direction: "column", gap: "lg", children: [
7462 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4338 7463 import_components.__experimentalNumberControl,
4339 7464 {
4340 - label: (0, import_i18n5.__)("Width"),
7465 + label: (0, import_i18n7.__)("Width"),
4341 7466 value: editedWidth,
4342 7467 min: 1,
4343 7468 onChange: (newWidth) => {
4344 7469 setEditedWidth(newWidth);
@@ -4344,38 +7469,38 @@
4344 7469 setEditedWidth(newWidth);
4345 7470 }
4346 7471 }
4347 7472 ),
4348 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7473 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4349 7474 import_components.TextareaControl,
4350 7475 {
4351 - label: (0, import_i18n5.__)("Alternative text"),
4352 - value: editedAlt,
7476 + label: (0, import_i18n7.__)("Alternative text"),
7477 + value: editedAlt ?? "",
4353 7478 onChange: (newAlt) => {
4354 7479 setEditedAlt(newAlt);
4355 7480 },
4356 - help: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
4357 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7481 + help: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
7482 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4358 7483 Link,
4359 7484 {
4360 7485 openInNewTab: true,
4361 7486 href: (
4362 7487 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
4363 - (0, import_i18n5.__)(
7488 + (0, import_i18n7.__)(
4364 7489 "https://www.w3.org/WAI/tutorials/images/decision-tree/"
4365 7490 )
4366 7491 ),
4367 - children: (0, import_i18n5.__)(
7492 + children: (0, import_i18n7.__)(
4368 7493 "Describe the purpose of the image."
4369 7494 )
4370 7495 }
4371 7496 ),
4372 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("br", {}),
4373 - (0, import_i18n5.__)("Leave empty if decorative.")
7497 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("br", {}),
7498 + (0, import_i18n7.__)("Leave empty if decorative.")
4374 7499 ] })
4375 7500 }
4376 7501 ),
4377 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7502 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4378 7503 import_components.Button,
4379 7504 {
4380 7505 disabled: !hasChanged,
4381 7506 accessibleWhenDisabled: true,
@@ -4381,9 +7506,9 @@
4381 7506 accessibleWhenDisabled: true,
4382 7507 variant: "primary",
4383 7508 type: "submit",
4384 7509 size: "compact",
4385 - children: (0, import_i18n5.__)("Apply")
7510 + children: (0, import_i18n7.__)("Apply")
4386 7511 }
4387 7512 ) })
4388 7513 ] })
4389 7514 }
@@ -4398,15 +7523,20 @@
4398 7523 isObjectActive,
4399 7524 activeObjectAttributes,
4400 7525 contentRef
4401 7526 }) {
4402 - return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
4403 - /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7527 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
7528 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4404 7529 import_block_editor3.MediaUpload,
4405 7530 {
4406 7531 allowedTypes: ALLOWED_MEDIA_TYPES,
4407 7532 value: getCurrentImageId(activeObjectAttributes),
4408 - onSelect: ({ id, url, alt, width: imgWidth }) => {
7533 + onSelect: ({
7534 + id,
7535 + url,
7536 + alt,
7537 + width: imgWidth
7538 + }) => {
4409 7539 onChange(
4410 7540 (0, import_rich_text3.insertObject)(value, {
4411 7541 type: name3,
4412 7542 attributes: {
@@ -4421,13 +7551,13 @@
4421 7551 })
4422 7552 );
4423 7553 onFocus();
4424 7554 },
4425 - render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7555 + render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4426 7556 import_block_editor3.RichTextToolbarButton,
4427 7557 {
4428 7558 icon: inline_image_default,
4429 - title: isObjectActive ? (0, import_i18n5.__)("Replace image") : title3,
7559 + title: isObjectActive ? (0, import_i18n7.__)("Replace image") : title3,
4430 7560 onClick: open,
4431 7561 isActive: isObjectActive
4432 7562 }
4433 7563 )
@@ -4432,9 +7562,9 @@
4432 7562 }
4433 7563 )
4434 7564 }
4435 7565 ),
4436 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
7566 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4437 7567 InlineUI,
4438 7568 {
4439 7569 value,
4440 7570 onChange,
@@ -4445,29 +7575,35 @@
4445 7575 ] });
4446 7576 }
4447 7577
4448 7578 // packages/format-library/build-module/italic/index.mjs
4449 - var import_i18n6 = __toESM(require_i18n(), 1);
7579 + var import_i18n8 = __toESM(require_i18n(), 1);
4450 7580 var import_rich_text4 = __toESM(require_rich_text(), 1);
4451 7581 var import_block_editor4 = __toESM(require_block_editor(), 1);
4452 - var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
7582 + var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
4453 7583 var name4 = "core/italic";
4454 - var title4 = (0, import_i18n6.__)("Italic");
7584 + var title4 = (0, import_i18n8.__)("Italic");
4455 7585 var italic = {
4456 7586 name: name4,
4457 7587 title: title4,
4458 7588 tagName: "em",
4459 7589 className: null,
4460 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
7590 + edit({
7591 + isActive,
7592 + value,
7593 + onChange,
7594 + onFocus,
7595 + isVisible = true
7596 + }) {
4461 7597 function onToggle() {
4462 7598 onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
4463 7599 }
4464 7600 function onClick() {
4465 - onChange((0, import_rich_text4.toggleFormat)(value, { type: name4 }));
7601 + onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
4466 7602 onFocus();
4467 7603 }
4468 - return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4469 - /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7604 + return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
7605 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4470 7606 import_block_editor4.RichTextShortcut,
4471 7607 {
4472 7608 type: "primary",
4473 7609 character: "i",
@@ -4473,9 +7609,9 @@
4473 7609 character: "i",
4474 7610 onUse: onToggle
4475 7611 }
4476 7612 ),
4477 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7613 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4478 7614 import_block_editor4.RichTextToolbarButton,
4479 7615 {
4480 7616 name: "italic",
4481 7617 icon: format_italic_default,
@@ -4485,9 +7621,9 @@
4485 7621 shortcutType: "primary",
4486 7622 shortcutCharacter: "i"
4487 7623 }
4488 7624 ),
4489 - /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7625 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4490 7626 import_block_editor4.__unstableRichTextInputEvent,
4491 7627 {
4492 7628 inputType: "formatItalic",
4493 7629 onInput: onToggle
@@ -4497,10 +7633,10 @@
4497 7633 }
4498 7634 };
4499 7635
4500 7636 // packages/format-library/build-module/link/index.mjs
4501 - var import_i18n9 = __toESM(require_i18n(), 1);
4502 - var import_element15 = __toESM(require_element(), 1);
7637 + var import_i18n11 = __toESM(require_i18n(), 1);
7638 + var import_element29 = __toESM(require_element(), 1);
4503 7639 var import_rich_text6 = __toESM(require_rich_text(), 1);
4504 7640 var import_url3 = __toESM(require_url(), 1);
4505 7641 var import_block_editor6 = __toESM(require_block_editor(), 1);
4506 7642 var import_html_entities = __toESM(require_html_entities(), 1);
@@ -4506,10 +7642,10 @@
4506 7642 var import_html_entities = __toESM(require_html_entities(), 1);
4507 7643 var import_a11y2 = __toESM(require_a11y(), 1);
4508 7644
4509 7645 // packages/format-library/build-module/link/inline.mjs
4510 - var import_element14 = __toESM(require_element(), 1);
4511 - var import_i18n8 = __toESM(require_i18n(), 1);
7646 + var import_element28 = __toESM(require_element(), 1);
7647 + var import_i18n10 = __toESM(require_i18n(), 1);
4512 7648 var import_a11y = __toESM(require_a11y(), 1);
4513 7649 var import_components3 = __toESM(require_components(), 1);
4514 7650 var import_url2 = __toESM(require_url(), 1);
4515 7651 var import_rich_text5 = __toESM(require_rich_text(), 1);
@@ -4527,9 +7663,9 @@
4527 7663 return false;
4528 7664 }
4529 7665 if (/^\S+:/.test(trimmedHref)) {
4530 7666 const protocol = (0, import_url.getProtocol)(trimmedHref);
4531 - if (!(0, import_url.isValidProtocol)(protocol)) {
7667 + if (!protocol || !(0, import_url.isValidProtocol)(protocol)) {
4532 7668 return false;
4533 7669 }
4534 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
4535 7671 return false;
@@ -4534,9 +7670,9 @@
4534 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
4535 7671 return false;
4536 7672 }
4537 7673 const authority = (0, import_url.getAuthority)(trimmedHref);
4538 - if (!(0, import_url.isValidAuthority)(authority)) {
7674 + if (!authority || !(0, import_url.isValidAuthority)(authority)) {
4539 7675 return false;
4540 7676 }
4541 7677 const path = (0, import_url.getPath)(trimmedHref);
4542 7678 if (path && !(0, import_url.isValidPath)(path)) {
@@ -4621,12 +7757,11 @@
4621 7757 initialIndex = endIndex - 1;
4622 7758 } else {
4623 7759 return EMPTY_BOUNDARIES;
4624 7760 }
4625 - const index = newFormats[initialIndex].indexOf(targetFormat);
4626 - const walkingArgs = [newFormats, initialIndex, targetFormat, index];
4627 - startIndex = walkToStart(...walkingArgs);
4628 - endIndex = walkToEnd(...walkingArgs);
7761 + const index2 = newFormats[initialIndex].indexOf(targetFormat);
7762 + startIndex = walkToStart(newFormats, initialIndex, targetFormat, index2);
7763 + endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index2);
4629 7764 startIndex = startIndex < 0 ? 0 : startIndex;
4630 7765 return {
4631 7766 start: startIndex,
4632 7767 end: endIndex + 1
@@ -4632,9 +7767,9 @@
4632 7767 end: endIndex + 1
4633 7768 };
4634 7769 }
4635 7770 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) {
4636 - let index = initialIndex;
7771 + let index2 = initialIndex;
4637 7772 const directions = {
4638 7773 forwards: 1,
4639 7774 backwards: -1
4640 7775 };
@@ -4639,28 +7774,31 @@
4639 7774 backwards: -1
4640 7775 };
4641 7776 const directionIncrement = directions[direction] || 1;
4642 7777 const inverseDirectionIncrement = directionIncrement * -1;
4643 - while (formats[index] && formats[index][formatIndex] === targetFormatRef) {
4644 - index = index + directionIncrement;
7778 + while (formats[index2] && formats[index2][formatIndex] === targetFormatRef) {
7779 + index2 = index2 + directionIncrement;
4645 7780 }
4646 - index = index + inverseDirectionIncrement;
4647 - return index;
7781 + index2 = index2 + inverseDirectionIncrement;
7782 + return index2;
4648 7783 }
4649 - var partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
4650 - var walkToStart = partialRight(walkToBoundary, "backwards");
4651 - var walkToEnd = partialRight(walkToBoundary, "forwards");
7784 + var walkToStart = (...args) => walkToBoundary(...args, "backwards");
7785 + var walkToEnd = (...args) => walkToBoundary(...args, "forwards");
4652 7786
4653 7787 // packages/format-library/build-module/link/css-classes-setting.mjs
4654 - var import_element13 = __toESM(require_element(), 1);
4655 - var import_compose2 = __toESM(require_compose(), 1);
4656 - var import_i18n7 = __toESM(require_i18n(), 1);
7788 + var import_element27 = __toESM(require_element(), 1);
7789 + var import_compose4 = __toESM(require_compose(), 1);
7790 + var import_i18n9 = __toESM(require_i18n(), 1);
4657 7791 var import_components2 = __toESM(require_components(), 1);
4658 - var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
4659 - var CSSClassesSettingComponent = ({ setting, value, onChange }) => {
4660 - const hasValue = value ? value?.cssClasses?.length > 0 : false;
4661 - const [isSettingActive, setIsSettingActive] = (0, import_element13.useState)(hasValue);
4662 - const instanceId = (0, import_compose2.useInstanceId)(CSSClassesSettingComponent);
7792 + var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
7793 + var CSSClassesSettingComponent = ({
7794 + setting,
7795 + value,
7796 + onChange
7797 + }) => {
7798 + const hasValue = !!value?.cssClasses?.length;
7799 + const [isSettingActive, setIsSettingActive] = (0, import_element27.useState)(hasValue);
7800 + const instanceId = (0, import_compose4.useInstanceId)(CSSClassesSettingComponent);
4663 7801 const controlledRegionId = `css-classes-setting-${instanceId}`;
4664 7802 const handleSettingChange = (newValue) => {
4665 7803 const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue;
4666 7804 onChange({
@@ -4677,12 +7815,12 @@
4677 7815 } else {
4678 7816 setIsSettingActive(true);
4679 7817 }
4680 7818 };
4681 - return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("fieldset", { children: [
4682 - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", {}), children: setting.title }),
4683 - /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Stack, { direction: "column", gap: "md", children: [
4684 - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7819 + return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("fieldset", { children: [
7820 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("legend", {}), children: setting.title }),
7821 + /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { direction: "column", gap: "md", children: [
7822 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4685 7823 import_components2.CheckboxControl,
4686 7824 {
4687 7825 label: setting.title,
4688 7826 onChange: handleCheckboxChange,
@@ -4690,15 +7828,15 @@
4690 7828 "aria-expanded": isSettingActive,
4691 7829 "aria-controls": isSettingActive ? controlledRegionId : void 0
4692 7830 }
4693 7831 ),
4694 - isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7832 + isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4695 7833 import_components2.__experimentalInputControl,
4696 7834 {
4697 - label: (0, import_i18n7.__)("CSS classes"),
7835 + label: (0, import_i18n9.__)("CSS classes"),
4698 7836 value: value?.cssClasses,
4699 7837 onChange: handleSettingChange,
4700 - help: (0, import_i18n7.__)(
7838 + help: (0, import_i18n9.__)(
4701 7839 "Separate multiple classes with spaces."
4702 7840 ),
4703 7841 __unstableInputWidth: "100%"
4704 7842 }
@@ -4708,28 +7846,26 @@
4708 7846 };
4709 7847 var css_classes_setting_default = CSSClassesSettingComponent;
4710 7848
4711 7849 // packages/format-library/build-module/link/inline.mjs
4712 - var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
7850 + var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
4713 7851 var LINK_SETTINGS = [
4714 7852 ...import_block_editor5.LinkControl.DEFAULT_LINK_SETTINGS,
4715 7853 {
4716 7854 id: "nofollow",
4717 - title: (0, import_i18n8.__)("Mark as nofollow")
7855 + title: (0, import_i18n10.__)("Mark as nofollow")
4718 7856 },
4719 7857 {
4720 7858 id: "cssClasses",
4721 - title: (0, import_i18n8.__)("Additional CSS class(es)"),
4722 - render: (setting, value, onChange) => {
4723 - return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4724 - css_classes_setting_default,
4725 - {
4726 - setting,
4727 - value,
4728 - onChange
4729 - }
4730 - );
4731 - }
7859 + title: (0, import_i18n10.__)("Additional CSS class(es)"),
7860 + render: (setting, value, onChange) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7861 + css_classes_setting_default,
7862 + {
7863 + setting,
7864 + value,
7865 + onChange
7866 + }
7867 + )
4732 7868 }
4733 7869 ];
4734 7870 function InlineLinkUI({
4735 7871 isActive,
@@ -4755,9 +7891,9 @@
4755 7891 };
4756 7892 },
4757 7893 []
4758 7894 );
4759 - const linkValue = (0, import_element14.useMemo)(
7895 + const linkValue = (0, import_element28.useMemo)(
4760 7896 () => ({
4761 7897 url: activeAttributes.url,
4762 7898 type: activeAttributes.type,
4763 7899 id: activeAttributes.id,
@@ -4779,9 +7915,9 @@
4779 7915 function removeLink() {
4780 7916 const newValue = (0, import_rich_text5.removeFormat)(value, "core/link");
4781 7917 onChange(newValue);
4782 7918 stopAddingLink();
4783 - (0, import_a11y.speak)((0, import_i18n8.__)("Link removed."), "assertive");
7919 + (0, import_a11y.speak)((0, import_i18n10.__)("Link removed."), "assertive");
4784 7920 }
4785 7921 function onChangeLink(nextValue) {
4786 7922 const hasLink = linkValue?.url;
4787 7923 const isNewLink = !hasLink;
@@ -4788,9 +7924,9 @@
4788 7924 nextValue = {
4789 7925 ...linkValue,
4790 7926 ...nextValue
4791 7927 };
4792 - const newUrl = (0, import_url2.prependHTTPS)(nextValue.url);
7928 + const newUrl = (0, import_url2.prependHTTPS)(nextValue?.url ?? "");
4793 7929 const linkFormat = createLinkFormat({
4794 7930 url: newUrl,
4795 7931 type: nextValue.type,
4796 7932 id: nextValue.id !== void 0 && nextValue.id !== null ? String(nextValue.id) : void 0,
@@ -4831,13 +7967,13 @@
4831 7967 newValue = (0, import_rich_text5.applyFormat)(newValue, linkFormat, 0, newText.length);
4832 7968 const boundary = getFormatBoundary(value, {
4833 7969 type: "core/link"
4834 7970 });
4835 - const [valBefore, valAfter] = (0, import_rich_text5.split)(
4836 - value,
4837 - boundary.start,
4838 - boundary.start
4839 - );
7971 + const splitValue = (0, import_rich_text5.split)(value, boundary.start, boundary.start);
7972 + if (!splitValue) {
7973 + return;
7974 + }
7975 + const [valBefore, valAfter] = splitValue;
4840 7976 const newValAfter = (0, import_rich_text5.replace)(valAfter, richTextText, newValue);
4841 7977 newValue = (0, import_rich_text5.concat)(valBefore, newValAfter);
4842 7978 }
4843 7979 onChange(newValue);
@@ -4845,25 +7981,24 @@
4845 7981 stopAddingLink();
4846 7982 }
4847 7983 if (!isValidHref(newUrl)) {
4848 7984 (0, import_a11y.speak)(
4849 - (0, import_i18n8.__)(
7985 + (0, import_i18n10.__)(
4850 7986 "Warning: the link has been inserted but may have errors. Please test it."
4851 7987 ),
4852 7988 "assertive"
4853 7989 );
4854 7990 } else if (isActive) {
4855 - (0, import_a11y.speak)((0, import_i18n8.__)("Link edited."), "assertive");
7991 + (0, import_a11y.speak)((0, import_i18n10.__)("Link edited."), "assertive");
4856 7992 } else {
4857 - (0, import_a11y.speak)((0, import_i18n8.__)("Link inserted."), "assertive");
7993 + (0, import_a11y.speak)((0, import_i18n10.__)("Link inserted."), "assertive");
4858 7994 }
4859 7995 }
7996 + const anchorSettings = { ...link, isActive };
4860 7997 const popoverAnchor = (0, import_rich_text5.useAnchor)({
7998 + // eslint-disable-next-line react-hooks/refs
4861 7999 editableContentElement: contentRef.current,
4862 - settings: {
4863 - ...link,
4864 - isActive
4865 - }
8000 + settings: anchorSettings
4866 8001 });
4867 8002 async function handleCreate(pageTitle) {
4868 8003 const page = await createPageEntity({
4869 8004 title: pageTitle,
@@ -4877,18 +8012,18 @@
4877 8012 kind: "post-type"
4878 8013 };
4879 8014 }
4880 8015 function createButtonText(searchTerm) {
4881 - return (0, import_element14.createInterpolateElement)(
4882 - (0, import_i18n8.sprintf)(
8016 + return (0, import_element28.createInterpolateElement)(
8017 + (0, import_i18n10.sprintf)(
4883 8018 /* translators: %s: search term. */
4884 - (0, import_i18n8.__)("Create page: <mark>%s</mark>"),
8019 + (0, import_i18n10.__)("Create page: <mark>%s</mark>"),
4885 8020 searchTerm
4886 8021 ),
4887 - { mark: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("mark", {}) }
8022 + { mark: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("mark", {}) }
4888 8023 );
4889 8024 }
4890 - return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
8025 + return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4891 8026 import_components3.Popover,
4892 8027 {
4893 8028 anchor: popoverAnchor,
4894 8029 animate: false,
@@ -4898,9 +8033,9 @@
4898 8033 offset: 8,
4899 8034 shift: true,
4900 8035 focusOnMount,
4901 8036 constrainTabbing: true,
4902 - children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
8037 + children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4903 8038 import_block_editor5.LinkControl,
4904 8039 {
4905 8040 value: linkValue,
4906 8041 onChange: onChangeLink,
@@ -4931,10 +8066,10 @@
4931 8066 if (isActive) {
4932 8067 const boundary = getFormatBoundary(value, {
4933 8068 type: "core/link"
4934 8069 });
4935 - textStart = boundary.start;
4936 - textEnd = boundary.end;
8070 + textStart = boundary.start ?? value.start;
8071 + textEnd = boundary.end ?? value.end;
4937 8072 }
4938 8073 return (0, import_rich_text5.slice)(value, textStart, textEnd);
4939 8074 }
4940 8075 var inline_default = InlineLinkUI;
@@ -4939,11 +8074,11 @@
4939 8074 }
4940 8075 var inline_default = InlineLinkUI;
4941 8076
4942 8077 // packages/format-library/build-module/link/index.mjs
4943 - var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
8078 + var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
4944 8079 var name5 = "core/link";
4945 - var title5 = (0, import_i18n9.__)("Link");
8080 + var title5 = (0, import_i18n11.__)("Link");
4946 8081 function Edit2({
4947 8082 isActive,
4948 8083 activeAttributes,
4949 8084 value,
@@ -4951,22 +8086,24 @@
4951 8086 onFocus,
4952 8087 contentRef,
4953 8088 isVisible = true
4954 8089 }) {
4955 - const [addingLink, setAddingLink] = (0, import_element15.useState)(false);
4956 - const [openedBy, setOpenedBy] = (0, import_element15.useState)(null);
4957 - (0, import_element15.useEffect)(() => {
8090 + const [addingLink, setAddingLink] = (0, import_element29.useState)(false);
8091 + const [openedBy, setOpenedBy] = (0, import_element29.useState)(null);
8092 + (0, import_element29.useEffect)(() => {
4958 8093 if (!isActive) {
4959 8094 setAddingLink(false);
4960 8095 }
4961 8096 }, [isActive]);
4962 - (0, import_element15.useLayoutEffect)(() => {
8097 + (0, import_element29.useLayoutEffect)(() => {
4963 8098 const editableContentElement = contentRef.current;
4964 8099 if (!editableContentElement) {
4965 8100 return;
4966 8101 }
4967 8102 function handleClick(event) {
4968 - const link2 = event.target.closest("[contenteditable] a");
8103 + const link2 = event.target.closest(
8104 + "[contenteditable] a"
8105 + );
4969 8106 if (!link2 || // other formats (e.g. bold) may be nested within the link.
4970 8107 !isActive) {
4971 8108 return;
4972 8109 }
@@ -5029,14 +8166,14 @@
5029 8166 setOpenedBy(null);
5030 8167 }
5031 8168 function onRemoveFormat() {
5032 8169 onChange((0, import_rich_text6.removeFormat)(value, name5));
5033 - (0, import_a11y2.speak)((0, import_i18n9.__)("Link removed."), "assertive");
8170 + (0, import_a11y2.speak)((0, import_i18n11.__)("Link removed."), "assertive");
5034 8171 }
5035 8172 const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click");
5036 8173 const hasSelection = !(0, import_rich_text6.isCollapsed)(value);
5037 - return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
5038 - hasSelection && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8174 + return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
8175 + hasSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5039 8176 import_block_editor6.RichTextShortcut,
5040 8177 {
5041 8178 type: "primary",
5042 8179 character: "k",
@@ -5042,9 +8179,9 @@
5042 8179 character: "k",
5043 8180 onUse: addLink
5044 8181 }
5045 8182 ),
5046 - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8183 + /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5047 8184 import_block_editor6.RichTextShortcut,
5048 8185 {
5049 8186 type: "primaryShift",
5050 8187 character: "k",
@@ -5050,14 +8187,14 @@
5050 8187 character: "k",
5051 8188 onUse: onRemoveFormat
5052 8189 }
5053 8190 ),
5054 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8191 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5055 8192 import_block_editor6.RichTextToolbarButton,
5056 8193 {
5057 8194 name: "link",
5058 8195 icon: link_default,
5059 - title: isActive ? (0, import_i18n9.__)("Link") : title5,
8196 + title: isActive ? (0, import_i18n11.__)("Link") : title5,
5060 8197 onClick: (event) => {
5061 8198 addLink(event.currentTarget);
5062 8199 },
5063 8200 isActive: isActive || addingLink,
@@ -5066,9 +8203,9 @@
5066 8203 "aria-haspopup": "true",
5067 8204 "aria-expanded": addingLink
5068 8205 }
5069 8206 ),
5070 - isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8207 + isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5071 8208 inline_default,
5072 8209 {
5073 8210 stopAddingLink,
5074 8211 onFocusOutside,
@@ -5124,14 +8261,14 @@
5124 8261 edit: Edit2
5125 8262 };
5126 8263
5127 8264 // packages/format-library/build-module/strikethrough/index.mjs
5128 - var import_i18n10 = __toESM(require_i18n(), 1);
8265 + var import_i18n12 = __toESM(require_i18n(), 1);
5129 8266 var import_rich_text7 = __toESM(require_rich_text(), 1);
5130 8267 var import_block_editor7 = __toESM(require_block_editor(), 1);
5131 - var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
8268 + var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
5132 8269 var name6 = "core/strikethrough";
5133 - var title6 = (0, import_i18n10.__)("Strikethrough");
8270 + var title6 = (0, import_i18n12.__)("Strikethrough");
5134 8271 var strikethrough = {
5135 8272 name: name6,
5136 8273 title: title6,
5137 8274 tagName: "s",
@@ -5140,10 +8277,10 @@
5140 8277 function onClick() {
5141 8278 onChange((0, import_rich_text7.toggleFormat)(value, { type: name6, title: title6 }));
5142 8279 onFocus();
5143 8280 }
5144 - return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
5145 - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8281 + return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8282 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5146 8283 import_block_editor7.RichTextShortcut,
5147 8284 {
5148 8285 type: "access",
5149 8286 character: "d",
@@ -5149,9 +8286,9 @@
5149 8286 character: "d",
5150 8287 onUse: onClick
5151 8288 }
5152 8289 ),
5153 - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8290 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5154 8291 import_block_editor7.RichTextToolbarButton,
5155 8292 {
5156 8293 icon: format_strikethrough_default,
5157 8294 title: title6,
@@ -5164,14 +8301,14 @@
5164 8301 }
5165 8302 };
5166 8303
5167 8304 // packages/format-library/build-module/underline/index.mjs
5168 - var import_i18n11 = __toESM(require_i18n(), 1);
8305 + var import_i18n13 = __toESM(require_i18n(), 1);
5169 8306 var import_rich_text8 = __toESM(require_rich_text(), 1);
5170 8307 var import_block_editor8 = __toESM(require_block_editor(), 1);
5171 - var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
8308 + var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
5172 8309 var name7 = "core/underline";
5173 - var title7 = (0, import_i18n11.__)("Underline");
8310 + var title7 = (0, import_i18n13.__)("Underline");
5174 8311 var underline = {
5175 8312 name: name7,
5176 8313 title: title7,
5177 8314 tagName: "span",
@@ -5190,10 +8327,10 @@
5190 8327 title: title7
5191 8328 })
5192 8329 );
5193 8330 };
5194 - return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
5195 - /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
8331 + return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
8332 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5196 8333 import_block_editor8.RichTextShortcut,
5197 8334 {
5198 8335 type: "primary",
5199 8336 character: "u",
@@ -5199,9 +8336,9 @@
5199 8336 character: "u",
5200 8337 onUse: onToggle
5201 8338 }
5202 8339 ),
5203 - /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
8340 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5204 8341 import_block_editor8.__unstableRichTextInputEvent,
5205 8342 {
5206 8343 inputType: "formatUnderline",
5207 8344 onInput: onToggle
@@ -5211,38 +8348,41 @@
5211 8348 }
5212 8349 };
5213 8350
5214 8351 // packages/format-library/build-module/text-color/index.mjs
5215 - var import_i18n13 = __toESM(require_i18n(), 1);
5216 - var import_element17 = __toESM(require_element(), 1);
8352 + var import_i18n15 = __toESM(require_i18n(), 1);
8353 + var import_element31 = __toESM(require_element(), 1);
5217 8354 var import_block_editor10 = __toESM(require_block_editor(), 1);
5218 8355 var import_rich_text10 = __toESM(require_rich_text(), 1);
5219 8356
5220 8357 // packages/format-library/build-module/text-color/inline.mjs
5221 - var import_element16 = __toESM(require_element(), 1);
8358 + var import_element30 = __toESM(require_element(), 1);
5222 8359 var import_data2 = __toESM(require_data(), 1);
5223 8360 var import_rich_text9 = __toESM(require_rich_text(), 1);
5224 8361 var import_block_editor9 = __toESM(require_block_editor(), 1);
5225 8362 var import_components4 = __toESM(require_components(), 1);
5226 - var import_i18n12 = __toESM(require_i18n(), 1);
5227 - var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
8363 + var import_i18n14 = __toESM(require_i18n(), 1);
8364 + var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
5228 8365 var TABS = [
5229 - { name: "color", title: (0, import_i18n12.__)("Text") },
5230 - { name: "backgroundColor", title: (0, import_i18n12.__)("Background") }
8366 + { name: "color", title: (0, import_i18n14.__)("Text") },
8367 + { name: "backgroundColor", title: (0, import_i18n14.__)("Background") }
5231 8368 ];
5232 8369 function parseCSS(css = "") {
5233 - return css.split(";").reduce((accumulator, rule) => {
5234 - if (rule) {
5235 - const [property, value] = rule.split(":");
5236 - if (property === "color") {
5237 - accumulator.color = value;
8370 + return css.split(";").reduce(
8371 + (accumulator, rule) => {
8372 + if (rule) {
8373 + const [property, value] = rule.split(":");
8374 + if (property === "color") {
8375 + accumulator.color = value;
8376 + }
8377 + if (property === "background-color" && value !== transparentValue) {
8378 + accumulator.backgroundColor = value;
8379 + }
5238 8380 }
5239 - if (property === "background-color" && value !== transparentValue) {
5240 - accumulator.backgroundColor = value;
5241 - }
5242 - }
5243 - return accumulator;
5244 - }, {});
8381 + return accumulator;
8382 + },
8383 + {}
8384 + );
5245 8385 }
5246 8386 function parseClassName(className = "", colorSettings) {
5247 8387 return className.split(" ").reduce((accumulator, name16) => {
5248 8388 if (name16.startsWith("has-") && name16.endsWith("-color")) {
@@ -5261,10 +8401,10 @@
5261 8401 if (!activeColorFormat) {
5262 8402 return {};
5263 8403 }
5264 8404 return {
5265 - ...parseCSS(activeColorFormat.attributes.style),
5266 - ...parseClassName(activeColorFormat.attributes.class, colorSettings)
8405 + ...parseCSS(activeColorFormat.attributes?.style),
8406 + ...parseClassName(activeColorFormat.attributes?.class, colorSettings)
5267 8407 };
5268 8408 }
5269 8409 function setColors(value, name16, colorSettings, colors) {
5270 8410 const { color, backgroundColor } = {
@@ -5283,10 +8423,16 @@
5283 8423 styles.push(["background-color", transparentValue].join(":"));
5284 8424 }
5285 8425 if (color) {
5286 8426 const colorObject = (0, import_block_editor9.getColorObjectByColorValue)(colorSettings, color);
5287 - if (colorObject) {
5288 - classNames.push((0, import_block_editor9.getColorClassName)("color", colorObject.slug));
8427 + if (colorObject && colorObject.slug) {
8428 + const colorClassName = (0, import_block_editor9.getColorClassName)(
8429 + "color",
8430 + colorObject.slug
8431 + );
8432 + if (colorClassName) {
8433 + classNames.push(colorClassName);
8434 + }
5289 8435 } else {
5290 8436 styles.push(["color", color].join(":"));
5291 8437 }
5292 8438 }
@@ -5302,13 +8448,13 @@
5302 8448 const colors = (0, import_data2.useSelect)((select) => {
5303 8449 const { getSettings } = select(import_block_editor9.store);
5304 8450 return getSettings().colors ?? [];
5305 8451 }, []);
5306 - const activeColors = (0, import_element16.useMemo)(
8452 + const activeColors = (0, import_element30.useMemo)(
5307 8453 () => getActiveColors(value, name16, colors),
5308 8454 [name16, value, colors]
5309 8455 );
5310 - return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
8456 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5311 8457 import_block_editor9.ColorPalette,
5312 8458 {
5313 8459 value: activeColors[property],
5314 8460 onChange: (color) => {
@@ -5328,26 +8474,28 @@
5328 8474 onClose,
5329 8475 contentRef,
5330 8476 isActive
5331 8477 }) {
8478 + const anchorSettings = { ...textColor, isActive };
5332 8479 const popoverAnchor = (0, import_rich_text9.useAnchor)({
8480 + // eslint-disable-next-line react-hooks/refs
5333 8481 editableContentElement: contentRef.current,
5334 - settings: { ...textColor, isActive }
8482 + settings: anchorSettings
5335 8483 });
5336 - return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
8484 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5337 8485 import_components4.Popover,
5338 8486 {
5339 8487 onClose,
5340 8488 className: "format-library__inline-color-popover",
5341 8489 anchor: popoverAnchor,
5342 - children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [
5343 - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(tabs_exports.List, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(tabs_exports.Tab, { value: tab.name, children: tab.title }, tab.name)) }),
5344 - TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
8490 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [
8491 + /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.List, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.Tab, { value: tab.name, children: tab.title }, tab.name)) }),
8492 + TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5345 8493 tabs_exports.Panel,
5346 8494 {
5347 8495 value: tab.name,
5348 8496 tabIndex: -1,
5349 - children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
8497 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5350 8498 ColorPicker,
5351 8499 {
5352 8500 name: name16,
5353 8501 property: tab.name,
@@ -5363,18 +8511,18 @@
5363 8511 );
5364 8512 }
5365 8513
5366 8514 // packages/format-library/build-module/text-color/index.mjs
5367 - var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
8515 + var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
5368 8516 var transparentValue = "rgba(0, 0, 0, 0)";
5369 8517 var name8 = "core/text-color";
5370 - var title8 = (0, import_i18n13.__)("Highlight");
5371 - var EMPTY_ARRAY3 = [];
8518 + var title8 = (0, import_i18n15.__)("Highlight");
8519 + var EMPTY_ARRAY2 = [];
5372 8520 function getComputedStyleProperty(element, property) {
5373 8521 const { ownerDocument: ownerDocument2 } = element;
5374 8522 const { defaultView } = ownerDocument2;
5375 - const style = defaultView.getComputedStyle(element);
5376 - const value = style.getPropertyValue(property);
8523 + const style = defaultView?.getComputedStyle(element);
8524 + const value = style?.getPropertyValue(property);
5377 8525 if (property === "background-color" && value === transparentValue && element.parentElement) {
5378 8526 return getComputedStyleProperty(element.parentElement, property);
5379 8527 }
5380 8528 return value;
@@ -5379,9 +8527,9 @@
5379 8527 }
5380 8528 return value;
5381 8529 }
5382 8530 function fillComputedColors(element, { color, backgroundColor }) {
5383 - if (!color && !backgroundColor) {
8531 + if (!element || !color && !backgroundColor) {
5384 8532 return;
5385 8533 }
5386 8534 return {
5387 8535 color: color || getComputedStyleProperty(element, "color"),
@@ -5394,14 +8542,14 @@
5394 8542 isActive,
5395 8543 activeAttributes,
5396 8544 contentRef
5397 8545 }) {
5398 - const [allowCustomControl, colors = EMPTY_ARRAY3] = (0, import_block_editor10.useSettings)(
8546 + const [allowCustomControl, colors = EMPTY_ARRAY2] = (0, import_block_editor10.useSettings)(
5399 8547 "color.custom",
5400 8548 "color.palette"
5401 8549 );
5402 - const [isAddingColor, setIsAddingColor] = (0, import_element17.useState)(false);
5403 - const colorIndicatorStyle = (0, import_element17.useMemo)(
8550 + const [isAddingColor, setIsAddingColor] = (0, import_element31.useState)(false);
8551 + const colorIndicatorStyle = (0, import_element31.useMemo)(
5404 8552 () => fillComputedColors(
5405 8553 contentRef.current,
5406 8554 getActiveColors(value, name8, colors)
5407 8555 ),
@@ -5410,15 +8558,15 @@
5410 8558 const hasColorsToChoose = !!colors.length || allowCustomControl;
5411 8559 if (!hasColorsToChoose && !isActive) {
5412 8560 return null;
5413 8561 }
5414 - return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
5415 - /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8562 + return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
8563 + /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5416 8564 import_block_editor10.RichTextToolbarButton,
5417 8565 {
5418 8566 className: "format-library-text-color-button",
5419 8567 isActive,
5420 - icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8568 + icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5421 8569 icon_default,
5422 8570 {
5423 8571 icon: Object.keys(activeAttributes).length ? text_color_default : color_default,
5424 8572 style: colorIndicatorStyle
@@ -5428,14 +8576,13 @@
5428 8576 onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0, import_rich_text10.removeFormat)(value, name8)),
5429 8577 role: "menuitemcheckbox"
5430 8578 }
5431 8579 ),
5432 - isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8580 + isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5433 8581 InlineColorUI,
5434 8582 {
5435 8583 name: name8,
5436 8584 onClose: () => setIsAddingColor(false),
5437 - activeAttributes,
5438 8585 value,
5439 8586 onChange,
5440 8587 contentRef,
5441 8588 isActive
@@ -5455,14 +8602,14 @@
5455 8602 edit: TextColorEdit
5456 8603 };
5457 8604
5458 8605 // packages/format-library/build-module/subscript/index.mjs
5459 - var import_i18n14 = __toESM(require_i18n(), 1);
8606 + var import_i18n16 = __toESM(require_i18n(), 1);
5460 8607 var import_rich_text11 = __toESM(require_rich_text(), 1);
5461 8608 var import_block_editor11 = __toESM(require_block_editor(), 1);
5462 - var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
8609 + var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
5463 8610 var name9 = "core/subscript";
5464 - var title9 = (0, import_i18n14.__)("Subscript");
8611 + var title9 = (0, import_i18n16.__)("Subscript");
5465 8612 var subscript = {
5466 8613 name: name9,
5467 8614 title: title9,
5468 8615 tagName: "sub",
@@ -5474,9 +8621,9 @@
5474 8621 function onClick() {
5475 8622 onToggle();
5476 8623 onFocus();
5477 8624 }
5478 - return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8625 + return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
5479 8626 import_block_editor11.RichTextToolbarButton,
5480 8627 {
5481 8628 icon: subscript_default,
5482 8629 title: title9,
@@ -5488,14 +8635,14 @@
5488 8635 }
5489 8636 };
5490 8637
5491 8638 // packages/format-library/build-module/superscript/index.mjs
5492 - var import_i18n15 = __toESM(require_i18n(), 1);
8639 + var import_i18n17 = __toESM(require_i18n(), 1);
5493 8640 var import_rich_text12 = __toESM(require_rich_text(), 1);
5494 8641 var import_block_editor12 = __toESM(require_block_editor(), 1);
5495 - var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
8642 + var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
5496 8643 var name10 = "core/superscript";
5497 - var title10 = (0, import_i18n15.__)("Superscript");
8644 + var title10 = (0, import_i18n17.__)("Superscript");
5498 8645 var superscript = {
5499 8646 name: name10,
5500 8647 title: title10,
5501 8648 tagName: "sup",
@@ -5507,9 +8654,9 @@
5507 8654 function onClick() {
5508 8655 onToggle();
5509 8656 onFocus();
5510 8657 }
5511 - return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8658 + return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5512 8659 import_block_editor12.RichTextToolbarButton,
5513 8660 {
5514 8661 icon: superscript_default,
5515 8662 title: title10,
@@ -5521,14 +8668,14 @@
5521 8668 }
5522 8669 };
5523 8670
5524 8671 // packages/format-library/build-module/keyboard/index.mjs
5525 - var import_i18n16 = __toESM(require_i18n(), 1);
8672 + var import_i18n18 = __toESM(require_i18n(), 1);
5526 8673 var import_rich_text13 = __toESM(require_rich_text(), 1);
5527 8674 var import_block_editor13 = __toESM(require_block_editor(), 1);
5528 - var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
8675 + var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
5529 8676 var name11 = "core/keyboard";
5530 - var title11 = (0, import_i18n16.__)("Keyboard input");
8677 + var title11 = (0, import_i18n18.__)("Keyboard input");
5531 8678 var keyboard2 = {
5532 8679 name: name11,
5533 8680 title: title11,
5534 8681 tagName: "kbd",
@@ -5540,9 +8687,9 @@
5540 8687 function onClick() {
5541 8688 onToggle();
5542 8689 onFocus();
5543 8690 }
5544 - return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
8691 + return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5545 8692 import_block_editor13.RichTextToolbarButton,
5546 8693 {
5547 8694 icon: button_default,
5548 8695 title: title11,
@@ -5554,14 +8701,14 @@
5554 8701 }
5555 8702 };
5556 8703
5557 8704 // packages/format-library/build-module/unknown/index.mjs
5558 - var import_i18n17 = __toESM(require_i18n(), 1);
8705 + var import_i18n19 = __toESM(require_i18n(), 1);
5559 8706 var import_rich_text14 = __toESM(require_rich_text(), 1);
5560 8707 var import_block_editor14 = __toESM(require_block_editor(), 1);
5561 - var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
8708 + var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
5562 8709 var name12 = "core/unknown";
5563 - var title12 = (0, import_i18n17.__)("Clear Unknown Formatting");
8710 + var title12 = (0, import_i18n19.__)("Clear Unknown Formatting");
5564 8711 function selectionContainsUnknownFormats(value) {
5565 8712 if ((0, import_rich_text14.isCollapsed)(value)) {
5566 8713 return false;
5567 8714 }
@@ -5582,9 +8729,9 @@
5582 8729 function onClick() {
5583 8730 onChange((0, import_rich_text14.removeFormat)(value, name12));
5584 8731 onFocus();
5585 8732 }
5586 - return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
8733 + return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5587 8734 import_block_editor14.RichTextToolbarButton,
5588 8735 {
5589 8736 name: "unknown",
5590 8737 icon: help_default,
@@ -5596,16 +8743,16 @@
5596 8743 }
5597 8744 };
5598 8745
5599 8746 // packages/format-library/build-module/language/index.mjs
5600 - var import_i18n18 = __toESM(require_i18n(), 1);
8747 + var import_i18n20 = __toESM(require_i18n(), 1);
5601 8748 var import_block_editor15 = __toESM(require_block_editor(), 1);
5602 8749 var import_components5 = __toESM(require_components(), 1);
5603 - var import_element18 = __toESM(require_element(), 1);
8750 + var import_element32 = __toESM(require_element(), 1);
5604 8751 var import_rich_text15 = __toESM(require_rich_text(), 1);
5605 - var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
8752 + var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
5606 8753 var name13 = "core/language";
5607 - var title13 = (0, import_i18n18.__)("Language");
8754 + var title13 = (0, import_i18n20.__)("Language");
5608 8755 var language = {
5609 8756 name: name13,
5610 8757 title: title13,
5611 8758 tagName: "bdo",
@@ -5616,14 +8763,14 @@
5616 8763 },
5617 8764 edit: Edit3
5618 8765 };
5619 8766 function Edit3({ isActive, value, onChange, contentRef }) {
5620 - const [isPopoverVisible, setIsPopoverVisible] = (0, import_element18.useState)(false);
8767 + const [isPopoverVisible, setIsPopoverVisible] = (0, import_element32.useState)(false);
5621 8768 const togglePopover = () => {
5622 8769 setIsPopoverVisible((state) => !state);
5623 8770 };
5624 - return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
5625 - /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8771 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
8772 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5626 8773 import_block_editor15.RichTextToolbarButton,
5627 8774 {
5628 8775 icon: language_default,
5629 8776 label: title13,
@@ -5638,9 +8785,9 @@
5638 8785 isActive,
5639 8786 role: "menuitemcheckbox"
5640 8787 }
5641 8788 ),
5642 - isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8789 + isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5643 8790 InlineLanguageUI,
5644 8791 {
5645 8792 value,
5646 8793 onChange,
@@ -5649,25 +8796,31 @@
5649 8796 }
5650 8797 )
5651 8798 ] });
5652 8799 }
5653 - function InlineLanguageUI({ value, contentRef, onChange, onClose }) {
8800 + function InlineLanguageUI({
8801 + value,
8802 + contentRef,
8803 + onChange,
8804 + onClose
8805 + }) {
5654 8806 const popoverAnchor = (0, import_rich_text15.useAnchor)({
8807 + // eslint-disable-next-line react-hooks/refs
5655 8808 editableContentElement: contentRef.current,
5656 8809 settings: language
5657 8810 });
5658 - const [lang, setLang] = (0, import_element18.useState)("");
5659 - const [dir, setDir] = (0, import_element18.useState)("ltr");
5660 - return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8811 + const [lang, setLang] = (0, import_element32.useState)("");
8812 + const [dir, setDir] = (0, import_element32.useState)("ltr");
8813 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5661 8814 import_components5.Popover,
5662 8815 {
5663 8816 className: "block-editor-format-toolbar__language-popover",
5664 8817 anchor: popoverAnchor,
5665 8818 onClose,
5666 - children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
8819 + children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
5667 8820 Stack,
5668 8821 {
5669 - render: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("form", {}),
8822 + render: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("form", {}),
5670 8823 direction: "column",
5671 8824 gap: "lg",
5672 8825 className: "block-editor-format-toolbar__language-container-content",
5673 8826 onSubmit: (event) => {
@@ -5683,31 +8836,31 @@
5683 8836 );
5684 8837 onClose();
5685 8838 },
5686 8839 children: [
5687 - /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8840 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5688 8841 import_components5.TextControl,
5689 8842 {
5690 8843 label: title13,
5691 8844 value: lang,
5692 8845 onChange: (val) => setLang(val),
5693 - help: (0, import_i18n18.__)(
8846 + help: (0, import_i18n20.__)(
5694 8847 'A valid language attribute, like "en" or "fr".'
5695 8848 )
5696 8849 }
5697 8850 ),
5698 - /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8851 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5699 8852 import_components5.SelectControl,
5700 8853 {
5701 - label: (0, import_i18n18.__)("Text direction"),
8854 + label: (0, import_i18n20.__)("Text direction"),
5702 8855 value: dir,
5703 8856 options: [
5704 8857 {
5705 - label: (0, import_i18n18.__)("Left to right"),
8858 + label: (0, import_i18n20.__)("Left to right"),
5706 8859 value: "ltr"
5707 8860 },
5708 8861 {
5709 - label: (0, import_i18n18.__)("Right to left"),
8862 + label: (0, import_i18n20.__)("Right to left"),
5710 8863 value: "rtl"
5711 8864 }
5712 8865 ],
5713 8866 onChange: (val) => setDir(val)
@@ -5712,15 +8865,15 @@
5712 8865 ],
5713 8866 onChange: (val) => setDir(val)
5714 8867 }
5715 8868 ),
5716 - /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8869 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5717 8870 import_components5.Button,
5718 8871 {
5719 8872 __next40pxDefaultSize: true,
5720 8873 variant: "primary",
5721 8874 type: "submit",
5722 - text: (0, import_i18n18.__)("Apply")
8875 + text: (0, import_i18n20.__)("Apply")
5723 8876 }
5724 8877 ) })
5725 8878 ]
5726 8879 }
@@ -5729,26 +8882,16 @@
5729 8882 );
5730 8883 }
5731 8884
5732 8885 // packages/format-library/build-module/math/index.mjs
5733 - var import_i18n19 = __toESM(require_i18n(), 1);
5734 - var import_element19 = __toESM(require_element(), 1);
8886 + var import_i18n21 = __toESM(require_i18n(), 1);
8887 + var import_element33 = __toESM(require_element(), 1);
5735 8888 var import_rich_text16 = __toESM(require_rich_text(), 1);
5736 8889 var import_block_editor16 = __toESM(require_block_editor(), 1);
5737 8890 var import_components6 = __toESM(require_components(), 1);
5738 -
5739 - // packages/format-library/build-module/lock-unlock.mjs
5740 - var import_private_apis = __toESM(require_private_apis(), 1);
5741 - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
5742 - "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
5743 - "@wordpress/format-library"
5744 - );
5745 -
5746 - // packages/format-library/build-module/math/index.mjs
5747 - var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
5748 - var { ValidatedInputControl } = unlock(import_components6.privateApis);
8891 + var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
5749 8892 var name14 = "core/math";
5750 - var title14 = (0, import_i18n19.__)("Math");
8893 + var title14 = (0, import_i18n21.__)("Math");
5751 8894 function InlineUI2({
5752 8895 value,
5753 8896 onChange,
5754 8897 activeAttributes,
@@ -5754,14 +8897,15 @@
5754 8897 activeAttributes,
5755 8898 contentRef,
5756 8899 latexToMathML
5757 8900 }) {
5758 - const [latex, setLatex] = (0, import_element19.useState)(
8901 + const [latex, setLatex] = (0, import_element33.useState)(
5759 8902 activeAttributes?.["data-latex"] || ""
5760 8903 );
5761 - const [error2, setError] = (0, import_element19.useState)(null);
5762 - const formRef = (0, import_element19.useRef)();
8904 + const [error2, setError] = (0, import_element33.useState)(null);
8905 + const formRef = (0, import_element33.useRef)(null);
5763 8906 const popoverAnchor = (0, import_rich_text16.useAnchor)({
8907 + // eslint-disable-next-line react-hooks/refs
5764 8908 editableContentElement: contentRef.current,
5765 8909 settings: math
5766 8910 });
5767 8911 const handleLatexChange = (newLatex) => {
@@ -5771,9 +8915,11 @@
5771 8915 try {
5772 8916 mathML = latexToMathML(newLatex, { displayMode: false });
5773 8917 setError(null);
5774 8918 } catch (err) {
5775 - setError(err.message);
8919 + setError(
8920 + err instanceof Error ? err.message : (0, import_i18n21.__)("Could not parse the LaTeX math syntax.")
8921 + );
5776 8922 }
5777 8923 } else {
5778 8924 setError(null);
5779 8925 }
@@ -5789,9 +8935,9 @@
5789 8935 ...value,
5790 8936 replacements: newReplacements
5791 8937 });
5792 8938 };
5793 - return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8939 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5794 8940 import_components6.Popover,
5795 8941 {
5796 8942 placement: "bottom-start",
5797 8943 offset: 8,
@@ -5798,27 +8944,39 @@
5798 8944 focusOnMount: false,
5799 8945 anchor: popoverAnchor,
5800 8946 onFocusOutside: () => formRef.current?.reportValidity(),
5801 8947 className: "block-editor-format-toolbar__math-popover",
5802 - children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8948 + children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
5803 8949 "form",
5804 8950 {
5805 8951 ref: formRef,
5806 - style: { minWidth: "300px", padding: "4px" },
8952 + style: { minWidth: "300px", padding: "16px" },
5807 8953 onSubmit: (event) => event.preventDefault(),
5808 - children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5809 - ValidatedInputControl,
5810 - {
5811 - hideLabelFromVision: true,
5812 - label: (0, import_i18n19.__)("LaTeX math syntax"),
5813 - value: latex,
5814 - customValidity: error2 ? { type: "invalid", message: error2 } : void 0,
5815 - onChange: handleLatexChange,
5816 - placeholder: (0, import_i18n19.__)("e.g., x^2, \\frac{a}{b}"),
5817 - autoComplete: "off",
5818 - className: "block-editor-format-toolbar__math-input"
5819 - }
5820 - )
8954 + children: [
8955 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8956 + ValidatedInputControl,
8957 + {
8958 + label: (0, import_i18n21.__)("LaTeX math syntax"),
8959 + value: latex,
8960 + customValidity: error2 ? { type: "invalid", message: error2 } : void 0,
8961 + onValueChange: handleLatexChange,
8962 + placeholder: (0, import_i18n21.__)("e.g., x^2, \\frac{a}{b}, \\sqrt{x}"),
8963 + autoComplete: "off",
8964 + className: "block-editor-format-toolbar__math-input"
8965 + }
8966 + ),
8967 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8968 + Link,
8969 + {
8970 + openInNewTab: true,
8971 + className: "block-editor-format-toolbar__math-learn-more",
8972 + href: (0, import_i18n21.__)(
8973 + "https://wordpress.org/documentation/article/math-block/"
8974 + ),
8975 + children: (0, import_i18n21.__)("Learn more about LaTeX syntax")
8976 + }
8977 + )
8978 + ]
5821 8979 }
5822 8980 )
5823 8981 }
5824 8982 );
@@ -5830,10 +8988,10 @@
5830 8988 isObjectActive,
5831 8989 activeObjectAttributes,
5832 8990 contentRef
5833 8991 }) {
5834 - const [latexToMathML, setLatexToMathML] = (0, import_element19.useState)();
5835 - (0, import_element19.useEffect)(() => {
8992 + const [latexToMathML, setLatexToMathML] = (0, import_element33.useState)();
8993 + (0, import_element33.useEffect)(() => {
5836 8994 import("@wordpress/latex-to-mathml").then((module) => {
5837 8995 setLatexToMathML(() => module.default);
5838 8996 });
5839 8997 }, []);
@@ -5863,10 +9021,10 @@
5863 9021 }
5864 9022 onChange(newValue);
5865 9023 onFocus();
5866 9024 }
5867 - return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
5868 - /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
9025 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
9026 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5869 9027 import_block_editor16.RichTextToolbarButton,
5870 9028 {
5871 9029 icon: math_default,
5872 9030 title: title14,
@@ -5873,9 +9031,9 @@
5873 9031 onClick,
5874 9032 isActive: isObjectActive
5875 9033 }
5876 9034 ),
5877 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
9035 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5878 9036 InlineUI2,
5879 9037 {
5880 9038 value,
5881 9039 onChange,
@@ -5898,31 +9056,63 @@
5898 9056 edit: Edit4
5899 9057 };
5900 9058
5901 9059 // packages/format-library/build-module/non-breaking-space/index.mjs
5902 - var import_i18n20 = __toESM(require_i18n(), 1);
9060 + var import_i18n22 = __toESM(require_i18n(), 1);
5903 9061 var import_rich_text17 = __toESM(require_rich_text(), 1);
5904 9062 var import_block_editor17 = __toESM(require_block_editor(), 1);
5905 - var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
9063 + var import_components7 = __toESM(require_components(), 1);
9064 + var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
5906 9065 var name15 = "core/non-breaking-space";
5907 - var title15 = (0, import_i18n20.__)("Non breaking space");
9066 + var title15 = (0, import_i18n22.__)("Non breaking space");
9067 + function PopoverAnchor({ contentRef }) {
9068 + const popoverAnchor = (0, import_rich_text17.useAnchor)({
9069 + // eslint-disable-next-line react-hooks/refs
9070 + editableContentElement: contentRef.current,
9071 + settings: nonBreakingSpace
9072 + });
9073 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components7.Popover, { anchor: popoverAnchor, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { style: { whiteSpace: "nowrap", padding: "4px" }, children: (0, import_i18n22.__)("Non-breaking space") }) });
9074 + }
5908 9075 var nonBreakingSpace = {
5909 9076 name: name15,
5910 9077 title: title15,
5911 - tagName: "nbsp",
5912 - className: null,
5913 - edit({ value, onChange }) {
9078 + tagName: "span",
9079 + className: "non-breaking-space",
9080 + edit({ value, onChange, contentRef }) {
5914 9081 function addNonBreakingSpace() {
5915 9082 onChange((0, import_rich_text17.insert)(value, "\xA0"));
5916 9083 }
5917 - return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5918 - import_block_editor17.RichTextShortcut,
5919 - {
5920 - type: "primaryShift",
5921 - character: " ",
5922 - onUse: addNonBreakingSpace
5923 - }
5924 - );
9084 + const selectedValue = value.start && value.end ? value.text.slice(value.start, value.end) : null;
9085 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
9086 + /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
9087 + import_block_editor17.RichTextShortcut,
9088 + {
9089 + type: "primaryShift",
9090 + character: " ",
9091 + onUse: addNonBreakingSpace
9092 + }
9093 + ),
9094 + selectedValue === "\xA0" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverAnchor, { contentRef })
9095 + ] });
9096 + },
9097 + __experimentalCreatePrepareEditableTree() {
9098 + return (formats, text) => {
9099 + const NBSP = "\xA0";
9100 + let record = { formats, text };
9101 + let index2 = -1;
9102 + do {
9103 + index2 = text.indexOf(NBSP, index2 + 1);
9104 + if (index2 !== -1) {
9105 + record = (0, import_rich_text17.applyFormat)(
9106 + record,
9107 + { type: name15 },
9108 + index2,
9109 + index2 + 1
9110 + );
9111 + }
9112 + } while (index2 !== -1);
9113 + return record.formats;
9114 + };
5925 9115 }
5926 9116 };
5927 9117
5928 9118 // packages/format-library/build-module/default-formats.mjs