PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
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 +743 -427 24.0.0 → 24.1.0 View file →
@@ -109,9 +109,9 @@
109 109 function is(x, y) {
110 110 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
111 111 }
112 112 function useSyncExternalStore$2(subscribe2, getSnapshot2) {
113 - didWarnOld18Alpha || void 0 === React50.startTransition || (didWarnOld18Alpha = true, console.error(
113 + didWarnOld18Alpha || void 0 === React51.startTransition || (didWarnOld18Alpha = true, console.error(
114 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."
115 115 ));
116 116 var value = getSnapshot2();
117 117 if (!didWarnUncachedGetSnapshot) {
@@ -131,9 +131,9 @@
131 131 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
132 132 },
133 133 [subscribe2, value, getSnapshot2]
134 134 );
135 - useEffect15(
135 + useEffect14(
136 136 function() {
137 137 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
138 138 return subscribe2(function() {
139 139 checkIfSnapshotChanged(inst) && forceUpdate({ inst });
@@ -157,10 +157,10 @@
157 157 function useSyncExternalStore$1(subscribe2, getSnapshot2) {
158 158 return getSnapshot2();
159 159 }
160 160 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
161 - var React50 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React50.useState, useEffect15 = React50.useEffect, useLayoutEffect3 = React50.useLayoutEffect, useDebugValue = React50.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 !== React50.useSyncExternalStore ? React50.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;
163 163 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
164 164 })();
165 165 }
166 166 });
@@ -241,9 +241,9 @@
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);
@@ -256,29 +256,29 @@
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 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 error_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, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) });
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 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_bold_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: "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" }) });
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 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_italic_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: "M12.5 5L10 19h1.9l2.5-14z" }) });
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 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 format_strikethrough_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: "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" }) });
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 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);
@@ -289,14 +289,17 @@
289 289
290 290 // packages/icons/build-module/library/inline-image.mjs
291 291 var import_primitives10 = __toESM(require_primitives(), 1);
292 292 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.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" }) });
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" }) });
294 294
295 295 // packages/icons/build-module/library/language.mjs
296 296 var import_primitives11 = __toESM(require_primitives(), 1);
297 297 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
298 - var language_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: "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" }) });
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 + ] });
299 302
300 303 // packages/icons/build-module/library/link.mjs
301 304 var import_primitives12 = __toESM(require_primitives(), 1);
302 305 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
@@ -304,9 +307,9 @@
304 307
305 308 // packages/icons/build-module/library/math.mjs
306 309 var import_primitives13 = __toESM(require_primitives(), 1);
307 310 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
308 - var math_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: "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" }) });
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" }) });
309 312
310 313 // packages/icons/build-module/library/published.mjs
311 314 var import_primitives14 = __toESM(require_primitives(), 1);
312 315 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
@@ -317,19 +320,25 @@
317 320
318 321 // packages/icons/build-module/library/subscript.mjs
319 322 var import_primitives15 = __toESM(require_primitives(), 1);
320 323 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
321 - var subscript_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: "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" }) });
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 + ] });
322 328
323 329 // packages/icons/build-module/library/superscript.mjs
324 330 var import_primitives16 = __toESM(require_primitives(), 1);
325 331 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
326 - var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.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" }) });
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 + ] });
327 336
328 337 // packages/icons/build-module/library/text-color.mjs
329 338 var import_primitives17 = __toESM(require_primitives(), 1);
330 339 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
331 - 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.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" }) });
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" }) });
332 341
333 342 // packages/format-library/build-module/bold/index.mjs
334 343 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
335 344 var name = "core/bold";
@@ -475,23 +484,34 @@
475 484
476 485 // node_modules/@base-ui/utils/useControlled.mjs
477 486 var React = __toESM(require_react(), 1);
478 487
479 - // node_modules/@base-ui/utils/error.mjs
480 - var set;
488 + // node_modules/@base-ui/utils/createLogOnce.mjs
489 + var loggedMessages;
481 490 if (true) {
482 - set = /* @__PURE__ */ new Set();
491 + loggedMessages = /* @__PURE__ */ new Set();
483 492 }
484 - function error(...messages) {
485 - if (true) {
486 - const messageKey = messages.join(" ");
487 - if (!set.has(messageKey)) {
488 - set.add(messageKey);
489 - 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 + }
490 507 }
491 - }
508 + };
492 509 }
493 510
511 + // node_modules/@base-ui/utils/error.mjs
512 + var error = createLogOnce("error", "Base UI");
513 +
494 514 // node_modules/@base-ui/utils/useControlled.mjs
495 515 function useControlled({
496 516 controlled,
497 517 default: defaultProp,
@@ -501,9 +521,9 @@
501 521 const {
502 522 current: isControlled
503 523 } = React.useRef(controlled !== void 0);
504 524 const [valueState, setValue] = React.useState(defaultProp);
505 - const value = isControlled ? controlled : valueState;
525 + const value = isControlled && controlled !== void 0 ? controlled : valueState;
506 526 if (true) {
507 527 React.useEffect(() => {
508 528 if (isControlled !== (controlled !== void 0)) {
509 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"));
@@ -602,21 +622,15 @@
602 622 }
603 623 }
604 624
605 625 // node_modules/@base-ui/utils/warn.mjs
606 - var set2;
607 - if (true) {
608 - set2 = /* @__PURE__ */ new Set();
626 + var warn = createLogOnce("warn", "Base UI");
627 +
628 + // node_modules/@base-ui/utils/empty.mjs
629 + function NOOP() {
609 630 }
610 - function warn(...messages) {
611 - if (true) {
612 - const messageKey = messages.join(" ");
613 - if (!set2.has(messageKey)) {
614 - set2.add(messageKey);
615 - console.warn(`Base UI: ${messageKey}`);
616 - }
617 - }
618 - }
631 + var EMPTY_ARRAY = Object.freeze([]);
632 + var EMPTY_OBJECT = Object.freeze({});
619 633
620 634 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
621 635 var React6 = __toESM(require_react(), 1);
622 636
@@ -658,9 +672,9 @@
658 672 const listeners = useRefWithInit(createListeners).current;
659 673 const map = useRefWithInit(createMap).current;
660 674 const nextIndexRef = React6.useRef(0);
661 675 const isDirtyRef = React6.useRef(true);
662 - const itemsRef = React6.useRef([]);
676 + const itemsRef = React6.useRef(null);
663 677 const mutationObserverRef = React6.useRef(null);
664 678 const scheduleMapUpdate = useStableCallback(() => {
665 679 if (isDirtyRef.current) {
666 680 return;
@@ -732,16 +746,24 @@
732 746 }
733 747 const flush = useStableCallback(() => {
734 748 const [items, automaticNodes] = getCompositeListSnapshot(map);
735 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;
754 + });
736 755 observe(automaticNodes);
737 756 itemsRef.current = items;
738 757 isDirtyRef.current = false;
758 + if (!changed) {
759 + return;
760 + }
739 761 listeners.forEach((listener) => listener(nextMap));
740 762 onMapChange(nextMap);
741 763 });
742 764 useIsoLayoutEffect(() => {
743 - if (!isDirtyRef.current) {
765 + if (!isDirtyRef.current && itemsRef.current) {
744 766 syncRefs(itemsRef.current);
745 767 }
746 768 return () => {
747 769 elementsRef.current = [];
@@ -791,18 +813,18 @@
791 813 map.forEach((registration, node) => {
792 814 if (!node.isConnected) {
793 815 return;
794 816 }
795 - const index = registration.index;
817 + const index2 = registration.index;
796 818 const item = {
797 - index: index ?? -1,
819 + index: index2 ?? -1,
798 820 element: node,
799 821 registration
800 822 };
801 - if (index === null) {
823 + if (index2 === null) {
802 824 automaticItems.push(item);
803 - } else if (index >= 0) {
804 - reservedIndices.add(index);
825 + } else if (index2 >= 0) {
826 + reservedIndices.add(index2);
805 827 items.push(item);
806 828 }
807 829 });
808 830 let nextAutomaticIndex = 0;
@@ -869,9 +891,9 @@
869 891 function didChange(forkRef, a, b, c, d) {
870 892 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
871 893 }
872 894 function didChangeN(forkRef, newRefs) {
873 - 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]);
874 896 }
875 897 function update(forkRef, refs) {
876 898 forkRef.refs = refs;
877 899 if (refs.every((ref) => ref == null)) {
@@ -969,14 +991,8 @@
969 991 }
970 992 return void 0;
971 993 }
972 994
973 - // node_modules/@base-ui/utils/empty.mjs
974 - function NOOP() {
975 - }
976 - var EMPTY_ARRAY = Object.freeze([]);
977 - var EMPTY_OBJECT = Object.freeze({});
978 -
979 995 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
980 996 function getStateAttributesProps(state, customMapping) {
981 997 const props = {};
982 998 for (const key in state) {
@@ -1164,10 +1180,13 @@
1164 1180
1165 1181 // node_modules/@base-ui/react/internals/useRenderElement.mjs
1166 1182 var import_react = __toESM(require_react(), 1);
1167 1183 function useRenderElement(element, componentProps, params = {}) {
1168 - const renderProp = componentProps.render;
1169 - 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);
1170 1189 if (params.enabled === false) {
1171 1190 return null;
1172 1191 }
1173 1192 const state = params.state ?? EMPTY_OBJECT;
@@ -1172,13 +1191,12 @@
1172 1191 }
1173 1192 const state = params.state ?? EMPTY_OBJECT;
1174 1193 return evaluateRenderProp(element, renderProp, outProps, state);
1175 1194 }
1176 - function useRenderElementProps(componentProps, params = {}) {
1195 + function useRenderElementProps(componentProps, params, renderProp) {
1177 1196 const {
1178 1197 className: classNameProp,
1179 - style: styleProp,
1180 - render: renderProp
1198 + style: styleProp
1181 1199 } = componentProps;
1182 1200 const {
1183 1201 state = EMPTY_OBJECT,
1184 1202 ref,
@@ -1219,8 +1237,15 @@
1219 1237 }
1220 1238 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1221 1239 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
1222 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 + }
1223 1248 function evaluateRenderProp(element, render, props, state) {
1224 1249 if (render) {
1225 1250 if (typeof render === "function") {
1226 1251 if (true) {
@@ -1229,19 +1254,14 @@
1229 1254 return render(props, state);
1230 1255 }
1231 1256 const mergedProps = mergeProps(props, render.props);
1232 1257 mergedProps.ref = props.ref;
1233 - let newElement = render;
1234 - if (newElement?.$$typeof === REACT_LAZY_TYPE) {
1235 - const children = React9.Children.toArray(render);
1236 - newElement = children[0];
1237 - }
1238 1258 if (true) {
1239 - if (!/* @__PURE__ */ React9.isValidElement(newElement)) {
1259 + if (!/* @__PURE__ */ React9.isValidElement(render)) {
1240 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"));
1241 1261 }
1242 1262 }
1243 - return /* @__PURE__ */ React9.cloneElement(newElement, mergedProps);
1263 + return /* @__PURE__ */ React9.cloneElement(render, mergedProps);
1244 1264 }
1245 1265 if (element) {
1246 1266 if (typeof element === "string") {
1247 1267 return renderTag(element, props);
@@ -1459,13 +1479,16 @@
1459 1479 }
1460 1480 return id;
1461 1481 }
1462 1482 cancel(id) {
1463 - const index = id - this.startId;
1464 - if (index < 0 || index >= this.callbacks.length) {
1483 + const index2 = id - this.startId;
1484 + if (index2 < 0 || index2 >= this.callbacks.length) {
1465 1485 return;
1466 1486 }
1467 - this.callbacks[index] = null;
1487 + if (this.callbacks[index2] === null) {
1488 + return;
1489 + }
1490 + this.callbacks[index2] = null;
1468 1491 this.callbacksCount -= 1;
1469 1492 }
1470 1493 };
1471 1494 var scheduler = new Scheduler();
@@ -1506,11 +1529,11 @@
1506 1529 return timeout;
1507 1530 }
1508 1531
1509 1532 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1510 - function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {
1533 + function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
1511 1534 const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0);
1512 - const [mounted, setMounted] = React12.useState(open);
1535 + const [mounted, setMounted] = React12.useState(open && !animateInitialOpen);
1513 1536 if (open && !mounted) {
1514 1537 setMounted(true);
1515 1538 setTransitionStatus("starting");
1516 1539 }
@@ -1587,9 +1610,9 @@
1587 1610 indexRef.current = newIndex;
1588 1611 }
1589 1612 return indexRef.current;
1590 1613 } : -1);
1591 - const index = externalIndex ?? internalIndex;
1614 + const index2 = externalIndex ?? internalIndex;
1592 1615 const componentRef = React13.useRef(null);
1593 1616 const ref = React13.useCallback((node) => {
1594 1617 const previousNode = componentRef.current;
1595 1618 if (previousNode) {
@@ -1617,18 +1640,27 @@
1617 1640 });
1618 1641 }, [externalIndex, subscribeMapChange]);
1619 1642 return {
1620 1643 ref,
1621 - index
1644 + index: index2
1622 1645 };
1623 1646 }
1624 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 +
1625 1657 // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
1626 1658 var STARTING_HOOK = {
1627 - "data-starting-style": ""
1659 + [startingStyle]: ""
1628 1660 };
1629 1661 var ENDING_HOOK = {
1630 - "data-ending-style": ""
1662 + [endingStyle]: ""
1631 1663 };
1632 1664 var transitionStatusMapping = {
1633 1665 transitionStatus(value) {
1634 1666 if (value === "starting") {
@@ -1647,17 +1679,27 @@
1647 1679 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1648 1680 function hasWindow() {
1649 1681 return typeof window !== "undefined";
1650 1682 }
1683 + function getNodeName(node) {
1684 + if (isNode(node)) {
1685 + return (node.nodeName || "").toLowerCase();
1686 + }
1687 + return "#document";
1688 + }
1651 1689 function getWindow(node) {
1652 1690 var _node$ownerDocument;
1653 1691 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1654 1692 }
1655 - function isElement(value) {
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) {
1656 1698 if (!hasWindow()) {
1657 1699 return false;
1658 1700 }
1659 - return value instanceof Element || value instanceof getWindow(value).Element;
1701 + return value instanceof Node || value instanceof getWindow(value).Node;
1660 1702 }
1661 1703 function isHTMLElement(value) {
1662 1704 if (!hasWindow()) {
1663 1705 return false;
@@ -1669,11 +1711,27 @@
1669 1711 return false;
1670 1712 }
1671 1713 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1672 1714 }
1715 + function isLastTraversableNode(node) {
1716 + return /^(html|body|#document)$/.test(getNodeName(node));
1717 + }
1673 1718 function getComputedStyle2(element) {
1674 1719 return getWindow(element).getComputedStyle(element);
1675 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 + }
1676 1734
1677 1735 // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
1678 1736 var React14 = __toESM(require_react(), 1);
1679 1737 var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
@@ -1924,9 +1982,25 @@
1924 1982 return "current" in maybeRef ? maybeRef.current : maybeRef;
1925 1983 }
1926 1984
1927 1985 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1928 - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) {
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) {
1929 2003 const frame = useAnimationFrame();
1930 2004 return useStableCallback((fnToExecute, signal = null) => {
1931 2005 frame.cancel();
1932 2006 const element = resolveRef(elementOrRef);
@@ -1934,9 +2008,17 @@
1934 2008 return;
1935 2009 }
1936 2010 const resolvedElement = element;
1937 2011 const done = () => {
1938 - ReactDOM.flushSync(fnToExecute);
2012 + if (!batch) {
2013 + ReactDOM.flushSync(fnToExecute);
2014 + return;
2015 + }
2016 + flushBeforePaint(() => {
2017 + if (!signal?.aborted) {
2018 + fnToExecute();
2019 + }
2020 + });
1939 2021 };
1940 2022 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
1941 2023 fnToExecute();
1942 2024 return;
@@ -1958,9 +2040,9 @@
1958 2040 done();
1959 2041 });
1960 2042 }
1961 2043 if (waitForStartingStyleRemoved) {
1962 - const startingStyleAttribute = "data-starting-style";
2044 + const startingStyleAttribute = startingStyle;
1963 2045 if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
1964 2046 frame.request(exec);
1965 2047 return;
1966 2048 }
@@ -1988,12 +2070,13 @@
1988 2070 const {
1989 2071 enabled = true,
1990 2072 open,
1991 2073 ref,
2074 + batch = false,
1992 2075 onComplete: onCompleteParam
1993 2076 } = parameters;
1994 2077 const onComplete = useStableCallback(onCompleteParam);
1995 - const runOnceAnimationsFinish = useAnimationsFinished(ref, open);
2078 + const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);
1996 2079 React17.useEffect(() => {
1997 2080 if (!enabled) {
1998 2081 return void 0;
1999 2082 }
@@ -2040,9 +2123,9 @@
2040 2123 useOnMount(timeout.disposeEffect);
2041 2124 return timeout;
2042 2125 }
2043 2126
2044 - // node_modules/@base-ui/react/internals/shadowDom.mjs
2127 + // node_modules/@base-ui/utils/shadowDom.mjs
2045 2128 function activeElement(doc) {
2046 2129 let element = doc.activeElement;
2047 2130 while (element?.shadowRoot?.activeElement != null) {
2048 2131 element = element.shadowRoot.activeElement;
@@ -2069,9 +2152,9 @@
2069 2152 return false;
2070 2153 }
2071 2154 function getTarget(event) {
2072 2155 if ("composedPath" in event) {
2073 - return event.composedPath()[0];
2156 + return event.composedPath()[0] ?? event.target;
2074 2157 }
2075 2158 return event.target;
2076 2159 }
2077 2160
@@ -2078,10 +2161,10 @@
2078 2161 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2079 2162 var round = Math.round;
2080 2163
2081 2164 // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
2082 - function isIndexOutOfListBounds(list, index) {
2083 - return index < 0 || index >= list.length;
2165 + function isIndexOutOfListBounds(list, index2) {
2166 + return index2 < 0 || index2 >= list.length;
2084 2167 }
2085 2168 function getMinListIndex(listRef, disabledIndices) {
2086 2169 return findNonDisabledListIndex(listRef.current, {
2087 2170 disabledIndices
@@ -2099,20 +2182,20 @@
2099 2182 decrement = false,
2100 2183 disabledIndices,
2101 2184 amount = 1
2102 2185 } = {}) {
2103 - let index = startingIndex;
2186 + let index2 = startingIndex;
2104 2187 do {
2105 - index += decrement ? -amount : amount;
2106 - } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));
2107 - return index;
2188 + index2 += decrement ? -amount : amount;
2189 + } while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
2190 + return index2;
2108 2191 }
2109 - function isListIndexDisabled(list, index, disabledIndices) {
2110 - 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;
2111 2194 if (isExplicitlyDisabled) {
2112 2195 return true;
2113 2196 }
2114 - const element = list[index];
2197 + const element = list[index2];
2115 2198 if (!element) {
2116 2199 return false;
2117 2200 }
2118 2201 if (!isElementVisible(element)) {
@@ -2243,11 +2326,28 @@
2243 2326 }
2244 2327 return value ? "true" : void 0;
2245 2328 }
2246 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 +
2247 2343 // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2248 - var React19 = __toESM(require_react(), 1);
2344 + var React20 = __toESM(require_react(), 1);
2249 2345
2346 + // node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
2347 + var valid = "data-valid";
2348 + var invalid = "data-invalid";
2349 +
2250 2350 // node_modules/@base-ui/react/internals/field-constants/constants.mjs
2251 2351 var DEFAULT_VALIDITY_STATE = {
2252 2352 badInput: false,
2253 2353 customError: false,
@@ -2278,13 +2378,13 @@
2278 2378 return null;
2279 2379 }
2280 2380 if (value) {
2281 2381 return {
2282 - "data-valid": ""
2382 + [valid]: ""
2283 2383 };
2284 2384 }
2285 2385 return {
2286 - "data-invalid": ""
2386 + [invalid]: ""
2287 2387 };
2288 2388 }
2289 2389 };
2290 2390
@@ -2321,12 +2421,12 @@
2321 2421 },
2322 2422 change: NOOP
2323 2423 }
2324 2424 };
2325 - var FieldRootContext = /* @__PURE__ */ React19.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2425 + var FieldRootContext = /* @__PURE__ */ React20.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2326 2426 if (true) FieldRootContext.displayName = "FieldRootContext";
2327 2427 function useFieldRootContext(optional = true) {
2328 - const context = React19.useContext(FieldRootContext);
2428 + const context = React20.useContext(FieldRootContext);
2329 2429 if (context.setValidityData === NOOP && !optional) {
2330 2430 throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
2331 2431 }
2332 2432 return context;
@@ -2361,10 +2461,10 @@
2361 2461 }, [registerFieldControl, sourceRef]);
2362 2462 }
2363 2463
2364 2464 // node_modules/@base-ui/react/internals/form-context/FormContext.mjs
2365 - var React20 = __toESM(require_react(), 1);
2366 - var FormContext = /* @__PURE__ */ React20.createContext({
2465 + var React21 = __toESM(require_react(), 1);
2466 + var FormContext = /* @__PURE__ */ React21.createContext({
2367 2467 elementRef: {
2368 2468 current: null
2369 2469 },
2370 2470 formRef: {
@@ -2374,25 +2474,26 @@
2374 2474 },
2375 2475 errors: {},
2376 2476 clearErrors: NOOP,
2377 2477 validationMode: "onSubmit",
2378 - submitAttemptedRef: {
2379 - current: false
2478 + submitCountRef: {
2479 + current: 0
2380 2480 }
2381 2481 });
2382 2482 if (true) FormContext.displayName = "FormContext";
2383 2483 function useFormContext() {
2384 - return React20.useContext(FormContext);
2484 + return React21.useContext(FormContext);
2385 2485 }
2386 2486
2387 2487 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2388 - var React22 = __toESM(require_react(), 1);
2488 + var React23 = __toESM(require_react(), 1);
2389 2489
2390 2490 // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
2391 - var React21 = __toESM(require_react(), 1);
2392 - var LabelableContext = /* @__PURE__ */ React21.createContext({
2491 + var React22 = __toESM(require_react(), 1);
2492 + var LabelableContext = /* @__PURE__ */ React22.createContext({
2393 2493 controlId: void 0,
2394 2494 registerControlId: NOOP,
2495 + resetControlId: NOOP,
2395 2496 labelId: void 0,
2396 2497 setLabelId: NOOP,
2397 2498 messageIds: [],
2398 2499 setMessageIds: NOOP,
@@ -2399,9 +2500,9 @@
2399 2500 getDescriptionProps: (externalProps) => externalProps
2400 2501 });
2401 2502 if (true) LabelableContext.displayName = "LabelableContext";
2402 2503 function useLabelableContext() {
2403 - return React21.useContext(LabelableContext);
2504 + return React22.useContext(LabelableContext);
2404 2505 }
2405 2506
2406 2507 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2407 2508 function useLabelableId(params = {}) {
@@ -2406,20 +2507,19 @@
2406 2507 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2407 2508 function useLabelableId(params = {}) {
2408 2509 const {
2409 2510 id,
2410 - implicit = false,
2411 - controlRef
2511 + enabled = true
2412 2512 } = params;
2413 2513 const {
2414 2514 controlId,
2415 - registerControlId
2515 + registerControlId,
2516 + resetControlId
2416 2517 } = useLabelableContext();
2417 - const defaultId = useBaseUiId(id);
2418 - const controlIdForEffect = implicit ? controlId : void 0;
2518 + const defaultId = useBaseUiId();
2419 2519 const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2420 - const hasRegisteredRef = React22.useRef(false);
2421 - const hadExplicitIdRef = React22.useRef(id != null);
2520 + const hasRegisteredRef = React23.useRef(false);
2521 + const hadExplicitIdRef = React23.useRef(false);
2422 2522 const unregisterControlId = useStableCallback(() => {
2423 2523 if (!hasRegisteredRef.current || registerControlId === NOOP) {
2424 2524 return;
2425 2525 }
@@ -2426,26 +2526,20 @@
2426 2526 hasRegisteredRef.current = false;
2427 2527 registerControlId(controlSourceRef.current, void 0);
2428 2528 });
2429 2529 useIsoLayoutEffect(() => {
2430 - if (registerControlId === NOOP) {
2530 + if (!enabled || registerControlId === NOOP) {
2531 + unregisterControlId();
2431 2532 return void 0;
2432 2533 }
2433 2534 let nextId;
2434 - if (implicit) {
2435 - const elem = controlRef?.current;
2436 - if (isElement(elem) && elem.closest("label") != null) {
2437 - nextId = id ?? null;
2438 - } else {
2439 - nextId = controlIdForEffect ?? defaultId;
2440 - }
2441 - } else if (id != null) {
2535 + if (id !== void 0) {
2442 2536 hadExplicitIdRef.current = true;
2443 2537 nextId = id;
2444 2538 } else if (hadExplicitIdRef.current) {
2445 2539 nextId = defaultId;
2446 2540 } else {
2447 - unregisterControlId();
2541 + resetControlId();
2448 2542 return void 0;
2449 2543 }
2450 2544 if (nextId === void 0) {
2451 2545 unregisterControlId();
@@ -2453,45 +2547,45 @@
2453 2547 }
2454 2548 hasRegisteredRef.current = true;
2455 2549 registerControlId(controlSourceRef.current, nextId);
2456 2550 return void 0;
2457 - }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);
2458 - React22.useEffect(() => {
2551 + }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
2552 + useIsoLayoutEffect(() => {
2459 2553 return unregisterControlId;
2460 2554 }, [unregisterControlId]);
2461 - return controlId ?? defaultId;
2555 + return (enabled ? controlId : void 0) ?? id ?? defaultId;
2462 2556 }
2463 2557
2464 2558 // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
2465 - var React23 = __toESM(require_react(), 1);
2466 - var DirectionContext = /* @__PURE__ */ React23.createContext(void 0);
2559 + var React24 = __toESM(require_react(), 1);
2560 + var DirectionContext = /* @__PURE__ */ React24.createContext(void 0);
2467 2561 if (true) DirectionContext.displayName = "DirectionContext";
2468 2562 function useDirection() {
2469 - const context = React23.useContext(DirectionContext);
2563 + const context = React24.useContext(DirectionContext);
2470 2564 return context?.direction ?? "ltr";
2471 2565 }
2472 2566
2473 2567 // node_modules/@base-ui/react/field/item/FieldItemContext.mjs
2474 - var React24 = __toESM(require_react(), 1);
2475 - var FieldItemContext = /* @__PURE__ */ React24.createContext({
2568 + var React25 = __toESM(require_react(), 1);
2569 + var FieldItemContext = /* @__PURE__ */ React25.createContext({
2476 2570 disabled: false
2477 2571 });
2478 2572 if (true) FieldItemContext.displayName = "FieldItemContext";
2479 2573 function useFieldItemContext() {
2480 - const context = React24.useContext(FieldItemContext);
2574 + const context = React25.useContext(FieldItemContext);
2481 2575 return context;
2482 2576 }
2483 2577
2484 2578 // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2485 - var React25 = __toESM(require_react(), 1);
2579 + var React26 = __toESM(require_react(), 1);
2486 2580
2487 2581 // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
2488 - function getCombinedFieldValidityData(validityData, invalid) {
2582 + function getCombinedFieldValidityData(validityData, invalid2) {
2489 2583 return {
2490 2584 ...validityData,
2491 2585 state: {
2492 2586 ...validityData.state,
2493 - valid: !invalid && validityData.state.valid
2587 + valid: !invalid2 && validityData.state.valid
2494 2588 }
2495 2589 };
2496 2590 }
2497 2591
@@ -2518,14 +2612,18 @@
2518 2612 fallback ??= input;
2519 2613 }
2520 2614 return fallback;
2521 2615 }
2522 - function clearCustomValidity(element, inputs) {
2523 - for (const input of inputs.keys()) {
2524 - input.setCustomValidity("");
2525 - }
2526 - element?.setCustomValidity("");
2616 + function makeState(customError) {
2617 + return {
2618 + ...DEFAULT_VALIDITY_STATE,
2619 + valid: !customError,
2620 + customError
2621 + };
2527 2622 }
2623 + function getNativeErrors(element) {
2624 + return element && element.validationMessage ? [element.validationMessage] : [];
2625 + }
2528 2626 function useFieldValidation(params) {
2529 2627 const {
2530 2628 elementRef,
2531 2629 formRef
@@ -2534,12 +2632,13 @@
2534 2632 setValidityData,
2535 2633 validate,
2536 2634 validityData,
2537 2635 validationDebounceTime,
2538 - invalid,
2636 + invalid: invalid2,
2539 2637 markedDirtyRef,
2540 2638 state,
2541 2639 shouldValidateOnChange,
2640 + validationMode,
2542 2641 registeredFieldIdRef
2543 2642 } = params;
2544 2643 const {
2545 2644 controlId,
@@ -2545,12 +2644,13 @@
2545 2644 controlId,
2546 2645 getDescriptionProps
2547 2646 } = useLabelableContext();
2548 2647 const timeout = useTimeout();
2549 - const inputRef = React25.useRef(null);
2648 + const inputRef = React26.useRef(null);
2550 2649 const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
2551 - const validationCommitIdRef = React25.useRef(0);
2552 - const registerInput = React25.useCallback((element, registration) => {
2650 + const validationCommitIdRef = React26.useRef(0);
2651 + const customValidityRef = React26.useRef(null);
2652 + const registerInput = React26.useCallback((element, registration) => {
2553 2653 registeredInputs.set(element, registration);
2554 2654 return () => {
2555 2655 registeredInputs.delete(element);
2556 2656 };
@@ -2561,9 +2661,9 @@
2561 2661 });
2562 2662 const commit = useStableCallback(async (value, revalidate = false) => {
2563 2663 validationCommitIdRef.current += 1;
2564 2664 const validationCommitId = validationCommitIdRef.current;
2565 - function updateRegisteredFieldValidity(nextValidityData2, externalInvalid = invalid) {
2665 + function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
2566 2666 const fieldId = registeredFieldIdRef.current ?? controlId;
2567 2667 if (fieldId == null) {
2568 2668 return;
2569 2669 }
@@ -2570,45 +2670,42 @@
2570 2670 const currentFieldData = formRef.current.fields.get(fieldId);
2571 2671 if (!currentFieldData) {
2572 2672 return;
2573 2673 }
2574 - const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData2, externalInvalid);
2674 + const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
2575 2675 formRef.current.fields.set(fieldId, {
2576 2676 ...currentFieldData,
2577 2677 validityData: validityDataWithFormErrors
2578 2678 });
2579 2679 }
2580 - function publishAllValid(input, externalInvalid) {
2581 - const nextValidityData2 = {
2680 + function makeValidityData(validityState, errorMessages) {
2681 + const errors = validityState.valid === false ? errorMessages : [];
2682 + return {
2582 2683 value,
2583 - state: {
2584 - ...DEFAULT_VALIDITY_STATE,
2585 - valid: true
2586 - },
2587 - error: "",
2588 - errors: [],
2684 + state: validityState,
2685 + error: errors[0] ?? "",
2686 + errors,
2589 2687 initialValue: validityData.initialValue
2590 2688 };
2591 - clearCustomValidity(input, registeredInputs);
2592 - updateRegisteredFieldValidity(nextValidityData2, externalInvalid);
2593 - setValidityData(nextValidityData2);
2594 2689 }
2595 - const element = registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
2596 - if (revalidate) {
2597 - if (state.valid !== false || !element) {
2598 - return;
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]);
2599 2701 }
2600 - const currentNativeValidity = element.validity;
2601 - if (!currentNativeValidity.valueMissing) {
2602 - publishAllValid(element, false);
2603 - return;
2604 - }
2605 - for (const key of validityKeys) {
2606 - if (key !== "valid" && key !== "valueMissing" && key !== "customError" && currentNativeValidity[key]) {
2607 - return;
2608 - }
2609 - }
2610 2702 }
2703 + function publish(validityState, errorMessages, externalInvalid) {
2704 + const nextValidityData = makeValidityData(validityState, errorMessages);
2705 + updateRegisteredFieldValidity(nextValidityData, externalInvalid);
2706 + setValidityData(nextValidityData);
2707 + }
2611 2708 function getState(el) {
2612 2709 const computedState = validityKeys.reduce((acc, key) => {
2613 2710 acc[key] = el.validity[key];
2614 2711 return acc;
@@ -2629,21 +2726,39 @@
2629 2726 computedState.valueMissing = false;
2630 2727 }
2631 2728 return computedState;
2632 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 + }
2633 2755 timeout.clear();
2634 - let result = null;
2635 - let validationErrors = [];
2636 - const nextState = element ? getState(element) : {
2637 - ...DEFAULT_VALIDITY_STATE,
2638 - valid: true
2639 - };
2640 - let defaultValidationMessage;
2756 + clearCustomValidity();
2757 + let nextState = refreshState();
2758 + let validationErrors = getNativeErrors(element);
2641 2759 const isValidatingOnChange = shouldValidateOnChange();
2642 - if (element && element.validationMessage && !isValidatingOnChange) {
2643 - defaultValidationMessage = element.validationMessage;
2644 - validationErrors = [element.validationMessage];
2645 - } else {
2760 + if (validationErrors.length === 0 || isValidatingOnChange) {
2646 2761 const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
2647 2762 if (field.name) {
2648 2763 acc[field.name] = field.getValue();
2649 2764 }
@@ -2649,52 +2764,45 @@
2649 2764 }
2650 2765 return acc;
2651 2766 }, {});
2652 2767 const resultOrPromise = validate(value, formValues);
2768 + let result;
2653 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 + }
2654 2776 result = await resultOrPromise;
2655 2777 if (validationCommitId !== validationCommitIdRef.current) {
2656 2778 return;
2657 2779 }
2780 + nextState = refreshState();
2658 2781 } else {
2659 2782 result = resultOrPromise;
2660 2783 }
2661 - if (result !== null) {
2784 + validationErrors = result ? [].concat(result).filter(Boolean) : [];
2785 + if (validationErrors.length > 0) {
2662 2786 nextState.valid = false;
2663 2787 nextState.customError = true;
2664 - if (Array.isArray(result)) {
2665 - validationErrors = result;
2666 - element?.setCustomValidity(result.join("\n"));
2667 - } else if (result) {
2668 - validationErrors = [result];
2669 - element?.setCustomValidity(result);
2788 + if (element?.willValidate) {
2789 + setCustomValidity(element, validationErrors.join("\n"));
2670 2790 }
2671 - } else if (isValidatingOnChange) {
2672 - clearCustomValidity(element, registeredInputs);
2673 - nextState.customError = false;
2674 - if (element && element.validationMessage) {
2675 - defaultValidationMessage = element.validationMessage;
2676 - validationErrors = [element.validationMessage];
2677 - } else if ((!element || element.validity.valid) && !nextState.valid) {
2678 - nextState.valid = true;
2679 - }
2791 + } else {
2792 + validationErrors = getNativeErrors(element);
2680 2793 }
2681 2794 }
2682 - const nextValidityData = {
2683 - value,
2684 - state: nextState,
2685 - error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ""),
2686 - errors: validationErrors,
2687 - initialValue: validityData.initialValue
2688 - };
2689 - updateRegisteredFieldValidity(nextValidityData);
2690 - setValidityData(nextValidityData);
2795 + publish(nextState, validationErrors);
2691 2796 });
2692 - const change = useStableCallback((value) => {
2797 + const change = useStableCallback((value, cancelPending = false) => {
2693 2798 timeout.clear();
2799 + validationCommitIdRef.current += 1;
2800 + if (cancelPending) {
2801 + return;
2802 + }
2694 2803 const validateOnChange = shouldValidateOnChange();
2695 2804 if (validateOnChange && value !== "" && validationDebounceTime) {
2696 - validationCommitIdRef.current += 1;
2697 2805 timeout.start(validationDebounceTime, () => {
2698 2806 commit(value);
2699 2807 });
2700 2808 } else {
@@ -2700,12 +2808,12 @@
2700 2808 } else {
2701 2809 commit(value, !validateOnChange);
2702 2810 }
2703 2811 });
2704 - const getValidationProps = React25.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
2812 + const getValidationProps = React26.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
2705 2813 "aria-invalid": true
2706 2814 } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
2707 - return React25.useMemo(() => ({
2815 + return React26.useMemo(() => ({
2708 2816 getValidationProps,
2709 2817 inputRef,
2710 2818 registeredInputs,
2711 2819 registerInput,
@@ -2773,9 +2881,9 @@
2773 2881 focusControl(event);
2774 2882 }
2775 2883 return native ? {
2776 2884 id,
2777 - htmlFor: resolvedControlId ?? void 0,
2885 + htmlFor: resolvedControlId,
2778 2886 onMouseDown: handleInteraction
2779 2887 } : {
2780 2888 id,
2781 2889 onClick: handleInteraction,
@@ -2792,9 +2900,9 @@
2792 2900 });
2793 2901 }
2794 2902
2795 2903 // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
2796 - var React26 = __toESM(require_react(), 1);
2904 + var React27 = __toESM(require_react(), 1);
2797 2905 function useCompositeItem(params = {}) {
2798 2906 const {
2799 2907 highlightItemOnHover,
2800 2908 highlightedIndex,
@@ -2801,17 +2909,17 @@
2801 2909 onHighlightedIndexChange
2802 2910 } = useCompositeRootContext();
2803 2911 const {
2804 2912 ref,
2805 - index
2913 + index: index2
2806 2914 } = useCompositeListItem(params);
2807 - const isHighlighted = highlightedIndex === index;
2808 - const itemRef = React26.useRef(null);
2915 + const isHighlighted = highlightedIndex === index2;
2916 + const itemRef = React27.useRef(null);
2809 2917 const mergedRef = useMergedRefs(ref, itemRef);
2810 2918 const compositeProps = {
2811 2919 tabIndex: isHighlighted ? 0 : -1,
2812 2920 onFocus() {
2813 - onHighlightedIndexChange(index);
2921 + onHighlightedIndexChange(index2);
2814 2922 },
2815 2923 onMouseMove() {
2816 2924 const item = itemRef.current;
2817 2925 if (!highlightItemOnHover || !item) {
@@ -2825,9 +2933,9 @@
2825 2933 };
2826 2934 return {
2827 2935 compositeProps,
2828 2936 compositeRef: mergedRef,
2829 - index
2937 + index: index2
2830 2938 };
2831 2939 }
2832 2940
2833 2941 // node_modules/@base-ui/react/utils/getCssDimensions.mjs
@@ -2849,15 +2957,15 @@
2849 2957 };
2850 2958 }
2851 2959
2852 2960 // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
2853 - var React27 = __toESM(require_react(), 1);
2961 + var React28 = __toESM(require_react(), 1);
2854 2962 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2855 2963 var DirectionProvider = function DirectionProvider2(props) {
2856 2964 const {
2857 2965 direction = "ltr"
2858 2966 } = props;
2859 - const contextValue = React27.useMemo(() => ({
2967 + const contextValue = React28.useMemo(() => ({
2860 2968 direction
2861 2969 }), [direction]);
2862 2970 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DirectionContext.Provider, {
2863 2971 value: contextValue,
@@ -2871,18 +2979,46 @@
2871 2979 return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
2872 2980 }
2873 2981
2874 2982 // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
2875 - var React28 = __toESM(require_react(), 1);
2876 - var CSPContext = /* @__PURE__ */ React28.createContext(void 0);
2983 + var React29 = __toESM(require_react(), 1);
2984 + var CSPContext = /* @__PURE__ */ React29.createContext(void 0);
2877 2985 if (true) CSPContext.displayName = "CSPContext";
2878 2986 var DEFAULT_CSP_CONTEXT_VALUE = {
2879 2987 disableStyleElements: false
2880 2988 };
2881 2989 function useCSPContext() {
2882 - return React28.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2990 + return React29.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2883 2991 }
2884 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 +
2885 3021 // node_modules/@base-ui/react/field/index.parts.mjs
2886 3022 var index_parts_exports = {};
2887 3023 __export(index_parts_exports, {
2888 3024 Control: () => FieldControl,
@@ -2894,16 +3030,16 @@
2894 3030 Validity: () => FieldValidity
2895 3031 });
2896 3032
2897 3033 // node_modules/@base-ui/react/field/root/FieldRoot.mjs
2898 - var React32 = __toESM(require_react(), 1);
3034 + var React33 = __toESM(require_react(), 1);
2899 3035
2900 3036 // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
2901 - var React29 = __toESM(require_react(), 1);
2902 - var FieldsetRootContext = /* @__PURE__ */ React29.createContext(void 0);
3037 + var React30 = __toESM(require_react(), 1);
3038 + var FieldsetRootContext = /* @__PURE__ */ React30.createContext(void 0);
2903 3039 if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
2904 3040 function useFieldsetRootContext(optional = false) {
2905 - const context = React29.useContext(FieldsetRootContext);
3041 + const context = React30.useContext(FieldsetRootContext);
2906 3042 if (!context && !optional) {
2907 3043 throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
2908 3044 }
2909 3045 return context;
@@ -2909,16 +3045,16 @@
2909 3045 return context;
2910 3046 }
2911 3047
2912 3048 // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
2913 - var React30 = __toESM(require_react(), 1);
3049 + var React31 = __toESM(require_react(), 1);
2914 3050 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
2915 3051 var LabelableProvider = function LabelableProvider2(props) {
2916 3052 const defaultId = useBaseUiId();
2917 - const initialControlId = props.controlId === void 0 ? defaultId : props.controlId;
2918 - const [controlId, setControlIdState] = React30.useState(initialControlId);
2919 - const [labelId, setLabelId] = React30.useState(props.labelId);
2920 - const [messageIds, setMessageIds] = React30.useState([]);
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;
2921 3057 const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
2922 3058 const {
2923 3059 messageIds: parentMessageIds
2924 3060 } = useLabelableContext();
@@ -2925,18 +3061,18 @@
2925 3061 const registerControlId = useStableCallback((source, nextId) => {
2926 3062 const registrations = registrationsRef.current;
2927 3063 if (nextId === void 0) {
2928 3064 registrations.delete(source);
2929 - return;
3065 + } else {
3066 + registrations.set(source, nextId);
2930 3067 }
2931 - registrations.set(source, nextId);
2932 3068 setControlIdState((prev) => {
2933 3069 if (registrations.size === 0) {
2934 - return void 0;
3070 + return prev;
2935 3071 }
2936 3072 let nextControlId;
2937 3073 for (const id of registrations.values()) {
2938 - if (prev !== void 0 && id === prev) {
3074 + if (id === prev) {
2939 3075 return prev;
2940 3076 }
2941 3077 if (nextControlId === void 0) {
2942 3078 nextControlId = id;
@@ -2944,9 +3080,14 @@
2944 3080 }
2945 3081 return nextControlId;
2946 3082 });
2947 3083 });
2948 - const getDescriptionProps = React30.useCallback((externalProps) => {
3084 + const resetControlId = useStableCallback(() => {
3085 + if (registrationsRef.current.size === 0) {
3086 + setControlIdState(defaultId);
3087 + }
3088 + });
3089 + const getDescriptionProps = React31.useCallback((externalProps) => {
2949 3090 const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
2950 3091 ids.push(...parentMessageIds, ...messageIds);
2951 3092 return {
2952 3093 ...externalProps,
@@ -2952,17 +3093,18 @@
2952 3093 ...externalProps,
2953 3094 "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
2954 3095 };
2955 3096 }, [parentMessageIds, messageIds]);
2956 - const contextValue = React30.useMemo(() => ({
3097 + const contextValue = React31.useMemo(() => ({
2957 3098 controlId,
2958 3099 registerControlId,
3100 + resetControlId,
2959 3101 labelId,
2960 3102 setLabelId,
2961 3103 messageIds,
2962 3104 setMessageIds,
2963 3105 getDescriptionProps
2964 - }), [controlId, registerControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
3106 + }), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
2965 3107 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LabelableContext.Provider, {
2966 3108 value: contextValue,
2967 3109 children: props.children
2968 3110 });
@@ -2969,13 +3111,14 @@
2969 3111 };
2970 3112 if (true) LabelableProvider.displayName = "LabelableProvider";
2971 3113
2972 3114 // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
2973 - var React31 = __toESM(require_react(), 1);
3115 + var React32 = __toESM(require_react(), 1);
2974 3116 function useFieldControlRegistration(params) {
2975 3117 const {
3118 + change,
2976 3119 commit,
2977 - invalid,
3120 + invalid: invalid2,
2978 3121 markedDirtyRef,
2979 3122 name: name16,
2980 3123 setRegisteredFieldName,
2981 3124 registeredFieldIdRef,
@@ -2984,11 +3127,11 @@
2984 3127 } = params;
2985 3128 const {
2986 3129 formRef
2987 3130 } = useFormContext();
2988 - const activeFieldControlSourceRef = React31.useRef(null);
2989 - const registrationRef = React31.useRef(null);
2990 - const initialValueCapturedRef = React31.useRef(false);
3131 + const activeFieldControlSourceRef = React32.useRef(null);
3132 + const registrationRef = React32.useRef(null);
3133 + const initialValueCapturedRef = React32.useRef(false);
2991 3134 const getValueForForm = useStableCallback(() => {
2992 3135 const registration = registrationRef.current;
2993 3136 if (!registration) {
2994 3137 return void 0;
@@ -3018,9 +3161,9 @@
3018 3161 formRef.current.fields.set(registration.id, {
3019 3162 getValue: getValueForForm,
3020 3163 name: name16 ?? registration.name,
3021 3164 controlRef: registration.controlRef,
3022 - validityData: getCombinedFieldValidityData(validityData, invalid),
3165 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3023 3166 validate
3024 3167 });
3025 3168 }
3026 3169 function deleteRegistration(id = registrationRef.current?.id) {
@@ -3048,12 +3191,12 @@
3048 3191 formRef.current.fields.set(registration.id, {
3049 3192 getValue: getValueForForm,
3050 3193 name: name16 ?? registration.name,
3051 3194 controlRef: registration.controlRef,
3052 - validityData: getCombinedFieldValidityData(validityData, invalid),
3195 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3053 3196 validate
3054 3197 });
3055 - }, [formRef, getValueForForm, invalid, name16, setRegisteredFieldName, validate, validityData]);
3198 + }, [formRef, getValueForForm, invalid2, name16, setRegisteredFieldName, validate, validityData]);
3056 3199 useIsoLayoutEffect(() => {
3057 3200 const fields = formRef.current.fields;
3058 3201 return () => {
3059 3202 const id = registrationRef.current?.id;
@@ -3065,8 +3208,9 @@
3065 3208 const register = useStableCallback((source, registration) => {
3066 3209 if (!registration) {
3067 3210 if (activeFieldControlSourceRef.current === source) {
3068 3211 activeFieldControlSourceRef.current = null;
3212 + change(void 0, true);
3069 3213 deleteRegistration();
3070 3214 registrationRef.current = null;
3071 3215 setRegisteredFieldName(void 0);
3072 3216 registeredFieldIdRef.current = void 0;
@@ -3073,8 +3217,12 @@
3073 3217 }
3074 3218 return;
3075 3219 }
3076 3220 const previousId = registrationRef.current?.id;
3221 + const previousSource = activeFieldControlSourceRef.current;
3222 + if (previousSource && previousSource !== source) {
3223 + change(void 0, true);
3224 + }
3077 3225 activeFieldControlSourceRef.current = source;
3078 3226 registrationRef.current = registration;
3079 3227 if (!name16) {
3080 3228 setRegisteredFieldName(registration.name);
@@ -3090,13 +3238,13 @@
3090 3238 }
3091 3239
3092 3240 // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3093 3241 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
3094 - var FieldRootInner = /* @__PURE__ */ React32.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
3242 + var FieldRootInner = /* @__PURE__ */ React33.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
3095 3243 const {
3096 3244 errors,
3097 3245 validationMode: formValidationMode,
3098 - submitAttemptedRef
3246 + submitCountRef
3099 3247 } = useFormContext();
3100 3248 const {
3101 3249 render,
3102 3250 className,
@@ -3114,17 +3262,17 @@
3114 3262 } = componentProps;
3115 3263 const disabledFieldset = useFieldsetRootContext(true)?.disabled;
3116 3264 const validate = useStableCallback(validateProp || (() => null));
3117 3265 const disabled2 = disabledFieldset || disabledProp;
3118 - const [touchedState, setTouchedUnwrapped] = React32.useState(false);
3119 - const [dirtyState, setDirtyUnwrapped] = React32.useState(false);
3120 - const [filled, setFilled] = React32.useState(false);
3121 - const [focused, setFocused] = React32.useState(false);
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);
3122 3270 const dirty = dirtyProp ?? dirtyState;
3123 3271 const touched = touchedProp ?? touchedState;
3124 - const markedDirtyRef = React32.useRef(dirty);
3125 - const registeredFieldIdRef = React32.useRef(void 0);
3126 - const [registeredFieldName, setRegisteredFieldName] = React32.useState();
3272 + const markedDirtyRef = React33.useRef(dirty);
3273 + const registeredFieldIdRef = React33.useRef(void 0);
3274 + const [registeredFieldName, setRegisteredFieldName] = React33.useState();
3127 3275 const effectiveName = name16 ?? registeredFieldName;
3128 3276 useIsoLayoutEffect(() => {
3129 3277 if (dirtyProp !== void 0) {
3130 3278 markedDirtyRef.current = dirtyProp;
@@ -3144,13 +3292,13 @@
3144 3292 return;
3145 3293 }
3146 3294 setTouchedUnwrapped(value);
3147 3295 });
3148 - const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitAttemptedRef.current);
3296 + const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
3149 3297 const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
3150 3298 const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3151 - const invalid = invalidProp === true || hasFormError;
3152 - const [validityData, setValidityData] = React32.useState({
3299 + const invalid2 = invalidProp === true || hasFormError;
3300 + const [validityData, setValidityData] = React33.useState({
3153 3301 state: DEFAULT_VALIDITY_STATE,
3154 3302 error: "",
3155 3303 errors: [],
3156 3304 value: null,
@@ -3155,31 +3303,33 @@
3155 3303 errors: [],
3156 3304 value: null,
3157 3305 initialValue: null
3158 3306 });
3159 - const valid = !invalid && (disabled2 ? null : validityData.state.valid);
3160 - const state = React32.useMemo(() => ({
3307 + const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
3308 + const state = React33.useMemo(() => ({
3161 3309 disabled: disabled2,
3162 3310 touched,
3163 3311 dirty,
3164 - valid,
3312 + valid: valid2,
3165 3313 filled,
3166 3314 focused
3167 - }), [disabled2, touched, dirty, valid, filled, focused]);
3315 + }), [disabled2, touched, dirty, valid2, filled, focused]);
3168 3316 const validation = useFieldValidation({
3169 3317 setValidityData,
3170 3318 validate,
3171 3319 validityData,
3172 3320 validationDebounceTime,
3173 - invalid,
3321 + invalid: invalid2,
3174 3322 markedDirtyRef,
3175 3323 state,
3176 3324 shouldValidateOnChange,
3325 + validationMode,
3177 3326 registeredFieldIdRef
3178 3327 });
3179 3328 const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
3329 + change: validation.change,
3180 3330 commit: validation.commit,
3181 - invalid,
3331 + invalid: invalid2,
3182 3332 markedDirtyRef,
3183 3333 name: name16,
3184 3334 setRegisteredFieldName,
3185 3335 registeredFieldIdRef,
@@ -3185,13 +3335,13 @@
3185 3335 registeredFieldIdRef,
3186 3336 setValidityData,
3187 3337 validityData
3188 3338 });
3189 - React32.useImperativeHandle(actionsRef, () => ({
3339 + React33.useImperativeHandle(actionsRef, () => ({
3190 3340 validate: validateFieldControl
3191 3341 }), [validateFieldControl]);
3192 - const contextValue = React32.useMemo(() => ({
3193 - invalid,
3342 + const contextValue = React33.useMemo(() => ({
3343 + invalid: invalid2,
3194 3344 name: effectiveName,
3195 3345 validityData,
3196 3346 setValidityData,
3197 3347 disabled: disabled2,
@@ -3203,9 +3353,9 @@
3203 3353 shouldValidateOnChange,
3204 3354 state,
3205 3355 registerFieldControl,
3206 3356 validation
3207 - }), [invalid, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
3357 + }), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
3208 3358 const element = useRenderElement("div", componentProps, {
3209 3359 ref: forwardedRef,
3210 3360 state,
3211 3361 props: elementProps,
@@ -3216,9 +3366,9 @@
3216 3366 children: element
3217 3367 });
3218 3368 });
3219 3369 if (true) FieldRootInner.displayName = "FieldRootInner";
3220 - var FieldRoot = /* @__PURE__ */ React32.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
3370 + var FieldRoot = /* @__PURE__ */ React33.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
3221 3371 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelableProvider, {
3222 3372 children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootInner, {
3223 3373 ...componentProps,
3224 3374 ref: forwardedRef
@@ -3227,10 +3377,10 @@
3227 3377 });
3228 3378 if (true) FieldRoot.displayName = "FieldRoot";
3229 3379
3230 3380 // node_modules/@base-ui/react/field/label/FieldLabel.mjs
3231 - var React33 = __toESM(require_react(), 1);
3232 - var FieldLabel = /* @__PURE__ */ React33.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
3381 + var React34 = __toESM(require_react(), 1);
3382 + var FieldLabel = /* @__PURE__ */ React34.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
3233 3383 const {
3234 3384 render,
3235 3385 className,
3236 3386 style,
@@ -3246,15 +3396,15 @@
3246 3396 const state = {
3247 3397 ...fieldRootContext.state,
3248 3398 disabled: fieldRootContext.disabled || fieldItemContext.disabled
3249 3399 };
3250 - const labelRef = React33.useRef(null);
3400 + const labelRef = React34.useRef(null);
3251 3401 const labelProps = useLabel({
3252 3402 id: labelId ?? idProp,
3253 3403 native: nativeLabel
3254 3404 });
3255 3405 if (true) {
3256 - React33.useEffect(() => {
3406 + React34.useEffect(() => {
3257 3407 if (!labelRef.current) {
3258 3408 return;
3259 3409 }
3260 3410 const isLabelTag = labelRef.current.tagName === "LABEL";
@@ -3281,15 +3431,15 @@
3281 3431 });
3282 3432 if (true) FieldLabel.displayName = "FieldLabel";
3283 3433
3284 3434 // node_modules/@base-ui/react/field/error/FieldError.mjs
3285 - var React34 = __toESM(require_react(), 1);
3435 + var React35 = __toESM(require_react(), 1);
3286 3436 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3287 3437 var stateAttributesMapping = {
3288 3438 ...fieldValidityMapping,
3289 3439 ...transitionStatusMapping
3290 3440 };
3291 - var FieldError = /* @__PURE__ */ React34.forwardRef(function FieldError2(componentProps, forwardedRef) {
3441 + var FieldError = /* @__PURE__ */ React35.forwardRef(function FieldError2(componentProps, forwardedRef) {
3292 3442 const {
3293 3443 render,
3294 3444 id: idProp,
3295 3445 className,
@@ -3335,11 +3485,11 @@
3335 3485 return () => {
3336 3486 setMessageIds((v) => v.filter((item) => item !== id));
3337 3487 };
3338 3488 }, [rendered, id, setMessageIds]);
3339 - const errorRef = React34.useRef(null);
3340 - const [lastRenderedMessage, setLastRenderedMessage] = React34.useState(null);
3341 - const [lastRenderedMessageKey, setLastRenderedMessageKey] = React34.useState(null);
3489 + const errorRef = React35.useRef(null);
3490 + const [lastRenderedMessage, setLastRenderedMessage] = React35.useState(null);
3491 + const [lastRenderedMessageKey, setLastRenderedMessageKey] = React35.useState(null);
3342 3492 let error2 = validityData.error;
3343 3493 if (!hasSpecificMatch && hasFormError) {
3344 3494 error2 = formError;
3345 3495 } else if (validityData.errors.length > 1) {
@@ -3388,10 +3538,10 @@
3388 3538 });
3389 3539 if (true) FieldError.displayName = "FieldError";
3390 3540
3391 3541 // node_modules/@base-ui/react/field/description/FieldDescription.mjs
3392 - var React35 = __toESM(require_react(), 1);
3393 - var FieldDescription = /* @__PURE__ */ React35.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
3542 + var React36 = __toESM(require_react(), 1);
3543 + var FieldDescription = /* @__PURE__ */ React36.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
3394 3544 const {
3395 3545 render,
3396 3546 id: idProp,
3397 3547 className,
@@ -3429,10 +3579,10 @@
3429 3579 });
3430 3580 if (true) FieldDescription.displayName = "FieldDescription";
3431 3581
3432 3582 // node_modules/@base-ui/react/field/control/FieldControl.mjs
3433 - var React36 = __toESM(require_react(), 1);
3434 - var FieldControl = /* @__PURE__ */ React36.forwardRef(function FieldControl2(componentProps, forwardedRef) {
3583 + var React37 = __toESM(require_react(), 1);
3584 + var FieldControl = /* @__PURE__ */ React37.forwardRef(function FieldControl2(componentProps, forwardedRef) {
3435 3585 const {
3436 3586 render,
3437 3587 className,
3438 3588 id: idProp,
@@ -3457,9 +3607,11 @@
3457 3607 validationMode,
3458 3608 validation
3459 3609 } = useFieldRootContext();
3460 3610 const {
3461 - clearErrors
3611 + clearErrors,
3612 + elementRef: formElementRef,
3613 + submitCountRef
3462 3614 } = useFormContext();
3463 3615 const disabled2 = fieldDisabled || disabledProp;
3464 3616 const name16 = fieldName ?? nameProp;
3465 3617 const state = {
@@ -3471,22 +3623,8 @@
3471 3623 } = useLabelableContext();
3472 3624 const id = useLabelableId({
3473 3625 id: idProp
3474 3626 });
3475 - useIsoLayoutEffect(() => {
3476 - const hasExternalValue = valueProp != null;
3477 - if (validation.inputRef.current?.value || hasExternalValue && valueProp !== "") {
3478 - setFilled(true);
3479 - } else if (hasExternalValue && valueProp === "") {
3480 - setFilled(false);
3481 - }
3482 - }, [validation.inputRef, setFilled, valueProp]);
3483 - const inputRef = React36.useRef(null);
3484 - useIsoLayoutEffect(() => {
3485 - if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {
3486 - setFocused(true);
3487 - }
3488 - }, [autoFocus, setFocused]);
3489 3627 const [valueUnwrapped] = useControlled({
3490 3628 controlled: valueProp,
3491 3629 default: defaultValue,
3492 3630 name: "FieldControl",
@@ -3493,10 +3631,32 @@
3493 3631 state: "value"
3494 3632 });
3495 3633 const isControlled = valueProp !== void 0;
3496 3634 const value = isControlled ? valueUnwrapped : void 0;
3635 + const serializedValue = value == null ? void 0 : String(value);
3497 3636 const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
3498 - useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput, !disabled2, nameProp);
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]);
3499 3659 const element = useRenderElement("input", componentProps, {
3500 3660 ref: [forwardedRef, inputRef],
3501 3661 state,
3502 3662 props: [{
@@ -3512,12 +3672,16 @@
3512 3672 defaultValue
3513 3673 },
3514 3674 onChange(event) {
3515 3675 const inputValue = event.currentTarget.value;
3516 - onValueChange?.(inputValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent));
3676 + const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
3677 + onValueChange?.(inputValue, details);
3678 + if (isControlled) {
3679 + return;
3680 + }
3517 3681 setDirty(inputValue !== (validityData.initialValue ?? ""));
3518 3682 setFilled(inputValue !== "");
3519 - if (!event.nativeEvent.defaultPrevented) {
3683 + if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
3520 3684 clearErrors(name16);
3521 3685 validation.change(inputValue);
3522 3686 }
3523 3687 },
@@ -3527,15 +3691,36 @@
3527 3691 onBlur(event) {
3528 3692 setTouched(true);
3529 3693 setFocused(false);
3530 3694 if (validationMode === "onBlur") {
3531 - validation.commit(event.currentTarget.value);
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 + }
3532 3705 }
3533 3706 },
3534 3707 onKeyDown(event) {
3535 3708 if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
3536 3709 setTouched(true);
3537 - validation.commit(event.currentTarget.value);
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 + }
3538 3723 }
3539 3724 }
3540 3725 }, elementProps, (props) => validation.getValidationProps(disabled2, props)],
3541 3726 stateAttributesMapping: fieldValidityMapping
@@ -3544,9 +3729,9 @@
3544 3729 });
3545 3730 if (true) FieldControl.displayName = "FieldControl";
3546 3731
3547 3732 // node_modules/@base-ui/react/field/validity/FieldValidity.mjs
3548 - var React37 = __toESM(require_react(), 1);
3733 + var React38 = __toESM(require_react(), 1);
3549 3734 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
3550 3735 var FieldValidity = function FieldValidity2(props) {
3551 3736 const {
3552 3737 children
@@ -3552,16 +3737,16 @@
3552 3737 children
3553 3738 } = props;
3554 3739 const {
3555 3740 validityData,
3556 - invalid
3741 + invalid: invalid2
3557 3742 } = useFieldRootContext(false);
3558 - const combinedFieldValidityData = React37.useMemo(() => getCombinedFieldValidityData(validityData, invalid), [validityData, invalid]);
3743 + const combinedFieldValidityData = React38.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
3559 3744 const isInvalid = combinedFieldValidityData.state.valid === false;
3560 3745 const {
3561 3746 transitionStatus
3562 3747 } = useTransitionStatus(isInvalid);
3563 - const fieldValidityState = React37.useMemo(() => {
3748 + const fieldValidityState = React38.useMemo(() => {
3564 3749 return {
3565 3750 ...combinedFieldValidityData,
3566 3751 validity: combinedFieldValidityData.state,
3567 3752 transitionStatus
@@ -3566,9 +3751,9 @@
3566 3751 validity: combinedFieldValidityData.state,
3567 3752 transitionStatus
3568 3753 };
3569 3754 }, [combinedFieldValidityData, transitionStatus]);
3570 - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React37.Fragment, {
3755 + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React38.Fragment, {
3571 3756 children: children(fieldValidityState)
3572 3757 });
3573 3758 };
3574 3759 if (true) FieldValidity.displayName = "FieldValidity";
@@ -3573,11 +3758,11 @@
3573 3758 };
3574 3759 if (true) FieldValidity.displayName = "FieldValidity";
3575 3760
3576 3761 // node_modules/@base-ui/react/field/item/FieldItem.mjs
3577 - var React38 = __toESM(require_react(), 1);
3762 + var React39 = __toESM(require_react(), 1);
3578 3763 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
3579 - var FieldItem = /* @__PURE__ */ React38.forwardRef(function FieldItem2(componentProps, forwardedRef) {
3764 + var FieldItem = /* @__PURE__ */ React39.forwardRef(function FieldItem2(componentProps, forwardedRef) {
3580 3765 const {
3581 3766 render,
3582 3767 className,
3583 3768 style,
@@ -3592,9 +3777,9 @@
3592 3777 const state = {
3593 3778 ...fieldState,
3594 3779 disabled: disabled2
3595 3780 };
3596 - const fieldItemContext = React38.useMemo(() => ({
3781 + const fieldItemContext = React39.useMemo(() => ({
3597 3782 disabled: disabled2
3598 3783 }), [disabled2]);
3599 3784 const element = useRenderElement("div", componentProps, {
3600 3785 ref: forwardedRef,
@@ -3611,11 +3796,11 @@
3611 3796 });
3612 3797 if (true) FieldItem.displayName = "FieldItem";
3613 3798
3614 3799 // node_modules/@base-ui/react/input/Input.mjs
3615 - var React39 = __toESM(require_react(), 1);
3800 + var React40 = __toESM(require_react(), 1);
3616 3801 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
3617 - var Input = /* @__PURE__ */ React39.forwardRef(function Input2(props, forwardedRef) {
3802 + var Input = /* @__PURE__ */ React40.forwardRef(function Input2(props, forwardedRef) {
3618 3803 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Control, {
3619 3804 ref: forwardedRef,
3620 3805 ...props
3621 3806 });
@@ -3622,18 +3807,17 @@
3622 3807 });
3623 3808 if (true) Input.displayName = "Input";
3624 3809
3625 3810 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
3626 - var React41 = __toESM(require_react(), 1);
3811 + var React42 = __toESM(require_react(), 1);
3627 3812
3628 3813 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
3629 - var React40 = __toESM(require_react(), 1);
3814 + var React41 = __toESM(require_react(), 1);
3630 3815
3631 3816 // node_modules/@base-ui/react/internals/composite/constants.mjs
3632 3817 var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
3633 3818
3634 3819 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
3635 - var EMPTY_ARRAY2 = [];
3636 3820 function useCompositeRoot(params) {
3637 3821 const {
3638 3822 loopFocus = true,
3639 3823 orientation = "both",
@@ -3645,28 +3829,45 @@
3645 3829 rootRef: externalRef,
3646 3830 enableHomeAndEndKeys = false,
3647 3831 stopEventPropagation,
3648 3832 disabledIndices,
3649 - modifierKeys = EMPTY_ARRAY2
3833 + modifierKeys = EMPTY_ARRAY
3650 3834 } = params;
3651 - const [internalHighlightedIndex, internalSetHighlightedIndex] = React40.useState(0);
3835 + const [internalHighlightedIndex, internalSetHighlightedIndex] = React41.useState(0);
3652 3836 const isGrid = grid != null;
3653 - const rootRef = React40.useRef(null);
3837 + const rootRef = React41.useRef(null);
3654 3838 const mergedRef = useMergedRefs(rootRef, externalRef);
3655 - const elementsRef = React40.useRef([]);
3656 - const hasSetDefaultIndexRef = React40.useRef(false);
3839 + const elementsRef = React41.useRef([]);
3840 + const hasSetDefaultIndexRef = React41.useRef(false);
3841 + const highlightedElementRef = React41.useRef(null);
3657 3842 const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
3658 - const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
3659 - (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
3843 + const onHighlightedIndexChange = useStableCallback((index2, shouldScrollIntoView = false) => {
3844 + highlightedElementRef.current = elementsRef.current[index2] ?? null;
3845 + (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index2);
3660 3846 if (shouldScrollIntoView) {
3661 - const newActiveItem = elementsRef.current[index];
3847 + const newActiveItem = elementsRef.current[index2];
3662 3848 scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
3663 3849 }
3664 3850 });
3665 3851 const onMapChange = useStableCallback((map) => {
3666 - if (map.size === 0 || hasSetDefaultIndexRef.current) {
3852 + if (map.size === 0) {
3667 3853 return;
3668 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 + }
3669 3870 hasSetDefaultIndexRef.current = true;
3670 3871 const sortedElements = Array.from(map.keys());
3671 3872 const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
3672 3873 const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
@@ -3812,8 +4013,24 @@
3812 4013 onMapChange,
3813 4014 relayKeyboardEvent: onKeyDown
3814 4015 };
3815 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 + }
3816 4033 function isModifierKeySet(event, ignoredModifierKeys) {
3817 4034 for (const key of MODIFIER_KEYS) {
3818 4035 if (ignoredModifierKeys.includes(key)) {
3819 4036 continue;
@@ -3879,9 +4096,9 @@
3879 4096 ref: refs,
3880 4097 props: [defaultProps, ...props, elementProps],
3881 4098 stateAttributesMapping: stateAttributesMapping4
3882 4099 });
3883 - const contextValue = React41.useMemo(() => ({
4100 + const contextValue = React42.useMemo(() => ({
3884 4101 highlightedIndex,
3885 4102 onHighlightedIndexChange,
3886 4103 highlightItemOnHover,
3887 4104 relayKeyboardEvent
@@ -3917,9 +4134,9 @@
3917 4134 return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
3918 4135 }
3919 4136
3920 4137 // node_modules/@base-ui/react/internals/PrehydrationScript.mjs
3921 - var React42 = __toESM(require_react(), 1);
4138 + var React43 = __toESM(require_react(), 1);
3922 4139 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
3923 4140 function PrehydrationScript(props) {
3924 4141 const {
3925 4142 script: script2
@@ -3950,16 +4167,16 @@
3950 4167 Tab: () => TabsTab
3951 4168 });
3952 4169
3953 4170 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
3954 - var React44 = __toESM(require_react(), 1);
4171 + var React45 = __toESM(require_react(), 1);
3955 4172
3956 4173 // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
3957 - var React43 = __toESM(require_react(), 1);
3958 - var TabsRootContext = /* @__PURE__ */ React43.createContext(void 0);
4174 + var React44 = __toESM(require_react(), 1);
4175 + var TabsRootContext = /* @__PURE__ */ React44.createContext(void 0);
3959 4176 if (true) TabsRootContext.displayName = "TabsRootContext";
3960 4177 function useTabsRootContext() {
3961 - const context = React43.useContext(TabsRootContext);
4178 + const context = React44.useContext(TabsRootContext);
3962 4179 if (context === void 0) {
3963 4180 throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
3964 4181 }
3965 4182 return context;
@@ -3964,18 +4181,21 @@
3964 4181 }
3965 4182 return context;
3966 4183 }
3967 4184
4185 + // node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
4186 + var activationDirection = "data-activation-direction";
4187 +
3968 4188 // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs
3969 4189 var tabsStateAttributesMapping = {
3970 4190 tabActivationDirection: (dir) => ({
3971 - "data-activation-direction": dir
4191 + [activationDirection]: dir
3972 4192 })
3973 4193 };
3974 4194
3975 4195 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
3976 4196 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
3977 - var TabsRoot = /* @__PURE__ */ React44.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
4197 + var TabsRoot = /* @__PURE__ */ React45.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
3978 4198 const {
3979 4199 className,
3980 4200 defaultValue: defaultValueProp = 0,
3981 4201 onValueChange: onValueChangeProp,
@@ -3985,10 +4205,10 @@
3985 4205 style,
3986 4206 ...elementProps
3987 4207 } = componentProps;
3988 4208 const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0;
3989 - const tabPanelRefs = React44.useRef([]);
3990 - const [mountedTabPanels, setMountedTabPanels] = React44.useState(() => /* @__PURE__ */ new Map());
4209 + const tabPanelRefs = React45.useRef([]);
4210 + const [mountedTabPanels, setMountedTabPanels] = React45.useState(() => /* @__PURE__ */ new Map());
3991 4211 const [value, setValue] = useControlled({
3992 4212 controlled: valueProp,
3993 4213 default: defaultValueProp,
3994 4214 name: "Tabs",
@@ -3994,12 +4214,12 @@
3994 4214 name: "Tabs",
3995 4215 state: "value"
3996 4216 });
3997 4217 const isControlled = valueProp !== void 0;
3998 - const [tabMap, setTabMap] = React44.useState(() => /* @__PURE__ */ new Map());
3999 - const lastKnownTabElementRef = React44.useRef(void 0);
4000 - const getTabElementBySelectedValue = React44.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]);
4001 - const [activationDirectionState, setActivationDirectionState] = React44.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(() => ({
4002 4222 previousValue: value,
4003 4223 tabActivationDirection: "none"
4004 4224 }));
4005 4225 const {
@@ -4023,10 +4243,10 @@
4023 4243 tabActivationDirection
4024 4244 });
4025 4245 }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);
4026 4246 const onValueChange = useStableCallback((newValue, eventDetails) => {
4027 - const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
4028 - eventDetails.activationDirection = activationDirection;
4247 + const activationDirection2 = computeActivationDirection(value, newValue, orientation, tabMap);
4248 + eventDetails.activationDirection = activationDirection2;
4029 4249 onValueChangeProp?.(newValue, eventDetails);
4030 4250 if (eventDetails.isCanceled) {
4031 4251 return;
4032 4252 }
@@ -4053,12 +4273,12 @@
4053 4273 return next;
4054 4274 });
4055 4275 };
4056 4276 });
4057 - const getTabPanelIdByValue = React44.useCallback((tabValue) => {
4277 + const getTabPanelIdByValue = React45.useCallback((tabValue) => {
4058 4278 return mountedTabPanels.get(tabValue);
4059 4279 }, [mountedTabPanels]);
4060 - const getTabIdByPanelValue = React44.useCallback((tabPanelValue) => {
4280 + const getTabIdByPanelValue = React45.useCallback((tabPanelValue) => {
4061 4281 for (const tabMetadata of tabMap.values()) {
4062 4282 if (tabPanelValue === tabMetadata.value) {
4063 4283 return tabMetadata.id;
4064 4284 }
@@ -4064,9 +4284,9 @@
4064 4284 }
4065 4285 }
4066 4286 return void 0;
4067 4287 }, [tabMap]);
4068 - const tabsContextValue = React44.useMemo(() => ({
4288 + const tabsContextValue = React45.useMemo(() => ({
4069 4289 getTabElementBySelectedValue,
4070 4290 getTabIdByPanelValue,
4071 4291 getTabPanelIdByValue,
4072 4292 onValueChange,
@@ -4075,9 +4295,9 @@
4075 4295 setTabMap,
4076 4296 tabActivationDirection,
4077 4297 value
4078 4298 }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]);
4079 - const selectedTabMetadata = React44.useMemo(() => {
4299 + const selectedTabMetadata = React45.useMemo(() => {
4080 4300 for (const tabMetadata of tabMap.values()) {
4081 4301 if (tabMetadata.value === value) {
4082 4302 return tabMetadata;
4083 4303 }
@@ -4083,9 +4303,9 @@
4083 4303 }
4084 4304 }
4085 4305 return void 0;
4086 4306 }, [tabMap, value]);
4087 - const firstEnabledTabValue = React44.useMemo(() => {
4307 + const firstEnabledTabValue = React45.useMemo(() => {
4088 4308 for (const tabMetadata of tabMap.values()) {
4089 4309 if (!tabMetadata.disabled) {
4090 4310 return tabMetadata.value;
4091 4311 }
@@ -4091,12 +4311,12 @@
4091 4311 }
4092 4312 }
4093 4313 return void 0;
4094 4314 }, [tabMap]);
4095 - const shouldNotifyInitialValueChangeRef = React44.useRef(!hasExplicitDefaultValueProp);
4096 - const initialDefaultValueRef = React44.useRef(defaultValueProp);
4097 - const shouldHonorDisabledDefaultValueRef = React44.useRef(hasExplicitDefaultValueProp);
4098 - const didRegisterTabsRef = React44.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);
4099 4319 useIsoLayoutEffect(() => {
4100 4320 if (isControlled) {
4101 4321 return;
4102 4322 }
@@ -4197,16 +4417,16 @@
4197 4417 return "none";
4198 4418 }
4199 4419
4200 4420 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4201 - var React46 = __toESM(require_react(), 1);
4421 + var React47 = __toESM(require_react(), 1);
4202 4422
4203 4423 // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
4204 - var React45 = __toESM(require_react(), 1);
4205 - var TabsListContext = /* @__PURE__ */ React45.createContext(void 0);
4424 + var React46 = __toESM(require_react(), 1);
4425 + var TabsListContext = /* @__PURE__ */ React46.createContext(void 0);
4206 4426 if (true) TabsListContext.displayName = "TabsListContext";
4207 4427 function useTabsListContext() {
4208 - const context = React45.useContext(TabsListContext);
4428 + const context = React46.useContext(TabsListContext);
4209 4429 if (context === void 0) {
4210 4430 throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
4211 4431 }
4212 4432 return context;
@@ -4212,9 +4432,9 @@
4212 4432 return context;
4213 4433 }
4214 4434
4215 4435 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4216 - var TabsTab = /* @__PURE__ */ React46.forwardRef(function TabsTab2(componentProps, forwardedRef) {
4436 + var TabsTab = /* @__PURE__ */ React47.forwardRef(function TabsTab2(componentProps, forwardedRef) {
4217 4437 const {
4218 4438 className,
4219 4439 disabled: disabled2 = false,
4220 4440 render,
@@ -4240,9 +4460,9 @@
4240 4460 highlightedIndex,
4241 4461 onHighlightedIndexChange
4242 4462 } = useCompositeRootContext();
4243 4463 const id = useBaseUiId(idProp);
4244 - const tabMetadata = React46.useMemo(() => ({
4464 + const tabMetadata = React47.useMemo(() => ({
4245 4465 disabled: disabled2,
4246 4466 id,
4247 4467 value
4248 4468 }), [disabled2, id, value]);
@@ -4248,9 +4468,9 @@
4248 4468 }), [disabled2, id, value]);
4249 4469 const {
4250 4470 compositeProps,
4251 4471 compositeRef,
4252 - index
4472 + index: index2
4253 4473 // hook is used instead of the CompositeItem component
4254 4474 // because the index is needed for Tab internals
4255 4475 } = useCompositeItem({
4256 4476 metadata: tabMetadata
@@ -4255,10 +4475,10 @@
4255 4475 } = useCompositeItem({
4256 4476 metadata: tabMetadata
4257 4477 });
4258 4478 const active = value === activeTabValue;
4259 - const isNavigatingRef = React46.useRef(false);
4260 - const unobserveTabElementRef = React46.useRef(null);
4479 + const isNavigatingRef = React47.useRef(false);
4480 + const unobserveTabElementRef = React47.useRef(null);
4261 4481 const observeTabElement = useStableCallback((element2) => {
4262 4482 unobserveTabElementRef.current?.();
4263 4483 unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null;
4264 4484 });
@@ -4266,9 +4486,9 @@
4266 4486 if (isNavigatingRef.current) {
4267 4487 isNavigatingRef.current = false;
4268 4488 return;
4269 4489 }
4270 - if (!(active && index > -1 && highlightedIndex !== index)) {
4490 + if (!(active && index2 > -1 && highlightedIndex !== index2)) {
4271 4491 return;
4272 4492 }
4273 4493 const listElement = tabsListElement;
4274 4494 if (listElement != null) {
@@ -4277,11 +4497,11 @@
4277 4497 return;
4278 4498 }
4279 4499 }
4280 4500 if (!disabled2) {
4281 - onHighlightedIndexChange(index);
4501 + onHighlightedIndexChange(index2);
4282 4502 }
4283 - }, [active, index, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]);
4503 + }, [active, index2, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]);
4284 4504 const {
4285 4505 getButtonProps,
4286 4506 buttonRef
4287 4507 } = useButton({
@@ -4289,10 +4509,10 @@
4289 4509 native: nativeButton,
4290 4510 focusableWhenDisabled: true
4291 4511 });
4292 4512 const tabPanelId = getTabPanelIdByValue(value);
4293 - const isPressingRef = React46.useRef(false);
4294 - const isMainButtonRef = React46.useRef(false);
4513 + const isPressingRef = React47.useRef(false);
4514 + const isMainButtonRef = React47.useRef(false);
4295 4515 function activate(event) {
4296 4516 onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
4297 4517 activationDirection: "none"
4298 4518 }));
@@ -4356,9 +4576,19 @@
4356 4576 });
4357 4577 if (true) TabsTab.displayName = "TabsTab";
4358 4578
4359 4579 // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4360 - var React47 = __toESM(require_react(), 1);
4580 + var React48 = __toESM(require_react(), 1);
4581 +
4582 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
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";
4589 +
4590 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4361 4591 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4362 4592 var _PrehydrationScript;
4363 4593 var stateAttributesMapping2 = {
4364 4594 ...tabsStateAttributesMapping,
@@ -4364,9 +4594,10 @@
4364 4594 ...tabsStateAttributesMapping,
4365 4595 activeTabPosition: () => null,
4366 4596 activeTabSize: () => null
4367 4597 };
4368 - var TabsIndicator = /* @__PURE__ */ React47.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
4598 + var MAX_LAYOUT_ROUNDING_ERROR = 2;
4599 + var TabsIndicator = /* @__PURE__ */ React48.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
4369 4600 const {
4370 4601 className,
4371 4602 render,
4372 4603 renderBeforeHydration = false,
@@ -4383,9 +4614,9 @@
4383 4614 tabsListElement,
4384 4615 registerIndicatorUpdateListener
4385 4616 } = useTabsListContext();
4386 4617 const rerender = useForcedRerendering();
4387 - React47.useEffect(() => {
4618 + React48.useEffect(() => {
4388 4619 return registerIndicatorUpdateListener(rerender);
4389 4620 }, [registerIndicatorUpdateListener, rerender]);
4390 4621 let left = 0;
4391 4622 let right = 0;
@@ -4409,17 +4640,17 @@
4409 4640 const tabRect = activeTab.getBoundingClientRect();
4410 4641 const tabsListRect = tabsListElement.getBoundingClientRect();
4411 4642 const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
4412 4643 const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
4413 - const hasNonZeroScale = scaleX > Number.EPSILON && scaleY > Number.EPSILON;
4414 - if (hasNonZeroScale) {
4415 - const tabLeftDelta = tabRect.left - tabsListRect.left;
4416 - const tabTopDelta = tabRect.top - tabsListRect.top;
4417 - left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
4418 - top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
4419 - } else {
4420 - left = activeTab.offsetLeft;
4421 - 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;
4422 4653 }
4423 4654 width = computedWidth;
4424 4655 height = computedHeight;
4425 4656 right = tabsListElement.scrollWidth - left - width;
@@ -4436,14 +4667,14 @@
4436 4667 width,
4437 4668 height
4438 4669 } : null;
4439 4670 const style = isTabSelected ? {
4440 - "--active-tab-left": `${left}px`,
4441 - "--active-tab-right": `${right}px`,
4442 - "--active-tab-top": `${top}px`,
4443 - "--active-tab-bottom": `${bottom}px`,
4444 - "--active-tab-width": `${width}px`,
4445 - "--active-tab-height": `${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`
4446 4677 } : void 0;
4447 4678 const displayIndicator = isTabSelected && width > 0 && height > 0;
4448 4679 const state = {
4449 4680 orientation,
@@ -4466,9 +4697,9 @@
4466 4697 });
4467 4698 if (value == null) {
4468 4699 return null;
4469 4700 }
4470 - return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React47.Fragment, {
4701 + return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React48.Fragment, {
4471 4702 children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrehydrationScript, {
4472 4703 script
4473 4704 })))]
4474 4705 });
@@ -4473,16 +4704,89 @@
4473 4704 })))]
4474 4705 });
4475 4706 });
4476 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 + }
4477 4774
4478 4775 // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4479 - var React48 = __toESM(require_react(), 1);
4776 + var React49 = __toESM(require_react(), 1);
4777 +
4778 + // node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
4779 + var index = "data-index";
4780 + var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle;
4781 + var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle;
4782 +
4783 + // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4480 4784 var stateAttributesMapping3 = {
4481 4785 ...tabsStateAttributesMapping,
4482 4786 ...transitionStatusMapping
4483 4787 };
4484 - var TabsPanel = /* @__PURE__ */ React48.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
4788 + var TabsPanel = /* @__PURE__ */ React49.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
4485 4789 const {
4486 4790 className,
4487 4791 value,
4488 4792 render,
@@ -4499,9 +4803,9 @@
4499 4803 } = useTabsRootContext();
4500 4804 const id = useBaseUiId();
4501 4805 const {
4502 4806 ref: listItemRef,
4503 - index
4807 + index: index2
4504 4808 } = useCompositeListItem();
4505 4809 const open = value === selectedValue;
4506 4810 const {
4507 4811 mounted,
@@ -4515,9 +4819,9 @@
4515 4819 orientation,
4516 4820 tabActivationDirection,
4517 4821 transitionStatus
4518 4822 };
4519 - const panelRef = React48.useRef(null);
4823 + const panelRef = React49.useRef(null);
4520 4824 const element = useRenderElement("div", componentProps, {
4521 4825 state,
4522 4826 ref: [forwardedRef, listItemRef, panelRef],
4523 4827 props: [{
@@ -4527,9 +4831,9 @@
4527 4831 role: "tabpanel",
4528 4832 tabIndex: open ? 0 : -1,
4529 4833 inert: inertValue(!open),
4530 4834 // Computed key: a plain literal key fails the DOM-props excess property check.
4531 - ["data-index"]: index
4835 + [index]: index2
4532 4836 }, elementProps],
4533 4837 stateAttributesMapping: stateAttributesMapping3
4534 4838 });
4535 4839 useOpenChangeComplete({
@@ -4555,11 +4859,11 @@
4555 4859 });
4556 4860 if (true) TabsPanel.displayName = "TabsPanel";
4557 4861
4558 4862 // node_modules/@base-ui/react/tabs/list/TabsList.mjs
4559 - var React49 = __toESM(require_react(), 1);
4863 + var React50 = __toESM(require_react(), 1);
4560 4864 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
4561 - var TabsList = /* @__PURE__ */ React49.forwardRef(function TabsList2(componentProps, forwardedRef) {
4865 + var TabsList = /* @__PURE__ */ React50.forwardRef(function TabsList2(componentProps, forwardedRef) {
4562 4866 const {
4563 4867 activateOnFocus = false,
4564 4868 className,
4565 4869 loopFocus = true,
@@ -4571,13 +4875,13 @@
4571 4875 orientation,
4572 4876 setTabMap,
4573 4877 tabActivationDirection
4574 4878 } = useTabsRootContext();
4575 - const [highlightedTabIndex, setHighlightedTabIndex] = React49.useState(0);
4576 - const [tabsListElement, setTabsListElement] = React49.useState(null);
4577 - const indicatorUpdateListenersRef = React49.useRef(/* @__PURE__ */ new Set());
4578 - const tabResizeObserverElementsRef = React49.useRef(/* @__PURE__ */ new Set());
4579 - const resizeObserverRef = React49.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);
4580 4884 useIsoLayoutEffect(() => {
4581 4885 if (typeof ResizeObserver === "undefined") {
4582 4886 return void 0;
4583 4887 }
@@ -4619,9 +4923,9 @@
4619 4923 const defaultProps = {
4620 4924 "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
4621 4925 role: "tablist"
4622 4926 };
4623 - const tabsListContextValue = React49.useMemo(() => ({
4927 + const tabsListContextValue = React50.useMemo(() => ({
4624 4928 activateOnFocus,
4625 4929 registerIndicatorUpdateListener,
4626 4930 registerTabResizeObserverElement,
4627 4931 tabsListElement
@@ -4906,9 +5210,9 @@
4906 5210 injectStyle2(targetDocument, hash, css);
4907 5211 }
4908 5212 }
4909 5213 if (typeof process === "undefined" || true) {
4910 - 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}}}");
4911 5215 }
4912 5216 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
4913 5217 var VisuallyHidden = (0, import_element4.forwardRef)(
4914 5218 function VisuallyHidden2({ render, ...restProps }, ref) {
@@ -7453,11 +7757,11 @@
7453 7757 initialIndex = endIndex - 1;
7454 7758 } else {
7455 7759 return EMPTY_BOUNDARIES;
7456 7760 }
7457 - const index = newFormats[initialIndex].indexOf(targetFormat);
7458 - startIndex = walkToStart(newFormats, initialIndex, targetFormat, index);
7459 - endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index);
7761 + const index2 = newFormats[initialIndex].indexOf(targetFormat);
7762 + startIndex = walkToStart(newFormats, initialIndex, targetFormat, index2);
7763 + endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index2);
7460 7764 startIndex = startIndex < 0 ? 0 : startIndex;
7461 7765 return {
7462 7766 start: startIndex,
7463 7767 end: endIndex + 1
@@ -7463,9 +7767,9 @@
7463 7767 end: endIndex + 1
7464 7768 };
7465 7769 }
7466 7770 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) {
7467 - let index = initialIndex;
7771 + let index2 = initialIndex;
7468 7772 const directions = {
7469 7773 forwards: 1,
7470 7774 backwards: -1
7471 7775 };
@@ -7470,13 +7774,13 @@
7470 7774 backwards: -1
7471 7775 };
7472 7776 const directionIncrement = directions[direction] || 1;
7473 7777 const inverseDirectionIncrement = directionIncrement * -1;
7474 - while (formats[index] && formats[index][formatIndex] === targetFormatRef) {
7475 - index = index + directionIncrement;
7778 + while (formats[index2] && formats[index2][formatIndex] === targetFormatRef) {
7779 + index2 = index2 + directionIncrement;
7476 7780 }
7477 - index = index + inverseDirectionIncrement;
7478 - return index;
7781 + index2 = index2 + inverseDirectionIncrement;
7782 + return index2;
7479 7783 }
7480 7784 var walkToStart = (...args) => walkToBoundary(...args, "backwards");
7481 7785 var walkToEnd = (...args) => walkToBoundary(...args, "forwards");
7482 7786
@@ -8211,9 +8515,9 @@
8211 8515 var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
8212 8516 var transparentValue = "rgba(0, 0, 0, 0)";
8213 8517 var name8 = "core/text-color";
8214 8518 var title8 = (0, import_i18n15.__)("Highlight");
8215 - var EMPTY_ARRAY3 = [];
8519 + var EMPTY_ARRAY2 = [];
8216 8520 function getComputedStyleProperty(element, property) {
8217 8521 const { ownerDocument: ownerDocument2 } = element;
8218 8522 const { defaultView } = ownerDocument2;
8219 8523 const style = defaultView?.getComputedStyle(element);
@@ -8238,9 +8542,9 @@
8238 8542 isActive,
8239 8543 activeAttributes,
8240 8544 contentRef
8241 8545 }) {
8242 - const [allowCustomControl, colors = EMPTY_ARRAY3] = (0, import_block_editor10.useSettings)(
8546 + const [allowCustomControl, colors = EMPTY_ARRAY2] = (0, import_block_editor10.useSettings)(
8243 8547 "color.custom",
8244 8548 "color.palette"
8245 8549 );
8246 8550 const [isAddingColor, setIsAddingColor] = (0, import_element31.useState)(false);
@@ -8640,27 +8944,39 @@
8640 8944 focusOnMount: false,
8641 8945 anchor: popoverAnchor,
8642 8946 onFocusOutside: () => formRef.current?.reportValidity(),
8643 8947 className: "block-editor-format-toolbar__math-popover",
8644 - children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8948 + children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
8645 8949 "form",
8646 8950 {
8647 8951 ref: formRef,
8648 - style: { minWidth: "300px", padding: "4px" },
8952 + style: { minWidth: "300px", padding: "16px" },
8649 8953 onSubmit: (event) => event.preventDefault(),
8650 - children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8651 - ValidatedInputControl,
8652 - {
8653 - hideLabelFromVision: true,
8654 - label: (0, import_i18n21.__)("LaTeX math syntax"),
8655 - value: latex,
8656 - customValidity: error2 ? { type: "invalid", message: error2 } : void 0,
8657 - onValueChange: handleLatexChange,
8658 - placeholder: (0, import_i18n21.__)("e.g., x^2, \\frac{a}{b}"),
8659 - autoComplete: "off",
8660 - className: "block-editor-format-toolbar__math-input"
8661 - }
8662 - )
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 + ]
8663 8979 }
8664 8980 )
8665 8981 }
8666 8982 );
@@ -8781,20 +9097,20 @@
8781 9097 __experimentalCreatePrepareEditableTree() {
8782 9098 return (formats, text) => {
8783 9099 const NBSP = "\xA0";
8784 9100 let record = { formats, text };
8785 - let index = -1;
9101 + let index2 = -1;
8786 9102 do {
8787 - index = text.indexOf(NBSP, index + 1);
8788 - if (index !== -1) {
9103 + index2 = text.indexOf(NBSP, index2 + 1);
9104 + if (index2 !== -1) {
8789 9105 record = (0, import_rich_text17.applyFormat)(
8790 9106 record,
8791 9107 { type: name15 },
8792 - index,
8793 - index + 1
9108 + index2,
9109 + index2 + 1
8794 9110 );
8795 9111 }
8796 - } while (index !== -1);
9112 + } while (index2 !== -1);
8797 9113 return record.formats;
8798 9114 };
8799 9115 }
8800 9116 };