| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 var __create = Object.create; 2 var __defProp = Object.defineProperty; 3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4 var __getOwnPropNames = Object.getOwnPropertyNames; 5 var __getProtoOf = Object.getPrototypeOf; 6 var __hasOwnProp = Object.prototype.hasOwnProperty; 7 var __commonJS = (cb, mod) => function __require() { 8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 9 }; 10 var __export = (target, all) => { 11 for (var name in all) 12 __defProp(target, name, { get: all[name], enumerable: true }); 13 }; 14 var __copyProps = (to, from, except, desc) => { 15 if (from && typeof from === "object" || typeof from === "function") { 16 for (let key of __getOwnPropNames(from)) 17 if (!__hasOwnProp.call(to, key) && key !== except) 18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 19 } 20 return to; 21 }; 22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 23 // If the importer is in node compatibility mode or this is not an ESM 24 // file that has been converted to a CommonJS file using a Babel- 25 // compatible transform (i.e. "__esModule" has not been set), then set 26 // "default" to the CommonJS "module.exports" for node compatibility. 27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 28 mod 29 )); 30 31 // package-external:@wordpress/element 32 var require_element = __commonJS({ 33 "package-external:@wordpress/element"(exports, module) { 34 module.exports = window.wp.element; 35 } 36 }); 37 38 // package-external:@wordpress/data 39 var require_data = __commonJS({ 40 "package-external:@wordpress/data"(exports, module) { 41 module.exports = window.wp.data; 42 } 43 }); 44 45 // package-external:@wordpress/i18n 46 var require_i18n = __commonJS({ 47 "package-external:@wordpress/i18n"(exports, module) { 48 module.exports = window.wp.i18n; 49 } 50 }); 51 52 // vendor-external:react 53 var require_react = __commonJS({ 54 "vendor-external:react"(exports, module) { 55 module.exports = window.React; 56 } 57 }); 58 59 // vendor-external:react/jsx-runtime 60 var require_jsx_runtime = __commonJS({ 61 "vendor-external:react/jsx-runtime"(exports, module) { 62 module.exports = window.ReactJSXRuntime; 63 } 64 }); 65 66 // vendor-external:react-dom 67 var require_react_dom = __commonJS({ 68 "vendor-external:react-dom"(exports, module) { 69 module.exports = window.ReactDOM; 70 } 71 }); 72 73 // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js 74 var require_use_sync_external_store_shim_development = __commonJS({ 75 "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { 76 "use strict"; 77 (function() { 78 function is(x, y) { 79 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 80 } 81 function useSyncExternalStore$2(subscribe, getSnapshot) { 82 didWarnOld18Alpha || void 0 === React48.startTransition || (didWarnOld18Alpha = true, console.error( 83 "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." 84 )); 85 var value = getSnapshot(); 86 if (!didWarnUncachedGetSnapshot) { 87 var cachedValue = getSnapshot(); 88 objectIs(value, cachedValue) || (console.error( 89 "The result of getSnapshot should be cached to avoid an infinite loop" 90 ), didWarnUncachedGetSnapshot = true); 91 } 92 cachedValue = useState19({ 93 inst: { value, getSnapshot } 94 }); 95 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 96 useLayoutEffect3( 97 function() { 98 inst.value = value; 99 inst.getSnapshot = getSnapshot; 100 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 101 }, 102 [subscribe, value, getSnapshot] 103 ); 104 useEffect18( 105 function() { 106 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 107 return subscribe(function() { 108 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 109 }); 110 }, 111 [subscribe] 112 ); 113 useDebugValue2(value); 114 return value; 115 } 116 function checkIfSnapshotChanged(inst) { 117 var latestGetSnapshot = inst.getSnapshot; 118 inst = inst.value; 119 try { 120 var nextValue = latestGetSnapshot(); 121 return !objectIs(inst, nextValue); 122 } catch (error) { 123 return true; 124 } 125 } 126 function useSyncExternalStore$1(subscribe, getSnapshot) { 127 return getSnapshot(); 128 } 129 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 130 var React48 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState19 = React48.useState, useEffect18 = React48.useEffect, useLayoutEffect3 = React48.useLayoutEffect, useDebugValue2 = React48.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 131 exports.useSyncExternalStore = void 0 !== React48.useSyncExternalStore ? React48.useSyncExternalStore : shim; 132 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 133 })(); 134 } 135 }); 136 137 // node_modules/use-sync-external-store/shim/index.js 138 var require_shim = __commonJS({ 139 "node_modules/use-sync-external-store/shim/index.js"(exports, module) { 140 "use strict"; 141 if (false) { 142 module.exports = null; 143 } else { 144 module.exports = require_use_sync_external_store_shim_development(); 145 } 146 } 147 }); 148 149 // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js 150 var require_with_selector_development = __commonJS({ 151 "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { 152 "use strict"; 153 (function() { 154 function is(x, y) { 155 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 156 } 157 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 158 var React48 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef21 = React48.useRef, useEffect18 = React48.useEffect, useMemo22 = React48.useMemo, useDebugValue2 = React48.useDebugValue; 159 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 160 var instRef = useRef21(null); 161 if (null === instRef.current) { 162 var inst = { hasValue: false, value: null }; 163 instRef.current = inst; 164 } else inst = instRef.current; 165 instRef = useMemo22( 166 function() { 167 function memoizedSelector(nextSnapshot) { 168 if (!hasMemo) { 169 hasMemo = true; 170 memoizedSnapshot = nextSnapshot; 171 nextSnapshot = selector(nextSnapshot); 172 if (void 0 !== isEqual && inst.hasValue) { 173 var currentSelection = inst.value; 174 if (isEqual(currentSelection, nextSnapshot)) 175 return memoizedSelection = currentSelection; 176 } 177 return memoizedSelection = nextSnapshot; 178 } 179 currentSelection = memoizedSelection; 180 if (objectIs(memoizedSnapshot, nextSnapshot)) 181 return currentSelection; 182 var nextSelection = selector(nextSnapshot); 183 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 184 return memoizedSnapshot = nextSnapshot, currentSelection; 185 memoizedSnapshot = nextSnapshot; 186 return memoizedSelection = nextSelection; 187 } 188 var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 189 return [ 190 function() { 191 return memoizedSelector(getSnapshot()); 192 }, 193 null === maybeGetServerSnapshot ? void 0 : function() { 194 return memoizedSelector(maybeGetServerSnapshot()); 195 } 196 ]; 197 }, 198 [getSnapshot, getServerSnapshot, selector, isEqual] 199 ); 200 var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]); 201 useEffect18( 202 function() { 203 inst.hasValue = true; 204 inst.value = value; 205 }, 206 [value] 207 ); 208 useDebugValue2(value); 209 return value; 210 }; 211 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 212 })(); 213 } 214 }); 215 216 // node_modules/use-sync-external-store/shim/with-selector.js 217 var require_with_selector = __commonJS({ 218 "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { 219 "use strict"; 220 if (false) { 221 module.exports = null; 222 } else { 223 module.exports = require_with_selector_development(); 224 } 225 } 226 }); 227 228 // package-external:@wordpress/compose 229 var require_compose = __commonJS({ 230 "package-external:@wordpress/compose"(exports, module) { 231 module.exports = window.wp.compose; 232 } 233 }); 234 235 // package-external:@wordpress/theme 236 var require_theme = __commonJS({ 237 "package-external:@wordpress/theme"(exports, module) { 238 module.exports = window.wp.theme; 239 } 240 }); 241 242 // package-external:@wordpress/private-apis 243 var require_private_apis = __commonJS({ 244 "package-external:@wordpress/private-apis"(exports, module) { 245 module.exports = window.wp.privateApis; 246 } 247 }); 248 249 // package-external:@wordpress/primitives 250 var require_primitives = __commonJS({ 251 "package-external:@wordpress/primitives"(exports, module) { 252 module.exports = window.wp.primitives; 253 } 254 }); 255 256 // package-external:@wordpress/components 257 var require_components = __commonJS({ 258 "package-external:@wordpress/components"(exports, module) { 259 module.exports = window.wp.components; 260 } 261 }); 262 263 // package-external:@wordpress/core-data 264 var require_core_data = __commonJS({ 265 "package-external:@wordpress/core-data"(exports, module) { 266 module.exports = window.wp.coreData; 267 } 268 }); 269 270 // package-external:@wordpress/notices 271 var require_notices = __commonJS({ 272 "package-external:@wordpress/notices"(exports, module) { 273 module.exports = window.wp.notices; 274 } 275 }); 276 277 // package-external:@wordpress/editor 278 var require_editor = __commonJS({ 279 "package-external:@wordpress/editor"(exports, module) { 280 module.exports = window.wp.editor; 281 } 282 }); 283 284 // package-external:@wordpress/keycodes 285 var require_keycodes = __commonJS({ 286 "package-external:@wordpress/keycodes"(exports, module) { 287 module.exports = window.wp.keycodes; 288 } 289 }); 290 291 // package-external:@wordpress/keyboard-shortcuts 292 var require_keyboard_shortcuts = __commonJS({ 293 "package-external:@wordpress/keyboard-shortcuts"(exports, module) { 294 module.exports = window.wp.keyboardShortcuts; 295 } 296 }); 297 298 // package-external:@wordpress/dom 299 var require_dom = __commonJS({ 300 "package-external:@wordpress/dom"(exports, module) { 301 module.exports = window.wp.dom; 302 } 303 }); 304 305 // package-external:@wordpress/url 306 var require_url = __commonJS({ 307 "package-external:@wordpress/url"(exports, module) { 308 module.exports = window.wp.url; 309 } 310 }); 311 312 // package-external:@wordpress/html-entities 313 var require_html_entities = __commonJS({ 314 "package-external:@wordpress/html-entities"(exports, module) { 315 module.exports = window.wp.htmlEntities; 316 } 317 }); 318 319 // package-external:@wordpress/plugins 320 var require_plugins = __commonJS({ 321 "package-external:@wordpress/plugins"(exports, module) { 322 module.exports = window.wp.plugins; 323 } 324 }); 325 326 // packages/boot/build-module/components/app/index.mjs 327 var import_element44 = __toESM(require_element(), 1); 328 var import_data14 = __toESM(require_data(), 1); 329 330 // packages/boot/build-module/components/app/router.mjs 331 var import_i18n19 = __toESM(require_i18n(), 1); 332 var import_element42 = __toESM(require_element(), 1); 333 334 // node_modules/clsx/dist/clsx.mjs 335 function r(e) { 336 var t, f, n = ""; 337 if ("string" == typeof e || "number" == typeof e) n += e; 338 else if ("object" == typeof e) if (Array.isArray(e)) { 339 var o = e.length; 340 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 341 } else for (f in e) e[f] && (n && (n += " "), n += f); 342 return n; 343 } 344 function clsx() { 345 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 346 return n; 347 } 348 var clsx_default = clsx; 349 350 // node_modules/@base-ui/utils/safeReact.mjs 351 var React = __toESM(require_react(), 1); 352 var SafeReact = { 353 ...React 354 }; 355 356 // node_modules/@base-ui/utils/useRefWithInit.mjs 357 var React2 = __toESM(require_react(), 1); 358 var UNINITIALIZED = {}; 359 function useRefWithInit(init2, initArg) { 360 const ref = React2.useRef(UNINITIALIZED); 361 if (ref.current === UNINITIALIZED) { 362 ref.current = init2(initArg); 363 } 364 return ref; 365 } 366 367 // node_modules/@base-ui/utils/useStableCallback.mjs 368 var useInsertionEffect = SafeReact.useInsertionEffect; 369 var useSafeInsertionEffect = ( 370 // React 17 doesn't have useInsertionEffect. 371 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 372 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 373 ); 374 function useStableCallback(callback) { 375 const stable = useRefWithInit(createStableCallback).current; 376 stable.next = callback; 377 useSafeInsertionEffect(stable.effect); 378 return stable.trampoline; 379 } 380 function createStableCallback() { 381 const stable = { 382 next: void 0, 383 callback: assertNotCalled, 384 trampoline: (...args) => stable.callback?.(...args), 385 effect: () => { 386 stable.callback = stable.next; 387 } 388 }; 389 return stable; 390 } 391 function assertNotCalled() { 392 if (true) { 393 throw ( 394 /* minify-error-disabled */ 395 new Error("Base UI: Cannot call an event handler while rendering.") 396 ); 397 } 398 } 399 400 // node_modules/@base-ui/utils/warn.mjs 401 var set; 402 if (true) { 403 set = /* @__PURE__ */ new Set(); 404 } 405 function warn(...messages) { 406 if (true) { 407 const messageKey = messages.join(" "); 408 if (!set.has(messageKey)) { 409 set.add(messageKey); 410 console.warn(`Base UI: $messageKey}`); 411 } 412 } 413 } 414 415 // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 416 var React3 = __toESM(require_react(), 1); 417 var noop = () => { 418 }; 419 var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop; 420 421 // node_modules/@base-ui/react/internals/useRenderElement.mjs 422 var React6 = __toESM(require_react(), 1); 423 424 // node_modules/@base-ui/utils/useMergedRefs.mjs 425 function useMergedRefs(a, b, c, d) { 426 const forkRef = useRefWithInit(createForkRef).current; 427 if (didChange(forkRef, a, b, c, d)) { 428 update(forkRef, [a, b, c, d]); 429 } 430 return forkRef.callback; 431 } 432 function useMergedRefsN(refs) { 433 const forkRef = useRefWithInit(createForkRef).current; 434 if (didChangeN(forkRef, refs)) { 435 update(forkRef, refs); 436 } 437 return forkRef.callback; 438 } 439 function createForkRef() { 440 return { 441 callback: null, 442 cleanup: null, 443 refs: [] 444 }; 445 } 446 function didChange(forkRef, a, b, c, d) { 447 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 448 } 449 function didChangeN(forkRef, newRefs) { 450 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 451 } 452 function update(forkRef, refs) { 453 forkRef.refs = refs; 454 if (refs.every((ref) => ref == null)) { 455 forkRef.callback = null; 456 return; 457 } 458 forkRef.callback = (instance) => { 459 if (forkRef.cleanup) { 460 forkRef.cleanup(); 461 forkRef.cleanup = null; 462 } 463 if (instance != null) { 464 const cleanupCallbacks = Array(refs.length).fill(null); 465 for (let i = 0; i < refs.length; i += 1) { 466 const ref = refs[i]; 467 if (ref == null) { 468 continue; 469 } 470 switch (typeof ref) { 471 case "function": { 472 const refCleanup = ref(instance); 473 if (typeof refCleanup === "function") { 474 cleanupCallbacks[i] = refCleanup; 475 } 476 break; 477 } 478 case "object": { 479 ref.current = instance; 480 break; 481 } 482 default: 483 } 484 } 485 forkRef.cleanup = () => { 486 for (let i = 0; i < refs.length; i += 1) { 487 const ref = refs[i]; 488 if (ref == null) { 489 continue; 490 } 491 switch (typeof ref) { 492 case "function": { 493 const cleanupCallback = cleanupCallbacks[i]; 494 if (typeof cleanupCallback === "function") { 495 cleanupCallback(); 496 } else { 497 void ref(null); 498 } 499 break; 500 } 501 case "object": { 502 ref.current = null; 503 break; 504 } 505 default: 506 } 507 } 508 }; 509 } 510 }; 511 } 512 513 // node_modules/@base-ui/utils/getReactElementRef.mjs 514 var React5 = __toESM(require_react(), 1); 515 516 // node_modules/@base-ui/utils/reactVersion.mjs 517 var React4 = __toESM(require_react(), 1); 518 var majorVersion = parseInt(React4.version, 10); 519 function isReactVersionAtLeast(reactVersionToCheck) { 520 return majorVersion >= reactVersionToCheck; 521 } 522 523 // node_modules/@base-ui/utils/getReactElementRef.mjs 524 function getReactElementRef(element) { 525 if (!/* @__PURE__ */ React5.isValidElement(element)) { 526 return null; 527 } 528 const reactElement = element; 529 const propsWithRef = reactElement.props; 530 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 531 } 532 533 // node_modules/@base-ui/utils/mergeObjects.mjs 534 function mergeObjects(a, b) { 535 if (a && !b) { 536 return a; 537 } 538 if (!a && b) { 539 return b; 540 } 541 if (a || b) { 542 return { 543 ...a, 544 ...b 545 }; 546 } 547 return void 0; 548 } 549 550 // node_modules/@base-ui/utils/empty.mjs 551 function NOOP() { 552 } 553 var EMPTY_ARRAY = Object.freeze([]); 554 var EMPTY_OBJECT = Object.freeze({}); 555 556 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 557 function getStateAttributesProps(state, customMapping) { 558 const props = {}; 559 for (const key in state) { 560 const value = state[key]; 561 if (customMapping?.hasOwnProperty(key)) { 562 const customProps = customMapping[key](value); 563 if (customProps != null) { 564 Object.assign(props, customProps); 565 } 566 continue; 567 } 568 if (value === true) { 569 props[`data-$key.toLowerCase()}`] = ""; 570 } else if (value) { 571 props[`data-$key.toLowerCase()}`] = value.toString(); 572 } 573 } 574 return props; 575 } 576 577 // node_modules/@base-ui/react/utils/resolveClassName.mjs 578 function resolveClassName(className, state) { 579 return typeof className === "function" ? className(state) : className; 580 } 581 582 // node_modules/@base-ui/react/utils/resolveStyle.mjs 583 function resolveStyle(style, state) { 584 return typeof style === "function" ? style(state) : style; 585 } 586 587 // node_modules/@base-ui/react/merge-props/mergeProps.mjs 588 var EMPTY_PROPS = {}; 589 function mergeProps(a, b, c, d, e) { 590 if (!c && !d && !e && !a) { 591 return createInitialMergedProps(b); 592 } 593 let merged = createInitialMergedProps(a); 594 if (b) { 595 merged = mergeInto(merged, b); 596 } 597 if (c) { 598 merged = mergeInto(merged, c); 599 } 600 if (d) { 601 merged = mergeInto(merged, d); 602 } 603 if (e) { 604 merged = mergeInto(merged, e); 605 } 606 return merged; 607 } 608 function mergePropsN(props) { 609 if (props.length === 0) { 610 return EMPTY_PROPS; 611 } 612 if (props.length === 1) { 613 return createInitialMergedProps(props[0]); 614 } 615 let merged = createInitialMergedProps(props[0]); 616 for (let i = 1; i < props.length; i += 1) { 617 merged = mergeInto(merged, props[i]); 618 } 619 return merged; 620 } 621 function createInitialMergedProps(inputProps) { 622 if (isPropsGetter(inputProps)) { 623 return { 624 ...resolvePropsGetter(inputProps, EMPTY_PROPS) 625 }; 626 } 627 return copyInitialProps(inputProps); 628 } 629 function mergeInto(merged, inputProps) { 630 if (isPropsGetter(inputProps)) { 631 return resolvePropsGetter(inputProps, merged); 632 } 633 return mutablyMergeInto(merged, inputProps); 634 } 635 function copyInitialProps(inputProps) { 636 const copiedProps = { 637 ...inputProps 638 }; 639 for (const propName in copiedProps) { 640 const propValue = copiedProps[propName]; 641 if (isEventHandler(propName, propValue)) { 642 copiedProps[propName] = wrapEventHandler(propValue); 643 } 644 } 645 return copiedProps; 646 } 647 function mutablyMergeInto(mergedProps, externalProps) { 648 if (!externalProps) { 649 return mergedProps; 650 } 651 for (const propName in externalProps) { 652 const externalPropValue = externalProps[propName]; 653 switch (propName) { 654 case "style": { 655 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 656 break; 657 } 658 case "className": { 659 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 660 break; 661 } 662 default: { 663 if (isEventHandler(propName, externalPropValue)) { 664 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 665 } else { 666 mergedProps[propName] = externalPropValue; 667 } 668 } 669 } 670 } 671 return mergedProps; 672 } 673 function isEventHandler(key, value) { 674 const code0 = key.charCodeAt(0); 675 const code1 = key.charCodeAt(1); 676 const code2 = key.charCodeAt(2); 677 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 678 } 679 function isPropsGetter(inputProps) { 680 return typeof inputProps === "function"; 681 } 682 function resolvePropsGetter(inputProps, previousProps) { 683 if (isPropsGetter(inputProps)) { 684 return inputProps(previousProps); 685 } 686 return inputProps ?? EMPTY_PROPS; 687 } 688 function mergeEventHandlers(ourHandler, theirHandler) { 689 if (!theirHandler) { 690 return ourHandler; 691 } 692 if (!ourHandler) { 693 return wrapEventHandler(theirHandler); 694 } 695 return (...args) => { 696 const event = args[0]; 697 if (isSyntheticEvent(event)) { 698 const baseUIEvent = event; 699 makeEventPreventable(baseUIEvent); 700 const result2 = theirHandler(...args); 701 if (!baseUIEvent.baseUIHandlerPrevented) { 702 ourHandler?.(...args); 703 } 704 return result2; 705 } 706 const result = theirHandler(...args); 707 ourHandler?.(...args); 708 return result; 709 }; 710 } 711 function wrapEventHandler(handler) { 712 if (!handler) { 713 return handler; 714 } 715 return (...args) => { 716 const event = args[0]; 717 if (isSyntheticEvent(event)) { 718 makeEventPreventable(event); 719 } 720 return handler(...args); 721 }; 722 } 723 function makeEventPreventable(event) { 724 event.preventBaseUIHandler = () => { 725 event.baseUIHandlerPrevented = true; 726 }; 727 return event; 728 } 729 function mergeClassNames(ourClassName, theirClassName) { 730 if (theirClassName) { 731 if (ourClassName) { 732 return theirClassName + " " + ourClassName; 733 } 734 return theirClassName; 735 } 736 return ourClassName; 737 } 738 function isSyntheticEvent(event) { 739 return event != null && typeof event === "object" && "nativeEvent" in event; 740 } 741 742 // node_modules/@base-ui/react/internals/useRenderElement.mjs 743 var import_react = __toESM(require_react(), 1); 744 function useRenderElement(element, componentProps, params = {}) { 745 const renderProp = componentProps.render; 746 const outProps = useRenderElementProps(componentProps, params); 747 if (params.enabled === false) { 748 return null; 749 } 750 const state = params.state ?? EMPTY_OBJECT; 751 return evaluateRenderProp(element, renderProp, outProps, state); 752 } 753 function useRenderElementProps(componentProps, params = {}) { 754 const { 755 className: classNameProp, 756 style: styleProp, 757 render: renderProp 758 } = componentProps; 759 const { 760 state = EMPTY_OBJECT, 761 ref, 762 props, 763 stateAttributesMapping, 764 enabled = true 765 } = params; 766 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 767 const style = enabled ? resolveStyle(styleProp, state) : void 0; 768 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; 769 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 770 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 771 if (typeof document !== "undefined") { 772 if (!enabled) { 773 void useMergedRefs(null, null); 774 } else if (Array.isArray(ref)) { 775 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 776 } else { 777 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 778 } 779 } 780 if (!enabled) { 781 return EMPTY_OBJECT; 782 } 783 if (className !== void 0) { 784 outProps.className = mergeClassNames(outProps.className, className); 785 } 786 if (style !== void 0) { 787 outProps.style = mergeObjects(outProps.style, style); 788 } 789 return outProps; 790 } 791 function resolveRenderFunctionProps(props) { 792 if (Array.isArray(props)) { 793 return mergePropsN(props); 794 } 795 return mergeProps(void 0, props); 796 } 797 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 798 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 799 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 800 function evaluateRenderProp(element, render, props, state) { 801 if (render) { 802 if (typeof render === "function") { 803 if (true) { 804 warnIfRenderPropLooksLikeComponent(render); 805 } 806 return render(props, state); 807 } 808 const mergedProps = mergeProps(props, render.props); 809 mergedProps.ref = props.ref; 810 let newElement = render; 811 if (newElement?.$$typeof === REACT_LAZY_TYPE) { 812 const children = React6.Children.toArray(render); 813 newElement = children[0]; 814 } 815 if (true) { 816 if (!/* @__PURE__ */ React6.isValidElement(newElement)) { 817 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")); 818 } 819 } 820 return /* @__PURE__ */ React6.cloneElement(newElement, mergedProps); 821 } 822 if (element) { 823 if (typeof element === "string") { 824 return renderTag(element, props); 825 } 826 } 827 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); 828 } 829 function warnIfRenderPropLooksLikeComponent(renderFn) { 830 const functionName = renderFn.name; 831 if (functionName.length === 0) { 832 return; 833 } 834 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 835 return; 836 } 837 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 838 return; 839 } 840 warn(`The \`render\` prop received a function named \`$functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop"); 841 } 842 function renderTag(Tag, props) { 843 if (Tag === "button") { 844 return /* @__PURE__ */ (0, import_react.createElement)("button", { 845 type: "button", 846 ...props, 847 key: props.key 848 }); 849 } 850 if (Tag === "img") { 851 return /* @__PURE__ */ (0, import_react.createElement)("img", { 852 alt: "", 853 ...props, 854 key: props.key 855 }); 856 } 857 return /* @__PURE__ */ React6.createElement(Tag, props); 858 } 859 860 // node_modules/@base-ui/utils/useId.mjs 861 var React7 = __toESM(require_react(), 1); 862 var globalId = 0; 863 function useGlobalId(idOverride, prefix = "mui") { 864 const [defaultId, setDefaultId] = React7.useState(idOverride); 865 const id = idOverride || defaultId; 866 React7.useEffect(() => { 867 if (defaultId == null) { 868 globalId += 1; 869 setDefaultId(`$prefix}-$globalId}`); 870 } 871 }, [defaultId, prefix]); 872 return id; 873 } 874 var maybeReactUseId = SafeReact.useId; 875 function useId(idOverride, prefix) { 876 if (maybeReactUseId !== void 0) { 877 const reactId = maybeReactUseId(); 878 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 879 } 880 return useGlobalId(idOverride, prefix); 881 } 882 883 // node_modules/@base-ui/react/internals/useBaseUiId.mjs 884 function useBaseUiId(idOverride) { 885 return useId(idOverride, "base-ui"); 886 } 887 888 // node_modules/@base-ui/react/internals/reason-parts.mjs 889 var reason_parts_exports = {}; 890 __export(reason_parts_exports, { 891 cancelOpen: () => cancelOpen, 892 chipRemovePress: () => chipRemovePress, 893 clearPress: () => clearPress, 894 closePress: () => closePress, 895 closeWatcher: () => closeWatcher, 896 decrementPress: () => decrementPress, 897 disabled: () => disabled, 898 drag: () => drag, 899 escapeKey: () => escapeKey, 900 focusOut: () => focusOut, 901 imperativeAction: () => imperativeAction, 902 incrementPress: () => incrementPress, 903 initial: () => initial, 904 inputBlur: () => inputBlur, 905 inputChange: () => inputChange, 906 inputClear: () => inputClear, 907 inputPaste: () => inputPaste, 908 inputPress: () => inputPress, 909 itemPress: () => itemPress, 910 keyboard: () => keyboard, 911 linkPress: () => linkPress, 912 listNavigation: () => listNavigation, 913 missing: () => missing, 914 none: () => none, 915 outsidePress: () => outsidePress, 916 pointer: () => pointer, 917 scrub: () => scrub, 918 siblingOpen: () => siblingOpen, 919 swipe: () => swipe, 920 trackPress: () => trackPress, 921 triggerFocus: () => triggerFocus, 922 triggerHover: () => triggerHover, 923 triggerPress: () => triggerPress, 924 wheel: () => wheel, 925 windowResize: () => windowResize 926 }); 927 var none = "none"; 928 var triggerPress = "trigger-press"; 929 var triggerHover = "trigger-hover"; 930 var triggerFocus = "trigger-focus"; 931 var outsidePress = "outside-press"; 932 var itemPress = "item-press"; 933 var closePress = "close-press"; 934 var linkPress = "link-press"; 935 var clearPress = "clear-press"; 936 var chipRemovePress = "chip-remove-press"; 937 var trackPress = "track-press"; 938 var incrementPress = "increment-press"; 939 var decrementPress = "decrement-press"; 940 var inputChange = "input-change"; 941 var inputClear = "input-clear"; 942 var inputBlur = "input-blur"; 943 var inputPaste = "input-paste"; 944 var inputPress = "input-press"; 945 var focusOut = "focus-out"; 946 var escapeKey = "escape-key"; 947 var closeWatcher = "close-watcher"; 948 var listNavigation = "list-navigation"; 949 var keyboard = "keyboard"; 950 var pointer = "pointer"; 951 var drag = "drag"; 952 var wheel = "wheel"; 953 var scrub = "scrub"; 954 var cancelOpen = "cancel-open"; 955 var siblingOpen = "sibling-open"; 956 var disabled = "disabled"; 957 var missing = "missing"; 958 var initial = "initial"; 959 var imperativeAction = "imperative-action"; 960 var swipe = "swipe"; 961 var windowResize = "window-resize"; 962 963 // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 964 function createChangeEventDetails(reason, event, trigger, customProperties) { 965 let canceled = false; 966 let allowPropagation = false; 967 const custom = customProperties ?? EMPTY_OBJECT; 968 const details = { 969 reason, 970 event: event ?? new Event("base-ui"), 971 cancel() { 972 canceled = true; 973 }, 974 allowPropagation() { 975 allowPropagation = true; 976 }, 977 get isCanceled() { 978 return canceled; 979 }, 980 get isPropagationAllowed() { 981 return allowPropagation; 982 }, 983 trigger, 984 ...custom 985 }; 986 return details; 987 } 988 989 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 990 var React9 = __toESM(require_react(), 1); 991 992 // node_modules/@base-ui/utils/useOnMount.mjs 993 var React8 = __toESM(require_react(), 1); 994 function useOnMount(fn) { 995 React8.useEffect(fn, EMPTY_ARRAY); 996 } 997 998 // node_modules/@base-ui/utils/useAnimationFrame.mjs 999 var EMPTY = null; 1000 var LAST_RAF = globalThis.requestAnimationFrame; 1001 var Scheduler = class { 1002 /* This implementation uses an array as a backing data-structure for frame callbacks. 1003 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 1004 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 1005 * be much more efficient if there is a call pattern that alterns as 1006 * "request-cancel-request-cancel-…". 1007 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 1008 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 1009 callbacks = []; 1010 callbacksCount = 0; 1011 nextId = 1; 1012 startId = 1; 1013 isScheduled = false; 1014 tick = (timestamp) => { 1015 this.isScheduled = false; 1016 const currentCallbacks = this.callbacks; 1017 const currentCallbacksCount = this.callbacksCount; 1018 this.callbacks = []; 1019 this.callbacksCount = 0; 1020 this.startId = this.nextId; 1021 if (currentCallbacksCount > 0) { 1022 for (let i = 0; i < currentCallbacks.length; i += 1) { 1023 currentCallbacks[i]?.(timestamp); 1024 } 1025 } 1026 }; 1027 request(fn) { 1028 const id = this.nextId; 1029 this.nextId += 1; 1030 this.callbacks.push(fn); 1031 this.callbacksCount += 1; 1032 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 1033 if (!this.isScheduled || didRAFChange) { 1034 requestAnimationFrame(this.tick); 1035 this.isScheduled = true; 1036 } 1037 return id; 1038 } 1039 cancel(id) { 1040 const index2 = id - this.startId; 1041 if (index2 < 0 || index2 >= this.callbacks.length) { 1042 return; 1043 } 1044 this.callbacks[index2] = null; 1045 this.callbacksCount -= 1; 1046 } 1047 }; 1048 var scheduler = new Scheduler(); 1049 var AnimationFrame = class _AnimationFrame { 1050 static create() { 1051 return new _AnimationFrame(); 1052 } 1053 static request(fn) { 1054 return scheduler.request(fn); 1055 } 1056 static cancel(id) { 1057 return scheduler.cancel(id); 1058 } 1059 currentId = EMPTY; 1060 /** 1061 * Executes `fn` after `delay`, clearing any previously scheduled call. 1062 */ 1063 request(fn) { 1064 this.cancel(); 1065 this.currentId = scheduler.request(() => { 1066 this.currentId = EMPTY; 1067 fn(); 1068 }); 1069 } 1070 cancel = () => { 1071 if (this.currentId !== EMPTY) { 1072 scheduler.cancel(this.currentId); 1073 this.currentId = EMPTY; 1074 } 1075 }; 1076 disposeEffect = () => { 1077 return this.cancel; 1078 }; 1079 }; 1080 function useAnimationFrame() { 1081 const timeout = useRefWithInit(AnimationFrame.create).current; 1082 useOnMount(timeout.disposeEffect); 1083 return timeout; 1084 } 1085 1086 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 1087 function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { 1088 const [transitionStatus, setTransitionStatus] = React9.useState(open && enableIdleState ? "idle" : void 0); 1089 const [mounted, setMounted] = React9.useState(open); 1090 if (open && !mounted) { 1091 setMounted(true); 1092 setTransitionStatus("starting"); 1093 } 1094 if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { 1095 setTransitionStatus("ending"); 1096 } 1097 if (!open && !mounted && transitionStatus === "ending") { 1098 setTransitionStatus(void 0); 1099 } 1100 useIsoLayoutEffect(() => { 1101 if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { 1102 const frame = AnimationFrame.request(() => { 1103 setTransitionStatus("ending"); 1104 }); 1105 return () => { 1106 AnimationFrame.cancel(frame); 1107 }; 1108 } 1109 return void 0; 1110 }, [open, mounted, transitionStatus, deferEndingState]); 1111 useIsoLayoutEffect(() => { 1112 if (!open || enableIdleState) { 1113 return void 0; 1114 } 1115 const frame = AnimationFrame.request(() => { 1116 setTransitionStatus(void 0); 1117 }); 1118 return () => { 1119 AnimationFrame.cancel(frame); 1120 }; 1121 }, [enableIdleState, open]); 1122 useIsoLayoutEffect(() => { 1123 if (!open || !enableIdleState) { 1124 return void 0; 1125 } 1126 if (open && mounted && transitionStatus !== "idle") { 1127 setTransitionStatus("starting"); 1128 } 1129 const frame = AnimationFrame.request(() => { 1130 setTransitionStatus("idle"); 1131 }); 1132 return () => { 1133 AnimationFrame.cancel(frame); 1134 }; 1135 }, [enableIdleState, open, mounted, transitionStatus]); 1136 return { 1137 mounted, 1138 setMounted, 1139 transitionStatus 1140 }; 1141 } 1142 1143 // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 1144 var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { 1145 TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; 1146 TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; 1147 return TransitionStatusDataAttributes2; 1148 })({}); 1149 var STARTING_HOOK = { 1150 "data-starting-style": "" 1151 }; 1152 var ENDING_HOOK = { 1153 "data-ending-style": "" 1154 }; 1155 var transitionStatusMapping = { 1156 transitionStatus(value) { 1157 if (value === "starting") { 1158 return STARTING_HOOK; 1159 } 1160 if (value === "ending") { 1161 return ENDING_HOOK; 1162 } 1163 return null; 1164 } 1165 }; 1166 1167 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1168 function hasWindow() { 1169 return typeof window !== "undefined"; 1170 } 1171 function getNodeName(node) { 1172 if (isNode(node)) { 1173 return (node.nodeName || "").toLowerCase(); 1174 } 1175 return "#document"; 1176 } 1177 function getWindow(node) { 1178 var _node$ownerDocument; 1179 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1180 } 1181 function getDocumentElement(node) { 1182 var _ref; 1183 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 1184 } 1185 function isNode(value) { 1186 if (!hasWindow()) { 1187 return false; 1188 } 1189 return value instanceof Node || value instanceof getWindow(value).Node; 1190 } 1191 function isElement(value) { 1192 if (!hasWindow()) { 1193 return false; 1194 } 1195 return value instanceof Element || value instanceof getWindow(value).Element; 1196 } 1197 function isHTMLElement(value) { 1198 if (!hasWindow()) { 1199 return false; 1200 } 1201 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1202 } 1203 function isShadowRoot(value) { 1204 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1205 return false; 1206 } 1207 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1208 } 1209 function isOverflowElement(element) { 1210 const { 1211 overflow, 1212 overflowX, 1213 overflowY, 1214 display 1215 } = getComputedStyle2(element); 1216 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 1217 } 1218 function isTableElement(element) { 1219 return /^(table|td|th)$/.test(getNodeName(element)); 1220 } 1221 function isTopLayer(element) { 1222 try { 1223 if (element.matches(":popover-open")) { 1224 return true; 1225 } 1226 } catch (_e) { 1227 } 1228 try { 1229 return element.matches(":modal"); 1230 } catch (_e) { 1231 return false; 1232 } 1233 } 1234 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 1235 var containRe = /paint|layout|strict|content/; 1236 var isNotNone = (value) => !!value && value !== "none"; 1237 var isWebKitValue; 1238 function isContainingBlock(elementOrCss) { 1239 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 1240 return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || ""); 1241 } 1242 function getContainingBlock(element) { 1243 let currentNode = getParentNode(element); 1244 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 1245 if (isContainingBlock(currentNode)) { 1246 return currentNode; 1247 } else if (isTopLayer(currentNode)) { 1248 return null; 1249 } 1250 currentNode = getParentNode(currentNode); 1251 } 1252 return null; 1253 } 1254 function isWebKit() { 1255 if (isWebKitValue == null) { 1256 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 1257 } 1258 return isWebKitValue; 1259 } 1260 function isLastTraversableNode(node) { 1261 return /^(html|body|#document)$/.test(getNodeName(node)); 1262 } 1263 function getComputedStyle2(element) { 1264 return getWindow(element).getComputedStyle(element); 1265 } 1266 function getNodeScroll(element) { 1267 if (isElement(element)) { 1268 return { 1269 scrollLeft: element.scrollLeft, 1270 scrollTop: element.scrollTop 1271 }; 1272 } 1273 return { 1274 scrollLeft: element.scrollX, 1275 scrollTop: element.scrollY 1276 }; 1277 } 1278 function getParentNode(node) { 1279 if (getNodeName(node) === "html") { 1280 return node; 1281 } 1282 const result = ( 1283 // Step into the shadow DOM of the parent of a slotted node. 1284 node.assignedSlot || // DOM Element detected. 1285 node.parentNode || // ShadowRoot detected. 1286 isShadowRoot(node) && node.host || // Fallback. 1287 getDocumentElement(node) 1288 ); 1289 return isShadowRoot(result) ? result.host : result; 1290 } 1291 function getNearestOverflowAncestor(node) { 1292 const parentNode = getParentNode(node); 1293 if (isLastTraversableNode(parentNode)) { 1294 return (node.ownerDocument || node).body; 1295 } 1296 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 1297 return parentNode; 1298 } 1299 return getNearestOverflowAncestor(parentNode); 1300 } 1301 function getOverflowAncestors(node, list, traverseIframes) { 1302 var _node$ownerDocument2; 1303 if (list === void 0) { 1304 list = []; 1305 } 1306 if (traverseIframes === void 0) { 1307 traverseIframes = true; 1308 } 1309 const scrollableAncestor = getNearestOverflowAncestor(node); 1310 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 1311 const win = getWindow(scrollableAncestor); 1312 if (isBody) { 1313 const frameElement = getFrameElement(win); 1314 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 1315 } else { 1316 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 1317 } 1318 } 1319 function getFrameElement(win) { 1320 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 1321 } 1322 1323 // node_modules/@base-ui/utils/owner.mjs 1324 function ownerDocument(node) { 1325 return node?.ownerDocument || document; 1326 } 1327 1328 // node_modules/@base-ui/utils/addEventListener.mjs 1329 function addEventListener(target, type, listener, options) { 1330 target.addEventListener(type, listener, options); 1331 return () => { 1332 target.removeEventListener(type, listener, options); 1333 }; 1334 } 1335 1336 // node_modules/@base-ui/utils/useValueAsRef.mjs 1337 function useValueAsRef(value) { 1338 const latest = useRefWithInit(createLatestRef, value).current; 1339 latest.next = value; 1340 useIsoLayoutEffect(latest.effect); 1341 return latest; 1342 } 1343 function createLatestRef(value) { 1344 const latest = { 1345 current: value, 1346 next: value, 1347 effect: () => { 1348 latest.current = latest.next; 1349 } 1350 }; 1351 return latest; 1352 } 1353 1354 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1355 var React10 = __toESM(require_react(), 1); 1356 1357 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1358 var ReactDOM = __toESM(require_react_dom(), 1); 1359 1360 // node_modules/@base-ui/react/utils/resolveRef.mjs 1361 function resolveRef(maybeRef) { 1362 if (maybeRef == null) { 1363 return maybeRef; 1364 } 1365 return "current" in maybeRef ? maybeRef.current : maybeRef; 1366 } 1367 1368 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1369 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) { 1370 const frame = useAnimationFrame(); 1371 return useStableCallback((fnToExecute, signal = null) => { 1372 frame.cancel(); 1373 const element = resolveRef(elementOrRef); 1374 if (element == null) { 1375 return; 1376 } 1377 const resolvedElement = element; 1378 const done = () => { 1379 ReactDOM.flushSync(fnToExecute); 1380 }; 1381 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 1382 fnToExecute(); 1383 return; 1384 } 1385 function exec() { 1386 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { 1387 if (!signal?.aborted) { 1388 done(); 1389 } 1390 }, () => { 1391 if (signal?.aborted) { 1392 return; 1393 } 1394 const currentAnimations = resolvedElement.getAnimations(); 1395 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 1396 exec(); 1397 return; 1398 } 1399 done(); 1400 }); 1401 } 1402 if (waitForStartingStyleRemoved) { 1403 const startingStyleAttribute = "data-starting-style"; 1404 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1405 frame.request(exec); 1406 return; 1407 } 1408 const attributeObserver = new MutationObserver(() => { 1409 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1410 attributeObserver.disconnect(); 1411 exec(); 1412 } 1413 }); 1414 attributeObserver.observe(resolvedElement, { 1415 attributes: true, 1416 attributeFilter: [startingStyleAttribute] 1417 }); 1418 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 1419 once: true 1420 }); 1421 return; 1422 } 1423 frame.request(exec); 1424 }); 1425 } 1426 1427 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1428 function useOpenChangeComplete(parameters) { 1429 const { 1430 enabled = true, 1431 open, 1432 ref, 1433 onComplete: onCompleteParam 1434 } = parameters; 1435 const onComplete = useStableCallback(onCompleteParam); 1436 const runOnceAnimationsFinish = useAnimationsFinished(ref, open); 1437 React10.useEffect(() => { 1438 if (!enabled) { 1439 return void 0; 1440 } 1441 const abortController = new AbortController(); 1442 runOnceAnimationsFinish(onComplete, abortController.signal); 1443 return () => { 1444 abortController.abort(); 1445 }; 1446 }, [enabled, open, onComplete, runOnceAnimationsFinish]); 1447 } 1448 1449 // node_modules/@base-ui/utils/platform/parts.mjs 1450 var parts_exports = {}; 1451 __export(parts_exports, { 1452 engine: () => engine_exports, 1453 env: () => env_exports, 1454 os: () => os_exports, 1455 screenReader: () => screen_reader_exports 1456 }); 1457 1458 // node_modules/@base-ui/utils/platform/os.mjs 1459 var os_exports = {}; 1460 __export(os_exports, { 1461 android: () => android, 1462 apple: () => apple, 1463 ios: () => ios, 1464 linux: () => linux, 1465 mac: () => mac, 1466 windows: () => windows 1467 }); 1468 1469 // node_modules/@base-ui/utils/platform/shared.mjs 1470 function readRawData() { 1471 if (typeof navigator === "undefined") { 1472 return { 1473 userAgent: "", 1474 platform: "", 1475 maxTouchPoints: 0 1476 }; 1477 } 1478 if (true) { 1479 const uaData = navigator.userAgentData; 1480 if (uaData && Array.isArray(uaData.brands)) { 1481 return { 1482 userAgent: uaData.brands.map(({ 1483 brand, 1484 version: version2 1485 }) => `$brand}/$version2}`).join(" "), 1486 platform: uaData.platform ?? navigator.platform ?? "", 1487 maxTouchPoints: navigator.maxTouchPoints ?? 0 1488 }; 1489 } 1490 } 1491 return { 1492 userAgent: navigator.userAgent, 1493 platform: navigator.platform ?? "", 1494 maxTouchPoints: navigator.maxTouchPoints ?? 0 1495 }; 1496 } 1497 var { 1498 userAgent, 1499 platform, 1500 maxTouchPoints 1501 } = readRawData(); 1502 var lowerUserAgent = userAgent.toLowerCase(); 1503 var lowerPlatform = platform.toLowerCase(); 1504 1505 // node_modules/@base-ui/utils/platform/os.mjs 1506 var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; 1507 var ANDROID_STRING = "android"; 1508 var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); 1509 var mac = !ios && lowerPlatform.startsWith("mac"); 1510 var windows = lowerPlatform.startsWith("win"); 1511 var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); 1512 var apple = mac || ios; 1513 1514 // node_modules/@base-ui/utils/platform/engine.mjs 1515 var engine_exports = {}; 1516 __export(engine_exports, { 1517 blink: () => blink, 1518 gecko: () => gecko, 1519 webkit: () => webkit 1520 }); 1521 var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none"); 1522 var gecko = !webkit && lowerUserAgent.includes("firefox"); 1523 var blink = !webkit && lowerUserAgent.includes("chrom"); 1524 1525 // node_modules/@base-ui/utils/platform/screen-reader.mjs 1526 var screen_reader_exports = {}; 1527 __export(screen_reader_exports, { 1528 voiceOver: () => voiceOver 1529 }); 1530 var voiceOver = apple; 1531 1532 // node_modules/@base-ui/utils/platform/env.mjs 1533 var env_exports = {}; 1534 __export(env_exports, { 1535 jsdom: () => jsdom 1536 }); 1537 var jsdom = /jsdom|happydom/.test(lowerUserAgent); 1538 1539 // node_modules/@base-ui/utils/useTimeout.mjs 1540 var EMPTY2 = 0; 1541 var Timeout = class _Timeout { 1542 static create() { 1543 return new _Timeout(); 1544 } 1545 currentId = EMPTY2; 1546 /** 1547 * Executes `fn` after `delay`, clearing any previously scheduled call. 1548 */ 1549 start(delay, fn) { 1550 this.clear(); 1551 this.currentId = setTimeout(() => { 1552 this.currentId = EMPTY2; 1553 fn(); 1554 }, delay); 1555 } 1556 isStarted() { 1557 return this.currentId !== EMPTY2; 1558 } 1559 clear = () => { 1560 if (this.currentId !== EMPTY2) { 1561 clearTimeout(this.currentId); 1562 this.currentId = EMPTY2; 1563 } 1564 }; 1565 disposeEffect = () => { 1566 return this.clear; 1567 }; 1568 }; 1569 function useTimeout() { 1570 const timeout = useRefWithInit(Timeout.create).current; 1571 useOnMount(timeout.disposeEffect); 1572 return timeout; 1573 } 1574 1575 // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 1576 var React11 = __toESM(require_react(), 1); 1577 1578 // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs 1579 function isReactEvent(event) { 1580 return "nativeEvent" in event; 1581 } 1582 function isMouseLikePointerType(pointerType, strict) { 1583 const values = ["mouse", "pen"]; 1584 if (!strict) { 1585 values.push("", void 0); 1586 } 1587 return values.includes(pointerType); 1588 } 1589 function isClickLikeEvent(event) { 1590 const type = event.type; 1591 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 1592 } 1593 1594 // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs 1595 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 1596 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 1597 1598 // node_modules/@base-ui/react/internals/shadowDom.mjs 1599 function activeElement(doc) { 1600 let element = doc.activeElement; 1601 while (element?.shadowRoot?.activeElement != null) { 1602 element = element.shadowRoot.activeElement; 1603 } 1604 return element; 1605 } 1606 function contains(parent, child) { 1607 if (!parent || !child) { 1608 return false; 1609 } 1610 const rootNode = child.getRootNode?.(); 1611 if (parent.contains(child)) { 1612 return true; 1613 } 1614 if (rootNode && isShadowRoot(rootNode)) { 1615 let next = child; 1616 while (next) { 1617 if (parent === next) { 1618 return true; 1619 } 1620 next = next.parentNode || next.host; 1621 } 1622 } 1623 return false; 1624 } 1625 function getTarget(event) { 1626 if ("composedPath" in event) { 1627 return event.composedPath()[0]; 1628 } 1629 return event.target; 1630 } 1631 1632 // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs 1633 function isTargetInsideEnabledTrigger(target, triggerElements) { 1634 if (!isElement(target)) { 1635 return false; 1636 } 1637 const targetElement = target; 1638 if (triggerElements.hasElement(targetElement)) { 1639 return !targetElement.hasAttribute("data-trigger-disabled"); 1640 } 1641 for (const [, trigger] of triggerElements.entries()) { 1642 if (contains(trigger, targetElement)) { 1643 return !trigger.hasAttribute("data-trigger-disabled"); 1644 } 1645 } 1646 return false; 1647 } 1648 function isEventTargetWithin(event, node) { 1649 if (node == null) { 1650 return false; 1651 } 1652 if ("composedPath" in event) { 1653 return event.composedPath().includes(node); 1654 } 1655 const eventAgain = event; 1656 return eventAgain.target != null && node.contains(eventAgain.target); 1657 } 1658 function isRootElement(element) { 1659 return element.matches("html,body"); 1660 } 1661 function isTypeableElement(element) { 1662 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 1663 } 1664 function isInteractiveElement(element) { 1665 return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 1666 } 1667 function matchesFocusVisible(element) { 1668 if (!element || parts_exports.env.jsdom) { 1669 return true; 1670 } 1671 try { 1672 return element.matches(":focus-visible"); 1673 } catch (_e) { 1674 return true; 1675 } 1676 } 1677 1678 // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs 1679 function resolveValue(value, pointerType) { 1680 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 1681 return 0; 1682 } 1683 if (typeof value === "function") { 1684 return value(); 1685 } 1686 return value; 1687 } 1688 function getDelay(value, prop, pointerType) { 1689 const result = resolveValue(value, pointerType); 1690 if (typeof result === "number") { 1691 return result; 1692 } 1693 return result?.[prop]; 1694 } 1695 function getRestMs(value) { 1696 if (typeof value === "function") { 1697 return value(); 1698 } 1699 return value; 1700 } 1701 function isClickLikeOpenEvent(openEventType, interactedInside) { 1702 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 1703 } 1704 function isHoverOpenEvent(openEventType) { 1705 return openEventType?.includes("mouse") && openEventType !== "mousedown"; 1706 } 1707 1708 // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 1709 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 1710 var FloatingDelayGroupContext = /* @__PURE__ */ React11.createContext({ 1711 hasProvider: false, 1712 timeoutMs: 0, 1713 delayRef: { 1714 current: 0 1715 }, 1716 initialDelayRef: { 1717 current: 0 1718 }, 1719 timeout: new Timeout(), 1720 currentIdRef: { 1721 current: null 1722 }, 1723 currentContextRef: { 1724 current: null 1725 } 1726 }); 1727 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 1728 function resetDelayRef(delayRef, initialDelayRef) { 1729 delayRef.current = initialDelayRef.current; 1730 } 1731 function FloatingDelayGroup(props) { 1732 const { 1733 children, 1734 delay, 1735 timeoutMs = 0 1736 } = props; 1737 const delayRef = React11.useRef(delay); 1738 const initialDelayRef = React11.useRef(delay); 1739 const currentIdRef = React11.useRef(null); 1740 const currentContextRef = React11.useRef(null); 1741 const timeout = useTimeout(); 1742 useIsoLayoutEffect(() => { 1743 initialDelayRef.current = delay; 1744 if (!currentIdRef.current) { 1745 delayRef.current = delay; 1746 return; 1747 } 1748 delayRef.current = { 1749 open: getDelay(delayRef.current, "open"), 1750 close: getDelay(delay, "close") 1751 }; 1752 }, [delay, currentIdRef, delayRef, initialDelayRef]); 1753 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { 1754 value: React11.useMemo(() => ({ 1755 hasProvider: true, 1756 delayRef, 1757 initialDelayRef, 1758 currentIdRef, 1759 timeoutMs, 1760 currentContextRef, 1761 timeout 1762 }), [timeoutMs, timeout]), 1763 children 1764 }); 1765 } 1766 function useDelayGroup(context, options = { 1767 open: false 1768 }) { 1769 const { 1770 open 1771 } = options; 1772 const store2 = "rootStore" in context ? context.rootStore : context; 1773 const floatingId = store2.useState("floatingId"); 1774 const groupContext = React11.useContext(FloatingDelayGroupContext); 1775 const { 1776 currentIdRef, 1777 delayRef, 1778 timeoutMs, 1779 initialDelayRef, 1780 currentContextRef, 1781 hasProvider, 1782 timeout 1783 } = groupContext; 1784 const [isInstantPhase, setIsInstantPhase] = React11.useState(false); 1785 const openRef = React11.useRef(open); 1786 useIsoLayoutEffect(() => { 1787 openRef.current = open; 1788 }, [open]); 1789 useIsoLayoutEffect(() => { 1790 function unset() { 1791 currentContextRef.current?.setIsInstantPhase(false); 1792 currentIdRef.current = null; 1793 currentContextRef.current = null; 1794 delayRef.current = initialDelayRef.current; 1795 timeout.clear(); 1796 } 1797 if (!currentIdRef.current) { 1798 return void 0; 1799 } 1800 if (!open && currentIdRef.current === floatingId) { 1801 setIsInstantPhase(false); 1802 if (timeoutMs) { 1803 const closingId = floatingId; 1804 timeout.start(timeoutMs, () => { 1805 if (store2.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 1806 return; 1807 } 1808 unset(); 1809 }); 1810 return () => { 1811 if (openRef.current || currentIdRef.current !== closingId) { 1812 timeout.clear(); 1813 } 1814 }; 1815 } 1816 unset(); 1817 } 1818 return void 0; 1819 }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); 1820 useIsoLayoutEffect(() => { 1821 if (!open) { 1822 return; 1823 } 1824 const prevContext = currentContextRef.current; 1825 const prevId = currentIdRef.current; 1826 timeout.clear(); 1827 currentContextRef.current = { 1828 onOpenChange: store2.setOpen, 1829 setIsInstantPhase 1830 }; 1831 currentIdRef.current = floatingId; 1832 delayRef.current = { 1833 open: 0, 1834 close: getDelay(initialDelayRef.current, "close") 1835 }; 1836 if (prevId !== null && prevId !== floatingId) { 1837 setIsInstantPhase(true); 1838 prevContext?.setIsInstantPhase(true); 1839 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 1840 } else { 1841 setIsInstantPhase(false); 1842 prevContext?.setIsInstantPhase(false); 1843 } 1844 }, [open, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); 1845 useIsoLayoutEffect(() => { 1846 return () => { 1847 if (currentIdRef.current === floatingId) { 1848 currentContextRef.current = null; 1849 if (!openRef.current) { 1850 return; 1851 } 1852 currentIdRef.current = null; 1853 resetDelayRef(delayRef, initialDelayRef); 1854 timeout.clear(); 1855 } 1856 }; 1857 }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); 1858 return React11.useMemo(() => ({ 1859 hasProvider, 1860 delayRef, 1861 isInstantPhase 1862 }), [hasProvider, delayRef, isInstantPhase]); 1863 } 1864 1865 // node_modules/@base-ui/utils/mergeCleanups.mjs 1866 function mergeCleanups(...cleanups) { 1867 return () => { 1868 for (let i = 0; i < cleanups.length; i += 1) { 1869 const cleanup = cleanups[i]; 1870 if (cleanup) { 1871 cleanup(); 1872 } 1873 } 1874 }; 1875 } 1876 1877 // node_modules/@base-ui/react/utils/FocusGuard.mjs 1878 var React12 = __toESM(require_react(), 1); 1879 1880 // node_modules/@base-ui/utils/visuallyHidden.mjs 1881 var visuallyHiddenBase = { 1882 clipPath: "inset(50%)", 1883 overflow: "hidden", 1884 whiteSpace: "nowrap", 1885 border: 0, 1886 padding: 0, 1887 width: 1, 1888 height: 1, 1889 margin: -1 1890 }; 1891 var visuallyHidden = { 1892 ...visuallyHiddenBase, 1893 position: "fixed", 1894 top: 0, 1895 left: 0 1896 }; 1897 var visuallyHiddenInput = { 1898 ...visuallyHiddenBase, 1899 position: "absolute" 1900 }; 1901 1902 // node_modules/@base-ui/react/utils/FocusGuard.mjs 1903 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 1904 var FocusGuard = /* @__PURE__ */ React12.forwardRef(function FocusGuard2(props, ref) { 1905 const [role, setRole] = React12.useState(); 1906 useIsoLayoutEffect(() => { 1907 if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { 1908 setRole("button"); 1909 } 1910 }, []); 1911 const restProps = { 1912 tabIndex: 0, 1913 // Role is only for VoiceOver 1914 role 1915 }; 1916 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { 1917 ...props, 1918 ref, 1919 style: visuallyHidden, 1920 "aria-hidden": role ? void 0 : true, 1921 ...restProps, 1922 "data-base-ui-focus-guard": "" 1923 }); 1924 }); 1925 if (true) FocusGuard.displayName = "FocusGuard"; 1926 1927 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 1928 var min = Math.min; 1929 var max = Math.max; 1930 var round = Math.round; 1931 var floor = Math.floor; 1932 var createCoords = (v) => ({ 1933 x: v, 1934 y: v 1935 }); 1936 var oppositeSideMap = { 1937 left: "right", 1938 right: "left", 1939 bottom: "top", 1940 top: "bottom" 1941 }; 1942 function clamp(start, value, end) { 1943 return max(start, min(value, end)); 1944 } 1945 function evaluate(value, param) { 1946 return typeof value === "function" ? value(param) : value; 1947 } 1948 function getSide(placement) { 1949 return placement.split("-")[0]; 1950 } 1951 function getAlignment(placement) { 1952 return placement.split("-")[1]; 1953 } 1954 function getOppositeAxis(axis) { 1955 return axis === "x" ? "y" : "x"; 1956 } 1957 function getAxisLength(axis) { 1958 return axis === "y" ? "height" : "width"; 1959 } 1960 function getSideAxis(placement) { 1961 const firstChar = placement[0]; 1962 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 1963 } 1964 function getAlignmentAxis(placement) { 1965 return getOppositeAxis(getSideAxis(placement)); 1966 } 1967 function getAlignmentSides(placement, rects, rtl) { 1968 if (rtl === void 0) { 1969 rtl = false; 1970 } 1971 const alignment = getAlignment(placement); 1972 const alignmentAxis = getAlignmentAxis(placement); 1973 const length = getAxisLength(alignmentAxis); 1974 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 1975 if (rects.reference[length] > rects.floating[length]) { 1976 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 1977 } 1978 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 1979 } 1980 function getExpandedPlacements(placement) { 1981 const oppositePlacement = getOppositePlacement(placement); 1982 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 1983 } 1984 function getOppositeAlignmentPlacement(placement) { 1985 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 1986 } 1987 var lrPlacement = ["left", "right"]; 1988 var rlPlacement = ["right", "left"]; 1989 var tbPlacement = ["top", "bottom"]; 1990 var btPlacement = ["bottom", "top"]; 1991 function getSideList(side, isStart, rtl) { 1992 switch (side) { 1993 case "top": 1994 case "bottom": 1995 if (rtl) return isStart ? rlPlacement : lrPlacement; 1996 return isStart ? lrPlacement : rlPlacement; 1997 case "left": 1998 case "right": 1999 return isStart ? tbPlacement : btPlacement; 2000 default: 2001 return []; 2002 } 2003 } 2004 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 2005 const alignment = getAlignment(placement); 2006 let list = getSideList(getSide(placement), direction === "start", rtl); 2007 if (alignment) { 2008 list = list.map((side) => side + "-" + alignment); 2009 if (flipAlignment) { 2010 list = list.concat(list.map(getOppositeAlignmentPlacement)); 2011 } 2012 } 2013 return list; 2014 } 2015 function getOppositePlacement(placement) { 2016 const side = getSide(placement); 2017 return oppositeSideMap[side] + placement.slice(side.length); 2018 } 2019 function expandPaddingObject(padding) { 2020 var _padding$top, _padding$right, _padding$bottom, _padding$left; 2021 return { 2022 top: (_padding$top = padding.top) != null ? _padding$top : 0, 2023 right: (_padding$right = padding.right) != null ? _padding$right : 0, 2024 bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, 2025 left: (_padding$left = padding.left) != null ? _padding$left : 0 2026 }; 2027 } 2028 function getPaddingObject(padding) { 2029 return typeof padding !== "number" ? expandPaddingObject(padding) : { 2030 top: padding, 2031 right: padding, 2032 bottom: padding, 2033 left: padding 2034 }; 2035 } 2036 function rectToClientRect(rect) { 2037 const { 2038 x, 2039 y, 2040 width, 2041 height 2042 } = rect; 2043 return { 2044 width, 2045 height, 2046 top: y, 2047 left: x, 2048 right: x + width, 2049 bottom: y + height, 2050 x, 2051 y 2052 }; 2053 } 2054 2055 // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 2056 function isHiddenByStyles(styles) { 2057 return styles.visibility === "hidden" || styles.visibility === "collapse"; 2058 } 2059 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 2060 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 2061 return false; 2062 } 2063 if (typeof element.checkVisibility === "function") { 2064 return element.checkVisibility(); 2065 } 2066 return styles.display !== "none" && styles.display !== "contents"; 2067 } 2068 2069 // node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs 2070 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 2071 function getParentElement(element) { 2072 const assignedSlot = element.assignedSlot; 2073 if (assignedSlot) { 2074 return assignedSlot; 2075 } 2076 if (element.parentElement) { 2077 return element.parentElement; 2078 } 2079 const rootNode = element.getRootNode(); 2080 return isShadowRoot(rootNode) ? rootNode.host : null; 2081 } 2082 function getDetailsSummary(details) { 2083 for (const child of Array.from(details.children)) { 2084 if (getNodeName(child) === "summary") { 2085 return child; 2086 } 2087 } 2088 return null; 2089 } 2090 function isWithinOpenDetailsSummary(element, details) { 2091 const summary = getDetailsSummary(details); 2092 return !!summary && (element === summary || contains(summary, element)); 2093 } 2094 function isFocusableCandidate(element) { 2095 const nodeName = element ? getNodeName(element) : ""; 2096 return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden"); 2097 } 2098 function isFocusableElement(element) { 2099 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 2100 return false; 2101 } 2102 for (let current = element; current; current = getParentElement(current)) { 2103 const isAncestor = current !== element; 2104 const isSlot = getNodeName(current) === "slot"; 2105 if (current.hasAttribute("inert")) { 2106 return false; 2107 } 2108 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 2109 return false; 2110 } 2111 } 2112 return true; 2113 } 2114 function isVisibleInTabbableTree(element, isAncestor) { 2115 const styles = getComputedStyle2(element); 2116 if (!isAncestor) { 2117 return isElementVisible(element, styles); 2118 } 2119 return styles.display !== "none"; 2120 } 2121 function getTabIndex(element) { 2122 const tabIndex = element.tabIndex; 2123 if (tabIndex < 0) { 2124 const nodeName = getNodeName(element); 2125 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 2126 return 0; 2127 } 2128 } 2129 return tabIndex; 2130 } 2131 function getNamedRadioInput(element) { 2132 if (getNodeName(element) !== "input") { 2133 return null; 2134 } 2135 const input = element; 2136 return input.type === "radio" && input.name !== "" ? input : null; 2137 } 2138 function isTabbableRadio(element, candidates) { 2139 const input = getNamedRadioInput(element); 2140 if (!input) { 2141 return true; 2142 } 2143 const checkedRadio = candidates.find((candidate) => { 2144 const radio = getNamedRadioInput(candidate); 2145 return radio?.name === input.name && radio.form === input.form && radio.checked; 2146 }); 2147 if (checkedRadio) { 2148 return checkedRadio === input; 2149 } 2150 return candidates.find((candidate) => { 2151 const radio = getNamedRadioInput(candidate); 2152 return radio?.name === input.name && radio.form === input.form; 2153 }) === input; 2154 } 2155 function getComposedChildren(container) { 2156 if (isHTMLElement(container) && getNodeName(container) === "slot") { 2157 const assignedElements = container.assignedElements({ 2158 flatten: true 2159 }); 2160 if (assignedElements.length > 0) { 2161 return assignedElements; 2162 } 2163 } 2164 if (isHTMLElement(container) && container.shadowRoot) { 2165 return Array.from(container.shadowRoot.children); 2166 } 2167 return Array.from(container.children); 2168 } 2169 function appendCandidates(container, list) { 2170 getComposedChildren(container).forEach((child) => { 2171 if (isFocusableCandidate(child)) { 2172 list.push(child); 2173 } 2174 appendCandidates(child, list); 2175 }); 2176 } 2177 function appendMatchingElements(container, selector, list) { 2178 getComposedChildren(container).forEach((child) => { 2179 if (isHTMLElement(child) && child.matches(selector)) { 2180 list.push(child); 2181 } 2182 appendMatchingElements(child, selector, list); 2183 }); 2184 } 2185 function focusable(container) { 2186 const candidates = []; 2187 appendCandidates(container, candidates); 2188 return candidates.filter(isFocusableElement); 2189 } 2190 function tabbable(container) { 2191 const candidates = focusable(container); 2192 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 2193 } 2194 function getTabbableIn(container, dir) { 2195 const list = tabbable(container); 2196 const len = list.length; 2197 if (len === 0) { 2198 return void 0; 2199 } 2200 const active = activeElement(ownerDocument(container)); 2201 const index2 = list.indexOf(active); 2202 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 2203 return list[nextIndex]; 2204 } 2205 function getNextTabbable(referenceElement) { 2206 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 2207 } 2208 function getPreviousTabbable(referenceElement) { 2209 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 2210 } 2211 function isOutsideEvent(event, container) { 2212 const containerElement = container || event.currentTarget; 2213 const relatedTarget = event.relatedTarget; 2214 return !relatedTarget || !contains(containerElement, relatedTarget); 2215 } 2216 function disableFocusInside(container) { 2217 const tabbableElements = tabbable(container); 2218 tabbableElements.forEach((element) => { 2219 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 2220 element.setAttribute("tabindex", "-1"); 2221 }); 2222 } 2223 function enableFocusInside(container) { 2224 const elements = []; 2225 appendMatchingElements(container, "[data-tabindex]", elements); 2226 elements.forEach((element) => { 2227 const tabindex = element.dataset.tabindex; 2228 delete element.dataset.tabindex; 2229 if (tabindex) { 2230 element.setAttribute("tabindex", tabindex); 2231 } else { 2232 element.removeAttribute("tabindex"); 2233 } 2234 }); 2235 } 2236 2237 // node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs 2238 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 2239 const directChildren = nodes.filter((node) => node.parentId === id); 2240 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 2241 } 2242 2243 // node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs 2244 function createAttribute(name) { 2245 return `data-base-ui-$name}`; 2246 } 2247 2248 // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2249 var React13 = __toESM(require_react(), 1); 2250 var ReactDOM2 = __toESM(require_react_dom(), 1); 2251 2252 // node_modules/@base-ui/react/internals/constants.mjs 2253 var DISABLED_TRANSITIONS_STYLE = { 2254 style: { 2255 transition: "none" 2256 } 2257 }; 2258 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 2259 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 2260 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 2261 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 2262 var POPUP_COLLISION_AVOIDANCE = { 2263 fallbackAxisSide: "end" 2264 }; 2265 var ownerVisuallyHidden = { 2266 clipPath: "inset(50%)", 2267 position: "fixed", 2268 top: 0, 2269 left: 0 2270 }; 2271 2272 // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2273 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 2274 var PortalContext = /* @__PURE__ */ React13.createContext(null); 2275 if (true) PortalContext.displayName = "PortalContext"; 2276 var usePortalContext = () => React13.useContext(PortalContext); 2277 var attr = createAttribute("portal"); 2278 function useFloatingPortalNode(props = {}) { 2279 const { 2280 ref, 2281 container: containerProp, 2282 componentProps = EMPTY_OBJECT, 2283 elementProps 2284 } = props; 2285 const uniqueId = useId(); 2286 const portalContext = usePortalContext(); 2287 const parentPortalNode = portalContext?.portalNode; 2288 const [containerElement, setContainerElement] = React13.useState(null); 2289 const [portalNode, setPortalNode] = React13.useState(null); 2290 const setPortalNodeRef = useStableCallback((node) => { 2291 if (node !== null) { 2292 setPortalNode(node); 2293 } 2294 }); 2295 const containerRef = React13.useRef(null); 2296 useIsoLayoutEffect(() => { 2297 if (containerProp === null) { 2298 if (containerRef.current) { 2299 containerRef.current = null; 2300 setPortalNode(null); 2301 setContainerElement(null); 2302 } 2303 return; 2304 } 2305 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 2306 if (resolvedContainer == null) { 2307 if (containerRef.current) { 2308 containerRef.current = null; 2309 setPortalNode(null); 2310 setContainerElement(null); 2311 } 2312 return; 2313 } 2314 if (containerRef.current !== resolvedContainer) { 2315 containerRef.current = resolvedContainer; 2316 setPortalNode(null); 2317 setContainerElement(resolvedContainer); 2318 } 2319 }, [containerProp, parentPortalNode]); 2320 const portalElement = useRenderElement("div", componentProps, { 2321 ref: [ref, setPortalNodeRef], 2322 props: [{ 2323 id: uniqueId, 2324 [attr]: "" 2325 }, elementProps] 2326 }); 2327 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 2328 return { 2329 node: portalNode, 2330 // `id` and `render` props can override or remove the generated ID. Use the exact 2331 // rendered value so `aria-owns` never points at an ID absent from the DOM. 2332 nodeId: /* @__PURE__ */ React13.isValidElement(portalElement) ? portalElement.props.id : void 0, 2333 subtree: portalSubtree 2334 }; 2335 } 2336 var FloatingPortal = /* @__PURE__ */ React13.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 2337 const { 2338 render, 2339 className, 2340 style, 2341 children, 2342 container, 2343 ...elementProps 2344 } = componentProps; 2345 const { 2346 node: portalNode, 2347 nodeId: portalNodeId, 2348 subtree: portalSubtree 2349 } = useFloatingPortalNode({ 2350 container, 2351 ref: forwardedRef, 2352 componentProps, 2353 elementProps 2354 }); 2355 const beforeOutsideRef = React13.useRef(null); 2356 const afterOutsideRef = React13.useRef(null); 2357 const beforeInsideRef = React13.useRef(null); 2358 const afterInsideRef = React13.useRef(null); 2359 const [focusManagerState, setFocusManagerState] = React13.useState(null); 2360 const focusInsideDisabledRef = React13.useRef(false); 2361 const modal = focusManagerState?.modal; 2362 const open = focusManagerState?.open; 2363 const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 2364 React13.useEffect(() => { 2365 if (!portalNode || modal) { 2366 return void 0; 2367 } 2368 function onFocus(event) { 2369 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 2370 if (event.type === "focusin") { 2371 if (focusInsideDisabledRef.current) { 2372 enableFocusInside(portalNode); 2373 focusInsideDisabledRef.current = false; 2374 } 2375 } else { 2376 disableFocusInside(portalNode); 2377 focusInsideDisabledRef.current = true; 2378 } 2379 } 2380 } 2381 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 2382 }, [portalNode, modal]); 2383 useIsoLayoutEffect(() => { 2384 if (!portalNode || open !== true || !focusInsideDisabledRef.current) { 2385 return; 2386 } 2387 enableFocusInside(portalNode); 2388 focusInsideDisabledRef.current = false; 2389 }, [open, portalNode]); 2390 const portalContextValue = React13.useMemo(() => ({ 2391 beforeOutsideRef, 2392 afterOutsideRef, 2393 beforeInsideRef, 2394 afterInsideRef, 2395 portalNode, 2396 setFocusManagerState 2397 }), [portalNode]); 2398 return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React13.Fragment, { 2399 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { 2400 value: portalContextValue, 2401 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2402 "data-type": "outside", 2403 ref: beforeOutsideRef, 2404 onFocus: (event) => { 2405 if (isOutsideEvent(event, portalNode)) { 2406 beforeInsideRef.current?.focus(); 2407 } else { 2408 const domReference = focusManagerState ? focusManagerState.domReference : null; 2409 const prevTabbable = getPreviousTabbable(domReference); 2410 prevTabbable?.focus(); 2411 } 2412 } 2413 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { 2414 "aria-owns": portalNodeId, 2415 style: ownerVisuallyHidden 2416 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2417 "data-type": "outside", 2418 ref: afterOutsideRef, 2419 onFocus: (event) => { 2420 if (isOutsideEvent(event, portalNode)) { 2421 afterInsideRef.current?.focus(); 2422 } else { 2423 const domReference = focusManagerState ? focusManagerState.domReference : null; 2424 const nextTabbable = getNextTabbable(domReference); 2425 nextTabbable?.focus(); 2426 if (focusManagerState?.closeOnFocusOut) { 2427 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 2428 } 2429 } 2430 } 2431 })] 2432 })] 2433 }); 2434 }); 2435 if (true) FloatingPortal.displayName = "FloatingPortal"; 2436 2437 // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 2438 var React14 = __toESM(require_react(), 1); 2439 2440 // node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs 2441 function createEventEmitter() { 2442 const map = /* @__PURE__ */ new Map(); 2443 return { 2444 emit(event, data) { 2445 map.get(event)?.forEach((listener) => listener(data)); 2446 }, 2447 on(event, listener) { 2448 if (!map.has(event)) { 2449 map.set(event, /* @__PURE__ */ new Set()); 2450 } 2451 map.get(event).add(listener); 2452 }, 2453 off(event, listener) { 2454 map.get(event)?.delete(listener); 2455 } 2456 }; 2457 } 2458 2459 // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 2460 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 2461 var FloatingNodeContext = /* @__PURE__ */ React14.createContext(null); 2462 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 2463 var FloatingTreeContext = /* @__PURE__ */ React14.createContext(null); 2464 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 2465 var useFloatingParentNodeId = () => React14.useContext(FloatingNodeContext)?.id || null; 2466 var useFloatingTree = (externalTree) => { 2467 const contextTree = React14.useContext(FloatingTreeContext); 2468 return externalTree ?? contextTree; 2469 }; 2470 2471 // node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs 2472 var React15 = __toESM(require_react(), 1); 2473 function createVirtualElement(domElement, data) { 2474 let offsetX = null; 2475 let offsetY = null; 2476 let isAutoUpdateEvent = false; 2477 return { 2478 contextElement: domElement || void 0, 2479 getBoundingClientRect() { 2480 const domRect = domElement?.getBoundingClientRect() || { 2481 width: 0, 2482 height: 0, 2483 x: 0, 2484 y: 0 2485 }; 2486 const isXAxis = data.axis === "x" || data.axis === "both"; 2487 const isYAxis = data.axis === "y" || data.axis === "both"; 2488 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 2489 let width = domRect.width; 2490 let height = domRect.height; 2491 let x = domRect.x; 2492 let y = domRect.y; 2493 if (offsetX == null && data.x && isXAxis) { 2494 offsetX = domRect.x - data.x; 2495 } 2496 if (offsetY == null && data.y && isYAxis) { 2497 offsetY = domRect.y - data.y; 2498 } 2499 x -= offsetX || 0; 2500 y -= offsetY || 0; 2501 width = 0; 2502 height = 0; 2503 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 2504 width = data.axis === "y" ? domRect.width : 0; 2505 height = data.axis === "x" ? domRect.height : 0; 2506 x = isXAxis && data.x != null ? data.x : x; 2507 y = isYAxis && data.y != null ? data.y : y; 2508 } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { 2509 height = data.axis === "x" ? domRect.height : height; 2510 width = data.axis === "y" ? domRect.width : width; 2511 } 2512 isAutoUpdateEvent = true; 2513 return { 2514 width, 2515 height, 2516 x, 2517 y, 2518 top: y, 2519 right: x + width, 2520 bottom: y + height, 2521 left: x 2522 }; 2523 } 2524 }; 2525 } 2526 function isMouseBasedEvent(event) { 2527 return event != null && event.clientX != null; 2528 } 2529 function useClientPoint(context, props = {}) { 2530 const { 2531 enabled = true, 2532 axis = "both" 2533 } = props; 2534 const store2 = "rootStore" in context ? context.rootStore : context; 2535 const open = store2.useState("open"); 2536 const floating = store2.useState("floatingElement"); 2537 const domReference = store2.useState("domReferenceElement"); 2538 const dataRef = store2.context.dataRef; 2539 const initialRef = React15.useRef(false); 2540 const cleanupListenerRef = React15.useRef(null); 2541 const [pointerType, setPointerType] = React15.useState(); 2542 const [reactive, setReactive] = React15.useState([]); 2543 const resetReference = useStableCallback((reference2) => { 2544 store2.set("positionReference", reference2); 2545 }); 2546 const setReference = useStableCallback((newX, newY, referenceElement) => { 2547 if (initialRef.current) { 2548 return; 2549 } 2550 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 2551 return; 2552 } 2553 store2.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 2554 x: newX, 2555 y: newY, 2556 axis, 2557 dataRef, 2558 pointerType 2559 })); 2560 }); 2561 const handleReferenceEnterOrMove = useStableCallback((event) => { 2562 if (!open) { 2563 setReference(event.clientX, event.clientY, event.currentTarget); 2564 } else if (!cleanupListenerRef.current) { 2565 setReference(event.clientX, event.clientY, event.currentTarget); 2566 setReactive([]); 2567 } 2568 }); 2569 const openCheck = isMouseLikePointerType(pointerType) ? floating : open; 2570 React15.useEffect(() => { 2571 if (!enabled) { 2572 resetReference(domReference); 2573 return void 0; 2574 } 2575 if (!openCheck) { 2576 return void 0; 2577 } 2578 function cleanupListener() { 2579 cleanupListenerRef.current?.(); 2580 cleanupListenerRef.current = null; 2581 } 2582 const win = getWindow(floating); 2583 function handleMouseMove(event) { 2584 const target = getTarget(event); 2585 if (!contains(floating, target)) { 2586 setReference(event.clientX, event.clientY); 2587 } else { 2588 cleanupListener(); 2589 } 2590 } 2591 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 2592 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 2593 } else { 2594 resetReference(domReference); 2595 } 2596 return cleanupListener; 2597 }, [openCheck, enabled, floating, dataRef, domReference, store2, setReference, resetReference, reactive]); 2598 React15.useEffect(() => () => { 2599 store2.set("positionReference", null); 2600 }, [store2]); 2601 React15.useEffect(() => { 2602 if (enabled && !floating) { 2603 initialRef.current = false; 2604 } 2605 }, [enabled, floating]); 2606 React15.useEffect(() => { 2607 if (!enabled && open) { 2608 initialRef.current = true; 2609 } 2610 }, [enabled, open]); 2611 const reference = React15.useMemo(() => { 2612 function setPointerTypeRef(event) { 2613 setPointerType(event.pointerType); 2614 } 2615 return { 2616 onPointerDown: setPointerTypeRef, 2617 onPointerEnter: setPointerTypeRef, 2618 onMouseMove: handleReferenceEnterOrMove, 2619 onMouseEnter: handleReferenceEnterOrMove 2620 }; 2621 }, [handleReferenceEnterOrMove]); 2622 return React15.useMemo(() => enabled ? { 2623 reference, 2624 trigger: reference 2625 } : {}, [enabled, reference]); 2626 } 2627 2628 // node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs 2629 var React16 = __toESM(require_react(), 1); 2630 function alwaysFalse() { 2631 return false; 2632 } 2633 function normalizeProp(normalizable) { 2634 return { 2635 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 2636 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 2637 }; 2638 } 2639 function useDismiss(context, props = {}) { 2640 const { 2641 enabled = true, 2642 escapeKey: escapeKey2 = true, 2643 outsidePress: outsidePressProp = true, 2644 outsidePressEvent = "sloppy", 2645 referencePress = alwaysFalse, 2646 bubbles, 2647 externalTree 2648 } = props; 2649 const store2 = "rootStore" in context ? context.rootStore : context; 2650 const open = store2.useState("open"); 2651 const floatingElement = store2.useState("floatingElement"); 2652 const { 2653 dataRef 2654 } = store2.context; 2655 const tree = useFloatingTree(externalTree); 2656 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 2657 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 2658 const outsidePressEnabled = outsidePress2 !== false; 2659 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 2660 const { 2661 escapeKey: escapeKeyBubbles, 2662 outsidePress: outsidePressBubbles 2663 } = normalizeProp(bubbles); 2664 const pressStartedInsideRef = React16.useRef(false); 2665 const pressStartPreventedRef = React16.useRef(false); 2666 const suppressNextOutsideClickRef = React16.useRef(false); 2667 const isComposingRef = React16.useRef(false); 2668 const currentPointerTypeRef = React16.useRef(""); 2669 const touchStateRef = React16.useRef(null); 2670 const cancelDismissOnEndTimeout = useTimeout(); 2671 const clearInsideReactTreeTimeout = useTimeout(); 2672 const clearInsideReactTree = useStableCallback(() => { 2673 clearInsideReactTreeTimeout.clear(); 2674 dataRef.current.insideReactTree = false; 2675 }); 2676 const hasBlockingChild = useStableCallback((bubbleKey) => { 2677 const nodeId = dataRef.current.floatingContext?.nodeId; 2678 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 2679 return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); 2680 }); 2681 const isEventWithinOwnElements = useStableCallback((event) => { 2682 return isEventTargetWithin(event, store2.select("floatingElement")) || isEventTargetWithin(event, store2.select("domReferenceElement")); 2683 }); 2684 const closeOnReferencePress = useStableCallback((event) => { 2685 if (!referencePress()) { 2686 return; 2687 } 2688 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 2689 }); 2690 const closeOnEscapeKeyDown = useStableCallback((event) => { 2691 if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { 2692 return; 2693 } 2694 if (isComposingRef.current) { 2695 return; 2696 } 2697 if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { 2698 return; 2699 } 2700 const native = isReactEvent(event) ? event.nativeEvent : event; 2701 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 2702 store2.setOpen(false, eventDetails); 2703 if (!eventDetails.isCanceled) { 2704 event.preventDefault(); 2705 } 2706 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 2707 event.stopPropagation(); 2708 } 2709 }); 2710 const markInsideReactTree = useStableCallback(() => { 2711 dataRef.current.insideReactTree = true; 2712 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 2713 }); 2714 const markPressStartedInsideReactTree = useStableCallback((event) => { 2715 if (!open || !enabled || event.button !== 0) { 2716 return; 2717 } 2718 const target = getTarget(event.nativeEvent); 2719 if (!contains(store2.select("floatingElement"), target)) { 2720 return; 2721 } 2722 if (!pressStartedInsideRef.current) { 2723 pressStartedInsideRef.current = true; 2724 pressStartPreventedRef.current = false; 2725 } 2726 }); 2727 const markInsidePressStartPrevented = useStableCallback((event) => { 2728 if (!open || !enabled) { 2729 return; 2730 } 2731 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 2732 return; 2733 } 2734 if (pressStartedInsideRef.current) { 2735 pressStartPreventedRef.current = true; 2736 } 2737 }); 2738 React16.useEffect(() => { 2739 if (!open || !enabled) { 2740 return clearInsideReactTree; 2741 } 2742 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 2743 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 2744 const compositionTimeout = new Timeout(); 2745 const preventedPressSuppressionTimeout = new Timeout(); 2746 function handleCompositionStart() { 2747 compositionTimeout.clear(); 2748 isComposingRef.current = true; 2749 } 2750 function handleCompositionEnd() { 2751 compositionTimeout.start( 2752 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 2753 // Only apply to WebKit for the test to remain 0ms. 2754 parts_exports.engine.webkit ? 5 : 0, 2755 () => { 2756 isComposingRef.current = false; 2757 } 2758 ); 2759 } 2760 function suppressImmediateOutsideClickAfterPreventedStart() { 2761 suppressNextOutsideClickRef.current = true; 2762 preventedPressSuppressionTimeout.start(0, () => { 2763 suppressNextOutsideClickRef.current = false; 2764 }); 2765 } 2766 function resetPressStartState() { 2767 pressStartedInsideRef.current = false; 2768 pressStartPreventedRef.current = false; 2769 } 2770 function getOutsidePressEvent() { 2771 const type = currentPointerTypeRef.current; 2772 const computedType = type === "pen" || !type ? "mouse" : type; 2773 const outsidePressEventValue = getOutsidePressEventProp(); 2774 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 2775 if (typeof resolved === "string") { 2776 return resolved; 2777 } 2778 return resolved[computedType]; 2779 } 2780 function shouldIgnoreEvent(event) { 2781 const computedOutsidePressEvent = getOutsidePressEvent(); 2782 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 2783 } 2784 function isEventWithinFloatingTree(event) { 2785 const nodeId = dataRef.current.floatingContext?.nodeId; 2786 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 2787 return isEventWithinOwnElements(event) || targetIsInsideChildren; 2788 } 2789 function closeOnPressOutside(event) { 2790 if (shouldIgnoreEvent(event)) { 2791 if (event.type !== "click" && !isEventWithinOwnElements(event)) { 2792 preventedPressSuppressionTimeout.clear(); 2793 suppressNextOutsideClickRef.current = false; 2794 } 2795 clearInsideReactTree(); 2796 return; 2797 } 2798 if (dataRef.current.insideReactTree) { 2799 clearInsideReactTree(); 2800 return; 2801 } 2802 const target = getTarget(event); 2803 const inertSelector = `[$createAttribute("inert")}]`; 2804 const targetRoot = isElement(target) ? target.getRootNode() : null; 2805 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store2.select("floatingElement"))).querySelectorAll(inertSelector)); 2806 const triggers = store2.context.triggerElements; 2807 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 2808 return; 2809 } 2810 let targetRootAncestor = isElement(target) ? target : null; 2811 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 2812 const nextParent = getParentNode(targetRootAncestor); 2813 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 2814 break; 2815 } 2816 targetRootAncestor = nextParent; 2817 } 2818 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 2819 !contains(target, store2.select("floatingElement")) && // If the target root element contains none of the markers, then the 2820 // element was injected after the floating element rendered. 2821 markers.every((marker) => !contains(targetRootAncestor, marker))) { 2822 return; 2823 } 2824 if (isHTMLElement(target) && !("touches" in event)) { 2825 const lastTraversableNode = isLastTraversableNode(target); 2826 const style = getComputedStyle2(target); 2827 const scrollRe = /auto|scroll/; 2828 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 2829 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 2830 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 2831 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 2832 const isRTL7 = style.direction === "rtl"; 2833 const pressedVerticalScrollbar = canScrollY && (isRTL7 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 2834 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 2835 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 2836 return; 2837 } 2838 } 2839 if (isEventWithinFloatingTree(event)) { 2840 return; 2841 } 2842 if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { 2843 preventedPressSuppressionTimeout.clear(); 2844 suppressNextOutsideClickRef.current = false; 2845 return; 2846 } 2847 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 2848 return; 2849 } 2850 if (hasBlockingChild("__outsidePressBubbles")) { 2851 return; 2852 } 2853 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 2854 clearInsideReactTree(); 2855 } 2856 function handlePointerDown(event) { 2857 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) { 2858 return; 2859 } 2860 closeOnPressOutside(event); 2861 } 2862 function handleTouchStart(event) { 2863 if (getOutsidePressEvent() !== "sloppy" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) { 2864 return; 2865 } 2866 const touch = event.touches[0]; 2867 if (touch) { 2868 touchStateRef.current = { 2869 startTime: Date.now(), 2870 startX: touch.clientX, 2871 startY: touch.clientY, 2872 dismissOnTouchEnd: false, 2873 dismissOnMouseDown: true 2874 }; 2875 cancelDismissOnEndTimeout.start(1e3, () => { 2876 if (touchStateRef.current) { 2877 touchStateRef.current.dismissOnTouchEnd = false; 2878 touchStateRef.current.dismissOnMouseDown = false; 2879 } 2880 }); 2881 } 2882 } 2883 function addTargetEventListenerOnce(event, listener) { 2884 const target = getTarget(event); 2885 if (!target) { 2886 return; 2887 } 2888 const unsubscribe2 = addEventListener(target, event.type, () => { 2889 listener(event); 2890 unsubscribe2(); 2891 }); 2892 } 2893 function handleTouchStartCapture(event) { 2894 currentPointerTypeRef.current = "touch"; 2895 addTargetEventListenerOnce(event, handleTouchStart); 2896 } 2897 function closeOnPressOutsideCapture(event) { 2898 cancelDismissOnEndTimeout.clear(); 2899 if (event.type === "pointerdown") { 2900 currentPointerTypeRef.current = event.pointerType; 2901 } 2902 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 2903 return; 2904 } 2905 addTargetEventListenerOnce(event, (targetEvent) => { 2906 if (targetEvent.type === "pointerdown") { 2907 handlePointerDown(targetEvent); 2908 } else { 2909 closeOnPressOutside(targetEvent); 2910 } 2911 }); 2912 } 2913 function handlePressEndCapture(event) { 2914 if (!pressStartedInsideRef.current) { 2915 return; 2916 } 2917 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 2918 resetPressStartState(); 2919 if (getOutsidePressEvent() !== "intentional") { 2920 return; 2921 } 2922 if (event.type === "pointercancel") { 2923 if (pressStartedInsideDefaultPrevented) { 2924 suppressImmediateOutsideClickAfterPreventedStart(); 2925 } 2926 return; 2927 } 2928 if (isEventWithinFloatingTree(event)) { 2929 return; 2930 } 2931 if (pressStartedInsideDefaultPrevented) { 2932 suppressImmediateOutsideClickAfterPreventedStart(); 2933 return; 2934 } 2935 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 2936 return; 2937 } 2938 preventedPressSuppressionTimeout.clear(); 2939 suppressNextOutsideClickRef.current = true; 2940 clearInsideReactTree(); 2941 } 2942 function handleTouchMove(event) { 2943 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 2944 return; 2945 } 2946 const touch = event.touches[0]; 2947 if (!touch) { 2948 return; 2949 } 2950 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 2951 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 2952 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 2953 if (distance > 5) { 2954 touchStateRef.current.dismissOnTouchEnd = true; 2955 } 2956 if (distance > 10) { 2957 closeOnPressOutside(event); 2958 cancelDismissOnEndTimeout.clear(); 2959 touchStateRef.current = null; 2960 } 2961 } 2962 function handleTouchMoveCapture(event) { 2963 addTargetEventListenerOnce(event, handleTouchMove); 2964 } 2965 function handleTouchEnd(event) { 2966 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 2967 return; 2968 } 2969 if (touchStateRef.current.dismissOnTouchEnd) { 2970 closeOnPressOutside(event); 2971 } 2972 cancelDismissOnEndTimeout.clear(); 2973 touchStateRef.current = null; 2974 } 2975 function handleTouchEndCapture(event) { 2976 addTargetEventListenerOnce(event, handleTouchEnd); 2977 } 2978 const doc = ownerDocument(floatingElement); 2979 const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, true), addEventListener(doc, "touchmove", handleTouchMoveCapture, true), addEventListener(doc, "touchend", handleTouchEndCapture, true))); 2980 return () => { 2981 unsubscribe(); 2982 compositionTimeout.clear(); 2983 preventedPressSuppressionTimeout.clear(); 2984 resetPressStartState(); 2985 suppressNextOutsideClickRef.current = false; 2986 clearInsideReactTree(); 2987 }; 2988 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); 2989 const reference = React16.useMemo(() => ({ 2990 onKeyDown: closeOnEscapeKeyDown, 2991 onPointerDown: closeOnReferencePress, 2992 onClick: closeOnReferencePress 2993 }), [closeOnEscapeKeyDown, closeOnReferencePress]); 2994 const floating = React16.useMemo(() => ({ 2995 onKeyDown: closeOnEscapeKeyDown, 2996 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 2997 // `onPointerDown`, such as with <NumberField.ScrubArea>. 2998 // See https://github.com/mui/base-ui/pull/3379 2999 onPointerDown: markInsidePressStartPrevented, 3000 onMouseDown: markInsidePressStartPrevented, 3001 onClickCapture: markInsideReactTree, 3002 onMouseDownCapture(event) { 3003 markInsideReactTree(); 3004 markPressStartedInsideReactTree(event); 3005 }, 3006 onPointerDownCapture(event) { 3007 markInsideReactTree(); 3008 markPressStartedInsideReactTree(event); 3009 }, 3010 onMouseUpCapture: markInsideReactTree, 3011 onTouchEndCapture: markInsideReactTree, 3012 onTouchMoveCapture: markInsideReactTree 3013 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 3014 return React16.useMemo(() => enabled ? { 3015 reference, 3016 floating, 3017 trigger: reference 3018 } : {}, [enabled, reference, floating]); 3019 } 3020 3021 // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs 3022 var React24 = __toESM(require_react(), 1); 3023 3024 // node_modules/@floating-ui/core/dist/floating-ui.core.mjs 3025 function computeCoordsFromPlacement(_ref, placement, rtl) { 3026 let { 3027 reference, 3028 floating 3029 } = _ref; 3030 const sideAxis = getSideAxis(placement); 3031 const alignmentAxis = getAlignmentAxis(placement); 3032 const alignLength = getAxisLength(alignmentAxis); 3033 const side = getSide(placement); 3034 const isVertical = sideAxis === "y"; 3035 const commonX = reference.x + reference.width / 2 - floating.width / 2; 3036 const commonY = reference.y + reference.height / 2 - floating.height / 2; 3037 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 3038 let coords; 3039 switch (side) { 3040 case "top": 3041 coords = { 3042 x: commonX, 3043 y: reference.y - floating.height 3044 }; 3045 break; 3046 case "bottom": 3047 coords = { 3048 x: commonX, 3049 y: reference.y + reference.height 3050 }; 3051 break; 3052 case "right": 3053 coords = { 3054 x: reference.x + reference.width, 3055 y: commonY 3056 }; 3057 break; 3058 case "left": 3059 coords = { 3060 x: reference.x - floating.width, 3061 y: commonY 3062 }; 3063 break; 3064 default: 3065 coords = { 3066 x: reference.x, 3067 y: reference.y 3068 }; 3069 } 3070 const alignment = getAlignment(placement); 3071 if (alignment) { 3072 coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); 3073 } 3074 return coords; 3075 } 3076 async function detectOverflow(state, options) { 3077 var _await$platform$isEle; 3078 if (options === void 0) { 3079 options = {}; 3080 } 3081 const { 3082 x, 3083 y, 3084 platform: platform3, 3085 rects, 3086 elements, 3087 strategy 3088 } = state; 3089 const { 3090 boundary = "clippingAncestors", 3091 rootBoundary = "viewport", 3092 elementContext = "floating", 3093 altBoundary = false, 3094 padding = 0 3095 } = evaluate(options, state); 3096 const paddingObject = getPaddingObject(padding); 3097 const altContext = elementContext === "floating" ? "reference" : "floating"; 3098 const element = elements[altBoundary ? altContext : elementContext]; 3099 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 3100 element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)), 3101 boundary, 3102 rootBoundary, 3103 strategy 3104 })); 3105 const rect = elementContext === "floating" ? { 3106 x, 3107 y, 3108 width: rects.floating.width, 3109 height: rects.floating.height 3110 } : rects.reference; 3111 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); 3112 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 3113 x: 1, 3114 y: 1 3115 }; 3116 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 3117 elements, 3118 rect, 3119 offsetParent, 3120 strategy 3121 }) : rect); 3122 return { 3123 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 3124 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 3125 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 3126 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 3127 }; 3128 } 3129 var MAX_RESET_COUNT = 50; 3130 var computePosition = async (reference, floating, config) => { 3131 const { 3132 placement = "bottom", 3133 strategy = "absolute", 3134 middleware = [], 3135 platform: platform3 3136 } = config; 3137 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 3138 ...platform3, 3139 detectOverflow 3140 }; 3141 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 3142 let rects = await platform3.getElementRects({ 3143 reference, 3144 floating, 3145 strategy 3146 }); 3147 let { 3148 x, 3149 y 3150 } = computeCoordsFromPlacement(rects, placement, rtl); 3151 let statefulPlacement = placement; 3152 let resetCount = 0; 3153 const middlewareData = {}; 3154 for (let i = 0; i < middleware.length; i++) { 3155 const currentMiddleware = middleware[i]; 3156 if (!currentMiddleware) { 3157 continue; 3158 } 3159 const { 3160 name, 3161 fn 3162 } = currentMiddleware; 3163 const { 3164 x: nextX, 3165 y: nextY, 3166 data, 3167 reset 3168 } = await fn({ 3169 x, 3170 y, 3171 initialPlacement: placement, 3172 placement: statefulPlacement, 3173 strategy, 3174 middlewareData, 3175 rects, 3176 platform: platformWithDetectOverflow, 3177 elements: { 3178 reference, 3179 floating 3180 } 3181 }); 3182 x = nextX != null ? nextX : x; 3183 y = nextY != null ? nextY : y; 3184 middlewareData[name] = { 3185 ...middlewareData[name], 3186 ...data 3187 }; 3188 if (reset && resetCount < MAX_RESET_COUNT) { 3189 resetCount++; 3190 if (typeof reset === "object") { 3191 if (reset.placement) { 3192 statefulPlacement = reset.placement; 3193 } 3194 if (reset.rects) { 3195 rects = reset.rects === true ? await platform3.getElementRects({ 3196 reference, 3197 floating, 3198 strategy 3199 }) : reset.rects; 3200 } 3201 ({ 3202 x, 3203 y 3204 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 3205 } 3206 i = -1; 3207 } 3208 } 3209 return { 3210 x, 3211 y, 3212 placement: statefulPlacement, 3213 strategy, 3214 middlewareData 3215 }; 3216 }; 3217 var flip = function(options) { 3218 if (options === void 0) { 3219 options = {}; 3220 } 3221 return { 3222 name: "flip", 3223 options, 3224 async fn(state) { 3225 var _middlewareData$arrow, _middlewareData$flip; 3226 const { 3227 placement, 3228 middlewareData, 3229 rects, 3230 initialPlacement, 3231 platform: platform3, 3232 elements 3233 } = state; 3234 const { 3235 mainAxis: checkMainAxis = true, 3236 crossAxis: checkCrossAxis = true, 3237 fallbackPlacements: specifiedFallbackPlacements, 3238 fallbackStrategy = "bestFit", 3239 fallbackAxisSideDirection = "none", 3240 flipAlignment = true, 3241 ...detectOverflowOptions 3242 } = evaluate(options, state); 3243 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3244 return {}; 3245 } 3246 const side = getSide(placement); 3247 const initialSideAxis = getSideAxis(initialPlacement); 3248 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 3249 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 3250 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 3251 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 3252 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 3253 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 3254 } 3255 const placements2 = [initialPlacement, ...fallbackPlacements]; 3256 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3257 const overflows = []; 3258 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 3259 if (checkMainAxis) { 3260 overflows.push(overflow[side]); 3261 } 3262 if (checkCrossAxis) { 3263 const sides2 = getAlignmentSides(placement, rects, rtl); 3264 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 3265 } 3266 overflowsData = [...overflowsData, { 3267 placement, 3268 overflows 3269 }]; 3270 if (!overflows.every((side2) => side2 <= 0)) { 3271 var _middlewareData$flip2, _overflowsData$filter; 3272 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 3273 const nextPlacement = placements2[nextIndex]; 3274 if (nextPlacement) { 3275 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 3276 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 3277 // overflows the main axis. 3278 overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 3279 return { 3280 data: { 3281 index: nextIndex, 3282 overflows: overflowsData 3283 }, 3284 reset: { 3285 placement: nextPlacement 3286 } 3287 }; 3288 } 3289 } 3290 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 3291 if (!resetPlacement) { 3292 switch (fallbackStrategy) { 3293 case "bestFit": { 3294 var _overflowsData$filter2; 3295 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 3296 if (hasFallbackAxisSideDirection) { 3297 const currentSideAxis = getSideAxis(d.placement); 3298 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 3299 // reading directions favoring greater width. 3300 currentSideAxis === "y"; 3301 } 3302 return true; 3303 }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 3304 if (placement2) { 3305 resetPlacement = placement2; 3306 } 3307 break; 3308 } 3309 case "initialPlacement": 3310 resetPlacement = initialPlacement; 3311 break; 3312 } 3313 } 3314 if (placement !== resetPlacement) { 3315 return { 3316 reset: { 3317 placement: resetPlacement 3318 } 3319 }; 3320 } 3321 } 3322 return {}; 3323 } 3324 }; 3325 }; 3326 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 3327 async function convertValueToCoords(state, options) { 3328 const { 3329 placement, 3330 platform: platform3, 3331 elements 3332 } = state; 3333 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 3334 const side = getSide(placement); 3335 const alignment = getAlignment(placement); 3336 const isVertical = getSideAxis(placement) === "y"; 3337 const mainAxisMulti = originSides.has(side) ? -1 : 1; 3338 const crossAxisMulti = rtl && isVertical ? -1 : 1; 3339 const rawValue = evaluate(options, state); 3340 let { 3341 mainAxis, 3342 crossAxis, 3343 alignmentAxis 3344 } = typeof rawValue === "number" ? { 3345 mainAxis: rawValue, 3346 crossAxis: 0, 3347 alignmentAxis: null 3348 } : { 3349 mainAxis: rawValue.mainAxis || 0, 3350 crossAxis: rawValue.crossAxis || 0, 3351 alignmentAxis: rawValue.alignmentAxis 3352 }; 3353 if (alignment && typeof alignmentAxis === "number") { 3354 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 3355 } 3356 return isVertical ? { 3357 x: crossAxis * crossAxisMulti, 3358 y: mainAxis * mainAxisMulti 3359 } : { 3360 x: mainAxis * mainAxisMulti, 3361 y: crossAxis * crossAxisMulti 3362 }; 3363 } 3364 var offset = function(options) { 3365 if (options === void 0) { 3366 options = 0; 3367 } 3368 return { 3369 name: "offset", 3370 options, 3371 async fn(state) { 3372 var _middlewareData$offse, _middlewareData$arrow; 3373 const { 3374 x, 3375 y, 3376 placement, 3377 middlewareData 3378 } = state; 3379 const diffCoords = await convertValueToCoords(state, options); 3380 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3381 return {}; 3382 } 3383 return { 3384 x: x + diffCoords.x, 3385 y: y + diffCoords.y, 3386 data: { 3387 ...diffCoords, 3388 placement 3389 } 3390 }; 3391 } 3392 }; 3393 }; 3394 var shift = function(options) { 3395 if (options === void 0) { 3396 options = {}; 3397 } 3398 return { 3399 name: "shift", 3400 options, 3401 async fn(state) { 3402 const { 3403 x, 3404 y, 3405 placement, 3406 platform: platform3 3407 } = state; 3408 const { 3409 mainAxis: checkMainAxis = true, 3410 crossAxis: checkCrossAxis = false, 3411 limiter = { 3412 fn: (_ref) => { 3413 let { 3414 x: x2, 3415 y: y2 3416 } = _ref; 3417 return { 3418 x: x2, 3419 y: y2 3420 }; 3421 } 3422 }, 3423 ...detectOverflowOptions 3424 } = evaluate(options, state); 3425 const coords = { 3426 x, 3427 y 3428 }; 3429 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3430 const crossAxis = getSideAxis(placement); 3431 const mainAxis = getOppositeAxis(crossAxis); 3432 let mainAxisCoord = coords[mainAxis]; 3433 let crossAxisCoord = coords[crossAxis]; 3434 const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); 3435 if (checkMainAxis) { 3436 mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); 3437 } 3438 if (checkCrossAxis) { 3439 crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); 3440 } 3441 const limitedCoords = limiter.fn({ 3442 ...state, 3443 [mainAxis]: mainAxisCoord, 3444 [crossAxis]: crossAxisCoord 3445 }); 3446 return { 3447 ...limitedCoords, 3448 data: { 3449 x: limitedCoords.x - x, 3450 y: limitedCoords.y - y, 3451 enabled: { 3452 [mainAxis]: checkMainAxis, 3453 [crossAxis]: checkCrossAxis 3454 } 3455 } 3456 }; 3457 } 3458 }; 3459 }; 3460 var limitShift = function(options) { 3461 if (options === void 0) { 3462 options = {}; 3463 } 3464 return { 3465 options, 3466 fn(state) { 3467 var _rawOffset$mainAxis, _rawOffset$crossAxis; 3468 const { 3469 x, 3470 y, 3471 placement, 3472 rects, 3473 middlewareData 3474 } = state; 3475 const { 3476 offset: offset4 = 0, 3477 mainAxis: checkMainAxis = true, 3478 crossAxis: checkCrossAxis = true 3479 } = evaluate(options, state); 3480 const coords = { 3481 x, 3482 y 3483 }; 3484 const crossAxis = getSideAxis(placement); 3485 const mainAxis = getOppositeAxis(crossAxis); 3486 let mainAxisCoord = coords[mainAxis]; 3487 let crossAxisCoord = coords[crossAxis]; 3488 const rawOffset = evaluate(offset4, state); 3489 const computedOffset = typeof rawOffset === "number" ? { 3490 mainAxis: rawOffset, 3491 crossAxis: 0 3492 } : { 3493 mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, 3494 crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 3495 }; 3496 if (checkMainAxis) { 3497 const len = mainAxis === "y" ? "height" : "width"; 3498 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 3499 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 3500 if (mainAxisCoord < limitMin) { 3501 mainAxisCoord = limitMin; 3502 } else if (mainAxisCoord > limitMax) { 3503 mainAxisCoord = limitMax; 3504 } 3505 } 3506 if (checkCrossAxis) { 3507 var _middlewareData$offse, _middlewareData$offse2; 3508 const len = mainAxis === "y" ? "width" : "height"; 3509 const isOriginSide = originSides.has(getSide(placement)); 3510 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 3511 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 3512 if (crossAxisCoord < limitMin) { 3513 crossAxisCoord = limitMin; 3514 } else if (crossAxisCoord > limitMax) { 3515 crossAxisCoord = limitMax; 3516 } 3517 } 3518 return { 3519 [mainAxis]: mainAxisCoord, 3520 [crossAxis]: crossAxisCoord 3521 }; 3522 } 3523 }; 3524 }; 3525 var size = function(options) { 3526 if (options === void 0) { 3527 options = {}; 3528 } 3529 return { 3530 name: "size", 3531 options, 3532 async fn(state) { 3533 const { 3534 placement, 3535 rects, 3536 platform: platform3, 3537 elements 3538 } = state; 3539 const { 3540 apply = () => { 3541 }, 3542 ...detectOverflowOptions 3543 } = evaluate(options, state); 3544 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3545 const side = getSide(placement); 3546 const alignment = getAlignment(placement); 3547 const isYAxis = getSideAxis(placement) === "y"; 3548 const { 3549 width, 3550 height 3551 } = rects.floating; 3552 let heightSide; 3553 let widthSide; 3554 if (side === "top" || side === "bottom") { 3555 heightSide = side; 3556 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; 3557 } else { 3558 widthSide = side; 3559 heightSide = alignment === "end" ? "top" : "bottom"; 3560 } 3561 const maximumClippingHeight = height - overflow.top - overflow.bottom; 3562 const maximumClippingWidth = width - overflow.left - overflow.right; 3563 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 3564 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 3565 const shiftData = state.middlewareData.shift; 3566 const noShift = !shiftData; 3567 let availableHeight = overflowAvailableHeight; 3568 let availableWidth = overflowAvailableWidth; 3569 if (shiftData != null && shiftData.enabled.x) { 3570 availableWidth = maximumClippingWidth; 3571 } 3572 if (shiftData != null && shiftData.enabled.y) { 3573 availableHeight = maximumClippingHeight; 3574 } 3575 if (noShift && !alignment) { 3576 if (isYAxis) { 3577 availableWidth = width - 2 * max(overflow.left, overflow.right); 3578 } else { 3579 availableHeight = height - 2 * max(overflow.top, overflow.bottom); 3580 } 3581 } 3582 await apply({ 3583 ...state, 3584 availableWidth, 3585 availableHeight 3586 }); 3587 const nextDimensions = await platform3.getDimensions(elements.floating); 3588 if (width !== nextDimensions.width || height !== nextDimensions.height) { 3589 return { 3590 reset: { 3591 rects: true 3592 } 3593 }; 3594 } 3595 return {}; 3596 } 3597 }; 3598 }; 3599 3600 // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 3601 function getCssDimensions(element) { 3602 const css = getComputedStyle2(element); 3603 let width = parseFloat(css.width) || 0; 3604 let height = parseFloat(css.height) || 0; 3605 const hasOffset = isHTMLElement(element); 3606 const offsetWidth = hasOffset ? element.offsetWidth : width; 3607 const offsetHeight = hasOffset ? element.offsetHeight : height; 3608 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 3609 if (shouldFallback) { 3610 width = offsetWidth; 3611 height = offsetHeight; 3612 } 3613 return { 3614 width, 3615 height, 3616 $: shouldFallback 3617 }; 3618 } 3619 function unwrapElement(element) { 3620 return !isElement(element) ? element.contextElement : element; 3621 } 3622 function getScale(element) { 3623 const domElement = unwrapElement(element); 3624 if (!isHTMLElement(domElement)) { 3625 return createCoords(1); 3626 } 3627 const rect = domElement.getBoundingClientRect(); 3628 const { 3629 width, 3630 height, 3631 $ 3632 } = getCssDimensions(domElement); 3633 let x = ($ ? round(rect.width) : rect.width) / width; 3634 let y = ($ ? round(rect.height) : rect.height) / height; 3635 if (!x || !Number.isFinite(x)) { 3636 x = 1; 3637 } 3638 if (!y || !Number.isFinite(y)) { 3639 y = 1; 3640 } 3641 return { 3642 x, 3643 y 3644 }; 3645 } 3646 var noOffsets = /* @__PURE__ */ createCoords(0); 3647 function getVisualOffsets(element) { 3648 const win = getWindow(element); 3649 if (!isWebKit() || !win.visualViewport) { 3650 return noOffsets; 3651 } 3652 return { 3653 x: win.visualViewport.offsetLeft, 3654 y: win.visualViewport.offsetTop 3655 }; 3656 } 3657 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 3658 if (isFixed === void 0) { 3659 isFixed = false; 3660 } 3661 return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); 3662 } 3663 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 3664 if (includeScale === void 0) { 3665 includeScale = false; 3666 } 3667 if (isFixedStrategy === void 0) { 3668 isFixedStrategy = false; 3669 } 3670 const clientRect = element.getBoundingClientRect(); 3671 const domElement = unwrapElement(element); 3672 let scale = createCoords(1); 3673 if (includeScale) { 3674 if (offsetParent) { 3675 if (isElement(offsetParent)) { 3676 scale = getScale(offsetParent); 3677 } 3678 } else { 3679 scale = getScale(element); 3680 } 3681 } 3682 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 3683 let x = (clientRect.left + visualOffsets.x) / scale.x; 3684 let y = (clientRect.top + visualOffsets.y) / scale.y; 3685 let width = clientRect.width / scale.x; 3686 let height = clientRect.height / scale.y; 3687 if (domElement && offsetParent) { 3688 const win = getWindow(domElement); 3689 const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 3690 let currentWin = win; 3691 let currentIFrame = getFrameElement(currentWin); 3692 while (currentIFrame && offsetWin !== currentWin) { 3693 const iframeScale = getScale(currentIFrame); 3694 const iframeRect = currentIFrame.getBoundingClientRect(); 3695 const css = getComputedStyle2(currentIFrame); 3696 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 3697 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 3698 x *= iframeScale.x; 3699 y *= iframeScale.y; 3700 width *= iframeScale.x; 3701 height *= iframeScale.y; 3702 x += left; 3703 y += top; 3704 currentWin = getWindow(currentIFrame); 3705 currentIFrame = getFrameElement(currentWin); 3706 } 3707 } 3708 return rectToClientRect({ 3709 width, 3710 height, 3711 x, 3712 y 3713 }); 3714 } 3715 function getWindowScrollBarX(element, rect) { 3716 const leftScroll = getNodeScroll(element).scrollLeft; 3717 if (!rect) { 3718 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 3719 } 3720 return rect.left + leftScroll; 3721 } 3722 function getHTMLOffset(documentElement, scroll) { 3723 const htmlRect = documentElement.getBoundingClientRect(); 3724 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 3725 const y = htmlRect.top + scroll.scrollTop; 3726 return { 3727 x, 3728 y 3729 }; 3730 } 3731 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 3732 let { 3733 elements, 3734 rect, 3735 offsetParent, 3736 strategy 3737 } = _ref; 3738 const isFixed = strategy === "fixed"; 3739 const documentElement = getDocumentElement(offsetParent); 3740 const topLayer = elements ? isTopLayer(elements.floating) : false; 3741 if (offsetParent === documentElement || topLayer && isFixed) { 3742 return rect; 3743 } 3744 let scroll = { 3745 scrollLeft: 0, 3746 scrollTop: 0 3747 }; 3748 let scale = createCoords(1); 3749 const offsets = createCoords(0); 3750 const isOffsetParentAnElement = isHTMLElement(offsetParent); 3751 if (isOffsetParentAnElement || !isFixed) { 3752 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 3753 scroll = getNodeScroll(offsetParent); 3754 } 3755 if (isOffsetParentAnElement) { 3756 const offsetRect = getBoundingClientRect(offsetParent); 3757 scale = getScale(offsetParent); 3758 offsets.x = offsetRect.x + offsetParent.clientLeft; 3759 offsets.y = offsetRect.y + offsetParent.clientTop; 3760 } 3761 } 3762 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 3763 return { 3764 width: rect.width * scale.x, 3765 height: rect.height * scale.y, 3766 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 3767 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 3768 }; 3769 } 3770 function getClientRects(element) { 3771 return element.getClientRects ? Array.from(element.getClientRects()) : []; 3772 } 3773 function getDocumentRect(html) { 3774 const scroll = getNodeScroll(html); 3775 const body = html.ownerDocument.body; 3776 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 3777 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 3778 let x = -scroll.scrollLeft + getWindowScrollBarX(html); 3779 const y = -scroll.scrollTop; 3780 if (getComputedStyle2(body).direction === "rtl") { 3781 x += max(html.clientWidth, body.clientWidth) - width; 3782 } 3783 return { 3784 width, 3785 height, 3786 x, 3787 y 3788 }; 3789 } 3790 var SCROLLBAR_MAX = 25; 3791 function getViewportRect(element, strategy, rootBoundary) { 3792 if (rootBoundary === void 0) { 3793 rootBoundary = "viewport"; 3794 } 3795 const isLayoutViewport = rootBoundary === "layoutViewport"; 3796 const win = getWindow(element); 3797 const html = getDocumentElement(element); 3798 const visualViewport = win.visualViewport; 3799 let width = html.clientWidth; 3800 let height = html.clientHeight; 3801 let x = 0; 3802 let y = 0; 3803 if (visualViewport) { 3804 const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; 3805 if (isLayoutViewport) { 3806 if (!layoutRelativeClientCoords) { 3807 x = -visualViewport.offsetLeft; 3808 y = -visualViewport.offsetTop; 3809 } 3810 } else { 3811 width = visualViewport.width; 3812 height = visualViewport.height; 3813 if (layoutRelativeClientCoords) { 3814 x = visualViewport.offsetLeft; 3815 y = visualViewport.offsetTop; 3816 } 3817 } 3818 } 3819 const windowScrollbarX = getWindowScrollBarX(html); 3820 if (windowScrollbarX <= 0) { 3821 const doc = html.ownerDocument; 3822 const body = doc.body; 3823 const bodyStyles = getComputedStyle(body); 3824 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 3825 const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 3826 const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; 3827 if (gutter <= SCROLLBAR_MAX) { 3828 width -= gutter; 3829 } 3830 } 3831 return { 3832 width, 3833 height, 3834 x, 3835 y 3836 }; 3837 } 3838 function getInnerBoundingClientRect(element, strategy) { 3839 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 3840 const top = clientRect.top + element.clientTop; 3841 const left = clientRect.left + element.clientLeft; 3842 const scale = getScale(element); 3843 const width = element.clientWidth * scale.x; 3844 const height = element.clientHeight * scale.y; 3845 const x = left * scale.x; 3846 const y = top * scale.y; 3847 return { 3848 width, 3849 height, 3850 x, 3851 y 3852 }; 3853 } 3854 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 3855 let rect; 3856 if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { 3857 rect = getViewportRect(element, strategy, clippingAncestor); 3858 } else if (clippingAncestor === "document") { 3859 rect = getDocumentRect(getDocumentElement(element)); 3860 } else if (isElement(clippingAncestor)) { 3861 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 3862 } else { 3863 const visualOffsets = getVisualOffsets(element); 3864 rect = { 3865 x: clippingAncestor.x - visualOffsets.x, 3866 y: clippingAncestor.y - visualOffsets.y, 3867 width: clippingAncestor.width, 3868 height: clippingAncestor.height 3869 }; 3870 } 3871 return rectToClientRect(rect); 3872 } 3873 function getClippingElementAncestors(element, cache) { 3874 const cachedResult = cache.get(element); 3875 if (cachedResult) { 3876 return cachedResult; 3877 } 3878 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 3879 let lastKeptComputedStyle = null; 3880 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 3881 let currentNode = elementIsFixed ? getParentNode(element) : element; 3882 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 3883 const computedStyle = getComputedStyle2(currentNode); 3884 const currentNodeIsContaining = isContainingBlock(currentNode); 3885 const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; 3886 const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); 3887 if (shouldDropCurrentNode) { 3888 result = result.filter((ancestor) => ancestor !== currentNode); 3889 } else { 3890 lastKeptComputedStyle = computedStyle; 3891 } 3892 currentNode = getParentNode(currentNode); 3893 } 3894 cache.set(element, result); 3895 return result; 3896 } 3897 function getClippingRect(_ref) { 3898 let { 3899 element, 3900 boundary, 3901 rootBoundary, 3902 strategy 3903 } = _ref; 3904 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 3905 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 3906 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 3907 let top = firstRect.top; 3908 let right = firstRect.right; 3909 let bottom = firstRect.bottom; 3910 let left = firstRect.left; 3911 for (let i = 1; i < clippingAncestors.length; i++) { 3912 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 3913 top = max(rect.top, top); 3914 right = min(rect.right, right); 3915 bottom = min(rect.bottom, bottom); 3916 left = max(rect.left, left); 3917 } 3918 return { 3919 width: right - left, 3920 height: bottom - top, 3921 x: left, 3922 y: top 3923 }; 3924 } 3925 function getDimensions(element) { 3926 const { 3927 width, 3928 height 3929 } = getCssDimensions(element); 3930 return { 3931 width, 3932 height 3933 }; 3934 } 3935 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 3936 const isOffsetParentAnElement = isHTMLElement(offsetParent); 3937 const documentElement = getDocumentElement(offsetParent); 3938 const isFixed = strategy === "fixed"; 3939 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 3940 let scroll = { 3941 scrollLeft: 0, 3942 scrollTop: 0 3943 }; 3944 const offsets = createCoords(0); 3945 if (isOffsetParentAnElement || !isFixed) { 3946 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 3947 scroll = getNodeScroll(offsetParent); 3948 } 3949 if (isOffsetParentAnElement) { 3950 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 3951 offsets.x = offsetRect.x + offsetParent.clientLeft; 3952 offsets.y = offsetRect.y + offsetParent.clientTop; 3953 } 3954 } 3955 if (!isOffsetParentAnElement && documentElement) { 3956 offsets.x = getWindowScrollBarX(documentElement); 3957 } 3958 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 3959 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 3960 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 3961 return { 3962 x, 3963 y, 3964 width: rect.width, 3965 height: rect.height 3966 }; 3967 } 3968 function isStaticPositioned(element) { 3969 return getComputedStyle2(element).position === "static"; 3970 } 3971 function getTrueOffsetParent(element, polyfill) { 3972 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 3973 return null; 3974 } 3975 if (polyfill) { 3976 return polyfill(element); 3977 } 3978 let rawOffsetParent = element.offsetParent; 3979 if (getDocumentElement(element) === rawOffsetParent) { 3980 rawOffsetParent = rawOffsetParent.ownerDocument.body; 3981 } 3982 return rawOffsetParent; 3983 } 3984 function getOffsetParent(element, polyfill) { 3985 const win = getWindow(element); 3986 if (isTopLayer(element)) { 3987 return win; 3988 } 3989 if (!isHTMLElement(element)) { 3990 let svgOffsetParent = getParentNode(element); 3991 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 3992 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 3993 return svgOffsetParent; 3994 } 3995 svgOffsetParent = getParentNode(svgOffsetParent); 3996 } 3997 return win; 3998 } 3999 let offsetParent = getTrueOffsetParent(element, polyfill); 4000 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 4001 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 4002 } 4003 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 4004 return win; 4005 } 4006 return offsetParent || getContainingBlock(element) || win; 4007 } 4008 var getElementRects = async function(data) { 4009 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 4010 const getDimensionsFn = this.getDimensions; 4011 const floatingDimensions = await getDimensionsFn(data.floating); 4012 return { 4013 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 4014 floating: { 4015 x: 0, 4016 y: 0, 4017 width: floatingDimensions.width, 4018 height: floatingDimensions.height 4019 } 4020 }; 4021 }; 4022 function isRTL(element) { 4023 return getComputedStyle2(element).direction === "rtl"; 4024 } 4025 var platform2 = { 4026 convertOffsetParentRelativeRectToViewportRelativeRect, 4027 getDocumentElement, 4028 getClippingRect, 4029 getOffsetParent, 4030 getElementRects, 4031 getClientRects, 4032 getDimensions, 4033 getScale, 4034 isElement, 4035 isRTL 4036 }; 4037 function rectsAreEqual(a, b) { 4038 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 4039 } 4040 function observeMove(element, onMove, ancestorResize) { 4041 let io = null; 4042 let timeoutId; 4043 const root = getDocumentElement(element); 4044 function cleanup() { 4045 var _io; 4046 clearTimeout(timeoutId); 4047 (_io = io) == null || _io.disconnect(); 4048 io = null; 4049 } 4050 function refresh(skip, threshold) { 4051 if (skip === void 0) { 4052 skip = false; 4053 } 4054 if (threshold === void 0) { 4055 threshold = 1; 4056 } 4057 cleanup(); 4058 const elementRectForRootMargin = element.getBoundingClientRect(); 4059 const { 4060 left, 4061 top, 4062 width, 4063 height 4064 } = elementRectForRootMargin; 4065 if (!skip) { 4066 onMove(); 4067 } 4068 if (!width || !height) { 4069 return; 4070 } 4071 const insetTop = floor(top); 4072 const insetRight = floor(root.clientWidth - (left + width)); 4073 const insetBottom = floor(root.clientHeight - (top + height)); 4074 const insetLeft = floor(left); 4075 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 4076 const options = { 4077 rootMargin, 4078 threshold: max(0, min(1, threshold)) || 1 4079 }; 4080 let isFirstUpdate = true; 4081 function handleObserve(entries) { 4082 const ratio = entries[0].intersectionRatio; 4083 if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 4084 return refresh(); 4085 } 4086 if (ratio !== threshold) { 4087 if (!isFirstUpdate) { 4088 return refresh(); 4089 } 4090 if (!ratio) { 4091 timeoutId = setTimeout(() => { 4092 refresh(false, 1e-7); 4093 }, 1e3); 4094 } else { 4095 refresh(false, ratio); 4096 } 4097 } 4098 isFirstUpdate = false; 4099 } 4100 try { 4101 io = new IntersectionObserver(handleObserve, { 4102 ...options, 4103 // Handle <iframe>s 4104 root: root.ownerDocument 4105 }); 4106 } catch (_e) { 4107 io = new IntersectionObserver(handleObserve, options); 4108 } 4109 io.observe(element); 4110 } 4111 const win = getWindow(element); 4112 const handleResize = () => refresh(ancestorResize); 4113 win.addEventListener("resize", handleResize); 4114 refresh(true); 4115 return () => { 4116 win.removeEventListener("resize", handleResize); 4117 cleanup(); 4118 }; 4119 } 4120 function autoUpdate(reference, floating, update2, options) { 4121 if (options === void 0) { 4122 options = {}; 4123 } 4124 const { 4125 ancestorScroll = true, 4126 ancestorResize = true, 4127 elementResize = typeof ResizeObserver === "function", 4128 layoutShift = typeof IntersectionObserver === "function", 4129 animationFrame = false 4130 } = options; 4131 const referenceEl = unwrapElement(reference); 4132 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 4133 ancestors.forEach((ancestor) => { 4134 ancestorScroll && ancestor.addEventListener("scroll", update2); 4135 ancestorResize && ancestor.addEventListener("resize", update2); 4136 }); 4137 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null; 4138 let reobserveFrame = -1; 4139 let resizeObserver = null; 4140 if (elementResize) { 4141 resizeObserver = new ResizeObserver((_ref) => { 4142 let [firstEntry] = _ref; 4143 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 4144 resizeObserver.unobserve(floating); 4145 cancelAnimationFrame(reobserveFrame); 4146 reobserveFrame = requestAnimationFrame(() => { 4147 var _resizeObserver; 4148 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 4149 }); 4150 } 4151 update2(); 4152 }); 4153 if (referenceEl && !animationFrame) { 4154 resizeObserver.observe(referenceEl); 4155 } 4156 if (floating) { 4157 resizeObserver.observe(floating); 4158 } 4159 } 4160 let frameId; 4161 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 4162 if (animationFrame) { 4163 frameLoop(); 4164 } 4165 function frameLoop() { 4166 const nextRefRect = getBoundingClientRect(reference); 4167 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 4168 update2(); 4169 } 4170 prevRefRect = nextRefRect; 4171 frameId = requestAnimationFrame(frameLoop); 4172 } 4173 update2(); 4174 return () => { 4175 var _resizeObserver2; 4176 ancestors.forEach((ancestor) => { 4177 ancestorScroll && ancestor.removeEventListener("scroll", update2); 4178 ancestorResize && ancestor.removeEventListener("resize", update2); 4179 }); 4180 cleanupIo == null || cleanupIo(); 4181 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 4182 resizeObserver = null; 4183 if (animationFrame) { 4184 cancelAnimationFrame(frameId); 4185 } 4186 }; 4187 } 4188 var offset2 = offset; 4189 var shift2 = shift; 4190 var flip2 = flip; 4191 var size2 = size; 4192 var limitShift2 = limitShift; 4193 var computePosition2 = (reference, floating, options) => { 4194 const cache = /* @__PURE__ */ new Map(); 4195 const mergedOptions = options != null ? options : {}; 4196 const platformWithCache = { 4197 ...platform2, 4198 ...mergedOptions.platform, 4199 _c: cache 4200 }; 4201 return computePosition(reference, floating, { 4202 ...mergedOptions, 4203 platform: platformWithCache 4204 }); 4205 }; 4206 4207 // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 4208 var React17 = __toESM(require_react(), 1); 4209 var import_react2 = __toESM(require_react(), 1); 4210 var ReactDOM3 = __toESM(require_react_dom(), 1); 4211 var isClient = typeof document !== "undefined"; 4212 var noop2 = function noop3() { 4213 }; 4214 var index = isClient ? import_react2.useLayoutEffect : noop2; 4215 function deepEqual(a, b) { 4216 if (a === b) { 4217 return true; 4218 } 4219 if (typeof a !== typeof b) { 4220 return false; 4221 } 4222 if (typeof a === "function" && a.toString() === b.toString()) { 4223 return true; 4224 } 4225 let length; 4226 let i; 4227 let keys; 4228 if (a && b && typeof a === "object") { 4229 if (Array.isArray(a)) { 4230 length = a.length; 4231 if (length !== b.length) return false; 4232 for (i = length; i-- !== 0; ) { 4233 if (!deepEqual(a[i], b[i])) { 4234 return false; 4235 } 4236 } 4237 return true; 4238 } 4239 keys = Object.keys(a); 4240 length = keys.length; 4241 if (length !== Object.keys(b).length) { 4242 return false; 4243 } 4244 for (i = length; i-- !== 0; ) { 4245 if (!{}.hasOwnProperty.call(b, keys[i])) { 4246 return false; 4247 } 4248 } 4249 for (i = length; i-- !== 0; ) { 4250 const key = keys[i]; 4251 if (key === "_owner" && a.$$typeof) { 4252 continue; 4253 } 4254 if (!deepEqual(a[key], b[key])) { 4255 return false; 4256 } 4257 } 4258 return true; 4259 } 4260 return a !== a && b !== b; 4261 } 4262 function getDPR(element) { 4263 if (typeof window === "undefined") { 4264 return 1; 4265 } 4266 const win = element.ownerDocument.defaultView || window; 4267 return win.devicePixelRatio || 1; 4268 } 4269 function roundByDPR(element, value) { 4270 const dpr = getDPR(element); 4271 return Math.round(value * dpr) / dpr; 4272 } 4273 function useLatestRef(value) { 4274 const ref = React17.useRef(value); 4275 index(() => { 4276 ref.current = value; 4277 }); 4278 return ref; 4279 } 4280 function useFloating(options) { 4281 if (options === void 0) { 4282 options = {}; 4283 } 4284 const { 4285 placement = "bottom", 4286 strategy = "absolute", 4287 middleware = [], 4288 platform: platform3, 4289 elements: { 4290 reference: externalReference, 4291 floating: externalFloating 4292 } = {}, 4293 transform = true, 4294 whileElementsMounted, 4295 open 4296 } = options; 4297 const [data, setData] = React17.useState({ 4298 x: 0, 4299 y: 0, 4300 strategy, 4301 placement, 4302 middlewareData: {}, 4303 isPositioned: false 4304 }); 4305 const [latestMiddleware, setLatestMiddleware] = React17.useState(middleware); 4306 if (!deepEqual(latestMiddleware, middleware)) { 4307 setLatestMiddleware(middleware); 4308 } 4309 const [_reference, _setReference] = React17.useState(null); 4310 const [_floating, _setFloating] = React17.useState(null); 4311 const setReference = React17.useCallback((node) => { 4312 if (node !== referenceRef.current) { 4313 referenceRef.current = node; 4314 _setReference(node); 4315 } 4316 }, []); 4317 const setFloating = React17.useCallback((node) => { 4318 if (node !== floatingRef.current) { 4319 floatingRef.current = node; 4320 _setFloating(node); 4321 } 4322 }, []); 4323 const referenceEl = externalReference || _reference; 4324 const floatingEl = externalFloating || _floating; 4325 const referenceRef = React17.useRef(null); 4326 const floatingRef = React17.useRef(null); 4327 const dataRef = React17.useRef(data); 4328 const hasWhileElementsMounted = whileElementsMounted != null; 4329 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 4330 const platformRef = useLatestRef(platform3); 4331 const openRef = useLatestRef(open); 4332 const update2 = React17.useCallback(() => { 4333 if (!referenceRef.current || !floatingRef.current) { 4334 return; 4335 } 4336 const config = { 4337 placement, 4338 strategy, 4339 middleware: latestMiddleware 4340 }; 4341 if (platformRef.current) { 4342 config.platform = platformRef.current; 4343 } 4344 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 4345 const fullData = { 4346 ...data2, 4347 // The floating element's position may be recomputed while it's closed 4348 // but still mounted (such as when transitioning out). To ensure 4349 // `isPositioned` will be `false` initially on the next open, avoid 4350 // setting it to `true` when `open === false` (must be specified). 4351 isPositioned: openRef.current !== false 4352 }; 4353 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 4354 dataRef.current = fullData; 4355 ReactDOM3.flushSync(() => { 4356 setData(fullData); 4357 }); 4358 } 4359 }); 4360 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 4361 index(() => { 4362 if (open === false && dataRef.current.isPositioned) { 4363 dataRef.current.isPositioned = false; 4364 setData((data2) => ({ 4365 ...data2, 4366 isPositioned: false 4367 })); 4368 } 4369 }, [open]); 4370 const isMountedRef = React17.useRef(false); 4371 index(() => { 4372 isMountedRef.current = true; 4373 return () => { 4374 isMountedRef.current = false; 4375 }; 4376 }, []); 4377 index(() => { 4378 if (referenceEl) referenceRef.current = referenceEl; 4379 if (floatingEl) floatingRef.current = floatingEl; 4380 if (referenceEl && floatingEl) { 4381 if (whileElementsMountedRef.current) { 4382 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 4383 } 4384 update2(); 4385 } 4386 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 4387 const refs = React17.useMemo(() => ({ 4388 reference: referenceRef, 4389 floating: floatingRef, 4390 setReference, 4391 setFloating 4392 }), [setReference, setFloating]); 4393 const elements = React17.useMemo(() => ({ 4394 reference: referenceEl, 4395 floating: floatingEl 4396 }), [referenceEl, floatingEl]); 4397 const floatingStyles = React17.useMemo(() => { 4398 const initialStyles = { 4399 position: strategy, 4400 left: 0, 4401 top: 0 4402 }; 4403 if (!elements.floating) { 4404 return initialStyles; 4405 } 4406 const x = roundByDPR(elements.floating, data.x); 4407 const y = roundByDPR(elements.floating, data.y); 4408 if (transform) { 4409 return { 4410 ...initialStyles, 4411 transform: "translate(" + x + "px, " + y + "px)", 4412 ...getDPR(elements.floating) >= 1.5 && { 4413 willChange: "transform" 4414 } 4415 }; 4416 } 4417 return { 4418 position: strategy, 4419 left: x, 4420 top: y 4421 }; 4422 }, [strategy, transform, elements.floating, data.x, data.y]); 4423 return React17.useMemo(() => ({ 4424 ...data, 4425 update: update2, 4426 refs, 4427 elements, 4428 floatingStyles 4429 }), [data, update2, refs, elements, floatingStyles]); 4430 } 4431 var offset3 = (options, deps) => { 4432 const result = offset2(options); 4433 return { 4434 name: result.name, 4435 fn: result.fn, 4436 options: [options, deps] 4437 }; 4438 }; 4439 var shift3 = (options, deps) => { 4440 const result = shift2(options); 4441 return { 4442 name: result.name, 4443 fn: result.fn, 4444 options: [options, deps] 4445 }; 4446 }; 4447 var limitShift3 = (options, deps) => { 4448 const result = limitShift2(options); 4449 return { 4450 fn: result.fn, 4451 options: [options, deps] 4452 }; 4453 }; 4454 var flip3 = (options, deps) => { 4455 const result = flip2(options); 4456 return { 4457 name: result.name, 4458 fn: result.fn, 4459 options: [options, deps] 4460 }; 4461 }; 4462 var size3 = (options, deps) => { 4463 const result = size2(options); 4464 return { 4465 name: result.name, 4466 fn: result.fn, 4467 options: [options, deps] 4468 }; 4469 }; 4470 4471 // node_modules/@base-ui/react/utils/popups/popupHandle.mjs 4472 var BasePopupHandle = class { 4473 /** 4474 * Stores of every root currently using this handle, in attach order. A handle is meant to be used 4475 * by a single mounted root, but roots can transiently overlap (e.g. during an animated route 4476 * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of 4477 * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. 4478 */ 4479 attachedStores = []; 4480 /** 4481 * Store of the root that currently controls the handle: the most recently attached one still 4482 * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. 4483 */ 4484 attachedStoreValue = null; 4485 /** 4486 * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. 4487 */ 4488 storeListeners = /* @__PURE__ */ new Set(); 4489 /** 4490 * Creates a handle backed by the store used while no root is attached. 4491 * 4492 * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, 4493 * so they can render and register without a mounted root. Triggers register into whichever store 4494 * `store` currently resolves to, so while detached they live in this store's trigger map and 4495 * migrate themselves to the root's store (and back) as it attaches/detaches. 4496 * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces 4497 * `MenuHandle.open()` in warning text. 4498 * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is 4499 * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, 4500 * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. 4501 */ 4502 constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { 4503 this.fallbackStore = fallbackStore; 4504 this.componentName = componentName; 4505 this.throwOnMissingTrigger = throwOnMissingTrigger; 4506 } 4507 get attachedStore() { 4508 return this.attachedStoreValue; 4509 } 4510 /** 4511 * Store that detached triggers read from: the attached root's store, or an inert fallback store 4512 * used while no root is attached. 4513 * @internal 4514 */ 4515 get store() { 4516 return this.attachedStoreValue ?? this.fallbackStore; 4517 } 4518 /** 4519 * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on 4520 * the handle during render because a handle can be shared by concurrent server-rendered requests. 4521 * @internal 4522 */ 4523 get serverStore() { 4524 return this.fallbackStore; 4525 } 4526 /** 4527 * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind 4528 * when a root attaches or detaches. Returns a function that removes the listener. 4529 * @internal 4530 */ 4531 subscribeStore(listener) { 4532 this.storeListeners.add(listener); 4533 return () => { 4534 this.storeListeners.delete(listener); 4535 }; 4536 } 4537 /** 4538 * Points the handle at a root's store and notifies subscribers so detached triggers re-render and 4539 * re-register into it (their registration ref re-fires on the store-pointer change). Returns a 4540 * cleanup function that detaches the store again. 4541 * @internal 4542 */ 4543 attachStore(newStore) { 4544 this.attachedStores.push(newStore); 4545 this.setActiveStore(newStore); 4546 if (true) { 4547 if (this.attachedStores.length > 1) { 4548 const dev = this; 4549 (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { 4550 if (this.attachedStores.length > 1) { 4551 console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle."); 4552 } 4553 }); 4554 } 4555 } 4556 return () => { 4557 const index2 = this.attachedStores.lastIndexOf(newStore); 4558 if (index2 !== -1) { 4559 this.attachedStores.splice(index2, 1); 4560 } 4561 this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); 4562 }; 4563 } 4564 /** 4565 * Sets the store that currently controls the handle and notifies subscribers when it changes, so 4566 * detached triggers re-render and migrate their registration to the new store. 4567 */ 4568 setActiveStore(store2) { 4569 if (this.attachedStoreValue !== store2) { 4570 this.attachedStoreValue = store2; 4571 this.storeListeners.forEach((listener) => { 4572 listener(); 4573 }); 4574 } 4575 } 4576 /** 4577 * Opens the attached root's store and associates it with the trigger with the given id, or a 4578 * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public 4579 * `open()` method, which only narrows the parameter type. 4580 * 4581 * When a trigger id is given but no matching trigger is registered, anchored popups throw (see 4582 * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. 4583 * 4584 * This method should only be called in an event handler or an effect (not during rendering). 4585 * 4586 * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open 4587 * without associating any trigger. 4588 */ 4589 openByTrigger(triggerId) { 4590 const attachedStore = this.attachedStore; 4591 if (attachedStore === null) { 4592 if (true) { 4593 console.warn(`Base UI: $this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`); 4594 } 4595 return; 4596 } 4597 let triggerElement; 4598 if (triggerId) { 4599 for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { 4600 triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); 4601 } 4602 triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); 4603 } 4604 if (triggerId && !triggerElement) { 4605 if (this.throwOnMissingTrigger) { 4606 throw new Error(true ? `Base UI: $this.componentName}Handle.open() was called with the trigger id "$triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted $this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName)); 4607 } 4608 if (true) { 4609 console.warn(`Base UI: $this.componentName}Handle.open: No trigger found with id "$triggerId}". The popup will open, but the trigger will not be associated with it.`); 4610 } 4611 } 4612 attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 4613 } 4614 /** 4615 * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) 4616 * while no root is attached. Shared by every concrete handle's public `close()` method. 4617 * 4618 * This method should only be called in an event handler or an effect (not during rendering). 4619 */ 4620 closePopup() { 4621 const attachedStore = this.attachedStore; 4622 if (attachedStore === null) { 4623 if (true) { 4624 console.warn(`Base UI: $this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); 4625 } 4626 return; 4627 } 4628 attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 4629 } 4630 }; 4631 4632 // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 4633 var React22 = __toESM(require_react(), 1); 4634 var ReactDOM4 = __toESM(require_react_dom(), 1); 4635 4636 // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs 4637 var React21 = __toESM(require_react(), 1); 4638 4639 // node_modules/@base-ui/utils/store/useStore.mjs 4640 var React19 = __toESM(require_react(), 1); 4641 var import_shim = __toESM(require_shim(), 1); 4642 var import_with_selector = __toESM(require_with_selector(), 1); 4643 4644 // node_modules/@base-ui/utils/fastHooks.mjs 4645 var React18 = __toESM(require_react(), 1); 4646 var hooks = []; 4647 var currentInstance = void 0; 4648 function getInstance() { 4649 return currentInstance; 4650 } 4651 function register(hook) { 4652 hooks.push(hook); 4653 } 4654 function fastComponent(fn) { 4655 const FastComponent = (props, forwardedRef) => { 4656 const instance = useRefWithInit(createInstance).current; 4657 let result; 4658 try { 4659 currentInstance = instance; 4660 for (const hook of hooks) { 4661 hook.before(instance); 4662 } 4663 result = fn(props, forwardedRef); 4664 for (const hook of hooks) { 4665 hook.after(instance); 4666 } 4667 instance.didInitialize = true; 4668 } finally { 4669 currentInstance = void 0; 4670 } 4671 return result; 4672 }; 4673 FastComponent.displayName = fn.displayName || fn.name; 4674 return FastComponent; 4675 } 4676 function fastComponentRef(fn) { 4677 return /* @__PURE__ */ React18.forwardRef(fastComponent(fn)); 4678 } 4679 function createInstance() { 4680 return { 4681 didInitialize: false 4682 }; 4683 } 4684 4685 // node_modules/@base-ui/utils/store/useStore.mjs 4686 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 4687 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 4688 function useStore(store2, selector, a1, a2, a3) { 4689 return useStoreImplementation(store2, selector, a1, a2, a3); 4690 } 4691 function useStoreR19(store2, selector, a1, a2, a3) { 4692 const getSelection = React19.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]); 4693 return (0, import_shim.useSyncExternalStore)(store2.subscribe, getSelection, getSelection); 4694 } 4695 register({ 4696 before(instance) { 4697 instance.syncIndex = 0; 4698 if (!instance.didInitialize) { 4699 instance.syncTick = 1; 4700 instance.syncHooks = []; 4701 instance.didChangeStore = true; 4702 instance.getSnapshot = () => { 4703 let didChange2 = false; 4704 for (let i = 0; i < instance.syncHooks.length; i += 1) { 4705 const hook = instance.syncHooks[i]; 4706 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 4707 if (!Object.is(hook.value, value)) { 4708 didChange2 = true; 4709 hook.value = value; 4710 } 4711 } 4712 if (didChange2) { 4713 instance.syncTick += 1; 4714 } 4715 return instance.syncTick; 4716 }; 4717 } 4718 }, 4719 after(instance) { 4720 if (instance.syncHooks.length > 0) { 4721 if (instance.didChangeStore) { 4722 instance.didChangeStore = false; 4723 instance.subscribe = (onStoreChange) => { 4724 const stores = /* @__PURE__ */ new Set(); 4725 for (const hook of instance.syncHooks) { 4726 stores.add(hook.store); 4727 } 4728 const unsubscribes = []; 4729 for (const store2 of stores) { 4730 unsubscribes.push(store2.subscribe(onStoreChange)); 4731 } 4732 return () => { 4733 for (const unsubscribe of unsubscribes) { 4734 unsubscribe(); 4735 } 4736 }; 4737 }; 4738 } 4739 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 4740 } 4741 } 4742 }); 4743 function useStoreFast(store2, selector, a1, a2, a3) { 4744 const instance = getInstance(); 4745 if (!instance) { 4746 return useStoreR19(store2, selector, a1, a2, a3); 4747 } 4748 const index2 = instance.syncIndex; 4749 instance.syncIndex += 1; 4750 let hook; 4751 if (!instance.didInitialize) { 4752 hook = { 4753 store: store2, 4754 selector, 4755 a1, 4756 a2, 4757 a3, 4758 value: selector(store2.getSnapshot(), a1, a2, a3) 4759 }; 4760 instance.syncHooks.push(hook); 4761 } else { 4762 hook = instance.syncHooks[index2]; 4763 if (hook.store !== store2 || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 4764 if (hook.store !== store2) { 4765 instance.didChangeStore = true; 4766 } 4767 hook.store = store2; 4768 hook.selector = selector; 4769 hook.a1 = a1; 4770 hook.a2 = a2; 4771 hook.a3 = a3; 4772 hook.value = selector(store2.getSnapshot(), a1, a2, a3); 4773 } 4774 } 4775 return hook.value; 4776 } 4777 function useStoreLegacy(store2, selector, a1, a2, a3) { 4778 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store2.subscribe, store2.getSnapshot, store2.getSnapshot, (state) => selector(state, a1, a2, a3)); 4779 } 4780 4781 // node_modules/@base-ui/utils/store/Store.mjs 4782 var Store = class { 4783 /** 4784 * The current state of the store. 4785 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 4786 * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState). 4787 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 4788 * 4789 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 4790 */ 4791 // Internal state to handle recursive `setState()` calls 4792 constructor(state) { 4793 this.state = state; 4794 this.listeners = /* @__PURE__ */ new Set(); 4795 this.updateTick = 0; 4796 } 4797 /** 4798 * Registers a listener that will be called whenever the store's state changes. 4799 * 4800 * @param fn The listener function to be called on state changes. 4801 * @returns A function to unsubscribe the listener. 4802 */ 4803 subscribe = (fn) => { 4804 this.listeners.add(fn); 4805 return () => { 4806 this.listeners.delete(fn); 4807 }; 4808 }; 4809 /** 4810 * Returns the current state of the store. 4811 */ 4812 getSnapshot = () => { 4813 return this.state; 4814 }; 4815 /** 4816 * Updates the entire store's state and notifies all registered listeners. 4817 * 4818 * @param newState The new state to set for the store. 4819 */ 4820 setState(newState) { 4821 if (this.state === newState) { 4822 return; 4823 } 4824 this.state = newState; 4825 this.updateTick += 1; 4826 const currentTick = this.updateTick; 4827 for (const listener of this.listeners) { 4828 if (currentTick !== this.updateTick) { 4829 return; 4830 } 4831 listener(newState); 4832 } 4833 } 4834 /** 4835 * Merges the provided changes into the current state and notifies listeners if there are changes. 4836 * 4837 * @param changes An object containing the changes to apply to the current state. 4838 */ 4839 update(changes) { 4840 for (const key in changes) { 4841 if (!Object.is(this.state[key], changes[key])) { 4842 this.setState({ 4843 ...this.state, 4844 ...changes 4845 }); 4846 return; 4847 } 4848 } 4849 } 4850 /** 4851 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 4852 * 4853 * @param key The key in the store's state to update. 4854 * @param value The new value to set for the specified key. 4855 */ 4856 set(key, value) { 4857 if (!Object.is(this.state[key], value)) { 4858 this.setState({ 4859 ...this.state, 4860 [key]: value 4861 }); 4862 } 4863 } 4864 /** 4865 * Gives the state a new reference and updates all registered listeners. 4866 */ 4867 notifyAll() { 4868 const newState = { 4869 ...this.state 4870 }; 4871 this.setState(newState); 4872 } 4873 use(selector, a1, a2, a3) { 4874 return useStore(this, selector, a1, a2, a3); 4875 } 4876 }; 4877 4878 // node_modules/@base-ui/utils/store/ReactStore.mjs 4879 var React20 = __toESM(require_react(), 1); 4880 var ReactStore = class extends Store { 4881 /** 4882 * Creates a new ReactStore instance. 4883 * 4884 * @param state Initial state of the store. 4885 * @param context Non-reactive context values. 4886 * @param selectors Optional selectors for use with `useState`. 4887 */ 4888 constructor(state, context = {}, selectors3) { 4889 super(state); 4890 this.context = context; 4891 this.selectors = selectors3; 4892 } 4893 /** 4894 * Non-reactive values such as refs, callbacks, etc. 4895 */ 4896 /** 4897 * Synchronizes a single external value into the store. 4898 * 4899 * Note that the while the value in `state` is updated immediately, the value returned 4900 * by `useState` is updated before the next render (similarly to React's `useState`). 4901 */ 4902 useSyncedValue(key, value) { 4903 React20.useDebugValue(key); 4904 const store2 = this; 4905 useIsoLayoutEffect(() => { 4906 if (store2.state[key] !== value) { 4907 store2.set(key, value); 4908 } 4909 }, [store2, key, value]); 4910 } 4911 /** 4912 * Synchronizes a single external value into the store and 4913 * cleans it up (sets to `undefined`) on unmount. 4914 * 4915 * Note that the while the value in `state` is updated immediately, the value returned 4916 * by `useState` is updated before the next render (similarly to React's `useState`). 4917 */ 4918 useSyncedValueWithCleanup(key, value) { 4919 const store2 = this; 4920 useIsoLayoutEffect(() => { 4921 if (store2.state[key] !== value) { 4922 store2.set(key, value); 4923 } 4924 return () => { 4925 store2.set(key, void 0); 4926 }; 4927 }, [store2, key, value]); 4928 } 4929 /** 4930 * Synchronizes multiple external values into the store. 4931 * 4932 * Note that the while the values in `state` are updated immediately, the values returned 4933 * by `useState` are updated before the next render (similarly to React's `useState`). 4934 */ 4935 useSyncedValues(statePart) { 4936 const store2 = this; 4937 if (true) { 4938 React20.useDebugValue(statePart, (p) => Object.keys(p)); 4939 const keys = React20.useRef(Object.keys(statePart)).current; 4940 const nextKeys = Object.keys(statePart); 4941 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 4942 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 4943 } 4944 } 4945 const dependencies = Object.values(statePart); 4946 useIsoLayoutEffect(() => { 4947 store2.update(statePart); 4948 }, [store2, ...dependencies]); 4949 } 4950 /** 4951 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 4952 * is non-undefined, the store's state at `key` is updated to match `controlled`. 4953 */ 4954 useControlledProp(key, controlled) { 4955 React20.useDebugValue(key); 4956 const store2 = this; 4957 const isControlled = controlled !== void 0; 4958 useIsoLayoutEffect(() => { 4959 if (isControlled && !Object.is(store2.state[key], controlled)) { 4960 store2.setState({ 4961 ...store2.state, 4962 [key]: controlled 4963 }); 4964 } 4965 }, [store2, key, controlled, isControlled]); 4966 if (true) { 4967 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 4968 if (!cache.has(key)) { 4969 cache.set(key, isControlled); 4970 } 4971 const previouslyControlled = cache.get(key); 4972 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 4973 console.error(`A component is changing the $isControlled ? "" : "un"}controlled state of $key.toString()} to be $isControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`); 4974 } 4975 } 4976 } 4977 /** Gets the current value from the store using a selector with the provided key. 4978 * 4979 * @param key Key of the selector to use. 4980 */ 4981 select(key, a1, a2, a3) { 4982 const selector = this.selectors[key]; 4983 return selector(this.state, a1, a2, a3); 4984 } 4985 /** 4986 * Returns a value from the store's state using a selector function. 4987 * Used to subscribe to specific parts of the state. 4988 * This methods causes a rerender whenever the selected state changes. 4989 * 4990 * @param key Key of the selector to use. 4991 */ 4992 useState(key, a1, a2, a3) { 4993 React20.useDebugValue(key); 4994 return useStore(this, this.selectors[key], a1, a2, a3); 4995 } 4996 /** 4997 * Wraps a function with `useStableCallback` to ensure it has a stable reference 4998 * and assigns it to the context. 4999 * 5000 * @param key Key of the event callback. Must be a function in the context. 5001 * @param fn Function to assign. 5002 */ 5003 useContextCallback(key, fn) { 5004 React20.useDebugValue(key); 5005 const stableFunction = useStableCallback(fn ?? NOOP); 5006 this.context[key] = stableFunction; 5007 } 5008 /** 5009 * Returns a stable setter function for a specific key in the store's state. 5010 * It's commonly used to pass as a ref callback to React elements. 5011 * 5012 * @param key Key of the state to set. 5013 */ 5014 useStateSetter(key) { 5015 const ref = React20.useRef(void 0); 5016 if (ref.current === void 0) { 5017 ref.current = (value) => { 5018 this.set(key, value); 5019 }; 5020 } 5021 return ref.current; 5022 } 5023 /** 5024 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 5025 * 5026 * @param key Key of the selector to observe. 5027 * @param listener Listener function called when the selector result changes. 5028 */ 5029 observe(selector, listener) { 5030 let selectFn; 5031 if (typeof selector === "function") { 5032 selectFn = selector; 5033 } else { 5034 selectFn = this.selectors[selector]; 5035 } 5036 let prevValue = selectFn(this.state); 5037 listener(prevValue, prevValue, this); 5038 return this.subscribe((nextState) => { 5039 const nextValue = selectFn(nextState); 5040 if (!Object.is(prevValue, nextValue)) { 5041 const oldValue = prevValue; 5042 prevValue = nextValue; 5043 listener(nextValue, oldValue, this); 5044 } 5045 }); 5046 } 5047 }; 5048 5049 // node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs 5050 var selectors = { 5051 open: (state) => state.open, 5052 transitionStatus: (state) => state.transitionStatus, 5053 domReferenceElement: (state) => state.domReferenceElement, 5054 referenceElement: (state) => state.positionReference ?? state.referenceElement, 5055 floatingElement: (state) => state.floatingElement, 5056 floatingId: (state) => state.floatingId 5057 }; 5058 var FloatingRootStore = class extends ReactStore { 5059 constructor(options) { 5060 const { 5061 syncOnly, 5062 nested, 5063 onOpenChange, 5064 triggerElements, 5065 ...initialState2 5066 } = options; 5067 super({ 5068 ...initialState2, 5069 positionReference: initialState2.referenceElement, 5070 domReferenceElement: initialState2.referenceElement 5071 }, { 5072 onOpenChange, 5073 dataRef: { 5074 current: {} 5075 }, 5076 events: createEventEmitter(), 5077 nested, 5078 triggerElements 5079 }, selectors); 5080 this.syncOnly = syncOnly; 5081 } 5082 /** 5083 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 5084 */ 5085 syncOpenEvent = (newOpen, event) => { 5086 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 5087 // click events to upgrade a hover-open. 5088 event != null && isClickLikeEvent(event)) { 5089 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 5090 } 5091 }; 5092 /** 5093 * Runs the root-owned side effects for an open state change. 5094 */ 5095 dispatchOpenChange = (newOpen, eventDetails) => { 5096 this.syncOpenEvent(newOpen, eventDetails.event); 5097 const details = { 5098 open: newOpen, 5099 reason: eventDetails.reason, 5100 nativeEvent: eventDetails.event, 5101 nested: this.context.nested, 5102 triggerElement: eventDetails.trigger 5103 }; 5104 this.context.events.emit("openchange", details); 5105 }; 5106 /** 5107 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 5108 * 5109 * @param newOpen The new open state. 5110 * @param eventDetails Details about the event that triggered the open state change. 5111 */ 5112 setOpen = (newOpen, eventDetails) => { 5113 if (this.syncOnly) { 5114 this.context.onOpenChange?.(newOpen, eventDetails); 5115 return; 5116 } 5117 this.dispatchOpenChange(newOpen, eventDetails); 5118 this.context.onOpenChange?.(newOpen, eventDetails); 5119 }; 5120 }; 5121 5122 // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs 5123 function useSyncedFloatingRootContext(options) { 5124 const { 5125 popupStore, 5126 treatPopupAsFloatingElement = false, 5127 floatingRootContext: floatingRootContextProp, 5128 floatingId, 5129 nested, 5130 onOpenChange 5131 } = options; 5132 const open = popupStore.useState("open"); 5133 const referenceElement = popupStore.useState("activeTriggerElement"); 5134 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 5135 const triggerElements = popupStore.context.triggerElements; 5136 const handleOpenChange = onOpenChange; 5137 const internalStoreRef = React21.useRef(null); 5138 if (floatingRootContextProp === void 0 && internalStoreRef.current === null) { 5139 internalStoreRef.current = new FloatingRootStore({ 5140 open, 5141 transitionStatus: void 0, 5142 referenceElement, 5143 floatingElement, 5144 triggerElements, 5145 onOpenChange: handleOpenChange, 5146 floatingId, 5147 syncOnly: true, 5148 nested 5149 }); 5150 } 5151 const store2 = floatingRootContextProp ?? internalStoreRef.current; 5152 popupStore.useSyncedValue("floatingId", floatingId); 5153 useIsoLayoutEffect(() => { 5154 const valuesToSync = { 5155 open, 5156 floatingId, 5157 referenceElement, 5158 floatingElement 5159 }; 5160 if (isElement(referenceElement)) { 5161 valuesToSync.domReferenceElement = referenceElement; 5162 } 5163 if (store2.state.positionReference === store2.state.referenceElement) { 5164 valuesToSync.positionReference = referenceElement; 5165 } 5166 store2.update(valuesToSync); 5167 }, [open, floatingId, referenceElement, floatingElement, store2]); 5168 store2.context.onOpenChange = handleOpenChange; 5169 store2.context.nested = nested; 5170 return store2; 5171 } 5172 5173 // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 5174 var FOCUSABLE_POPUP_PROPS = { 5175 tabIndex: -1, 5176 [FOCUSABLE_ATTRIBUTE]: "" 5177 }; 5178 function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { 5179 const floatingId = useId(); 5180 const nested = useFloatingParentNodeId() != null; 5181 const store2 = useRefWithInit(() => createStore(floatingId, nested)).current; 5182 useSyncedFloatingRootContext({ 5183 popupStore: store2, 5184 treatPopupAsFloatingElement, 5185 floatingRootContext: store2.state.floatingRootContext, 5186 floatingId, 5187 nested, 5188 onOpenChange: store2.setOpen 5189 }); 5190 return store2; 5191 } 5192 function PopupHandleAttachment({ 5193 handle, 5194 store: store2 5195 }) { 5196 useIsoLayoutEffect(() => { 5197 return handle.attachStore(store2); 5198 }, [handle, store2]); 5199 return null; 5200 } 5201 function useTriggerRegistration(id, store2) { 5202 const registeredElementIdRef = React22.useRef(null); 5203 const registeredElementRef = React22.useRef(null); 5204 return React22.useCallback((element) => { 5205 if (id === void 0) { 5206 return; 5207 } 5208 let shouldSyncTriggerCount = false; 5209 if (registeredElementIdRef.current !== null) { 5210 const registeredId = registeredElementIdRef.current; 5211 const registeredElement = registeredElementRef.current; 5212 const currentElement = store2.context.triggerElements.getById(registeredId); 5213 if (registeredElement && currentElement === registeredElement) { 5214 store2.context.triggerElements.delete(registeredId); 5215 shouldSyncTriggerCount = true; 5216 } 5217 registeredElementIdRef.current = null; 5218 registeredElementRef.current = null; 5219 } 5220 if (element !== null) { 5221 registeredElementIdRef.current = id; 5222 registeredElementRef.current = element; 5223 store2.context.triggerElements.add(id, element); 5224 shouldSyncTriggerCount = true; 5225 } 5226 if (shouldSyncTriggerCount) { 5227 const triggerCount = store2.context.triggerElements.size; 5228 if (store2.select("open") && store2.state.triggerCount !== triggerCount) { 5229 store2.set("triggerCount", triggerCount); 5230 } 5231 } 5232 }, [store2, id]); 5233 } 5234 function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) { 5235 if (open) { 5236 state.preventUnmountingOnClose = false; 5237 } else if (preventUnmountOnClose) { 5238 state.preventUnmountingOnClose = true; 5239 } 5240 const triggerId = trigger?.id ?? null; 5241 if (triggerId || open) { 5242 state.activeTriggerId = triggerId; 5243 state.activeTriggerElement = trigger ?? null; 5244 } 5245 } 5246 function attachPreventUnmountOnClose(eventDetails) { 5247 let preventUnmountOnClose = false; 5248 eventDetails.preventUnmountOnClose = () => { 5249 preventUnmountOnClose = true; 5250 }; 5251 return () => preventUnmountOnClose; 5252 } 5253 function applyPopupOpenChange(store2, nextOpen, eventDetails, options = {}) { 5254 const reason = eventDetails.reason; 5255 const isHover = reason === reason_parts_exports.triggerHover; 5256 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 5257 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 5258 const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails); 5259 store2.context.onOpenChange?.(nextOpen, eventDetails); 5260 if (eventDetails.isCanceled) { 5261 return; 5262 } 5263 options.onBeforeDispatch?.(); 5264 store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 5265 const changeState = () => { 5266 const updatedState = { 5267 ...options.extraState, 5268 open: nextOpen 5269 }; 5270 if (isFocusOpen) { 5271 updatedState.instantType = "focus"; 5272 } else if (isDismissClose) { 5273 updatedState.instantType = "dismiss"; 5274 } else if (isHover) { 5275 updatedState.instantType = void 0; 5276 } 5277 setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); 5278 store2.update(updatedState); 5279 }; 5280 if (isHover) { 5281 ReactDOM4.flushSync(changeState); 5282 } else { 5283 changeState(); 5284 } 5285 } 5286 function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) { 5287 const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId); 5288 const baseRegisterTrigger = useTriggerRegistration(triggerId, store2); 5289 const applyTriggerData = useStableCallback((element) => { 5290 const open = store2.select("open"); 5291 const activeTriggerId = store2.select("activeTriggerId"); 5292 if (activeTriggerId === triggerId) { 5293 store2.update({ 5294 activeTriggerElement: element, 5295 ...open ? stateUpdates : null 5296 }); 5297 return; 5298 } 5299 if (activeTriggerId == null && open) { 5300 store2.update({ 5301 activeTriggerId: triggerId, 5302 activeTriggerElement: element, 5303 ...stateUpdates 5304 }); 5305 } 5306 }); 5307 const registerTrigger = React22.useCallback((element) => { 5308 baseRegisterTrigger(element); 5309 if (element) { 5310 applyTriggerData(element); 5311 } 5312 }, [baseRegisterTrigger, applyTriggerData]); 5313 useIsoLayoutEffect(() => { 5314 if (isMountedByThisTrigger) { 5315 store2.update({ 5316 activeTriggerElement: triggerElementRef.current, 5317 ...stateUpdates 5318 }); 5319 } 5320 }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]); 5321 return { 5322 registerTrigger, 5323 isMountedByThisTrigger 5324 }; 5325 } 5326 function useImplicitActiveTrigger(store2, options = {}) { 5327 const { 5328 closeOnActiveTriggerUnmount = false 5329 } = options; 5330 const resolvedActiveTriggerIdRef = React22.useRef(null); 5331 const open = store2.useState("open"); 5332 const reactiveTriggerCount = store2.useState("triggerCount"); 5333 const activeTriggerId = store2.useState("activeTriggerId"); 5334 const reactiveActiveTriggerElement = store2.useState("activeTriggerElement"); 5335 useIsoLayoutEffect(() => { 5336 if (!open) { 5337 resolvedActiveTriggerIdRef.current = null; 5338 if (store2.state.triggerCount !== 0) { 5339 store2.set("triggerCount", 0); 5340 } 5341 return; 5342 } 5343 const triggerCount = store2.context.triggerElements.size; 5344 const stateUpdates = {}; 5345 if (store2.state.triggerCount !== triggerCount) { 5346 stateUpdates.triggerCount = triggerCount; 5347 } 5348 const currentActiveTriggerId = store2.select("activeTriggerId"); 5349 let lostActiveTriggerId = null; 5350 if (currentActiveTriggerId) { 5351 const activeTriggerElement = store2.context.triggerElements.getById(currentActiveTriggerId); 5352 if (!activeTriggerElement) { 5353 for (const [triggerId, triggerElement] of store2.context.triggerElements.entries()) { 5354 if (triggerElement === store2.state.activeTriggerElement) { 5355 stateUpdates.activeTriggerId = triggerId; 5356 stateUpdates.activeTriggerElement = triggerElement; 5357 resolvedActiveTriggerIdRef.current = triggerId; 5358 break; 5359 } 5360 } 5361 if (stateUpdates.activeTriggerId === void 0) { 5362 if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { 5363 lostActiveTriggerId = currentActiveTriggerId; 5364 } else { 5365 resolvedActiveTriggerIdRef.current = null; 5366 } 5367 } 5368 } else { 5369 resolvedActiveTriggerIdRef.current = currentActiveTriggerId; 5370 if (activeTriggerElement !== store2.state.activeTriggerElement) { 5371 stateUpdates.activeTriggerElement = activeTriggerElement; 5372 } 5373 } 5374 } else { 5375 resolvedActiveTriggerIdRef.current = null; 5376 } 5377 if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) { 5378 const iteratorResult = store2.context.triggerElements.entries().next(); 5379 if (!iteratorResult.done) { 5380 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 5381 stateUpdates.activeTriggerId = implicitTriggerId; 5382 stateUpdates.activeTriggerElement = implicitTriggerElement; 5383 resolvedActiveTriggerIdRef.current = implicitTriggerId; 5384 } 5385 } 5386 if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { 5387 store2.update(stateUpdates); 5388 } 5389 if (lostActiveTriggerId) { 5390 if (closeOnActiveTriggerUnmount) { 5391 queueMicrotask(() => { 5392 if (store2.select("open") && store2.select("activeTriggerId") === lostActiveTriggerId && !store2.context.triggerElements.getById(lostActiveTriggerId)) { 5393 const eventDetails = createChangeEventDetails(reason_parts_exports.none); 5394 store2.setOpen(false, eventDetails); 5395 if (!eventDetails.isCanceled) { 5396 store2.update({ 5397 activeTriggerId: null, 5398 activeTriggerElement: null 5399 }); 5400 } 5401 } 5402 }); 5403 } 5404 } 5405 }, [open, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); 5406 } 5407 function useOpenStateTransitions(open, store2, onUnmount) { 5408 const { 5409 mounted, 5410 setMounted, 5411 transitionStatus 5412 } = useTransitionStatus(open); 5413 const preventUnmountingOnClose = store2.useState("preventUnmountingOnClose"); 5414 const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose; 5415 store2.useSyncedValues({ 5416 mounted, 5417 transitionStatus, 5418 preventUnmountingOnClose: syncedPreventUnmountingOnClose 5419 }); 5420 const forceUnmount = useStableCallback(() => { 5421 setMounted(false); 5422 store2.update({ 5423 activeTriggerId: null, 5424 activeTriggerElement: null, 5425 mounted: false, 5426 preventUnmountingOnClose: false 5427 }); 5428 onUnmount?.(); 5429 store2.context.onOpenChangeComplete?.(false); 5430 }); 5431 useOpenChangeComplete({ 5432 enabled: mounted && !open && !syncedPreventUnmountingOnClose, 5433 open, 5434 ref: store2.context.popupRef, 5435 onComplete() { 5436 if (!open) { 5437 forceUnmount(); 5438 } 5439 } 5440 }); 5441 return { 5442 forceUnmount, 5443 transitionStatus 5444 }; 5445 } 5446 function usePopupInteractionProps(store2, statePart) { 5447 store2.useSyncedValues(statePart); 5448 useIsoLayoutEffect(() => () => { 5449 store2.update({ 5450 activeTriggerProps: EMPTY_OBJECT, 5451 inactiveTriggerProps: EMPTY_OBJECT, 5452 popupProps: EMPTY_OBJECT 5453 }); 5454 }, [store2]); 5455 } 5456 5457 // node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs 5458 var devElementIdsByMap; 5459 function getDevElementIds(map) { 5460 devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); 5461 let elementIds = devElementIdsByMap.get(map); 5462 if (!elementIds) { 5463 elementIds = /* @__PURE__ */ new WeakMap(); 5464 devElementIdsByMap.set(map, elementIds); 5465 } 5466 return elementIds; 5467 } 5468 var PopupTriggerMap = class { 5469 constructor() { 5470 this.idMap = /* @__PURE__ */ new Map(); 5471 } 5472 /** 5473 * Adds a trigger element with the given ID. 5474 * 5475 * Note: The provided element is assumed to not be registered under multiple IDs. 5476 */ 5477 add(id, element) { 5478 if (true) { 5479 const elementIds = getDevElementIds(this); 5480 const existingId = elementIds.get(element); 5481 if (existingId !== void 0 && existingId !== id) { 5482 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 5483 } 5484 const previousElement = this.idMap.get(id); 5485 if (previousElement !== void 0 && previousElement !== element) { 5486 elementIds.delete(previousElement); 5487 } 5488 elementIds.set(element, id); 5489 } 5490 this.idMap.set(id, element); 5491 } 5492 /** 5493 * Removes the trigger element with the given ID. 5494 */ 5495 delete(id) { 5496 if (true) { 5497 const element = this.idMap.get(id); 5498 if (element !== void 0) { 5499 devElementIdsByMap?.get(this)?.delete(element); 5500 } 5501 } 5502 this.idMap.delete(id); 5503 } 5504 /** 5505 * Whether the given element is registered as a trigger. 5506 */ 5507 hasElement(element) { 5508 for (const registered of this.idMap.values()) { 5509 if (registered === element) { 5510 return true; 5511 } 5512 } 5513 return false; 5514 } 5515 /** 5516 * Whether there is a registered trigger element matching the given predicate. 5517 */ 5518 hasMatchingElement(predicate) { 5519 for (const element of this.idMap.values()) { 5520 if (predicate(element)) { 5521 return true; 5522 } 5523 } 5524 return false; 5525 } 5526 /** 5527 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 5528 */ 5529 getById(id) { 5530 return this.idMap.get(id); 5531 } 5532 /** 5533 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 5534 */ 5535 entries() { 5536 return this.idMap.entries(); 5537 } 5538 /** 5539 * Returns an iterable of all registered trigger elements. 5540 */ 5541 elements() { 5542 return this.idMap.values(); 5543 } 5544 /** 5545 * Returns the number of registered trigger elements. 5546 */ 5547 get size() { 5548 return this.idMap.size; 5549 } 5550 }; 5551 5552 // node_modules/@base-ui/react/floating-ui-react/utils/getEmptyRootContext.mjs 5553 function getEmptyRootContext() { 5554 return new FloatingRootStore({ 5555 open: false, 5556 transitionStatus: void 0, 5557 floatingElement: null, 5558 referenceElement: null, 5559 triggerElements: new PopupTriggerMap(), 5560 floatingId: void 0, 5561 syncOnly: false, 5562 nested: false, 5563 onOpenChange: void 0 5564 }); 5565 } 5566 5567 // node_modules/@base-ui/react/utils/popups/store.mjs 5568 function createInitialPopupStoreState() { 5569 return { 5570 open: false, 5571 openProp: void 0, 5572 mounted: false, 5573 transitionStatus: void 0, 5574 floatingRootContext: getEmptyRootContext(), 5575 floatingId: void 0, 5576 triggerCount: 0, 5577 preventUnmountingOnClose: false, 5578 payload: void 0, 5579 activeTriggerId: null, 5580 activeTriggerElement: null, 5581 triggerIdProp: void 0, 5582 popupElement: null, 5583 positionerElement: null, 5584 activeTriggerProps: EMPTY_OBJECT, 5585 inactiveTriggerProps: EMPTY_OBJECT, 5586 popupProps: EMPTY_OBJECT 5587 }; 5588 } 5589 function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) { 5590 return new FloatingRootStore({ 5591 open: false, 5592 transitionStatus: void 0, 5593 floatingElement: null, 5594 referenceElement: null, 5595 triggerElements, 5596 floatingId, 5597 syncOnly: true, 5598 nested, 5599 onOpenChange: void 0 5600 }); 5601 } 5602 var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; 5603 var openSelector = (state) => state.openProp ?? state.open; 5604 var popupIdSelector = (state) => { 5605 const popupId = state.popupElement?.id ?? state.floatingId; 5606 return popupId || void 0; 5607 }; 5608 function triggerOwnsOpenPopup(state, triggerId) { 5609 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; 5610 } 5611 function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { 5612 if (triggerOwnsOpenPopup(state, triggerId)) { 5613 return true; 5614 } 5615 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1; 5616 } 5617 var popupStoreSelectors = { 5618 open: openSelector, 5619 mounted: (state) => state.mounted, 5620 transitionStatus: (state) => state.transitionStatus, 5621 floatingRootContext: (state) => state.floatingRootContext, 5622 triggerCount: (state) => state.triggerCount, 5623 preventUnmountingOnClose: (state) => state.preventUnmountingOnClose, 5624 payload: (state) => state.payload, 5625 activeTriggerId: activeTriggerIdSelector, 5626 activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null, 5627 popupId: popupIdSelector, 5628 /** 5629 * Whether the trigger with the given ID was used to open the popup. 5630 */ 5631 isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId, 5632 /** 5633 * Whether the popup is open and was activated by a trigger with the given ID. 5634 */ 5635 isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId), 5636 /** 5637 * Whether the popup is mounted and was activated by a trigger with the given ID. 5638 */ 5639 isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted, 5640 triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps, 5641 /** 5642 * Popup id for the trigger that currently owns the open popup. 5643 */ 5644 triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0, 5645 popupProps: (state) => state.popupProps, 5646 popupElement: (state) => state.popupElement, 5647 positionerElement: (state) => state.positionerElement 5648 }; 5649 5650 // node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs 5651 var React23 = __toESM(require_react(), 1); 5652 var import_shim2 = __toESM(require_shim(), 1); 5653 function usePopupHandleStore(handle) { 5654 const subscribe = React23.useCallback((listener) => { 5655 if (handle === void 0) { 5656 return NOOP; 5657 } 5658 return handle.subscribeStore(listener); 5659 }, [handle]); 5660 const getSnapshot = React23.useCallback(() => { 5661 return handle === void 0 ? void 0 : handle.store; 5662 }, [handle]); 5663 return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore); 5664 } 5665 5666 // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs 5667 function useBaseUIFloating(options) { 5668 return useFloatingWithStore(options, options.rootContext); 5669 } 5670 function useFloatingWithStore(options, store2) { 5671 const { 5672 nodeId, 5673 externalTree 5674 } = options; 5675 const referenceElement = store2.useState("referenceElement"); 5676 const floatingElement = store2.useState("floatingElement"); 5677 const domReferenceElement = store2.useState("domReferenceElement"); 5678 const open = store2.useState("open"); 5679 const floatingId = store2.useState("floatingId"); 5680 const [positionReference, setPositionReferenceRaw] = React24.useState(null); 5681 const [localDomReference, setLocalDomReference] = React24.useState(void 0); 5682 const [localFloatingElement, setLocalFloatingElement] = React24.useState(void 0); 5683 const domReferenceRef = React24.useRef(null); 5684 const tree = useFloatingTree(externalTree); 5685 const storeElements = React24.useMemo(() => ({ 5686 reference: referenceElement, 5687 floating: floatingElement, 5688 domReference: domReferenceElement 5689 }), [referenceElement, floatingElement, domReferenceElement]); 5690 const position = useFloating({ 5691 ...options, 5692 elements: { 5693 ...storeElements, 5694 ...positionReference && { 5695 reference: positionReference 5696 } 5697 } 5698 }); 5699 const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null; 5700 const syncedFloatingElement = localFloatingElement === void 0 ? store2.state.floatingElement : localFloatingElement; 5701 store2.useSyncedValue("referenceElement", localDomReference ?? null); 5702 store2.useSyncedValue("domReferenceElement", localDomReference === void 0 ? domReferenceElement : localDomReferenceElement); 5703 store2.useSyncedValue("floatingElement", syncedFloatingElement); 5704 const setPositionReference = React24.useCallback((node) => { 5705 const computedPositionReference = isElement(node) ? { 5706 getBoundingClientRect: () => node.getBoundingClientRect(), 5707 getClientRects: () => node.getClientRects(), 5708 contextElement: node 5709 } : node; 5710 setPositionReferenceRaw(computedPositionReference); 5711 position.refs.setReference(computedPositionReference); 5712 }, [position.refs]); 5713 const setReference = React24.useCallback((node) => { 5714 if (isElement(node) || node === null) { 5715 domReferenceRef.current = node; 5716 setLocalDomReference(node); 5717 } 5718 if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to 5719 // `null` to support `positionReference` + an unstable `reference` 5720 // callback ref. 5721 node !== null && !isElement(node)) { 5722 position.refs.setReference(node); 5723 } 5724 }, [position.refs, setLocalDomReference]); 5725 const setFloating = React24.useCallback((node) => { 5726 setLocalFloatingElement(node); 5727 position.refs.setFloating(node); 5728 }, [position.refs]); 5729 const refs = React24.useMemo(() => ({ 5730 ...position.refs, 5731 setReference, 5732 setFloating, 5733 setPositionReference, 5734 domReference: domReferenceRef 5735 }), [position.refs, setReference, setFloating, setPositionReference]); 5736 const elements = React24.useMemo(() => ({ 5737 ...position.elements, 5738 domReference: domReferenceElement 5739 }), [position.elements, domReferenceElement]); 5740 const context = React24.useMemo(() => ({ 5741 ...position, 5742 dataRef: store2.context.dataRef, 5743 open, 5744 onOpenChange: store2.setOpen, 5745 events: store2.context.events, 5746 floatingId, 5747 refs, 5748 elements, 5749 nodeId, 5750 rootStore: store2 5751 }), [position, refs, elements, nodeId, store2, open, floatingId]); 5752 useIsoLayoutEffect(() => { 5753 if (domReferenceElement) { 5754 domReferenceRef.current = domReferenceElement; 5755 } 5756 }, [domReferenceElement]); 5757 useIsoLayoutEffect(() => { 5758 store2.context.dataRef.current.floatingContext = context; 5759 const node = tree?.nodesRef.current.find((n) => n.id === nodeId); 5760 if (node) { 5761 node.context = context; 5762 } 5763 }); 5764 return React24.useMemo(() => ({ 5765 ...position, 5766 context, 5767 refs, 5768 elements, 5769 rootStore: store2 5770 }), [position, refs, elements, context, store2]); 5771 } 5772 5773 // node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs 5774 var React25 = __toESM(require_react(), 1); 5775 var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit; 5776 function useFocus(context, props = {}) { 5777 const { 5778 enabled = true, 5779 delay 5780 } = props; 5781 const store2 = "rootStore" in context ? context.rootStore : context; 5782 const { 5783 events, 5784 dataRef 5785 } = store2.context; 5786 const blockFocusRef = React25.useRef(false); 5787 const blockedReferenceRef = React25.useRef(null); 5788 const keyboardModalityRef = React25.useRef(true); 5789 const timeout = useTimeout(); 5790 React25.useEffect(() => { 5791 const domReference = store2.select("domReferenceElement"); 5792 if (!enabled) { 5793 return void 0; 5794 } 5795 const win = getWindow(domReference); 5796 function onBlur() { 5797 const currentDomReference = store2.select("domReferenceElement"); 5798 if (!store2.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 5799 blockFocusRef.current = true; 5800 } 5801 } 5802 function onKeyDown() { 5803 keyboardModalityRef.current = true; 5804 } 5805 function onPointerDown() { 5806 keyboardModalityRef.current = false; 5807 } 5808 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 5809 }, [store2, enabled]); 5810 React25.useEffect(() => { 5811 if (!enabled) { 5812 return void 0; 5813 } 5814 function onOpenChangeLocal(details) { 5815 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 5816 const referenceElement = store2.select("domReferenceElement"); 5817 if (isElement(referenceElement)) { 5818 blockedReferenceRef.current = referenceElement; 5819 blockFocusRef.current = true; 5820 } 5821 } 5822 } 5823 events.on("openchange", onOpenChangeLocal); 5824 return () => { 5825 events.off("openchange", onOpenChangeLocal); 5826 }; 5827 }, [events, enabled, store2]); 5828 const reference = React25.useMemo(() => { 5829 function resetBlockedFocus() { 5830 blockFocusRef.current = false; 5831 blockedReferenceRef.current = null; 5832 } 5833 return { 5834 onMouseLeave() { 5835 resetBlockedFocus(); 5836 }, 5837 onFocus(event) { 5838 const focusTarget = event.currentTarget; 5839 if (blockFocusRef.current) { 5840 if (blockedReferenceRef.current === focusTarget) { 5841 return; 5842 } 5843 resetBlockedFocus(); 5844 } 5845 const target = getTarget(event.nativeEvent); 5846 if (isElement(target)) { 5847 if (isMacSafari && !event.relatedTarget) { 5848 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 5849 return; 5850 } 5851 } else if (!matchesFocusVisible(target)) { 5852 return; 5853 } 5854 } 5855 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements); 5856 const { 5857 nativeEvent, 5858 currentTarget 5859 } = event; 5860 const delayValue = typeof delay === "function" ? delay() : delay; 5861 if (store2.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) { 5862 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5863 return; 5864 } 5865 timeout.start(delayValue, () => { 5866 if (blockFocusRef.current) { 5867 return; 5868 } 5869 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5870 }); 5871 }, 5872 onBlur(event) { 5873 resetBlockedFocus(); 5874 const relatedTarget = event.relatedTarget; 5875 const nativeEvent = event.nativeEvent; 5876 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 5877 timeout.start(0, () => { 5878 const domReference = store2.select("domReferenceElement"); 5879 const activeEl = activeElement(ownerDocument(domReference)); 5880 if (!relatedTarget && activeEl === domReference) { 5881 return; 5882 } 5883 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 5884 return; 5885 } 5886 const nextFocusedElement = relatedTarget ?? activeEl; 5887 if (isTargetInsideEnabledTrigger(nextFocusedElement, store2.context.triggerElements)) { 5888 return; 5889 } 5890 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 5891 }); 5892 } 5893 }; 5894 }, [dataRef, delay, store2, timeout]); 5895 return React25.useMemo(() => enabled ? { 5896 reference, 5897 trigger: reference 5898 } : {}, [enabled, reference]); 5899 } 5900 5901 // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 5902 var React26 = __toESM(require_react(), 1); 5903 5904 // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs 5905 var HoverInteraction = class _HoverInteraction { 5906 constructor() { 5907 this.pointerType = void 0; 5908 this.interactedInside = false; 5909 this.handler = void 0; 5910 this.blockMouseMove = true; 5911 this.performedPointerEventsMutation = false; 5912 this.pointerEventsScopeElement = null; 5913 this.pointerEventsReferenceElement = null; 5914 this.pointerEventsFloatingElement = null; 5915 this.restTimeoutPending = false; 5916 this.openChangeTimeout = new Timeout(); 5917 this.restTimeout = new Timeout(); 5918 this.handleCloseOptions = void 0; 5919 } 5920 static create() { 5921 return new _HoverInteraction(); 5922 } 5923 dispose = () => { 5924 this.openChangeTimeout.clear(); 5925 this.restTimeout.clear(); 5926 }; 5927 disposeEffect = () => { 5928 return this.dispose; 5929 }; 5930 }; 5931 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 5932 function clearSafePolygonPointerEventsMutation(instance) { 5933 if (!instance.performedPointerEventsMutation) { 5934 return; 5935 } 5936 const scopeElement = instance.pointerEventsScopeElement; 5937 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 5938 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 5939 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 5940 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 5941 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 5942 } 5943 instance.performedPointerEventsMutation = false; 5944 instance.pointerEventsScopeElement = null; 5945 instance.pointerEventsReferenceElement = null; 5946 instance.pointerEventsFloatingElement = null; 5947 } 5948 function applySafePolygonPointerEventsMutation(instance, options) { 5949 const { 5950 scopeElement, 5951 referenceElement, 5952 floatingElement 5953 } = options; 5954 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 5955 if (existingOwner && existingOwner !== instance) { 5956 clearSafePolygonPointerEventsMutation(existingOwner); 5957 } 5958 clearSafePolygonPointerEventsMutation(instance); 5959 instance.performedPointerEventsMutation = true; 5960 instance.pointerEventsScopeElement = scopeElement; 5961 instance.pointerEventsReferenceElement = referenceElement; 5962 instance.pointerEventsFloatingElement = floatingElement; 5963 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 5964 scopeElement.style.pointerEvents = "none"; 5965 referenceElement.style.pointerEvents = "auto"; 5966 floatingElement.style.pointerEvents = "auto"; 5967 } 5968 function useHoverInteractionSharedState(store2) { 5969 const data = store2.context.dataRef.current; 5970 const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current; 5971 if (!data.hoverInteractionState) { 5972 data.hoverInteractionState = instance; 5973 } 5974 useOnMount(data.hoverInteractionState.disposeEffect); 5975 return data.hoverInteractionState; 5976 } 5977 5978 // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 5979 function useHoverFloatingInteraction(context, parameters = {}) { 5980 const { 5981 enabled = true, 5982 closeDelay: closeDelayProp = 0, 5983 nodeId: nodeIdProp 5984 } = parameters; 5985 const store2 = "rootStore" in context ? context.rootStore : context; 5986 const open = store2.useState("open"); 5987 const floatingElement = store2.useState("floatingElement"); 5988 const domReferenceElement = store2.useState("domReferenceElement"); 5989 const { 5990 dataRef 5991 } = store2.context; 5992 const tree = useFloatingTree(); 5993 const parentId = useFloatingParentNodeId(); 5994 const instance = useHoverInteractionSharedState(store2); 5995 const childClosedTimeout = useTimeout(); 5996 const isClickLikeOpenEvent2 = useStableCallback(() => { 5997 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 5998 }); 5999 const isHoverOpen = useStableCallback(() => { 6000 return isHoverOpenEvent(dataRef.current.openEvent?.type); 6001 }); 6002 const clearPointerEvents = useStableCallback(() => { 6003 clearSafePolygonPointerEventsMutation(instance); 6004 }); 6005 useIsoLayoutEffect(() => { 6006 if (!open) { 6007 instance.pointerType = void 0; 6008 instance.restTimeoutPending = false; 6009 instance.interactedInside = false; 6010 clearPointerEvents(); 6011 } 6012 }, [open, instance, clearPointerEvents]); 6013 React26.useEffect(() => { 6014 return clearPointerEvents; 6015 }, [clearPointerEvents]); 6016 useIsoLayoutEffect(() => { 6017 if (!enabled) { 6018 return void 0; 6019 } 6020 if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 6021 const ref = domReferenceElement; 6022 const floatingEl = floatingElement; 6023 const doc = ownerDocument(floatingElement); 6024 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 6025 if (parentFloating) { 6026 parentFloating.style.pointerEvents = ""; 6027 } 6028 const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null; 6029 const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null; 6030 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? ref.closest("[data-rootownerid]") ?? doc.body; 6031 applySafePolygonPointerEventsMutation(instance, { 6032 scopeElement, 6033 referenceElement: ref, 6034 floatingElement: floatingEl 6035 }); 6036 return () => { 6037 clearPointerEvents(); 6038 }; 6039 } 6040 return void 0; 6041 }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 6042 React26.useEffect(() => { 6043 if (!enabled) { 6044 return void 0; 6045 } 6046 function hasParentChildren() { 6047 return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0); 6048 } 6049 function closeWithDelay(event) { 6050 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 6051 const close = () => { 6052 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6053 tree?.events.emit("floating.closed", event); 6054 }; 6055 if (closeDelay) { 6056 instance.openChangeTimeout.start(closeDelay, close); 6057 } else { 6058 instance.openChangeTimeout.clear(); 6059 close(); 6060 } 6061 } 6062 function handleInteractInside(event) { 6063 const target = getTarget(event); 6064 if (!isInteractiveElement(target)) { 6065 instance.interactedInside = false; 6066 return; 6067 } 6068 instance.interactedInside = target?.closest("[aria-haspopup]") != null; 6069 } 6070 function onFloatingMouseEnter() { 6071 instance.openChangeTimeout.clear(); 6072 childClosedTimeout.clear(); 6073 tree?.events.off("floating.closed", onNodeClosed); 6074 clearPointerEvents(); 6075 } 6076 function onFloatingMouseLeave(event) { 6077 if (hasParentChildren() && tree) { 6078 tree.events.on("floating.closed", onNodeClosed); 6079 return; 6080 } 6081 if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) { 6082 return; 6083 } 6084 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 6085 const relatedTarget = event.relatedTarget; 6086 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 6087 if (isMovingIntoDescendantFloating) { 6088 return; 6089 } 6090 if (instance.handler) { 6091 instance.handler(event); 6092 return; 6093 } 6094 clearPointerEvents(); 6095 if (isHoverOpen() && !isClickLikeOpenEvent2()) { 6096 closeWithDelay(event); 6097 } 6098 } 6099 function onNodeClosed(event) { 6100 if (!tree || !parentId || hasParentChildren()) { 6101 return; 6102 } 6103 childClosedTimeout.start(0, () => { 6104 tree.events.off("floating.closed", onNodeClosed); 6105 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6106 tree.events.emit("floating.closed", event); 6107 }); 6108 } 6109 const floating = floatingElement; 6110 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 6111 tree?.events.off("floating.closed", onNodeClosed); 6112 }); 6113 }, [enabled, floatingElement, store2, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); 6114 } 6115 6116 // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs 6117 var React27 = __toESM(require_react(), 1); 6118 var ReactDOM5 = __toESM(require_react_dom(), 1); 6119 var EMPTY_REF = { 6120 current: null 6121 }; 6122 function useHoverReferenceInteraction(context, props = {}) { 6123 const { 6124 enabled = true, 6125 delay = 0, 6126 handleClose = null, 6127 mouseOnly = false, 6128 restMs = 0, 6129 move = true, 6130 triggerElementRef = EMPTY_REF, 6131 externalTree, 6132 isActiveTrigger = true, 6133 getHandleCloseContext, 6134 isClosing, 6135 shouldOpen: shouldOpenProp, 6136 guardStaleOpen = false 6137 } = props; 6138 const store2 = "rootStore" in context ? context.rootStore : context; 6139 const { 6140 dataRef, 6141 events 6142 } = store2.context; 6143 const tree = useFloatingTree(externalTree); 6144 const instance = useHoverInteractionSharedState(store2); 6145 const isHoverCloseActiveRef = React27.useRef(false); 6146 const handleCloseRef = useValueAsRef(handleClose); 6147 const delayRef = useValueAsRef(delay); 6148 const restMsRef = useValueAsRef(restMs); 6149 const enabledRef = useValueAsRef(enabled); 6150 const shouldOpenRef = useValueAsRef(shouldOpenProp); 6151 const isClosingRef = useValueAsRef(isClosing); 6152 const isClickLikeOpenEvent2 = useStableCallback(() => { 6153 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6154 }); 6155 const checkShouldOpen = useStableCallback(() => { 6156 return shouldOpenRef.current?.() !== false; 6157 }); 6158 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 6159 const allTriggers = store2.context.triggerElements; 6160 if (allTriggers.hasElement(currentTarget)) { 6161 return !currentDomReference || !contains(currentDomReference, currentTarget); 6162 } 6163 if (!isElement(target)) { 6164 return false; 6165 } 6166 const targetElement = target; 6167 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 6168 }); 6169 const cleanupMouseMoveHandler = useStableCallback(() => { 6170 if (!instance.handler) { 6171 return; 6172 } 6173 const doc = ownerDocument(store2.select("domReferenceElement")); 6174 doc.removeEventListener("mousemove", instance.handler); 6175 instance.handler = void 0; 6176 }); 6177 const clearPointerEvents = useStableCallback(() => { 6178 clearSafePolygonPointerEventsMutation(instance); 6179 }); 6180 if (isActiveTrigger) { 6181 instance.handleCloseOptions = handleCloseRef.current?.__options; 6182 } 6183 React27.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 6184 React27.useEffect(() => { 6185 if (!enabled) { 6186 return void 0; 6187 } 6188 function onOpenChangeLocal(details) { 6189 if (!details.open) { 6190 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 6191 cleanupMouseMoveHandler(); 6192 instance.openChangeTimeout.clear(); 6193 instance.restTimeout.clear(); 6194 instance.blockMouseMove = true; 6195 instance.restTimeoutPending = false; 6196 } else { 6197 isHoverCloseActiveRef.current = false; 6198 } 6199 } 6200 events.on("openchange", onOpenChangeLocal); 6201 return () => { 6202 events.off("openchange", onOpenChangeLocal); 6203 }; 6204 }, [enabled, events, instance, cleanupMouseMoveHandler]); 6205 React27.useEffect(() => { 6206 if (!enabled) { 6207 return void 0; 6208 } 6209 function closeWithDelay(event, runElseBranch = true) { 6210 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 6211 if (closeDelay) { 6212 instance.openChangeTimeout.start(closeDelay, () => { 6213 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6214 tree?.events.emit("floating.closed", event); 6215 }); 6216 } else if (runElseBranch) { 6217 instance.openChangeTimeout.clear(); 6218 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6219 tree?.events.emit("floating.closed", event); 6220 } 6221 } 6222 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store2.select("domReferenceElement") : null); 6223 if (!isElement(trigger)) { 6224 return void 0; 6225 } 6226 function onMouseEnter(event) { 6227 instance.openChangeTimeout.clear(); 6228 instance.blockMouseMove = false; 6229 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6230 return; 6231 } 6232 const restMsValue = getRestMs(restMsRef.current); 6233 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 6234 const eventTarget = getTarget(event); 6235 const currentTarget = event.currentTarget ?? null; 6236 const currentDomReference = store2.select("domReferenceElement"); 6237 let triggerNode = currentTarget; 6238 if (isElement(eventTarget) && !store2.context.triggerElements.hasElement(eventTarget)) { 6239 for (const triggerElement of store2.context.triggerElements.elements()) { 6240 if (contains(triggerElement, eventTarget)) { 6241 triggerNode = triggerElement; 6242 break; 6243 } 6244 } 6245 } 6246 if (isElement(currentTarget) && isElement(currentDomReference) && !store2.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 6247 triggerNode = currentDomReference; 6248 } 6249 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 6250 const isOpen = store2.select("open"); 6251 const isInClosingTransition = isClosingRef.current?.() ?? store2.select("transitionStatus") === "ending"; 6252 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 6253 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 6254 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 6255 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 6256 const shouldOpen = !isOpen || isOverInactive; 6257 if (shouldOpenImmediately) { 6258 if (checkShouldOpen()) { 6259 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6260 } 6261 return; 6262 } 6263 if (isRestOnlyDelay) { 6264 return; 6265 } 6266 if (openDelay) { 6267 instance.openChangeTimeout.start(openDelay, () => { 6268 if (shouldOpen && checkShouldOpen()) { 6269 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6270 } 6271 }); 6272 } else if (shouldOpen) { 6273 if (checkShouldOpen()) { 6274 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6275 } 6276 } 6277 } 6278 function onMouseLeave(event) { 6279 if (isClickLikeOpenEvent2()) { 6280 clearPointerEvents(); 6281 return; 6282 } 6283 cleanupMouseMoveHandler(); 6284 const domReferenceElement = store2.select("domReferenceElement"); 6285 const doc = ownerDocument(domReferenceElement); 6286 instance.restTimeout.clear(); 6287 instance.restTimeoutPending = false; 6288 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 6289 if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) { 6290 return; 6291 } 6292 if (handleCloseRef.current && handleCloseContextBase) { 6293 if (!store2.select("open")) { 6294 instance.openChangeTimeout.clear(); 6295 } 6296 const currentTrigger = triggerElementRef.current; 6297 instance.handler = handleCloseRef.current({ 6298 ...handleCloseContextBase, 6299 tree, 6300 x: event.clientX, 6301 y: event.clientY, 6302 onClose() { 6303 clearPointerEvents(); 6304 cleanupMouseMoveHandler(); 6305 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store2.select("domReferenceElement")) { 6306 closeWithDelay(event, true); 6307 } 6308 } 6309 }); 6310 doc.addEventListener("mousemove", instance.handler); 6311 instance.handler(event); 6312 return; 6313 } 6314 const shouldClose = instance.pointerType === "touch" ? !contains(store2.select("floatingElement"), event.relatedTarget) : true; 6315 if (shouldClose) { 6316 closeWithDelay(event); 6317 } 6318 } 6319 function onMouseOut(event) { 6320 if (contains(trigger, event.relatedTarget)) { 6321 return; 6322 } 6323 instance.openChangeTimeout.clear(); 6324 instance.restTimeout.clear(); 6325 instance.restTimeoutPending = false; 6326 } 6327 const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0; 6328 if (move) { 6329 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 6330 once: true 6331 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 6332 } 6333 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 6334 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store2, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]); 6335 return React27.useMemo(() => { 6336 if (!enabled) { 6337 return void 0; 6338 } 6339 function setPointerRef(event) { 6340 instance.pointerType = event.pointerType; 6341 } 6342 return { 6343 onPointerDown: setPointerRef, 6344 onPointerEnter: setPointerRef, 6345 onMouseMove(event) { 6346 const { 6347 nativeEvent 6348 } = event; 6349 const trigger = event.currentTarget; 6350 const currentDomReference = store2.select("domReferenceElement"); 6351 const currentOpen = store2.select("open"); 6352 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 6353 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6354 return; 6355 } 6356 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 6357 const floatingElement = store2.select("floatingElement"); 6358 if (floatingElement) { 6359 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 6360 applySafePolygonPointerEventsMutation(instance, { 6361 scopeElement, 6362 referenceElement: trigger, 6363 floatingElement 6364 }); 6365 } 6366 } 6367 const restMsValue = getRestMs(restMsRef.current); 6368 if (currentOpen && !isOverInactive || restMsValue === 0) { 6369 return; 6370 } 6371 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 6372 return; 6373 } 6374 instance.restTimeout.clear(); 6375 function handleMouseMove() { 6376 instance.restTimeoutPending = false; 6377 if (isClickLikeOpenEvent2()) { 6378 return; 6379 } 6380 const latestOpen = store2.select("open"); 6381 if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) { 6382 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 6383 } 6384 } 6385 if (instance.pointerType === "touch") { 6386 ReactDOM5.flushSync(() => { 6387 handleMouseMove(); 6388 }); 6389 } else if (isOverInactive && currentOpen) { 6390 handleMouseMove(); 6391 } else { 6392 instance.restTimeoutPending = true; 6393 instance.restTimeout.start(restMsValue, handleMouseMove); 6394 } 6395 } 6396 }; 6397 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store2, restMsRef, checkShouldOpen]); 6398 } 6399 6400 // node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs 6401 var CURSOR_SPEED_THRESHOLD = 0.1; 6402 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 6403 var POLYGON_BUFFER = 0.5; 6404 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 6405 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 6406 } 6407 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 6408 let isInsideValue = false; 6409 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 6410 isInsideValue = !isInsideValue; 6411 } 6412 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 6413 isInsideValue = !isInsideValue; 6414 } 6415 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 6416 isInsideValue = !isInsideValue; 6417 } 6418 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 6419 isInsideValue = !isInsideValue; 6420 } 6421 return isInsideValue; 6422 } 6423 function isInsideRect(pointX, pointY, rect) { 6424 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 6425 } 6426 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 6427 const minX = Math.min(x1, x2); 6428 const maxX = Math.max(x1, x2); 6429 const minY = Math.min(y1, y2); 6430 const maxY = Math.max(y1, y2); 6431 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 6432 } 6433 function safePolygon(options = {}) { 6434 const { 6435 blockPointerEvents = false 6436 } = options; 6437 const timeout = new Timeout(); 6438 const fn = ({ 6439 x, 6440 y, 6441 placement, 6442 elements, 6443 onClose, 6444 nodeId, 6445 tree 6446 }) => { 6447 const side = placement?.split("-")[0]; 6448 let hasLanded = false; 6449 let lastX = null; 6450 let lastY = null; 6451 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 6452 function isCursorMovingSlowly(nextX, nextY) { 6453 const currentTime = performance.now(); 6454 const elapsedTime = currentTime - lastCursorTime; 6455 if (lastX === null || lastY === null || elapsedTime === 0) { 6456 lastX = nextX; 6457 lastY = nextY; 6458 lastCursorTime = currentTime; 6459 return false; 6460 } 6461 const deltaX = nextX - lastX; 6462 const deltaY = nextY - lastY; 6463 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 6464 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 6465 lastX = nextX; 6466 lastY = nextY; 6467 lastCursorTime = currentTime; 6468 return distanceSquared < thresholdSquared; 6469 } 6470 function close() { 6471 timeout.clear(); 6472 onClose(); 6473 } 6474 return function onMouseMove(event) { 6475 timeout.clear(); 6476 const domReference = elements.domReference; 6477 const floating = elements.floating; 6478 if (!domReference || !floating || side == null || x == null || y == null) { 6479 return void 0; 6480 } 6481 const { 6482 clientX, 6483 clientY 6484 } = event; 6485 const target = getTarget(event); 6486 const isLeave = event.type === "mouseleave"; 6487 const isOverFloatingEl = contains(floating, target); 6488 const isOverReferenceEl = contains(domReference, target); 6489 if (isOverFloatingEl) { 6490 hasLanded = true; 6491 if (!isLeave) { 6492 return void 0; 6493 } 6494 } 6495 if (isOverReferenceEl) { 6496 hasLanded = false; 6497 if (!isLeave) { 6498 hasLanded = true; 6499 return void 0; 6500 } 6501 } 6502 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 6503 return void 0; 6504 } 6505 function hasOpenChildNode() { 6506 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 6507 } 6508 function closeIfNoOpenChild() { 6509 if (!hasOpenChildNode()) { 6510 close(); 6511 } 6512 } 6513 if (hasOpenChildNode()) { 6514 return void 0; 6515 } 6516 const refRect = domReference.getBoundingClientRect(); 6517 const rect = floating.getBoundingClientRect(); 6518 const cursorLeaveFromRight = x > rect.right - rect.width / 2; 6519 const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; 6520 const isFloatingWider = rect.width > refRect.width; 6521 const isFloatingTaller = rect.height > refRect.height; 6522 const left = (isFloatingWider ? refRect : rect).left; 6523 const right = (isFloatingWider ? refRect : rect).right; 6524 const top = (isFloatingTaller ? refRect : rect).top; 6525 const bottom = (isFloatingTaller ? refRect : rect).bottom; 6526 if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) { 6527 closeIfNoOpenChild(); 6528 return void 0; 6529 } 6530 let isInsideTroughRect = false; 6531 switch (side) { 6532 case "top": 6533 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 6534 break; 6535 case "bottom": 6536 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 6537 break; 6538 case "left": 6539 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 6540 break; 6541 case "right": 6542 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 6543 break; 6544 default: 6545 } 6546 if (isInsideTroughRect) { 6547 return void 0; 6548 } 6549 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 6550 closeIfNoOpenChild(); 6551 return void 0; 6552 } 6553 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 6554 closeIfNoOpenChild(); 6555 return void 0; 6556 } 6557 let isInsidePolygon = false; 6558 switch (side) { 6559 case "top": { 6560 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6561 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6562 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6563 const cursorPointY = y + POLYGON_BUFFER + 1; 6564 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 6565 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 6566 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6567 break; 6568 } 6569 case "bottom": { 6570 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6571 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6572 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6573 const cursorPointY = y - POLYGON_BUFFER; 6574 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 6575 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 6576 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6577 break; 6578 } 6579 case "left": { 6580 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6581 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6582 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6583 const cursorPointX = x + POLYGON_BUFFER + 1; 6584 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 6585 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 6586 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 6587 break; 6588 } 6589 case "right": { 6590 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6591 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6592 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6593 const cursorPointX = x - POLYGON_BUFFER; 6594 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 6595 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 6596 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 6597 break; 6598 } 6599 default: 6600 } 6601 if (!isInsidePolygon) { 6602 closeIfNoOpenChild(); 6603 } else if (!hasLanded) { 6604 timeout.start(40, closeIfNoOpenChild); 6605 } 6606 return void 0; 6607 }; 6608 }; 6609 fn.__options = { 6610 ...options, 6611 blockPointerEvents 6612 }; 6613 return fn; 6614 } 6615 6616 // node_modules/@base-ui/react/utils/NullStore.mjs 6617 var NullStore = class extends ReactStore { 6618 // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding 6619 // `setState` alone would neutralize them today. They are overridden explicitly so the store stays 6620 // inert even if a future base-class change stops routing a mutator through `setState`. 6621 setState(_newState) { 6622 } 6623 update(_changes) { 6624 } 6625 set(_key, _value) { 6626 } 6627 notifyAll() { 6628 } 6629 }; 6630 6631 // node_modules/@base-ui/react/utils/popupStateMapping.mjs 6632 var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { 6633 CommonPopupDataAttributes2["open"] = "data-open"; 6634 CommonPopupDataAttributes2["closed"] = "data-closed"; 6635 CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; 6636 CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; 6637 CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; 6638 CommonPopupDataAttributes2["side"] = "data-side"; 6639 CommonPopupDataAttributes2["align"] = "data-align"; 6640 return CommonPopupDataAttributes2; 6641 })({}); 6642 var TRIGGER_HOOK = { 6643 "data-popup-open": "" 6644 }; 6645 var POPUP_OPEN_HOOK = { 6646 "data-open": "" 6647 }; 6648 var POPUP_CLOSED_HOOK = { 6649 "data-closed": "" 6650 }; 6651 var ANCHOR_HIDDEN_HOOK = { 6652 "data-anchor-hidden": "" 6653 }; 6654 var triggerOpenStateMapping = { 6655 open(value) { 6656 if (value) { 6657 return TRIGGER_HOOK; 6658 } 6659 return null; 6660 } 6661 }; 6662 var popupStateMapping = { 6663 open(value) { 6664 if (value) { 6665 return POPUP_OPEN_HOOK; 6666 } 6667 return POPUP_CLOSED_HOOK; 6668 }, 6669 anchorHidden(value) { 6670 if (value) { 6671 return ANCHOR_HIDDEN_HOOK; 6672 } 6673 return null; 6674 } 6675 }; 6676 var popupTransitionStateMapping = { 6677 ...popupStateMapping, 6678 ...transitionStatusMapping 6679 }; 6680 6681 // node_modules/@base-ui/utils/inertValue.mjs 6682 function inertValue(value) { 6683 if (isReactVersionAtLeast(19)) { 6684 return value; 6685 } 6686 return value ? "true" : void 0; 6687 } 6688 6689 // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 6690 var React28 = __toESM(require_react(), 1); 6691 var DirectionContext = /* @__PURE__ */ React28.createContext(void 0); 6692 if (true) DirectionContext.displayName = "DirectionContext"; 6693 function useDirection() { 6694 const context = React28.useContext(DirectionContext); 6695 return context?.direction ?? "ltr"; 6696 } 6697 6698 // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 6699 var React29 = __toESM(require_react(), 1); 6700 6701 // node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs 6702 var baseArrow = (options) => ({ 6703 name: "arrow", 6704 options, 6705 async fn(state) { 6706 const { 6707 x, 6708 y, 6709 placement, 6710 rects, 6711 platform: platform3, 6712 elements, 6713 middlewareData 6714 } = state; 6715 const { 6716 element, 6717 padding = 0, 6718 offsetParent = "real" 6719 } = evaluate(options, state) || {}; 6720 if (element == null) { 6721 return {}; 6722 } 6723 const paddingObject = getPaddingObject(padding); 6724 const coords = { 6725 x, 6726 y 6727 }; 6728 const axis = getAlignmentAxis(placement); 6729 const length = getAxisLength(axis); 6730 const arrowDimensions = await platform3.getDimensions(element); 6731 const isYAxis = axis === "y"; 6732 const minProp = isYAxis ? "top" : "left"; 6733 const maxProp = isYAxis ? "bottom" : "right"; 6734 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 6735 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 6736 const startDiff = coords[axis] - rects.reference[axis]; 6737 const arrowOffsetParent = offsetParent === "real" ? await platform3.getOffsetParent?.(element) : elements.floating; 6738 let clientSize = elements.floating[clientProp] || rects.floating[length]; 6739 if (!clientSize || !await platform3.isElement?.(arrowOffsetParent)) { 6740 clientSize = elements.floating[clientProp] || rects.floating[length]; 6741 } 6742 const centerToReference = endDiff / 2 - startDiff / 2; 6743 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 6744 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 6745 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 6746 const min2 = minPadding; 6747 const max2 = clientSize - arrowDimensions[length] - maxPadding; 6748 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 6749 const offset4 = clamp(min2, center, max2); 6750 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 6751 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 6752 return { 6753 [axis]: coords[axis] + alignmentOffset, 6754 data: { 6755 [axis]: offset4, 6756 centerOffset: center - offset4 - alignmentOffset, 6757 ...shouldAddOffset && { 6758 alignmentOffset 6759 } 6760 }, 6761 reset: shouldAddOffset 6762 }; 6763 } 6764 }); 6765 var arrow4 = (options, deps) => ({ 6766 ...baseArrow(options), 6767 options: [options, deps] 6768 }); 6769 6770 // node_modules/@base-ui/react/utils/hideMiddleware.mjs 6771 var hide4 = { 6772 name: "hide", 6773 async fn(state) { 6774 const { 6775 width, 6776 height, 6777 x, 6778 y 6779 } = state.rects.reference; 6780 const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0; 6781 const overflow = await state.platform.detectOverflow(state, { 6782 elementContext: "reference" 6783 }); 6784 const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; 6785 return { 6786 data: { 6787 referenceHidden: referenceHidden || anchorHidden 6788 } 6789 }; 6790 } 6791 }; 6792 6793 // node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs 6794 var DEFAULT_SIDES = { 6795 sideX: "left", 6796 sideY: "top" 6797 }; 6798 6799 // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 6800 var AVAILABLE_WIDTH_VAR = "--available-width"; 6801 var AVAILABLE_HEIGHT_VAR = "--available-height"; 6802 function getLogicalSide(sideParam, renderedSide, isRtl) { 6803 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 6804 const logicalRight = isRtl ? "inline-start" : "inline-end"; 6805 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 6806 return { 6807 top: "top", 6808 right: isLogicalSideParam ? logicalRight : "right", 6809 bottom: "bottom", 6810 left: isLogicalSideParam ? logicalLeft : "left" 6811 }[renderedSide]; 6812 } 6813 function getOffsetData(state, sideParam, isRtl) { 6814 const { 6815 rects, 6816 placement 6817 } = state; 6818 const data = { 6819 side: getLogicalSide(sideParam, getSide(placement), isRtl), 6820 align: getAlignment(placement) || "center", 6821 anchor: { 6822 width: rects.reference.width, 6823 height: rects.reference.height 6824 }, 6825 positioner: { 6826 width: rects.floating.width, 6827 height: rects.floating.height 6828 } 6829 }; 6830 return data; 6831 } 6832 function useAnchorPositioning(params) { 6833 return useAnchorPositioningWithHook(params, useBaseUIFloating); 6834 } 6835 function useAnchorPositioningWithHook(params, useFloatingHook) { 6836 const { 6837 // Public parameters 6838 anchor, 6839 positionMethod = "absolute", 6840 side: sideParam = "bottom", 6841 sideOffset = 0, 6842 align = "center", 6843 alignOffset = 0, 6844 collisionBoundary, 6845 collisionPadding: collisionPaddingParam = 5, 6846 sticky = false, 6847 arrowPadding = 5, 6848 disableAnchorTracking = false, 6849 inline: inlineMiddleware, 6850 // Private parameters 6851 keepMounted = false, 6852 floatingRootContext, 6853 mounted, 6854 collisionAvoidance, 6855 shift: shift4, 6856 nodeId, 6857 adaptiveOrigin: adaptiveOrigin2, 6858 lazyFlip = false, 6859 externalTree 6860 } = params; 6861 const [mountSide, setMountSide] = React29.useState(null); 6862 if (!mounted && mountSide !== null) { 6863 setMountSide(null); 6864 } 6865 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 6866 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 6867 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 6868 const shiftCrossAxis = shift4?.crossAxis ?? false; 6869 const shiftRootBoundary = shift4?.rootBoundary; 6870 const anchorFn = typeof anchor === "function" ? anchor : void 0; 6871 const anchorFnCallback = useStableCallback(anchorFn); 6872 const anchorDep = anchorFn ? anchorFnCallback : anchor; 6873 const anchorValueRef = useValueAsRef(anchor); 6874 const mountedRef = useValueAsRef(mounted); 6875 const direction = useDirection(); 6876 const isRtl = direction === "rtl"; 6877 const side = mountSide || { 6878 top: "top", 6879 right: "right", 6880 bottom: "bottom", 6881 left: "left", 6882 "inline-end": isRtl ? "left" : "right", 6883 "inline-start": isRtl ? "right" : "left" 6884 }[sideParam]; 6885 const placement = align === "center" ? side : `$side}-$align}`; 6886 let collisionPadding = collisionPaddingParam; 6887 if (typeof collisionPadding === "number") { 6888 collisionPadding = { 6889 top: collisionPadding, 6890 right: collisionPadding, 6891 bottom: collisionPadding, 6892 left: collisionPadding 6893 }; 6894 } else if (collisionPadding) { 6895 collisionPadding = { 6896 top: collisionPadding.top || 0, 6897 right: collisionPadding.right || 0, 6898 bottom: collisionPadding.bottom || 0, 6899 left: collisionPadding.left || 0 6900 }; 6901 } 6902 const bias = 1; 6903 const biasTop = sideParam === "bottom" ? bias : 0; 6904 const biasBottom = sideParam === "top" ? bias : 0; 6905 const biasLeft = sideParam === "right" ? bias : 0; 6906 const biasRight = sideParam === "left" ? bias : 0; 6907 const commonCollisionProps = { 6908 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 6909 padding: collisionPadding 6910 }; 6911 const arrowRef = React29.useRef(null); 6912 const sideOffsetRef = useValueAsRef(sideOffset); 6913 const alignOffsetRef = useValueAsRef(alignOffset); 6914 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 6915 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 6916 const middleware = []; 6917 if (inlineMiddleware) { 6918 middleware.push(inlineMiddleware); 6919 } 6920 middleware.push(offset3((state) => { 6921 const data = getOffsetData(state, sideParam, isRtl); 6922 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 6923 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 6924 return { 6925 mainAxis: sideAxis, 6926 crossAxis: alignAxis, 6927 alignmentAxis: alignAxis 6928 }; 6929 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])); 6930 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 6931 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 6932 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 6933 ...commonCollisionProps, 6934 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 6935 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 6936 padding: { 6937 top: collisionPadding.top + bias + biasTop, 6938 right: collisionPadding.right + bias + biasRight, 6939 bottom: collisionPadding.bottom + bias + biasBottom, 6940 left: collisionPadding.left + bias + biasLeft 6941 }, 6942 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 6943 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 6944 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 6945 }); 6946 const shiftMiddleware = shiftDisabled ? null : shift3({ 6947 ...commonCollisionProps, 6948 // Use the Layout Viewport to avoid shifting around when pinch-zooming. 6949 rootBoundary: shiftRootBoundary, 6950 mainAxis: collisionAvoidanceAlign !== "none", 6951 crossAxis: crossAxisShiftEnabled, 6952 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 6953 if (!arrowRef.current) { 6954 return {}; 6955 } 6956 const { 6957 width, 6958 height 6959 } = arrowRef.current.getBoundingClientRect(); 6960 const sideAxis = getSideAxis(getSide(limitData.placement)); 6961 const arrowSize = sideAxis === "y" ? width : height; 6962 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 6963 return { 6964 offset: arrowSize / 2 + offsetAmount / 2 6965 }; 6966 }) 6967 }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]); 6968 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") { 6969 middleware.push(shiftMiddleware, flipMiddleware); 6970 } else { 6971 middleware.push(flipMiddleware, shiftMiddleware); 6972 } 6973 middleware.push(size3({ 6974 ...commonCollisionProps, 6975 apply({ 6976 elements: { 6977 floating 6978 }, 6979 availableWidth, 6980 availableHeight, 6981 rects 6982 }) { 6983 if (!mountedRef.current) { 6984 return; 6985 } 6986 const floatingStyle = floating.style; 6987 floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `$availableWidth}px`); 6988 floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `$availableHeight}px`); 6989 const dpr = getWindow(floating).devicePixelRatio || 1; 6990 const { 6991 x: x2, 6992 y: y2, 6993 width, 6994 height 6995 } = rects.reference; 6996 const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; 6997 const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; 6998 floatingStyle.setProperty("--anchor-width", `$anchorWidth}px`); 6999 floatingStyle.setProperty("--anchor-height", `$anchorHeight}px`); 7000 } 7001 }), arrow4((state) => ({ 7002 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 7003 // we'll create a fake element. 7004 element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), 7005 padding: arrowPadding, 7006 offsetParent: "floating" 7007 }), [arrowPadding]), { 7008 name: "transformOrigin", 7009 fn(state) { 7010 const { 7011 elements: elements2, 7012 middlewareData: middlewareData2, 7013 placement: renderedPlacement2, 7014 rects, 7015 y: y2 7016 } = state; 7017 const currentRenderedSide = getSide(renderedPlacement2); 7018 const currentRenderedAxis = getSideAxis(currentRenderedSide); 7019 const arrowEl = arrowRef.current; 7020 const arrowX = middlewareData2.arrow?.x || 0; 7021 const arrowY = middlewareData2.arrow?.y || 0; 7022 const arrowWidth = arrowEl?.clientWidth || 0; 7023 const arrowHeight = arrowEl?.clientHeight || 0; 7024 const transformX = arrowX + arrowWidth / 2; 7025 const transformY = arrowY + arrowHeight / 2; 7026 const shiftY = Math.abs(middlewareData2.shift?.y || 0); 7027 const halfAnchorHeight = rects.reference.height / 2; 7028 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 7029 const isOverlappingAnchor = shiftY > sideOffsetValue; 7030 const adjacentTransformOrigin = { 7031 top: `$transformX}px calc(100% + $sideOffsetValue}px)`, 7032 bottom: `$transformX}px ${-sideOffsetValue}px`, 7033 left: `calc(100% + $sideOffsetValue}px) $transformY}px`, 7034 right: `${-sideOffsetValue}px $transformY}px` 7035 }[currentRenderedSide]; 7036 const overlapTransformOrigin = `$transformX}px $rects.reference.y + halfAnchorHeight - y2}px`; 7037 elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); 7038 return {}; 7039 } 7040 }, hide4, adaptiveOrigin2); 7041 useIsoLayoutEffect(() => { 7042 if (!mounted && floatingRootContext) { 7043 floatingRootContext.update({ 7044 referenceElement: null, 7045 floatingElement: null, 7046 domReferenceElement: null, 7047 positionReference: null 7048 }); 7049 } 7050 }, [mounted, floatingRootContext]); 7051 const autoUpdateOptions = React29.useMemo(() => ({ 7052 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 7053 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 7054 }), [disableAnchorTracking]); 7055 const { 7056 refs, 7057 elements, 7058 x, 7059 y, 7060 middlewareData, 7061 update: update2, 7062 placement: renderedPlacement, 7063 context, 7064 isPositioned, 7065 floatingStyles: originalFloatingStyles 7066 } = useFloatingHook({ 7067 rootContext: floatingRootContext, 7068 open: keepMounted ? mounted : void 0, 7069 placement, 7070 middleware, 7071 strategy: positionMethod, 7072 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 7073 nodeId, 7074 externalTree 7075 }); 7076 const { 7077 sideX, 7078 sideY 7079 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 7080 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 7081 const floatingStyles = React29.useMemo(() => { 7082 let base; 7083 if (!isPositioned) { 7084 base = { 7085 position: resolvedPosition, 7086 top: 0, 7087 left: 0 7088 }; 7089 } else if (adaptiveOrigin2) { 7090 base = { 7091 position: resolvedPosition, 7092 [sideX]: x, 7093 [sideY]: y 7094 }; 7095 } else { 7096 base = { 7097 ...originalFloatingStyles, 7098 position: resolvedPosition 7099 }; 7100 } 7101 base[AVAILABLE_WIDTH_VAR] = "100vw"; 7102 base[AVAILABLE_HEIGHT_VAR] = "100vh"; 7103 if (!isPositioned) { 7104 base.opacity = 0; 7105 } 7106 return base; 7107 }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); 7108 const registeredPositionReferenceRef = React29.useRef(null); 7109 useIsoLayoutEffect(() => { 7110 if (!mounted) { 7111 return; 7112 } 7113 const anchorValue = anchorValueRef.current; 7114 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 7115 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 7116 const finalAnchor = unwrappedElement || null; 7117 if (finalAnchor !== registeredPositionReferenceRef.current) { 7118 refs.setPositionReference(finalAnchor); 7119 registeredPositionReferenceRef.current = finalAnchor; 7120 } 7121 }, [mounted, refs, anchorDep, anchorValueRef]); 7122 React29.useEffect(() => { 7123 if (!mounted) { 7124 return; 7125 } 7126 const anchorValue = anchorValueRef.current; 7127 if (typeof anchorValue === "function") { 7128 return; 7129 } 7130 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 7131 refs.setPositionReference(anchorValue.current); 7132 registeredPositionReferenceRef.current = anchorValue.current; 7133 } 7134 }, [mounted, refs, anchorDep, anchorValueRef]); 7135 React29.useEffect(() => { 7136 if (keepMounted && mounted && elements.reference && elements.floating) { 7137 return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions); 7138 } 7139 return void 0; 7140 }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); 7141 const renderedSide = getSide(renderedPlacement); 7142 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 7143 const renderedAlign = getAlignment(renderedPlacement) || "center"; 7144 const anchorHidden = Boolean(middlewareData.hide?.referenceHidden); 7145 useIsoLayoutEffect(() => { 7146 if (lazyFlip && mounted && isPositioned && renderedSide !== side) { 7147 setMountSide(renderedSide); 7148 } 7149 }, [lazyFlip, mounted, isPositioned, renderedSide, side]); 7150 const arrowStyles = React29.useMemo(() => ({ 7151 position: "absolute", 7152 top: middlewareData.arrow?.y, 7153 left: middlewareData.arrow?.x 7154 }), [middlewareData.arrow]); 7155 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 7156 return React29.useMemo(() => ({ 7157 positionerStyles: floatingStyles, 7158 arrowStyles, 7159 arrowRef, 7160 arrowUncentered, 7161 side: logicalRenderedSide, 7162 align: renderedAlign, 7163 physicalSide: renderedSide, 7164 anchorHidden, 7165 refs, 7166 context, 7167 isPositioned, 7168 update: update2 7169 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); 7170 } 7171 function isRef(param) { 7172 return param != null && "current" in param; 7173 } 7174 7175 // node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs 7176 function getDisabledMountTransitionStyles(transitionStatus) { 7177 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 7178 } 7179 7180 // node_modules/@base-ui/react/utils/usePositioner.mjs 7181 function usePositioner(componentProps, state, { 7182 styles, 7183 transitionStatus, 7184 props, 7185 refs, 7186 hidden, 7187 inert = false 7188 }) { 7189 const style = { 7190 ...styles 7191 }; 7192 if (inert) { 7193 style.pointerEvents = "none"; 7194 } 7195 return useRenderElement("div", componentProps, { 7196 state, 7197 ref: refs, 7198 props: [{ 7199 role: "presentation", 7200 hidden, 7201 style 7202 }, getDisabledMountTransitionStyles(transitionStatus), props], 7203 stateAttributesMapping: popupStateMapping 7204 }); 7205 } 7206 7207 // node_modules/@base-ui/react/utils/usePopupViewport.mjs 7208 var React33 = __toESM(require_react(), 1); 7209 var ReactDOM6 = __toESM(require_react_dom(), 1); 7210 7211 // node_modules/@base-ui/utils/usePreviousValue.mjs 7212 var React30 = __toESM(require_react(), 1); 7213 function usePreviousValue(value) { 7214 const [state, setState] = React30.useState({ 7215 current: value, 7216 previous: null 7217 }); 7218 if (!Object.is(value, state.current)) { 7219 setState({ 7220 current: value, 7221 previous: state.current 7222 }); 7223 } 7224 return state.previous; 7225 } 7226 7227 // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7228 var React31 = __toESM(require_react(), 1); 7229 7230 // node_modules/@base-ui/react/utils/getCssDimensions.mjs 7231 function getCssDimensions2(element) { 7232 const css = getComputedStyle2(element); 7233 let width = parseFloat(css.width) || 0; 7234 let height = parseFloat(css.height) || 0; 7235 const hasOffset = isHTMLElement(element); 7236 const offsetWidth = hasOffset ? element.offsetWidth : width; 7237 const offsetHeight = hasOffset ? element.offsetHeight : height; 7238 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7239 if (shouldFallback) { 7240 width = offsetWidth; 7241 height = offsetHeight; 7242 } 7243 return { 7244 width, 7245 height 7246 }; 7247 } 7248 7249 // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7250 function usePopupAutoResize(parameters) { 7251 const { 7252 popupElement, 7253 positionerElement, 7254 content, 7255 mounted, 7256 onMeasureLayout: onMeasureLayoutParam, 7257 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 7258 side, 7259 direction 7260 } = parameters; 7261 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true); 7262 const animationFrame = useAnimationFrame(); 7263 const committedDimensionsRef = React31.useRef(null); 7264 const isInitialRenderRef = React31.useRef(true); 7265 const restoreAnchoringStylesRef = React31.useRef(NOOP); 7266 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 7267 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 7268 const anchoringStyles = React31.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]); 7269 useIsoLayoutEffect(() => { 7270 if (!mounted) { 7271 restoreAnchoringStylesRef.current = NOOP; 7272 isInitialRenderRef.current = true; 7273 committedDimensionsRef.current = null; 7274 return void 0; 7275 } 7276 if (!popupElement || !positionerElement) { 7277 return void 0; 7278 } 7279 restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles); 7280 setPopupCssSize(popupElement, "auto"); 7281 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 7282 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 7283 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 7284 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 7285 "--available-width": "max-content", 7286 "--available-height": "max-content" 7287 }); 7288 function restoreMeasurementOverrides() { 7289 restorePopupPosition(); 7290 restorePopupTransform(); 7291 restorePositionerAvailableSize(); 7292 } 7293 function restoreMeasurementOverridesIncludingScale() { 7294 restoreMeasurementOverrides(); 7295 restorePopupScale(); 7296 } 7297 onMeasureLayout?.(); 7298 if (isInitialRenderRef.current || committedDimensionsRef.current === null) { 7299 setPositionerCssSize(positionerElement, "max-content"); 7300 const dimensions = getCssDimensions2(popupElement); 7301 committedDimensionsRef.current = dimensions; 7302 setPositionerCssSize(positionerElement, dimensions); 7303 restoreMeasurementOverridesIncludingScale(); 7304 onMeasureLayoutComplete?.(null, dimensions); 7305 isInitialRenderRef.current = false; 7306 return () => { 7307 restoreAnchoringStylesRef.current(); 7308 restoreAnchoringStylesRef.current = NOOP; 7309 }; 7310 } 7311 setPositionerCssSize(positionerElement, "max-content"); 7312 const previousDimensions = committedDimensionsRef.current; 7313 const newDimensions = getCssDimensions2(popupElement); 7314 committedDimensionsRef.current = newDimensions; 7315 setPopupCssSize(popupElement, previousDimensions); 7316 restoreMeasurementOverridesIncludingScale(); 7317 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 7318 setPositionerCssSize(positionerElement, newDimensions); 7319 const abortController = new AbortController(); 7320 animationFrame.request(() => { 7321 setPopupCssSize(popupElement, newDimensions); 7322 runOnceAnimationsFinish(() => { 7323 popupElement.style.setProperty("--popup-width", "auto"); 7324 popupElement.style.setProperty("--popup-height", "auto"); 7325 }, abortController.signal); 7326 }); 7327 return () => { 7328 abortController.abort(); 7329 animationFrame.cancel(); 7330 restoreAnchoringStylesRef.current(); 7331 restoreAnchoringStylesRef.current = NOOP; 7332 }; 7333 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 7334 } 7335 function getPopupAnchoringStyles(side, direction) { 7336 const isPhysicalTop = side === "top"; 7337 const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start"); 7338 if (!isPhysicalTop && !isPhysicalLeft) { 7339 return EMPTY_OBJECT; 7340 } 7341 return { 7342 position: "absolute", 7343 [isPhysicalTop ? "bottom" : "top"]: "0", 7344 [isPhysicalLeft ? "right" : "left"]: "0" 7345 }; 7346 } 7347 function overrideElementStyle(element, property, value) { 7348 const originalValue = element.style.getPropertyValue(property); 7349 element.style.setProperty(property, value); 7350 return () => { 7351 element.style.setProperty(property, originalValue); 7352 }; 7353 } 7354 function applyElementStyles(element, styles) { 7355 const restorers = []; 7356 for (const [key, value] of Object.entries(styles)) { 7357 restorers.push(overrideElementStyle(element, key, value)); 7358 } 7359 return restorers.length ? () => { 7360 restorers.forEach((restore) => restore()); 7361 } : NOOP; 7362 } 7363 function setPopupCssSize(popupElement, size4) { 7364 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 7365 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 7366 popupElement.style.setProperty("--popup-width", width); 7367 popupElement.style.setProperty("--popup-height", height); 7368 } 7369 function setPositionerCssSize(positionerElement, size4) { 7370 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 7371 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 7372 positionerElement.style.setProperty("--positioner-width", width); 7373 positionerElement.style.setProperty("--positioner-height", height); 7374 } 7375 7376 // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 7377 var React32 = __toESM(require_react(), 1); 7378 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 7379 var DirectionProvider = function DirectionProvider2(props) { 7380 const { 7381 direction = "ltr" 7382 } = props; 7383 const contextValue = React32.useMemo(() => ({ 7384 direction 7385 }), [direction]); 7386 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DirectionContext.Provider, { 7387 value: contextValue, 7388 children: props.children 7389 }); 7390 }; 7391 if (true) DirectionProvider.displayName = "DirectionProvider"; 7392 7393 // node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs 7394 var adaptiveOrigin = { 7395 name: "adaptiveOrigin", 7396 async fn(state) { 7397 const { 7398 x: rawX, 7399 y: rawY, 7400 rects: { 7401 floating: floatRect 7402 }, 7403 elements: { 7404 floating 7405 }, 7406 platform: platform3, 7407 strategy, 7408 placement 7409 } = state; 7410 const win = getWindow(floating); 7411 const styles = win.getComputedStyle(floating); 7412 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 7413 if (!hasTransition) { 7414 return { 7415 x: rawX, 7416 y: rawY, 7417 data: DEFAULT_SIDES 7418 }; 7419 } 7420 const offsetParent = await platform3.getOffsetParent?.(floating); 7421 let offsetDimensions = { 7422 width: 0, 7423 height: 0 7424 }; 7425 if (strategy === "fixed" && win?.visualViewport) { 7426 offsetDimensions = { 7427 width: win.visualViewport.width, 7428 height: win.visualViewport.height 7429 }; 7430 } else if (offsetParent === win) { 7431 const doc = ownerDocument(floating); 7432 offsetDimensions = { 7433 width: doc.documentElement.clientWidth, 7434 height: doc.documentElement.clientHeight 7435 }; 7436 } else if (await platform3.isElement?.(offsetParent)) { 7437 offsetDimensions = await platform3.getDimensions(offsetParent); 7438 } 7439 const currentSide = getSide(placement); 7440 let x = rawX; 7441 let y = rawY; 7442 if (currentSide === "left") { 7443 x = offsetDimensions.width - (rawX + floatRect.width); 7444 } 7445 if (currentSide === "top") { 7446 y = offsetDimensions.height - (rawY + floatRect.height); 7447 } 7448 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 7449 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 7450 return { 7451 x, 7452 y, 7453 data: { 7454 sideX, 7455 sideY 7456 } 7457 }; 7458 } 7459 }; 7460 7461 // node_modules/@base-ui/react/utils/usePopupViewport.mjs 7462 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 7463 var popupViewportStateMapping = { 7464 activationDirection: (value) => value ? { 7465 "data-activation-direction": value 7466 } : null 7467 }; 7468 function usePopupViewport(parameters) { 7469 const { 7470 store: store2, 7471 side, 7472 children 7473 } = parameters; 7474 const direction = useDirection(); 7475 const activeTrigger = store2.useState("activeTriggerElement"); 7476 const activeTriggerId = store2.useState("activeTriggerId"); 7477 const open = store2.useState("open"); 7478 const payload = store2.useState("payload"); 7479 const mounted = store2.useState("mounted"); 7480 const popupElement = store2.useState("popupElement"); 7481 const positionerElement = store2.useState("positionerElement"); 7482 const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null); 7483 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 7484 const capturedNodeRef = React33.useRef(null); 7485 const [previousContentNode, setPreviousContentNode] = React33.useState(null); 7486 const [newTriggerOffset, setNewTriggerOffset] = React33.useState(null); 7487 const currentContainerRef = React33.useRef(null); 7488 const previousContainerRef = React33.useRef(null); 7489 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true); 7490 const cleanupFrame = useAnimationFrame(); 7491 const cleanupControllerRef = React33.useRef(null); 7492 const [previousContentDimensions, setPreviousContentDimensions] = React33.useState(null); 7493 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React33.useState(false); 7494 useIsoLayoutEffect(() => { 7495 store2.set("adaptiveOrigin", adaptiveOrigin); 7496 return () => { 7497 store2.set("adaptiveOrigin", void 0); 7498 }; 7499 }, [store2]); 7500 const handleMeasureLayout = useStableCallback(() => { 7501 currentContainerRef.current?.style.setProperty("animation", "none"); 7502 currentContainerRef.current?.style.setProperty("transition", "none"); 7503 previousContainerRef.current?.style.setProperty("display", "none"); 7504 }); 7505 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 7506 currentContainerRef.current?.style.removeProperty("animation"); 7507 currentContainerRef.current?.style.removeProperty("transition"); 7508 previousContainerRef.current?.style.removeProperty("display"); 7509 if (previousDimensions) { 7510 setPreviousContentDimensions(previousDimensions); 7511 } 7512 }); 7513 const armViewportCleanup = useStableCallback(() => { 7514 cleanupControllerRef.current?.abort(); 7515 const controller = new AbortController(); 7516 cleanupControllerRef.current = controller; 7517 onAnimationsFinished(() => { 7518 setPreviousContentNode(null); 7519 setPreviousContentDimensions(null); 7520 capturedNodeRef.current = null; 7521 }, controller.signal); 7522 }); 7523 const lastHandledTriggerRef = React33.useRef(null); 7524 useIsoLayoutEffect(() => { 7525 if (!open || !mounted) { 7526 lastHandledTriggerRef.current = null; 7527 } 7528 }, [open, mounted]); 7529 useIsoLayoutEffect(() => { 7530 if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 7531 setPreviousContentNode(capturedNodeRef.current); 7532 setShowStartingStyleAttribute(true); 7533 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 7534 setNewTriggerOffset(offset4); 7535 lastHandledTriggerRef.current = activeTrigger; 7536 } 7537 }, [activeTrigger, previousActiveTrigger]); 7538 useIsoLayoutEffect(() => { 7539 if (previousContentNode == null) { 7540 return; 7541 } 7542 cleanupControllerRef.current?.abort(); 7543 setShowStartingStyleAttribute(true); 7544 cleanupFrame.request(() => { 7545 ReactDOM6.flushSync(() => { 7546 setShowStartingStyleAttribute(false); 7547 }); 7548 armViewportCleanup(); 7549 }); 7550 }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]); 7551 useIsoLayoutEffect(() => { 7552 const source = currentContainerRef.current; 7553 if (!source) { 7554 return; 7555 } 7556 const wrapper = ownerDocument(source).createElement("div"); 7557 for (const child of Array.from(source.childNodes)) { 7558 wrapper.appendChild(child.cloneNode(true)); 7559 } 7560 capturedNodeRef.current = wrapper; 7561 }); 7562 const isTransitioning = previousContentNode != null; 7563 let childrenToRender; 7564 if (!isTransitioning) { 7565 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { 7566 "data-current": true, 7567 ref: currentContainerRef, 7568 children 7569 }, currentContentKey); 7570 } else { 7571 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React33.Fragment, { 7572 children: [/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { 7573 "data-previous": true, 7574 inert: inertValue(true), 7575 ref: previousContainerRef, 7576 style: { 7577 ...previousContentDimensions ? { 7578 "--popup-width": `$previousContentDimensions.width}px`, 7579 "--popup-height": `$previousContentDimensions.height}px` 7580 } : null, 7581 position: "absolute" 7582 }, 7583 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 7584 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { 7585 "data-current": true, 7586 ref: currentContainerRef, 7587 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 7588 children 7589 }, currentContentKey)] 7590 }); 7591 } 7592 useIsoLayoutEffect(() => { 7593 const container = previousContainerRef.current; 7594 if (!container || !previousContentNode) { 7595 return; 7596 } 7597 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 7598 }, [previousContentNode]); 7599 usePopupAutoResize({ 7600 popupElement, 7601 positionerElement, 7602 mounted, 7603 content: payload, 7604 onMeasureLayout: handleMeasureLayout, 7605 onMeasureLayoutComplete: handleMeasureLayoutComplete, 7606 side, 7607 direction 7608 }); 7609 const state = { 7610 activationDirection: getActivationDirection(newTriggerOffset), 7611 transitioning: isTransitioning 7612 }; 7613 return { 7614 children: childrenToRender, 7615 state 7616 }; 7617 } 7618 function getActivationDirection(offset4) { 7619 if (!offset4) { 7620 return void 0; 7621 } 7622 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 7623 } 7624 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 7625 if (value > tolerance) { 7626 return positiveLabel; 7627 } 7628 if (value < -tolerance) { 7629 return negativeLabel; 7630 } 7631 return ""; 7632 } 7633 function calculateRelativePosition(from, to) { 7634 const fromRect = from.getBoundingClientRect(); 7635 const toRect = to.getBoundingClientRect(); 7636 const fromCenter = { 7637 x: fromRect.left + fromRect.width / 2, 7638 y: fromRect.top + fromRect.height / 2 7639 }; 7640 const toCenter = { 7641 x: toRect.left + toRect.width / 2, 7642 y: toRect.top + toRect.height / 2 7643 }; 7644 return { 7645 horizontal: toCenter.x - fromCenter.x, 7646 vertical: toCenter.y - fromCenter.y 7647 }; 7648 } 7649 function usePopupContentKey(activeTriggerId, payload) { 7650 const [contentKey, setContentKey] = React33.useState(0); 7651 const previousActiveTriggerIdRef = React33.useRef(activeTriggerId); 7652 const previousPayloadRef = React33.useRef(payload); 7653 const pendingPayloadUpdateRef = React33.useRef(false); 7654 useIsoLayoutEffect(() => { 7655 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 7656 const previousPayload = previousPayloadRef.current; 7657 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 7658 const payloadChanged = payload !== previousPayload; 7659 if (triggerIdChanged) { 7660 setContentKey((value) => value + 1); 7661 pendingPayloadUpdateRef.current = !payloadChanged; 7662 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 7663 setContentKey((value) => value + 1); 7664 pendingPayloadUpdateRef.current = false; 7665 } 7666 previousActiveTriggerIdRef.current = activeTriggerId; 7667 previousPayloadRef.current = payload; 7668 }, [activeTriggerId, payload]); 7669 return `$activeTriggerId ?? "current"}-$contentKey}`; 7670 } 7671 7672 // node_modules/@base-ui/react/utils/FloatingPortalLite.mjs 7673 var React34 = __toESM(require_react(), 1); 7674 var ReactDOM7 = __toESM(require_react_dom(), 1); 7675 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 7676 var FloatingPortalLite = /* @__PURE__ */ React34.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 7677 const { 7678 children, 7679 container, 7680 className, 7681 render, 7682 style, 7683 ...elementProps 7684 } = componentProps; 7685 const { 7686 node: portalNode, 7687 subtree: portalSubtree 7688 } = useFloatingPortalNode({ 7689 container, 7690 ref: forwardedRef, 7691 componentProps, 7692 elementProps 7693 }); 7694 if (!portalSubtree && !portalNode) { 7695 return null; 7696 } 7697 return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React34.Fragment, { 7698 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] 7699 }); 7700 }); 7701 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 7702 7703 // node_modules/@base-ui/react/tooltip/index.parts.mjs 7704 var index_parts_exports = {}; 7705 __export(index_parts_exports, { 7706 Arrow: () => TooltipArrow, 7707 Handle: () => TooltipHandle, 7708 Popup: () => TooltipPopup, 7709 Portal: () => TooltipPortal, 7710 Positioner: () => TooltipPositioner, 7711 Provider: () => TooltipProvider, 7712 Root: () => TooltipRoot, 7713 Trigger: () => TooltipTrigger, 7714 Viewport: () => TooltipViewport, 7715 createHandle: () => createTooltipHandle 7716 }); 7717 7718 // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 7719 var React37 = __toESM(require_react(), 1); 7720 7721 // node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs 7722 var React35 = __toESM(require_react(), 1); 7723 var TooltipRootContext = /* @__PURE__ */ React35.createContext(void 0); 7724 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 7725 function useTooltipRootContext(optional) { 7726 const context = React35.useContext(TooltipRootContext); 7727 if (context === void 0 && !optional) { 7728 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 7729 } 7730 return context; 7731 } 7732 7733 // node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs 7734 var React36 = __toESM(require_react(), 1); 7735 var selectors2 = { 7736 ...popupStoreSelectors, 7737 disabled: (state) => state.disabled, 7738 instantType: (state) => state.instantType, 7739 isInstantPhase: (state) => state.isInstantPhase, 7740 trackCursorAxis: (state) => state.trackCursorAxis, 7741 disableHoverablePopup: (state) => state.disableHoverablePopup, 7742 lastOpenChangeReason: (state) => state.openChangeReason, 7743 closeOnClick: (state) => state.closeOnClick, 7744 closeDelay: (state) => state.closeDelay, 7745 adaptiveOrigin: (state) => state.adaptiveOrigin 7746 }; 7747 var TooltipStore = class extends ReactStore { 7748 constructor(initialState2, floatingId, nested) { 7749 const triggerElements = new PopupTriggerMap(); 7750 super(createInitialState(initialState2, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2); 7751 } 7752 setOpen = (nextOpen, eventDetails) => { 7753 applyPopupOpenChange(this, nextOpen, eventDetails, { 7754 extraState: { 7755 openChangeReason: eventDetails.reason 7756 } 7757 }); 7758 }; 7759 // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. 7760 cancelPendingOpen(event) { 7761 this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); 7762 } 7763 }; 7764 function createNullTooltipStore() { 7765 const triggerElements = new PopupTriggerMap(); 7766 const store2 = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2); 7767 return Object.assign(store2, { 7768 setOpen: NOOP, 7769 cancelPendingOpen: NOOP 7770 }); 7771 } 7772 function createInitialState(initialState2, triggerElements, floatingId, nested = false) { 7773 const state = { 7774 ...createInitialPopupStoreState(), 7775 disabled: false, 7776 instantType: void 0, 7777 isInstantPhase: false, 7778 trackCursorAxis: "none", 7779 disableHoverablePopup: false, 7780 openChangeReason: null, 7781 closeOnClick: true, 7782 closeDelay: 0, 7783 adaptiveOrigin: void 0, 7784 ...initialState2 7785 }; 7786 state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested); 7787 return state; 7788 } 7789 function createInitialContext(triggerElements) { 7790 return { 7791 popupRef: /* @__PURE__ */ React36.createRef(), 7792 onOpenChange: void 0, 7793 onOpenChangeComplete: void 0, 7794 triggerElements 7795 }; 7796 } 7797 7798 // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 7799 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 7800 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 7801 const { 7802 disabled: disabled2 = false, 7803 defaultOpen = false, 7804 open: openProp, 7805 disableHoverablePopup = false, 7806 trackCursorAxis = "none", 7807 actionsRef, 7808 onOpenChange, 7809 onOpenChangeComplete, 7810 handle, 7811 triggerId: triggerIdProp, 7812 defaultTriggerId: defaultTriggerIdProp = null, 7813 children 7814 } = props; 7815 const store2 = usePopupRootStore((floatingId, nested) => new TooltipStore({ 7816 open: defaultOpen, 7817 openProp, 7818 activeTriggerId: defaultTriggerIdProp, 7819 triggerIdProp 7820 }, floatingId, nested)); 7821 store2.useControlledProp("openProp", openProp); 7822 store2.useControlledProp("triggerIdProp", triggerIdProp); 7823 store2.useContextCallback("onOpenChange", onOpenChange); 7824 store2.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 7825 const openState = store2.useState("open"); 7826 const open = !disabled2 && openState; 7827 const activeTriggerId = store2.useState("activeTriggerId"); 7828 const mounted = store2.useState("mounted"); 7829 const payload = store2.useState("payload"); 7830 store2.useSyncedValues({ 7831 trackCursorAxis, 7832 disableHoverablePopup, 7833 disabled: disabled2 7834 }); 7835 useImplicitActiveTrigger(store2, { 7836 closeOnActiveTriggerUnmount: true 7837 }); 7838 const { 7839 forceUnmount, 7840 transitionStatus 7841 } = useOpenStateTransitions(open, store2); 7842 const isInstantPhase = store2.useState("isInstantPhase"); 7843 const instantType = store2.useState("instantType"); 7844 const lastOpenChangeReason = store2.useState("lastOpenChangeReason"); 7845 const previousInstantTypeRef = React37.useRef(null); 7846 useIsoLayoutEffect(() => { 7847 if (openState && disabled2) { 7848 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 7849 } 7850 }, [openState, disabled2, store2]); 7851 useIsoLayoutEffect(() => { 7852 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 7853 if (instantType !== "delay") { 7854 previousInstantTypeRef.current = instantType; 7855 } 7856 store2.set("instantType", "delay"); 7857 } else if (previousInstantTypeRef.current !== null) { 7858 store2.set("instantType", previousInstantTypeRef.current); 7859 previousInstantTypeRef.current = null; 7860 } 7861 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store2]); 7862 useIsoLayoutEffect(() => { 7863 if (open) { 7864 if (activeTriggerId == null) { 7865 store2.set("payload", void 0); 7866 } 7867 } 7868 }, [store2, activeTriggerId, open]); 7869 React37.useImperativeHandle(actionsRef, () => ({ 7870 unmount: forceUnmount, 7871 close: () => store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) 7872 }), [forceUnmount, store2]); 7873 const shouldRenderInteractions = open || mounted || !disabled2 && trackCursorAxis !== "none"; 7874 return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TooltipRootContext.Provider, { 7875 value: store2, 7876 children: [handle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopupHandleAttachment, { 7877 handle, 7878 store: store2 7879 }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipInteractions, { 7880 store: store2, 7881 disabled: disabled2, 7882 trackCursorAxis 7883 }), typeof children === "function" ? children({ 7884 payload 7885 }) : children] 7886 }); 7887 }); 7888 if (true) TooltipRoot.displayName = "TooltipRoot"; 7889 function TooltipInteractions({ 7890 store: store2, 7891 disabled: disabled2, 7892 trackCursorAxis 7893 }) { 7894 const floatingRootContext = store2.useState("floatingRootContext"); 7895 const dismiss = useDismiss(floatingRootContext, { 7896 enabled: !disabled2, 7897 referencePress: () => store2.select("closeOnClick") 7898 }); 7899 const clientPoint = useClientPoint(floatingRootContext, { 7900 enabled: !disabled2 && trackCursorAxis !== "none", 7901 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 7902 }); 7903 const triggerProps = React37.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); 7904 usePopupInteractionProps(store2, { 7905 activeTriggerProps: triggerProps, 7906 inactiveTriggerProps: triggerProps, 7907 popupProps: dismiss.floating ?? EMPTY_OBJECT 7908 }); 7909 return null; 7910 } 7911 7912 // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 7913 var React39 = __toESM(require_react(), 1); 7914 7915 // node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs 7916 var React38 = __toESM(require_react(), 1); 7917 var TooltipProviderContext = /* @__PURE__ */ React38.createContext(void 0); 7918 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 7919 function useTooltipProviderContext() { 7920 return React38.useContext(TooltipProviderContext); 7921 } 7922 7923 // node_modules/@base-ui/react/tooltip/utils/constants.mjs 7924 var OPEN_DELAY = 600; 7925 7926 // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 7927 var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger"; 7928 function getTargetElement(event) { 7929 if ("composedPath" in event) { 7930 const path = event.composedPath(); 7931 for (let i = 0; i < path.length; i += 1) { 7932 const element = path[i]; 7933 if (isElement(element)) { 7934 return element; 7935 } 7936 } 7937 } 7938 const target = event.target; 7939 if (isElement(target)) { 7940 return target; 7941 } 7942 return null; 7943 } 7944 function closestEnabledTooltipTrigger(element) { 7945 let current = element; 7946 while (current) { 7947 const trigger = current.closest(`[$TOOLTIP_TRIGGER_IDENTIFIER}]`); 7948 if (trigger) { 7949 return trigger; 7950 } 7951 const root = current.getRootNode(); 7952 current = "host" in root && isElement(root.host) ? root.host : null; 7953 } 7954 return null; 7955 } 7956 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 7957 const { 7958 render, 7959 className, 7960 style, 7961 handle, 7962 payload, 7963 disabled: disabledProp, 7964 delay, 7965 closeOnClick = true, 7966 closeDelay, 7967 id: idProp, 7968 ...elementProps 7969 } = componentProps; 7970 const rootContext = useTooltipRootContext(true); 7971 const handleStore = usePopupHandleStore(handle); 7972 const store2 = handleStore ?? rootContext; 7973 if (!store2) { 7974 throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82)); 7975 } 7976 const thisTriggerId = useBaseUiId(idProp); 7977 const isTriggerActive = store2.useState("isTriggerActive", thisTriggerId); 7978 const isOpenedByThisTrigger = store2.useState("isOpenedByTrigger", thisTriggerId); 7979 const floatingRootContext = store2.useState("floatingRootContext"); 7980 const triggerElementRef = React39.useRef(null); 7981 const delayWithDefault = delay ?? OPEN_DELAY; 7982 const closeDelayWithDefault = closeDelay ?? 0; 7983 const { 7984 registerTrigger, 7985 isMountedByThisTrigger 7986 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store2, { 7987 payload, 7988 closeOnClick, 7989 closeDelay: closeDelayWithDefault 7990 }); 7991 const providerDelay = useTooltipProviderContext(); 7992 const { 7993 delayRef, 7994 isInstantPhase, 7995 hasProvider 7996 } = useDelayGroup(floatingRootContext, { 7997 open: isOpenedByThisTrigger 7998 }); 7999 const hoverInteraction = useHoverInteractionSharedState(floatingRootContext); 8000 store2.useSyncedValue("isInstantPhase", isInstantPhase); 8001 const rootDisabled = store2.useState("disabled"); 8002 const disabled2 = disabledProp ?? rootDisabled; 8003 const disabledRef = useValueAsRef(disabled2); 8004 const trackCursorAxis = store2.useState("trackCursorAxis"); 8005 const disableHoverablePopup = store2.useState("disableHoverablePopup"); 8006 const isNestedTriggerHoveredRef = React39.useRef(false); 8007 const nestedTriggerOpenTimeout = useTimeout(); 8008 const pointerTypeRef = React39.useRef(void 0); 8009 function getOpenDelay() { 8010 if (!hasProvider) { 8011 return delayWithDefault; 8012 } 8013 return getDelay(delayRef.current, "open") === 0 ? 0 : delay ?? providerDelay ?? OPEN_DELAY; 8014 } 8015 function isEnabledNestedTriggerTarget(target) { 8016 const triggerEl = triggerElementRef.current; 8017 if (!triggerEl || !target) { 8018 return false; 8019 } 8020 const nearestTrigger = closestEnabledTooltipTrigger(target); 8021 return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger); 8022 } 8023 function detectNestedTriggerHover(target) { 8024 const nestedTriggerHovered = isEnabledNestedTriggerTarget(target); 8025 isNestedTriggerHoveredRef.current = nestedTriggerHovered; 8026 if (nestedTriggerHovered) { 8027 hoverInteraction.openChangeTimeout.clear(); 8028 hoverInteraction.restTimeout.clear(); 8029 hoverInteraction.restTimeoutPending = false; 8030 nestedTriggerOpenTimeout.clear(); 8031 } 8032 return nestedTriggerHovered; 8033 } 8034 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 8035 enabled: !disabled2, 8036 mouseOnly: true, 8037 move: false, 8038 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 8039 restMs: getOpenDelay, 8040 delay() { 8041 if (closeDelay == null && hasProvider) { 8042 return { 8043 close: getDelay(delayRef.current, "close") 8044 }; 8045 } 8046 return { 8047 close: closeDelayWithDefault 8048 }; 8049 }, 8050 triggerElementRef, 8051 isActiveTrigger: isTriggerActive, 8052 isClosing: () => store2.select("transitionStatus") === "ending", 8053 shouldOpen() { 8054 return !isNestedTriggerHoveredRef.current; 8055 } 8056 }); 8057 const focusProps = useFocus(floatingRootContext, { 8058 enabled: !disabled2 8059 }).reference; 8060 const handleNestedTriggerHover = (event) => { 8061 const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current; 8062 const target = getTargetElement(event); 8063 const nestedTriggerHovered = detectNestedTriggerHover(target); 8064 const triggerEl = triggerElementRef.current; 8065 const targetInsideTrigger = triggerEl && target && contains(triggerEl, target); 8066 if (nestedTriggerHovered && store2.select("open") && store2.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) { 8067 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 8068 return; 8069 } 8070 if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store2.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. 8071 isMouseLikePointerType(pointerTypeRef.current)) { 8072 const open = () => { 8073 if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store2.select("open")) { 8074 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); 8075 } 8076 }; 8077 const openDelay = getOpenDelay(); 8078 if (openDelay === 0) { 8079 nestedTriggerOpenTimeout.clear(); 8080 open(); 8081 } else { 8082 nestedTriggerOpenTimeout.start(openDelay, open); 8083 } 8084 } 8085 }; 8086 const rootTriggerProps = store2.useState("triggerProps", isMountedByThisTrigger); 8087 const shouldApplyRootTriggerProps = isMountedByThisTrigger || trackCursorAxis !== "none"; 8088 const state = { 8089 open: isOpenedByThisTrigger 8090 }; 8091 const element = useRenderElement("button", componentProps, { 8092 state, 8093 ref: [forwardedRef, registerTrigger, triggerElementRef], 8094 props: [hoverProps, focusProps, shouldApplyRootTriggerProps ? rootTriggerProps : void 0, { 8095 onMouseOver(event) { 8096 handleNestedTriggerHover(event.nativeEvent); 8097 }, 8098 onFocus(event) { 8099 if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) { 8100 event.preventBaseUIHandler(); 8101 } 8102 }, 8103 onMouseLeave() { 8104 isNestedTriggerHoveredRef.current = false; 8105 nestedTriggerOpenTimeout.clear(); 8106 pointerTypeRef.current = void 0; 8107 }, 8108 onPointerEnter(event) { 8109 pointerTypeRef.current = event.pointerType; 8110 }, 8111 onPointerDown(event) { 8112 pointerTypeRef.current = event.pointerType; 8113 store2.set("closeOnClick", closeOnClick); 8114 if (closeOnClick && !store2.select("open")) { 8115 store2.cancelPendingOpen(event.nativeEvent); 8116 } 8117 }, 8118 onClick(event) { 8119 if (closeOnClick && !store2.select("open")) { 8120 store2.cancelPendingOpen(event.nativeEvent); 8121 } 8122 }, 8123 id: thisTriggerId, 8124 "data-trigger-disabled": disabled2 ? "" : void 0, 8125 [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" 8126 }, elementProps], 8127 stateAttributesMapping: triggerOpenStateMapping 8128 }); 8129 return element; 8130 }); 8131 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 8132 8133 // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8134 var React41 = __toESM(require_react(), 1); 8135 8136 // node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs 8137 var React40 = __toESM(require_react(), 1); 8138 var TooltipPortalContext = /* @__PURE__ */ React40.createContext(void 0); 8139 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 8140 function useTooltipPortalContext() { 8141 const value = React40.useContext(TooltipPortalContext); 8142 if (value === void 0) { 8143 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 8144 } 8145 return value; 8146 } 8147 8148 // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8149 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 8150 var TooltipPortal = /* @__PURE__ */ React41.forwardRef(function TooltipPortal2(props, forwardedRef) { 8151 const { 8152 keepMounted = false, 8153 ...portalProps 8154 } = props; 8155 const store2 = useTooltipRootContext(); 8156 const mounted = store2.useState("mounted"); 8157 const shouldRender = mounted || keepMounted; 8158 if (!shouldRender) { 8159 return null; 8160 } 8161 return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPortalContext.Provider, { 8162 value: keepMounted, 8163 children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FloatingPortalLite, { 8164 ref: forwardedRef, 8165 ...portalProps 8166 }) 8167 }); 8168 }); 8169 if (true) TooltipPortal.displayName = "TooltipPortal"; 8170 8171 // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8172 var React43 = __toESM(require_react(), 1); 8173 8174 // node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs 8175 var React42 = __toESM(require_react(), 1); 8176 var TooltipPositionerContext = /* @__PURE__ */ React42.createContext(void 0); 8177 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 8178 function useTooltipPositionerContext() { 8179 const context = React42.useContext(TooltipPositionerContext); 8180 if (context === void 0) { 8181 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 8182 } 8183 return context; 8184 } 8185 8186 // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8187 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 8188 var TooltipPositioner = /* @__PURE__ */ React43.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 8189 const { 8190 render, 8191 className, 8192 anchor, 8193 positionMethod = "absolute", 8194 side = "top", 8195 align = "center", 8196 sideOffset = 0, 8197 alignOffset = 0, 8198 collisionBoundary = "clipping-ancestors", 8199 collisionPadding = 5, 8200 arrowPadding = 5, 8201 sticky = false, 8202 disableAnchorTracking = false, 8203 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 8204 style, 8205 ...elementProps 8206 } = componentProps; 8207 const store2 = useTooltipRootContext(); 8208 const keepMounted = useTooltipPortalContext(); 8209 const open = store2.useState("open"); 8210 const mounted = store2.useState("mounted"); 8211 const trackCursorAxis = store2.useState("trackCursorAxis"); 8212 const disableHoverablePopup = store2.useState("disableHoverablePopup"); 8213 const floatingRootContext = store2.useState("floatingRootContext"); 8214 const instantType = store2.useState("instantType"); 8215 const transitionStatus = store2.useState("transitionStatus"); 8216 const adaptiveOrigin2 = store2.useState("adaptiveOrigin"); 8217 const positioning = useAnchorPositioning({ 8218 anchor, 8219 positionMethod, 8220 floatingRootContext, 8221 mounted, 8222 side, 8223 sideOffset, 8224 align, 8225 alignOffset, 8226 collisionBoundary, 8227 collisionPadding, 8228 sticky, 8229 arrowPadding, 8230 disableAnchorTracking, 8231 keepMounted, 8232 collisionAvoidance, 8233 adaptiveOrigin: adaptiveOrigin2 8234 }); 8235 const state = React43.useMemo(() => ({ 8236 open, 8237 side: positioning.side, 8238 align: positioning.align, 8239 anchorHidden: positioning.anchorHidden, 8240 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 8241 }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 8242 const element = usePositioner(componentProps, state, { 8243 styles: positioning.positionerStyles, 8244 transitionStatus, 8245 props: elementProps, 8246 refs: [forwardedRef, store2.useStateSetter("positionerElement")], 8247 hidden: !mounted, 8248 inert: !open || trackCursorAxis === "both" || disableHoverablePopup 8249 }); 8250 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPositionerContext.Provider, { 8251 value: positioning, 8252 children: element 8253 }); 8254 }); 8255 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 8256 8257 // node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs 8258 var React44 = __toESM(require_react(), 1); 8259 var TooltipPopup = /* @__PURE__ */ React44.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 8260 const { 8261 render, 8262 className, 8263 style, 8264 ...elementProps 8265 } = componentProps; 8266 const store2 = useTooltipRootContext(); 8267 const { 8268 side, 8269 align 8270 } = useTooltipPositionerContext(); 8271 const open = store2.useState("open"); 8272 const instantType = store2.useState("instantType"); 8273 const transitionStatus = store2.useState("transitionStatus"); 8274 const popupProps = store2.useState("popupProps"); 8275 const floatingContext = store2.useState("floatingRootContext"); 8276 const disabled2 = store2.useState("disabled"); 8277 const closeDelay = store2.useState("closeDelay"); 8278 useOpenChangeComplete({ 8279 open, 8280 ref: store2.context.popupRef, 8281 onComplete() { 8282 if (open) { 8283 store2.context.onOpenChangeComplete?.(true); 8284 } 8285 } 8286 }); 8287 useHoverFloatingInteraction(floatingContext, { 8288 enabled: !disabled2, 8289 closeDelay 8290 }); 8291 const setPopupElement = store2.useStateSetter("popupElement"); 8292 const state = { 8293 open, 8294 side, 8295 align, 8296 instant: instantType, 8297 transitionStatus 8298 }; 8299 const element = useRenderElement("div", componentProps, { 8300 state, 8301 ref: [forwardedRef, store2.context.popupRef, setPopupElement], 8302 props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 8303 stateAttributesMapping: popupTransitionStateMapping 8304 }); 8305 return element; 8306 }); 8307 if (true) TooltipPopup.displayName = "TooltipPopup"; 8308 8309 // node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs 8310 var React45 = __toESM(require_react(), 1); 8311 var TooltipArrow = /* @__PURE__ */ React45.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 8312 const { 8313 render, 8314 className, 8315 style, 8316 ...elementProps 8317 } = componentProps; 8318 const store2 = useTooltipRootContext(); 8319 const { 8320 arrowRef, 8321 side, 8322 align, 8323 arrowUncentered, 8324 arrowStyles 8325 } = useTooltipPositionerContext(); 8326 const open = store2.useState("open"); 8327 const instantType = store2.useState("instantType"); 8328 const state = { 8329 open, 8330 side, 8331 align, 8332 uncentered: arrowUncentered, 8333 instant: instantType 8334 }; 8335 const element = useRenderElement("div", componentProps, { 8336 state, 8337 ref: [forwardedRef, arrowRef], 8338 props: [{ 8339 style: arrowStyles, 8340 "aria-hidden": true 8341 }, elementProps], 8342 stateAttributesMapping: popupStateMapping 8343 }); 8344 return element; 8345 }); 8346 if (true) TooltipArrow.displayName = "TooltipArrow"; 8347 8348 // node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs 8349 var React46 = __toESM(require_react(), 1); 8350 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 8351 var TooltipProvider = function TooltipProvider2(props) { 8352 const { 8353 delay, 8354 closeDelay, 8355 timeout = 400 8356 } = props; 8357 const delayValue = React46.useMemo(() => ({ 8358 open: delay, 8359 close: closeDelay 8360 }), [delay, closeDelay]); 8361 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProviderContext.Provider, { 8362 value: delay, 8363 children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FloatingDelayGroup, { 8364 delay: delayValue, 8365 timeoutMs: timeout, 8366 children: props.children 8367 }) 8368 }); 8369 }; 8370 if (true) TooltipProvider.displayName = "TooltipProvider"; 8371 8372 // node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs 8373 var React47 = __toESM(require_react(), 1); 8374 var TooltipViewport = /* @__PURE__ */ React47.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 8375 const { 8376 render, 8377 className, 8378 style, 8379 children, 8380 ...elementProps 8381 } = componentProps; 8382 const store2 = useTooltipRootContext(); 8383 const positioner = useTooltipPositionerContext(); 8384 const instantType = store2.useState("instantType"); 8385 const { 8386 children: childrenToRender, 8387 state: viewportState 8388 } = usePopupViewport({ 8389 store: store2, 8390 side: positioner.side, 8391 children 8392 }); 8393 const state = { 8394 activationDirection: viewportState.activationDirection, 8395 transitioning: viewportState.transitioning, 8396 instant: instantType 8397 }; 8398 return useRenderElement("div", componentProps, { 8399 state, 8400 ref: forwardedRef, 8401 props: [elementProps, { 8402 children: childrenToRender 8403 }], 8404 stateAttributesMapping: popupViewportStateMapping 8405 }); 8406 }); 8407 if (true) TooltipViewport.displayName = "TooltipViewport"; 8408 8409 // node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs 8410 var TooltipHandle = class extends BasePopupHandle { 8411 constructor() { 8412 super(createNullTooltipStore(), "Tooltip"); 8413 } 8414 /** 8415 * Opens the tooltip and associates it with the trigger with the given id. 8416 * 8417 * This method should only be called in an event handler or an effect (not during rendering). 8418 * 8419 * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching 8420 * `Tooltip.Trigger` with this handle passed as a prop. 8421 */ 8422 open(triggerId) { 8423 this.openByTrigger(triggerId); 8424 } 8425 /** 8426 * Closes the tooltip. 8427 * 8428 * This method should only be called in an event handler or an effect (not during rendering). 8429 */ 8430 close() { 8431 this.closePopup(); 8432 } 8433 /** 8434 * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle. 8435 */ 8436 get isOpen() { 8437 return this.attachedStore?.select("open") ?? false; 8438 } 8439 }; 8440 function createTooltipHandle() { 8441 return new TooltipHandle(); 8442 } 8443 8444 // node_modules/@base-ui/react/use-render/useRender.mjs 8445 function useRender(params) { 8446 return useRenderElement(params.defaultTagName ?? "div", params, params); 8447 } 8448 8449 // packages/ui/build-module/text/text.mjs 8450 var import_element10 = __toESM(require_element(), 1); 8451 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 8452 function getRuntime() { 8453 const globalScope = globalThis; 8454 if (globalScope.__wpStyleRuntime) { 8455 return globalScope.__wpStyleRuntime; 8456 } 8457 globalScope.__wpStyleRuntime = { 8458 documents: /* @__PURE__ */ new Map(), 8459 styles: /* @__PURE__ */ new Map(), 8460 injectedStyles: /* @__PURE__ */ new WeakMap() 8461 }; 8462 if (typeof document !== "undefined") { 8463 registerDocument(document); 8464 } 8465 return globalScope.__wpStyleRuntime; 8466 } 8467 function documentContainsStyleHash(targetDocument, hash) { 8468 if (!targetDocument.head) { 8469 return false; 8470 } 8471 for (const style of targetDocument.head.querySelectorAll( 8472 `style[$STYLE_HASH_ATTRIBUTE}]` 8473 )) { 8474 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 8475 return true; 8476 } 8477 } 8478 return false; 8479 } 8480 function injectStyle(targetDocument, hash, css) { 8481 if (!targetDocument.head) { 8482 return; 8483 } 8484 const runtime = getRuntime(); 8485 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8486 if (!injectedStyles) { 8487 injectedStyles = /* @__PURE__ */ new Set(); 8488 runtime.injectedStyles.set(targetDocument, injectedStyles); 8489 } 8490 if (injectedStyles.has(hash)) { 8491 return; 8492 } 8493 if (documentContainsStyleHash(targetDocument, hash)) { 8494 injectedStyles.add(hash); 8495 return; 8496 } 8497 const style = targetDocument.createElement("style"); 8498 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 8499 style.appendChild(targetDocument.createTextNode(css)); 8500 targetDocument.head.appendChild(style); 8501 injectedStyles.add(hash); 8502 } 8503 function registerDocument(targetDocument) { 8504 const runtime = getRuntime(); 8505 runtime.documents.set( 8506 targetDocument, 8507 (runtime.documents.get(targetDocument) ?? 0) + 1 8508 ); 8509 for (const [hash, css] of runtime.styles) { 8510 injectStyle(targetDocument, hash, css); 8511 } 8512 return () => { 8513 const count = runtime.documents.get(targetDocument); 8514 if (count === void 0) { 8515 return; 8516 } 8517 if (count <= 1) { 8518 runtime.documents.delete(targetDocument); 8519 return; 8520 } 8521 runtime.documents.set(targetDocument, count - 1); 8522 }; 8523 } 8524 function registerStyle(hash, css) { 8525 const runtime = getRuntime(); 8526 runtime.styles.set(hash, css); 8527 for (const targetDocument of runtime.documents.keys()) { 8528 injectStyle(targetDocument, hash, css); 8529 } 8530 } 8531 if (typeof process === "undefined" || true) { 8532 registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 8533 } 8534 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" }; 8535 if (typeof process === "undefined" || true) { 8536 registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 8537 } 8538 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 8539 var Text = (0, import_element10.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) { 8540 const element = useRender({ 8541 render, 8542 defaultTagName: "span", 8543 ref, 8544 props: mergeProps(props, { 8545 className: clsx_default( 8546 style_default.text, 8547 global_css_defense_default.heading, 8548 global_css_defense_default.p, 8549 style_default[variant], 8550 className 8551 ) 8552 }) 8553 }); 8554 return element; 8555 }); 8556 8557 // packages/ui/build-module/tooltip/index.mjs 8558 var tooltip_exports = {}; 8559 __export(tooltip_exports, { 8560 Popup: () => Popup, 8561 Portal: () => Portal, 8562 Positioner: () => Positioner, 8563 Provider: () => Provider, 8564 Root: () => Root, 8565 Trigger: () => Trigger 8566 }); 8567 8568 // packages/ui/build-module/tooltip/popup.mjs 8569 var import_element14 = __toESM(require_element(), 1); 8570 8571 // packages/ui/build-module/tooltip/portal.mjs 8572 var import_element11 = __toESM(require_element(), 1); 8573 8574 // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 8575 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 8576 function getRuntime2() { 8577 const globalScope = globalThis; 8578 if (globalScope.__wpStyleRuntime) { 8579 return globalScope.__wpStyleRuntime; 8580 } 8581 globalScope.__wpStyleRuntime = { 8582 documents: /* @__PURE__ */ new Map(), 8583 styles: /* @__PURE__ */ new Map(), 8584 injectedStyles: /* @__PURE__ */ new WeakMap() 8585 }; 8586 if (typeof document !== "undefined") { 8587 registerDocument2(document); 8588 } 8589 return globalScope.__wpStyleRuntime; 8590 } 8591 function documentContainsStyleHash2(targetDocument, hash) { 8592 if (!targetDocument.head) { 8593 return false; 8594 } 8595 for (const style of targetDocument.head.querySelectorAll( 8596 `style[$STYLE_HASH_ATTRIBUTE2}]` 8597 )) { 8598 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 8599 return true; 8600 } 8601 } 8602 return false; 8603 } 8604 function injectStyle2(targetDocument, hash, css) { 8605 if (!targetDocument.head) { 8606 return; 8607 } 8608 const runtime = getRuntime2(); 8609 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8610 if (!injectedStyles) { 8611 injectedStyles = /* @__PURE__ */ new Set(); 8612 runtime.injectedStyles.set(targetDocument, injectedStyles); 8613 } 8614 if (injectedStyles.has(hash)) { 8615 return; 8616 } 8617 if (documentContainsStyleHash2(targetDocument, hash)) { 8618 injectedStyles.add(hash); 8619 return; 8620 } 8621 const style = targetDocument.createElement("style"); 8622 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 8623 style.appendChild(targetDocument.createTextNode(css)); 8624 targetDocument.head.appendChild(style); 8625 injectedStyles.add(hash); 8626 } 8627 function registerDocument2(targetDocument) { 8628 const runtime = getRuntime2(); 8629 runtime.documents.set( 8630 targetDocument, 8631 (runtime.documents.get(targetDocument) ?? 0) + 1 8632 ); 8633 for (const [hash, css] of runtime.styles) { 8634 injectStyle2(targetDocument, hash, css); 8635 } 8636 return () => { 8637 const count = runtime.documents.get(targetDocument); 8638 if (count === void 0) { 8639 return; 8640 } 8641 if (count <= 1) { 8642 runtime.documents.delete(targetDocument); 8643 return; 8644 } 8645 runtime.documents.set(targetDocument, count - 1); 8646 }; 8647 } 8648 function registerStyle2(hash, css) { 8649 const runtime = getRuntime2(); 8650 runtime.styles.set(hash, css); 8651 for (const targetDocument of runtime.documents.keys()) { 8652 injectStyle2(targetDocument, hash, css); 8653 } 8654 } 8655 if (typeof process === "undefined" || true) { 8656 registerStyle2("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}"); 8657 } 8658 var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; 8659 var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; 8660 function resolveOwnerDocument() { 8661 return typeof document === "undefined" ? null : document; 8662 } 8663 function isInWordPressEnvironment() { 8664 let topWp; 8665 try { 8666 topWp = window.top?.wp; 8667 } catch { 8668 } 8669 const wp = topWp ?? window.wp; 8670 return typeof wp?.components === "object" && wp.components !== null; 8671 } 8672 var cachedSlot = null; 8673 function ensureSlotIsAccessible(element) { 8674 element.setAttribute("aria-hidden", "false"); 8675 return element; 8676 } 8677 function createSlot(ownerDocument2) { 8678 const element = ownerDocument2.createElement("div"); 8679 element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); 8680 if (wp_compat_overlay_slot_default.slot) { 8681 element.classList.add(wp_compat_overlay_slot_default.slot); 8682 } 8683 ownerDocument2.body.appendChild(element); 8684 return element; 8685 } 8686 function getWpCompatOverlaySlot() { 8687 if (typeof window === "undefined") { 8688 return void 0; 8689 } 8690 if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { 8691 return void 0; 8692 } 8693 const ownerDocument2 = resolveOwnerDocument(); 8694 if (!ownerDocument2 || !ownerDocument2.body) { 8695 return void 0; 8696 } 8697 if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { 8698 return ensureSlotIsAccessible(cachedSlot); 8699 } 8700 const existing = ownerDocument2.querySelector( 8701 `[$WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` 8702 ); 8703 if (existing instanceof HTMLDivElement) { 8704 cachedSlot = ensureSlotIsAccessible(existing); 8705 return cachedSlot; 8706 } 8707 if (cachedSlot?.isConnected) { 8708 cachedSlot.remove(); 8709 } 8710 cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); 8711 return cachedSlot; 8712 } 8713 8714 // packages/ui/build-module/tooltip/portal.mjs 8715 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 8716 var Portal = (0, import_element11.forwardRef)( 8717 function TooltipPortal3({ container, ...restProps }, ref) { 8718 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)( 8719 index_parts_exports.Portal, 8720 { 8721 container: container ?? getWpCompatOverlaySlot(), 8722 ...restProps, 8723 ref 8724 } 8725 ); 8726 } 8727 ); 8728 8729 // packages/ui/build-module/tooltip/positioner.mjs 8730 var import_element12 = __toESM(require_element(), 1); 8731 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 8732 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 8733 function getRuntime3() { 8734 const globalScope = globalThis; 8735 if (globalScope.__wpStyleRuntime) { 8736 return globalScope.__wpStyleRuntime; 8737 } 8738 globalScope.__wpStyleRuntime = { 8739 documents: /* @__PURE__ */ new Map(), 8740 styles: /* @__PURE__ */ new Map(), 8741 injectedStyles: /* @__PURE__ */ new WeakMap() 8742 }; 8743 if (typeof document !== "undefined") { 8744 registerDocument3(document); 8745 } 8746 return globalScope.__wpStyleRuntime; 8747 } 8748 function documentContainsStyleHash3(targetDocument, hash) { 8749 if (!targetDocument.head) { 8750 return false; 8751 } 8752 for (const style of targetDocument.head.querySelectorAll( 8753 `style[$STYLE_HASH_ATTRIBUTE3}]` 8754 )) { 8755 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 8756 return true; 8757 } 8758 } 8759 return false; 8760 } 8761 function injectStyle3(targetDocument, hash, css) { 8762 if (!targetDocument.head) { 8763 return; 8764 } 8765 const runtime = getRuntime3(); 8766 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8767 if (!injectedStyles) { 8768 injectedStyles = /* @__PURE__ */ new Set(); 8769 runtime.injectedStyles.set(targetDocument, injectedStyles); 8770 } 8771 if (injectedStyles.has(hash)) { 8772 return; 8773 } 8774 if (documentContainsStyleHash3(targetDocument, hash)) { 8775 injectedStyles.add(hash); 8776 return; 8777 } 8778 const style = targetDocument.createElement("style"); 8779 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 8780 style.appendChild(targetDocument.createTextNode(css)); 8781 targetDocument.head.appendChild(style); 8782 injectedStyles.add(hash); 8783 } 8784 function registerDocument3(targetDocument) { 8785 const runtime = getRuntime3(); 8786 runtime.documents.set( 8787 targetDocument, 8788 (runtime.documents.get(targetDocument) ?? 0) + 1 8789 ); 8790 for (const [hash, css] of runtime.styles) { 8791 injectStyle3(targetDocument, hash, css); 8792 } 8793 return () => { 8794 const count = runtime.documents.get(targetDocument); 8795 if (count === void 0) { 8796 return; 8797 } 8798 if (count <= 1) { 8799 runtime.documents.delete(targetDocument); 8800 return; 8801 } 8802 runtime.documents.set(targetDocument, count - 1); 8803 }; 8804 } 8805 function registerStyle3(hash, css) { 8806 const runtime = getRuntime3(); 8807 runtime.styles.set(hash, css); 8808 for (const targetDocument of runtime.documents.keys()) { 8809 injectStyle3(targetDocument, hash, css); 8810 } 8811 } 8812 if (typeof process === "undefined" || true) { 8813 registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 8814 } 8815 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 8816 if (typeof process === "undefined" || true) { 8817 registerStyle3("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 8818 } 8819 var style_default2 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 8820 var Positioner = (0, import_element12.forwardRef)( 8821 function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { 8822 return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( 8823 index_parts_exports.Positioner, 8824 { 8825 ref, 8826 align, 8827 side, 8828 sideOffset, 8829 ...props, 8830 className: clsx_default( 8831 resets_default["box-sizing"], 8832 style_default2.positioner, 8833 className 8834 ) 8835 } 8836 ); 8837 } 8838 ); 8839 8840 // packages/ui/build-module/utils/render-slot-with-children.mjs 8841 var import_element13 = __toESM(require_element(), 1); 8842 function renderSlotWithChildren(slot, defaultSlot, children) { 8843 return (0, import_element13.cloneElement)(slot ?? defaultSlot, { children }); 8844 } 8845 8846 // packages/ui/build-module/utils/theme-provider.mjs 8847 var theme = __toESM(require_theme(), 1); 8848 8849 // packages/ui/build-module/lock-unlock.mjs 8850 var import_private_apis = __toESM(require_private_apis(), 1); 8851 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 8852 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 8853 "@wordpress/ui" 8854 ); 8855 8856 // packages/ui/build-module/utils/theme-provider.mjs 8857 function getThemeProvider() { 8858 const themePackage = theme; 8859 if (themePackage.ThemeProvider) { 8860 return themePackage.ThemeProvider; 8861 } 8862 if (!themePackage.privateApis) { 8863 throw new Error( 8864 "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." 8865 ); 8866 } 8867 return unlock( 8868 themePackage.privateApis 8869 ).ThemeProvider; 8870 } 8871 var ThemeProvider = getThemeProvider(); 8872 8873 // packages/ui/build-module/tooltip/popup.mjs 8874 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 8875 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 8876 function getRuntime4() { 8877 const globalScope = globalThis; 8878 if (globalScope.__wpStyleRuntime) { 8879 return globalScope.__wpStyleRuntime; 8880 } 8881 globalScope.__wpStyleRuntime = { 8882 documents: /* @__PURE__ */ new Map(), 8883 styles: /* @__PURE__ */ new Map(), 8884 injectedStyles: /* @__PURE__ */ new WeakMap() 8885 }; 8886 if (typeof document !== "undefined") { 8887 registerDocument4(document); 8888 } 8889 return globalScope.__wpStyleRuntime; 8890 } 8891 function documentContainsStyleHash4(targetDocument, hash) { 8892 if (!targetDocument.head) { 8893 return false; 8894 } 8895 for (const style of targetDocument.head.querySelectorAll( 8896 `style[$STYLE_HASH_ATTRIBUTE4}]` 8897 )) { 8898 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 8899 return true; 8900 } 8901 } 8902 return false; 8903 } 8904 function injectStyle4(targetDocument, hash, css) { 8905 if (!targetDocument.head) { 8906 return; 8907 } 8908 const runtime = getRuntime4(); 8909 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8910 if (!injectedStyles) { 8911 injectedStyles = /* @__PURE__ */ new Set(); 8912 runtime.injectedStyles.set(targetDocument, injectedStyles); 8913 } 8914 if (injectedStyles.has(hash)) { 8915 return; 8916 } 8917 if (documentContainsStyleHash4(targetDocument, hash)) { 8918 injectedStyles.add(hash); 8919 return; 8920 } 8921 const style = targetDocument.createElement("style"); 8922 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 8923 style.appendChild(targetDocument.createTextNode(css)); 8924 targetDocument.head.appendChild(style); 8925 injectedStyles.add(hash); 8926 } 8927 function registerDocument4(targetDocument) { 8928 const runtime = getRuntime4(); 8929 runtime.documents.set( 8930 targetDocument, 8931 (runtime.documents.get(targetDocument) ?? 0) + 1 8932 ); 8933 for (const [hash, css] of runtime.styles) { 8934 injectStyle4(targetDocument, hash, css); 8935 } 8936 return () => { 8937 const count = runtime.documents.get(targetDocument); 8938 if (count === void 0) { 8939 return; 8940 } 8941 if (count <= 1) { 8942 runtime.documents.delete(targetDocument); 8943 return; 8944 } 8945 runtime.documents.set(targetDocument, count - 1); 8946 }; 8947 } 8948 function registerStyle4(hash, css) { 8949 const runtime = getRuntime4(); 8950 runtime.styles.set(hash, css); 8951 for (const targetDocument of runtime.documents.keys()) { 8952 injectStyle4(targetDocument, hash, css); 8953 } 8954 } 8955 if (typeof process === "undefined" || true) { 8956 registerStyle4("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 8957 } 8958 var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 8959 var POPUP_COLOR = { background: "#1e1e1e" }; 8960 var Popup = (0, import_element14.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { 8961 const popupContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( 8962 index_parts_exports.Popup, 8963 { 8964 ref, 8965 className: clsx_default(style_default3.popup, className), 8966 ...props, 8967 children 8968 } 8969 ) }); 8970 const positionedPopup = renderSlotWithChildren( 8971 positioner, 8972 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Positioner, {}), 8973 popupContent 8974 ); 8975 return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Portal, {}), positionedPopup); 8976 }); 8977 8978 // packages/ui/build-module/tooltip/trigger.mjs 8979 var import_element15 = __toESM(require_element(), 1); 8980 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 8981 var Trigger = (0, import_element15.forwardRef)( 8982 function TooltipTrigger3(props, ref) { 8983 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(index_parts_exports.Trigger, { ref, ...props }); 8984 } 8985 ); 8986 8987 // packages/ui/build-module/utils/direction-provider.mjs 8988 var import_i18n = __toESM(require_i18n(), 1); 8989 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 8990 function DirectionProvider3({ children }) { 8991 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DirectionProvider, { direction: (0, import_i18n.isRTL)() ? "rtl" : "ltr", children }); 8992 } 8993 8994 // packages/ui/build-module/tooltip/root.mjs 8995 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 8996 function Root(props) { 8997 return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(index_parts_exports.Root, { ...props }) }); 8998 } 8999 9000 // packages/ui/build-module/tooltip/provider.mjs 9001 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 9002 function Provider({ ...props }) { 9003 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Provider, { ...props }); 9004 } 9005 9006 // packages/ui/build-module/link/link.mjs 9007 var import_element16 = __toESM(require_element(), 1); 9008 var import_i18n2 = __toESM(require_i18n(), 1); 9009 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 9010 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 9011 function getRuntime5() { 9012 const globalScope = globalThis; 9013 if (globalScope.__wpStyleRuntime) { 9014 return globalScope.__wpStyleRuntime; 9015 } 9016 globalScope.__wpStyleRuntime = { 9017 documents: /* @__PURE__ */ new Map(), 9018 styles: /* @__PURE__ */ new Map(), 9019 injectedStyles: /* @__PURE__ */ new WeakMap() 9020 }; 9021 if (typeof document !== "undefined") { 9022 registerDocument5(document); 9023 } 9024 return globalScope.__wpStyleRuntime; 9025 } 9026 function documentContainsStyleHash5(targetDocument, hash) { 9027 if (!targetDocument.head) { 9028 return false; 9029 } 9030 for (const style of targetDocument.head.querySelectorAll( 9031 `style[$STYLE_HASH_ATTRIBUTE5}]` 9032 )) { 9033 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 9034 return true; 9035 } 9036 } 9037 return false; 9038 } 9039 function injectStyle5(targetDocument, hash, css) { 9040 if (!targetDocument.head) { 9041 return; 9042 } 9043 const runtime = getRuntime5(); 9044 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9045 if (!injectedStyles) { 9046 injectedStyles = /* @__PURE__ */ new Set(); 9047 runtime.injectedStyles.set(targetDocument, injectedStyles); 9048 } 9049 if (injectedStyles.has(hash)) { 9050 return; 9051 } 9052 if (documentContainsStyleHash5(targetDocument, hash)) { 9053 injectedStyles.add(hash); 9054 return; 9055 } 9056 const style = targetDocument.createElement("style"); 9057 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 9058 style.appendChild(targetDocument.createTextNode(css)); 9059 targetDocument.head.appendChild(style); 9060 injectedStyles.add(hash); 9061 } 9062 function registerDocument5(targetDocument) { 9063 const runtime = getRuntime5(); 9064 runtime.documents.set( 9065 targetDocument, 9066 (runtime.documents.get(targetDocument) ?? 0) + 1 9067 ); 9068 for (const [hash, css] of runtime.styles) { 9069 injectStyle5(targetDocument, hash, css); 9070 } 9071 return () => { 9072 const count = runtime.documents.get(targetDocument); 9073 if (count === void 0) { 9074 return; 9075 } 9076 if (count <= 1) { 9077 runtime.documents.delete(targetDocument); 9078 return; 9079 } 9080 runtime.documents.set(targetDocument, count - 1); 9081 }; 9082 } 9083 function registerStyle5(hash, css) { 9084 const runtime = getRuntime5(); 9085 runtime.styles.set(hash, css); 9086 for (const targetDocument of runtime.documents.keys()) { 9087 injectStyle5(targetDocument, hash, css); 9088 } 9089 } 9090 if (typeof process === "undefined" || true) { 9091 registerStyle5("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9092 } 9093 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 9094 if (typeof process === "undefined" || true) { 9095 registerStyle5("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 9096 } 9097 var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 9098 if (typeof process === "undefined" || true) { 9099 registerStyle5("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}'); 9100 } 9101 var style_default4 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" }; 9102 if (typeof process === "undefined" || true) { 9103 registerStyle5("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 9104 } 9105 var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 9106 var Link = (0, import_element16.forwardRef)(function Link2({ 9107 children, 9108 variant = "default", 9109 tone = "brand", 9110 openInNewTab = false, 9111 target, 9112 render, 9113 className, 9114 ...props 9115 }, ref) { 9116 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 9117 const element = useRender({ 9118 render, 9119 defaultTagName: "a", 9120 ref, 9121 props: mergeProps(props, { 9122 className: clsx_default( 9123 global_css_defense_default2.a, 9124 resets_default2["box-sizing"], 9125 focus_module_default["outset-ring--focus-except-active"], 9126 variant !== "unstyled" && style_default4.link, 9127 variant !== "unstyled" && style_default4[`is-$tone}`], 9128 variant === "unstyled" && style_default4["is-unstyled"], 9129 className 9130 ), 9131 target: target ?? (openInNewTab ? "_blank" : void 0), 9132 children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [ 9133 children, 9134 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( 9135 "span", 9136 { 9137 className: style_default4["link-icon"], 9138 role: "img", 9139 "aria-label": ( 9140 /* translators: accessibility text appended to link text */ 9141 (0, import_i18n2.__)("(opens in a new tab)") 9142 ) 9143 } 9144 ) 9145 ] }) 9146 }) 9147 }); 9148 return element; 9149 }); 9150 9151 // packages/icons/build-module/library/caution.mjs 9152 var import_primitives = __toESM(require_primitives(), 1); 9153 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 9154 var caution_default = /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(import_primitives.Path, { d: "M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); 9155 9156 // packages/icons/build-module/library/check.mjs 9157 var import_primitives2 = __toESM(require_primitives(), 1); 9158 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 9159 var check_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives2.Path, { d: "M7 12L10 15L17 8", vectorEffect: "non-scaling-stroke" }) }); 9160 9161 // packages/icons/build-module/library/chevron-down-small.mjs 9162 var import_primitives3 = __toESM(require_primitives(), 1); 9163 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 9164 var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives3.Path, { d: "M8.5 10.5L12 13.5L15.5 10.5", vectorEffect: "non-scaling-stroke" }) }); 9165 9166 // packages/icons/build-module/library/chevron-left-small.mjs 9167 var import_primitives4 = __toESM(require_primitives(), 1); 9168 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 9169 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsx)(import_primitives4.Path, { d: "M13.5 8.5L10.5 12L13.5 15.5", vectorEffect: "non-scaling-stroke" }) }); 9170 9171 // packages/icons/build-module/library/chevron-left.mjs 9172 var import_primitives5 = __toESM(require_primitives(), 1); 9173 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 9174 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsx)(import_primitives5.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) }); 9175 9176 // packages/icons/build-module/library/chevron-right-small.mjs 9177 var import_primitives6 = __toESM(require_primitives(), 1); 9178 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 9179 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime25.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_runtime25.jsx)(import_primitives6.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5", vectorEffect: "non-scaling-stroke" }) }); 9180 9181 // packages/icons/build-module/library/chevron-right.mjs 9182 var import_primitives7 = __toESM(require_primitives(), 1); 9183 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 9184 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime26.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_runtime26.jsx)(import_primitives7.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) }); 9185 9186 // packages/icons/build-module/library/menu.mjs 9187 var import_primitives8 = __toESM(require_primitives(), 1); 9188 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 9189 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime27.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_runtime27.jsx)(import_primitives8.Path, { d: "M5 12H19M5 18.25H19M5 5.75H19", vectorEffect: "non-scaling-stroke" }) }); 9190 9191 // packages/ui/build-module/icon/icon.mjs 9192 var import_element17 = __toESM(require_element(), 1); 9193 var import_primitives9 = __toESM(require_primitives(), 1); 9194 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 9195 var Icon = (0, import_element17.forwardRef)(function Icon2({ icon, size: size4 = 24, style, ...restProps }, ref) { 9196 const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; 9197 return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( 9198 import_primitives9.SVG, 9199 { 9200 ref, 9201 ...icon.props, 9202 ...restProps, 9203 ...mergedStyle ? { style: mergedStyle } : {}, 9204 width: size4, 9205 height: size4 9206 } 9207 ); 9208 }); 9209 9210 // packages/ui/build-module/utils/keyboard-shortcut.mjs 9211 var import_element19 = __toESM(require_element(), 1); 9212 var import_i18n3 = __toESM(require_i18n(), 1); 9213 9214 // packages/ui/build-module/visually-hidden/visually-hidden.mjs 9215 var import_element18 = __toESM(require_element(), 1); 9216 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 9217 function getRuntime6() { 9218 const globalScope = globalThis; 9219 if (globalScope.__wpStyleRuntime) { 9220 return globalScope.__wpStyleRuntime; 9221 } 9222 globalScope.__wpStyleRuntime = { 9223 documents: /* @__PURE__ */ new Map(), 9224 styles: /* @__PURE__ */ new Map(), 9225 injectedStyles: /* @__PURE__ */ new WeakMap() 9226 }; 9227 if (typeof document !== "undefined") { 9228 registerDocument6(document); 9229 } 9230 return globalScope.__wpStyleRuntime; 9231 } 9232 function documentContainsStyleHash6(targetDocument, hash) { 9233 if (!targetDocument.head) { 9234 return false; 9235 } 9236 for (const style of targetDocument.head.querySelectorAll( 9237 `style[$STYLE_HASH_ATTRIBUTE6}]` 9238 )) { 9239 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 9240 return true; 9241 } 9242 } 9243 return false; 9244 } 9245 function injectStyle6(targetDocument, hash, css) { 9246 if (!targetDocument.head) { 9247 return; 9248 } 9249 const runtime = getRuntime6(); 9250 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9251 if (!injectedStyles) { 9252 injectedStyles = /* @__PURE__ */ new Set(); 9253 runtime.injectedStyles.set(targetDocument, injectedStyles); 9254 } 9255 if (injectedStyles.has(hash)) { 9256 return; 9257 } 9258 if (documentContainsStyleHash6(targetDocument, hash)) { 9259 injectedStyles.add(hash); 9260 return; 9261 } 9262 const style = targetDocument.createElement("style"); 9263 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 9264 style.appendChild(targetDocument.createTextNode(css)); 9265 targetDocument.head.appendChild(style); 9266 injectedStyles.add(hash); 9267 } 9268 function registerDocument6(targetDocument) { 9269 const runtime = getRuntime6(); 9270 runtime.documents.set( 9271 targetDocument, 9272 (runtime.documents.get(targetDocument) ?? 0) + 1 9273 ); 9274 for (const [hash, css] of runtime.styles) { 9275 injectStyle6(targetDocument, hash, css); 9276 } 9277 return () => { 9278 const count = runtime.documents.get(targetDocument); 9279 if (count === void 0) { 9280 return; 9281 } 9282 if (count <= 1) { 9283 runtime.documents.delete(targetDocument); 9284 return; 9285 } 9286 runtime.documents.set(targetDocument, count - 1); 9287 }; 9288 } 9289 function registerStyle6(hash, css) { 9290 const runtime = getRuntime6(); 9291 runtime.styles.set(hash, css); 9292 for (const targetDocument of runtime.documents.keys()) { 9293 injectStyle6(targetDocument, hash, css); 9294 } 9295 } 9296 if (typeof process === "undefined" || true) { 9297 registerStyle6("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}}}"); 9298 } 9299 var style_default5 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; 9300 var VisuallyHidden = (0, import_element18.forwardRef)( 9301 function VisuallyHidden2({ render, ...restProps }, ref) { 9302 const element = useRender({ 9303 render, 9304 ref, 9305 props: mergeProps( 9306 { className: style_default5["visually-hidden"] }, 9307 restProps, 9308 { 9309 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. 9310 "data-visually-hidden": "" 9311 } 9312 ) 9313 }); 9314 return element; 9315 } 9316 ); 9317 9318 // packages/ui/build-module/utils/keyboard-shortcut.mjs 9319 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 9320 function useKeyboardShortcutProps({ 9321 "aria-describedby": ariaDescribedBy, 9322 "aria-keyshortcuts": ariaKeyShortcuts, 9323 shortcut 9324 }) { 9325 const generatedDescriptionId = (0, import_element19.useId)(); 9326 const descriptionId = shortcut ? generatedDescriptionId : void 0; 9327 const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" "); 9328 return { 9329 descriptionId, 9330 targetProps: { 9331 "aria-describedby": describedBy || void 0, 9332 "aria-keyshortcuts": shortcut?.ariaKeyShortcut ?? ariaKeyShortcuts 9333 } 9334 }; 9335 } 9336 var KeyboardShortcutDescription = (0, import_element19.forwardRef)(function KeyboardShortcutDescription2({ descriptionId, shortcut }, ref) { 9337 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( 9338 VisuallyHidden, 9339 { 9340 id: descriptionId, 9341 "aria-hidden": "true", 9342 render: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { ref }), 9343 children: (0, import_i18n3.sprintf)( 9344 /* translators: %s: keyboard shortcut. */ 9345 (0, import_i18n3.__)("Keyboard shortcut: %s"), 9346 shortcut.label ?? shortcut.ariaKeyShortcut 9347 ) 9348 } 9349 ); 9350 }); 9351 var KeyboardShortcutDisplay = (0, import_element19.forwardRef)(function KeyboardShortcutDisplay2({ className, shortcut }, ref) { 9352 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { ref, "aria-hidden": "true", className, dir: "ltr", children: shortcut.displayShortcut }); 9353 }); 9354 9355 // packages/ui/build-module/stack/stack.mjs 9356 var import_element20 = __toESM(require_element(), 1); 9357 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 9358 function getRuntime7() { 9359 const globalScope = globalThis; 9360 if (globalScope.__wpStyleRuntime) { 9361 return globalScope.__wpStyleRuntime; 9362 } 9363 globalScope.__wpStyleRuntime = { 9364 documents: /* @__PURE__ */ new Map(), 9365 styles: /* @__PURE__ */ new Map(), 9366 injectedStyles: /* @__PURE__ */ new WeakMap() 9367 }; 9368 if (typeof document !== "undefined") { 9369 registerDocument7(document); 9370 } 9371 return globalScope.__wpStyleRuntime; 9372 } 9373 function documentContainsStyleHash7(targetDocument, hash) { 9374 if (!targetDocument.head) { 9375 return false; 9376 } 9377 for (const style of targetDocument.head.querySelectorAll( 9378 `style[$STYLE_HASH_ATTRIBUTE7}]` 9379 )) { 9380 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 9381 return true; 9382 } 9383 } 9384 return false; 9385 } 9386 function injectStyle7(targetDocument, hash, css) { 9387 if (!targetDocument.head) { 9388 return; 9389 } 9390 const runtime = getRuntime7(); 9391 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9392 if (!injectedStyles) { 9393 injectedStyles = /* @__PURE__ */ new Set(); 9394 runtime.injectedStyles.set(targetDocument, injectedStyles); 9395 } 9396 if (injectedStyles.has(hash)) { 9397 return; 9398 } 9399 if (documentContainsStyleHash7(targetDocument, hash)) { 9400 injectedStyles.add(hash); 9401 return; 9402 } 9403 const style = targetDocument.createElement("style"); 9404 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 9405 style.appendChild(targetDocument.createTextNode(css)); 9406 targetDocument.head.appendChild(style); 9407 injectedStyles.add(hash); 9408 } 9409 function registerDocument7(targetDocument) { 9410 const runtime = getRuntime7(); 9411 runtime.documents.set( 9412 targetDocument, 9413 (runtime.documents.get(targetDocument) ?? 0) + 1 9414 ); 9415 for (const [hash, css] of runtime.styles) { 9416 injectStyle7(targetDocument, hash, css); 9417 } 9418 return () => { 9419 const count = runtime.documents.get(targetDocument); 9420 if (count === void 0) { 9421 return; 9422 } 9423 if (count <= 1) { 9424 runtime.documents.delete(targetDocument); 9425 return; 9426 } 9427 runtime.documents.set(targetDocument, count - 1); 9428 }; 9429 } 9430 function registerStyle7(hash, css) { 9431 const runtime = getRuntime7(); 9432 runtime.styles.set(hash, css); 9433 for (const targetDocument of runtime.documents.keys()) { 9434 injectStyle7(targetDocument, hash, css); 9435 } 9436 } 9437 if (typeof process === "undefined" || true) { 9438 registerStyle7("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 9439 } 9440 var style_default6 = { "stack": "_19ce0419607e1896__stack" }; 9441 var gapTokens = { 9442 xs: "var(--wpds-dimension-gap-xs, 4px)", 9443 sm: "var(--wpds-dimension-gap-sm, 8px)", 9444 md: "var(--wpds-dimension-gap-md, 12px)", 9445 lg: "var(--wpds-dimension-gap-lg, 16px)", 9446 xl: "var(--wpds-dimension-gap-xl, 24px)", 9447 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 9448 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 9449 }; 9450 var Stack = (0, import_element20.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { 9451 const style = { 9452 gap: gap && gapTokens[gap], 9453 alignItems: align, 9454 justifyContent: justify, 9455 flexDirection: direction, 9456 flexWrap: wrap 9457 }; 9458 const element = useRender({ 9459 render, 9460 ref, 9461 props: mergeProps(props, { style, className: style_default6.stack }) 9462 }); 9463 return element; 9464 }); 9465 9466 // packages/ui/build-module/empty-state/index.mjs 9467 var empty_state_exports = {}; 9468 __export(empty_state_exports, { 9469 Actions: () => Actions, 9470 Description: () => Description, 9471 Icon: () => Icon3, 9472 Root: () => Root2, 9473 Title: () => Title, 9474 Visual: () => Visual 9475 }); 9476 9477 // packages/ui/build-module/empty-state/root.mjs 9478 var import_element21 = __toESM(require_element(), 1); 9479 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 9480 function getRuntime8() { 9481 const globalScope = globalThis; 9482 if (globalScope.__wpStyleRuntime) { 9483 return globalScope.__wpStyleRuntime; 9484 } 9485 globalScope.__wpStyleRuntime = { 9486 documents: /* @__PURE__ */ new Map(), 9487 styles: /* @__PURE__ */ new Map(), 9488 injectedStyles: /* @__PURE__ */ new WeakMap() 9489 }; 9490 if (typeof document !== "undefined") { 9491 registerDocument8(document); 9492 } 9493 return globalScope.__wpStyleRuntime; 9494 } 9495 function documentContainsStyleHash8(targetDocument, hash) { 9496 if (!targetDocument.head) { 9497 return false; 9498 } 9499 for (const style of targetDocument.head.querySelectorAll( 9500 `style[$STYLE_HASH_ATTRIBUTE8}]` 9501 )) { 9502 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 9503 return true; 9504 } 9505 } 9506 return false; 9507 } 9508 function injectStyle8(targetDocument, hash, css) { 9509 if (!targetDocument.head) { 9510 return; 9511 } 9512 const runtime = getRuntime8(); 9513 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9514 if (!injectedStyles) { 9515 injectedStyles = /* @__PURE__ */ new Set(); 9516 runtime.injectedStyles.set(targetDocument, injectedStyles); 9517 } 9518 if (injectedStyles.has(hash)) { 9519 return; 9520 } 9521 if (documentContainsStyleHash8(targetDocument, hash)) { 9522 injectedStyles.add(hash); 9523 return; 9524 } 9525 const style = targetDocument.createElement("style"); 9526 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 9527 style.appendChild(targetDocument.createTextNode(css)); 9528 targetDocument.head.appendChild(style); 9529 injectedStyles.add(hash); 9530 } 9531 function registerDocument8(targetDocument) { 9532 const runtime = getRuntime8(); 9533 runtime.documents.set( 9534 targetDocument, 9535 (runtime.documents.get(targetDocument) ?? 0) + 1 9536 ); 9537 for (const [hash, css] of runtime.styles) { 9538 injectStyle8(targetDocument, hash, css); 9539 } 9540 return () => { 9541 const count = runtime.documents.get(targetDocument); 9542 if (count === void 0) { 9543 return; 9544 } 9545 if (count <= 1) { 9546 runtime.documents.delete(targetDocument); 9547 return; 9548 } 9549 runtime.documents.set(targetDocument, count - 1); 9550 }; 9551 } 9552 function registerStyle8(hash, css) { 9553 const runtime = getRuntime8(); 9554 runtime.styles.set(hash, css); 9555 for (const targetDocument of runtime.documents.keys()) { 9556 injectStyle8(targetDocument, hash, css); 9557 } 9558 } 9559 if (typeof process === "undefined" || true) { 9560 registerStyle8("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9561 } 9562 var style_default7 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9563 var Root2 = (0, import_element21.forwardRef)( 9564 function EmptyStateRoot({ render, ...props }, ref) { 9565 const className = clsx_default(style_default7.root); 9566 const element = useRender({ 9567 defaultTagName: "div", 9568 render, 9569 ref, 9570 props: mergeProps({ className }, props) 9571 }); 9572 return element; 9573 } 9574 ); 9575 9576 // packages/ui/build-module/empty-state/visual.mjs 9577 var import_element22 = __toESM(require_element(), 1); 9578 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 9579 function getRuntime9() { 9580 const globalScope = globalThis; 9581 if (globalScope.__wpStyleRuntime) { 9582 return globalScope.__wpStyleRuntime; 9583 } 9584 globalScope.__wpStyleRuntime = { 9585 documents: /* @__PURE__ */ new Map(), 9586 styles: /* @__PURE__ */ new Map(), 9587 injectedStyles: /* @__PURE__ */ new WeakMap() 9588 }; 9589 if (typeof document !== "undefined") { 9590 registerDocument9(document); 9591 } 9592 return globalScope.__wpStyleRuntime; 9593 } 9594 function documentContainsStyleHash9(targetDocument, hash) { 9595 if (!targetDocument.head) { 9596 return false; 9597 } 9598 for (const style of targetDocument.head.querySelectorAll( 9599 `style[$STYLE_HASH_ATTRIBUTE9}]` 9600 )) { 9601 if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 9602 return true; 9603 } 9604 } 9605 return false; 9606 } 9607 function injectStyle9(targetDocument, hash, css) { 9608 if (!targetDocument.head) { 9609 return; 9610 } 9611 const runtime = getRuntime9(); 9612 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9613 if (!injectedStyles) { 9614 injectedStyles = /* @__PURE__ */ new Set(); 9615 runtime.injectedStyles.set(targetDocument, injectedStyles); 9616 } 9617 if (injectedStyles.has(hash)) { 9618 return; 9619 } 9620 if (documentContainsStyleHash9(targetDocument, hash)) { 9621 injectedStyles.add(hash); 9622 return; 9623 } 9624 const style = targetDocument.createElement("style"); 9625 style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 9626 style.appendChild(targetDocument.createTextNode(css)); 9627 targetDocument.head.appendChild(style); 9628 injectedStyles.add(hash); 9629 } 9630 function registerDocument9(targetDocument) { 9631 const runtime = getRuntime9(); 9632 runtime.documents.set( 9633 targetDocument, 9634 (runtime.documents.get(targetDocument) ?? 0) + 1 9635 ); 9636 for (const [hash, css] of runtime.styles) { 9637 injectStyle9(targetDocument, hash, css); 9638 } 9639 return () => { 9640 const count = runtime.documents.get(targetDocument); 9641 if (count === void 0) { 9642 return; 9643 } 9644 if (count <= 1) { 9645 runtime.documents.delete(targetDocument); 9646 return; 9647 } 9648 runtime.documents.set(targetDocument, count - 1); 9649 }; 9650 } 9651 function registerStyle9(hash, css) { 9652 const runtime = getRuntime9(); 9653 runtime.styles.set(hash, css); 9654 for (const targetDocument of runtime.documents.keys()) { 9655 injectStyle9(targetDocument, hash, css); 9656 } 9657 } 9658 if (typeof process === "undefined" || true) { 9659 registerStyle9("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9660 } 9661 var style_default8 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9662 var Visual = (0, import_element22.forwardRef)( 9663 function EmptyStateVisual({ render, ...props }, ref) { 9664 const className = clsx_default(style_default8.visual); 9665 const element = useRender({ 9666 defaultTagName: "div", 9667 render, 9668 ref, 9669 props: mergeProps({ className }, props) 9670 }); 9671 return element; 9672 } 9673 ); 9674 9675 // packages/ui/build-module/empty-state/icon.mjs 9676 var import_element23 = __toESM(require_element(), 1); 9677 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 9678 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 9679 function getRuntime10() { 9680 const globalScope = globalThis; 9681 if (globalScope.__wpStyleRuntime) { 9682 return globalScope.__wpStyleRuntime; 9683 } 9684 globalScope.__wpStyleRuntime = { 9685 documents: /* @__PURE__ */ new Map(), 9686 styles: /* @__PURE__ */ new Map(), 9687 injectedStyles: /* @__PURE__ */ new WeakMap() 9688 }; 9689 if (typeof document !== "undefined") { 9690 registerDocument10(document); 9691 } 9692 return globalScope.__wpStyleRuntime; 9693 } 9694 function documentContainsStyleHash10(targetDocument, hash) { 9695 if (!targetDocument.head) { 9696 return false; 9697 } 9698 for (const style of targetDocument.head.querySelectorAll( 9699 `style[$STYLE_HASH_ATTRIBUTE10}]` 9700 )) { 9701 if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 9702 return true; 9703 } 9704 } 9705 return false; 9706 } 9707 function injectStyle10(targetDocument, hash, css) { 9708 if (!targetDocument.head) { 9709 return; 9710 } 9711 const runtime = getRuntime10(); 9712 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9713 if (!injectedStyles) { 9714 injectedStyles = /* @__PURE__ */ new Set(); 9715 runtime.injectedStyles.set(targetDocument, injectedStyles); 9716 } 9717 if (injectedStyles.has(hash)) { 9718 return; 9719 } 9720 if (documentContainsStyleHash10(targetDocument, hash)) { 9721 injectedStyles.add(hash); 9722 return; 9723 } 9724 const style = targetDocument.createElement("style"); 9725 style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 9726 style.appendChild(targetDocument.createTextNode(css)); 9727 targetDocument.head.appendChild(style); 9728 injectedStyles.add(hash); 9729 } 9730 function registerDocument10(targetDocument) { 9731 const runtime = getRuntime10(); 9732 runtime.documents.set( 9733 targetDocument, 9734 (runtime.documents.get(targetDocument) ?? 0) + 1 9735 ); 9736 for (const [hash, css] of runtime.styles) { 9737 injectStyle10(targetDocument, hash, css); 9738 } 9739 return () => { 9740 const count = runtime.documents.get(targetDocument); 9741 if (count === void 0) { 9742 return; 9743 } 9744 if (count <= 1) { 9745 runtime.documents.delete(targetDocument); 9746 return; 9747 } 9748 runtime.documents.set(targetDocument, count - 1); 9749 }; 9750 } 9751 function registerStyle10(hash, css) { 9752 const runtime = getRuntime10(); 9753 runtime.styles.set(hash, css); 9754 for (const targetDocument of runtime.documents.keys()) { 9755 injectStyle10(targetDocument, hash, css); 9756 } 9757 } 9758 if (typeof process === "undefined" || true) { 9759 registerStyle10("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9760 } 9761 var style_default9 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9762 var Icon3 = (0, import_element23.forwardRef)( 9763 function EmptyStateIcon({ icon, className, ...restProps }, ref) { 9764 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( 9765 Visual, 9766 { 9767 ref, 9768 className: clsx_default(style_default9.icon, className), 9769 ...restProps, 9770 children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { icon }) 9771 } 9772 ); 9773 } 9774 ); 9775 9776 // packages/ui/build-module/empty-state/title.mjs 9777 var import_element24 = __toESM(require_element(), 1); 9778 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 9779 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 9780 function getRuntime11() { 9781 const globalScope = globalThis; 9782 if (globalScope.__wpStyleRuntime) { 9783 return globalScope.__wpStyleRuntime; 9784 } 9785 globalScope.__wpStyleRuntime = { 9786 documents: /* @__PURE__ */ new Map(), 9787 styles: /* @__PURE__ */ new Map(), 9788 injectedStyles: /* @__PURE__ */ new WeakMap() 9789 }; 9790 if (typeof document !== "undefined") { 9791 registerDocument11(document); 9792 } 9793 return globalScope.__wpStyleRuntime; 9794 } 9795 function documentContainsStyleHash11(targetDocument, hash) { 9796 if (!targetDocument.head) { 9797 return false; 9798 } 9799 for (const style of targetDocument.head.querySelectorAll( 9800 `style[$STYLE_HASH_ATTRIBUTE11}]` 9801 )) { 9802 if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 9803 return true; 9804 } 9805 } 9806 return false; 9807 } 9808 function injectStyle11(targetDocument, hash, css) { 9809 if (!targetDocument.head) { 9810 return; 9811 } 9812 const runtime = getRuntime11(); 9813 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9814 if (!injectedStyles) { 9815 injectedStyles = /* @__PURE__ */ new Set(); 9816 runtime.injectedStyles.set(targetDocument, injectedStyles); 9817 } 9818 if (injectedStyles.has(hash)) { 9819 return; 9820 } 9821 if (documentContainsStyleHash11(targetDocument, hash)) { 9822 injectedStyles.add(hash); 9823 return; 9824 } 9825 const style = targetDocument.createElement("style"); 9826 style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 9827 style.appendChild(targetDocument.createTextNode(css)); 9828 targetDocument.head.appendChild(style); 9829 injectedStyles.add(hash); 9830 } 9831 function registerDocument11(targetDocument) { 9832 const runtime = getRuntime11(); 9833 runtime.documents.set( 9834 targetDocument, 9835 (runtime.documents.get(targetDocument) ?? 0) + 1 9836 ); 9837 for (const [hash, css] of runtime.styles) { 9838 injectStyle11(targetDocument, hash, css); 9839 } 9840 return () => { 9841 const count = runtime.documents.get(targetDocument); 9842 if (count === void 0) { 9843 return; 9844 } 9845 if (count <= 1) { 9846 runtime.documents.delete(targetDocument); 9847 return; 9848 } 9849 runtime.documents.set(targetDocument, count - 1); 9850 }; 9851 } 9852 function registerStyle11(hash, css) { 9853 const runtime = getRuntime11(); 9854 runtime.styles.set(hash, css); 9855 for (const targetDocument of runtime.documents.keys()) { 9856 injectStyle11(targetDocument, hash, css); 9857 } 9858 } 9859 if (typeof process === "undefined" || true) { 9860 registerStyle11("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9861 } 9862 var style_default10 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9863 var DEFAULT_TAG = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", {}); 9864 var Title = (0, import_element24.forwardRef)( 9865 function EmptyStateTitle({ render = DEFAULT_TAG, className, children, ...props }, ref) { 9866 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 9867 Text, 9868 { 9869 ref, 9870 variant: "heading-lg", 9871 render, 9872 className: clsx_default(style_default10.title, className), 9873 ...props, 9874 children 9875 } 9876 ); 9877 } 9878 ); 9879 9880 // packages/ui/build-module/empty-state/description.mjs 9881 var import_element25 = __toESM(require_element(), 1); 9882 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 9883 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 9884 function getRuntime12() { 9885 const globalScope = globalThis; 9886 if (globalScope.__wpStyleRuntime) { 9887 return globalScope.__wpStyleRuntime; 9888 } 9889 globalScope.__wpStyleRuntime = { 9890 documents: /* @__PURE__ */ new Map(), 9891 styles: /* @__PURE__ */ new Map(), 9892 injectedStyles: /* @__PURE__ */ new WeakMap() 9893 }; 9894 if (typeof document !== "undefined") { 9895 registerDocument12(document); 9896 } 9897 return globalScope.__wpStyleRuntime; 9898 } 9899 function documentContainsStyleHash12(targetDocument, hash) { 9900 if (!targetDocument.head) { 9901 return false; 9902 } 9903 for (const style of targetDocument.head.querySelectorAll( 9904 `style[$STYLE_HASH_ATTRIBUTE12}]` 9905 )) { 9906 if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 9907 return true; 9908 } 9909 } 9910 return false; 9911 } 9912 function injectStyle12(targetDocument, hash, css) { 9913 if (!targetDocument.head) { 9914 return; 9915 } 9916 const runtime = getRuntime12(); 9917 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9918 if (!injectedStyles) { 9919 injectedStyles = /* @__PURE__ */ new Set(); 9920 runtime.injectedStyles.set(targetDocument, injectedStyles); 9921 } 9922 if (injectedStyles.has(hash)) { 9923 return; 9924 } 9925 if (documentContainsStyleHash12(targetDocument, hash)) { 9926 injectedStyles.add(hash); 9927 return; 9928 } 9929 const style = targetDocument.createElement("style"); 9930 style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 9931 style.appendChild(targetDocument.createTextNode(css)); 9932 targetDocument.head.appendChild(style); 9933 injectedStyles.add(hash); 9934 } 9935 function registerDocument12(targetDocument) { 9936 const runtime = getRuntime12(); 9937 runtime.documents.set( 9938 targetDocument, 9939 (runtime.documents.get(targetDocument) ?? 0) + 1 9940 ); 9941 for (const [hash, css] of runtime.styles) { 9942 injectStyle12(targetDocument, hash, css); 9943 } 9944 return () => { 9945 const count = runtime.documents.get(targetDocument); 9946 if (count === void 0) { 9947 return; 9948 } 9949 if (count <= 1) { 9950 runtime.documents.delete(targetDocument); 9951 return; 9952 } 9953 runtime.documents.set(targetDocument, count - 1); 9954 }; 9955 } 9956 function registerStyle12(hash, css) { 9957 const runtime = getRuntime12(); 9958 runtime.styles.set(hash, css); 9959 for (const targetDocument of runtime.documents.keys()) { 9960 injectStyle12(targetDocument, hash, css); 9961 } 9962 } 9963 if (typeof process === "undefined" || true) { 9964 registerStyle12("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9965 } 9966 var style_default11 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9967 var DEFAULT_TAG2 = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", {}); 9968 var Description = (0, import_element25.forwardRef)(function EmptyStateDescription({ render = DEFAULT_TAG2, className, children, ...props }, ref) { 9969 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 9970 Text, 9971 { 9972 ref, 9973 variant: "body-md", 9974 render, 9975 className: clsx_default(style_default11.description, className), 9976 ...props, 9977 children 9978 } 9979 ); 9980 }); 9981 9982 // packages/ui/build-module/empty-state/actions.mjs 9983 var import_element26 = __toESM(require_element(), 1); 9984 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 9985 function getRuntime13() { 9986 const globalScope = globalThis; 9987 if (globalScope.__wpStyleRuntime) { 9988 return globalScope.__wpStyleRuntime; 9989 } 9990 globalScope.__wpStyleRuntime = { 9991 documents: /* @__PURE__ */ new Map(), 9992 styles: /* @__PURE__ */ new Map(), 9993 injectedStyles: /* @__PURE__ */ new WeakMap() 9994 }; 9995 if (typeof document !== "undefined") { 9996 registerDocument13(document); 9997 } 9998 return globalScope.__wpStyleRuntime; 9999 } 10000 function documentContainsStyleHash13(targetDocument, hash) { 10001 if (!targetDocument.head) { 10002 return false; 10003 } 10004 for (const style of targetDocument.head.querySelectorAll( 10005 `style[$STYLE_HASH_ATTRIBUTE13}]` 10006 )) { 10007 if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 10008 return true; 10009 } 10010 } 10011 return false; 10012 } 10013 function injectStyle13(targetDocument, hash, css) { 10014 if (!targetDocument.head) { 10015 return; 10016 } 10017 const runtime = getRuntime13(); 10018 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10019 if (!injectedStyles) { 10020 injectedStyles = /* @__PURE__ */ new Set(); 10021 runtime.injectedStyles.set(targetDocument, injectedStyles); 10022 } 10023 if (injectedStyles.has(hash)) { 10024 return; 10025 } 10026 if (documentContainsStyleHash13(targetDocument, hash)) { 10027 injectedStyles.add(hash); 10028 return; 10029 } 10030 const style = targetDocument.createElement("style"); 10031 style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 10032 style.appendChild(targetDocument.createTextNode(css)); 10033 targetDocument.head.appendChild(style); 10034 injectedStyles.add(hash); 10035 } 10036 function registerDocument13(targetDocument) { 10037 const runtime = getRuntime13(); 10038 runtime.documents.set( 10039 targetDocument, 10040 (runtime.documents.get(targetDocument) ?? 0) + 1 10041 ); 10042 for (const [hash, css] of runtime.styles) { 10043 injectStyle13(targetDocument, hash, css); 10044 } 10045 return () => { 10046 const count = runtime.documents.get(targetDocument); 10047 if (count === void 0) { 10048 return; 10049 } 10050 if (count <= 1) { 10051 runtime.documents.delete(targetDocument); 10052 return; 10053 } 10054 runtime.documents.set(targetDocument, count - 1); 10055 }; 10056 } 10057 function registerStyle13(hash, css) { 10058 const runtime = getRuntime13(); 10059 runtime.styles.set(hash, css); 10060 for (const targetDocument of runtime.documents.keys()) { 10061 injectStyle13(targetDocument, hash, css); 10062 } 10063 } 10064 if (typeof process === "undefined" || true) { 10065 registerStyle13("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 10066 } 10067 var style_default12 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 10068 var Actions = (0, import_element26.forwardRef)( 10069 function EmptyStateActions({ render, ...props }, ref) { 10070 const className = clsx_default(style_default12.actions); 10071 const element = useRender({ 10072 defaultTagName: "div", 10073 render, 10074 ref, 10075 props: mergeProps({ className }, props) 10076 }); 10077 return element; 10078 } 10079 ); 10080 10081 // packages/admin-ui/build-module/navigable-region/index.mjs 10082 var import_element27 = __toESM(require_element(), 1); 10083 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 10084 var NavigableRegion = (0, import_element27.forwardRef)( 10085 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { 10086 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( 10087 Tag, 10088 { 10089 ref, 10090 className: clsx_default("admin-ui-navigable-region", className), 10091 "aria-label": ariaLabel, 10092 role: "region", 10093 tabIndex: "-1", 10094 ...props, 10095 children 10096 } 10097 ); 10098 } 10099 ); 10100 NavigableRegion.displayName = "NavigableRegion"; 10101 var navigable_region_default = NavigableRegion; 10102 10103 // packages/admin-ui/build-module/navigation/index.mjs 10104 var import_i18n4 = __toESM(require_i18n(), 1); 10105 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 10106 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 10107 function getRuntime14() { 10108 const globalScope = globalThis; 10109 if (globalScope.__wpStyleRuntime) { 10110 return globalScope.__wpStyleRuntime; 10111 } 10112 globalScope.__wpStyleRuntime = { 10113 documents: /* @__PURE__ */ new Map(), 10114 styles: /* @__PURE__ */ new Map(), 10115 injectedStyles: /* @__PURE__ */ new WeakMap() 10116 }; 10117 if (typeof document !== "undefined") { 10118 registerDocument14(document); 10119 } 10120 return globalScope.__wpStyleRuntime; 10121 } 10122 function documentContainsStyleHash14(targetDocument, hash) { 10123 if (!targetDocument.head) { 10124 return false; 10125 } 10126 for (const style of targetDocument.head.querySelectorAll( 10127 `style[$STYLE_HASH_ATTRIBUTE14}]` 10128 )) { 10129 if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 10130 return true; 10131 } 10132 } 10133 return false; 10134 } 10135 function injectStyle14(targetDocument, hash, css) { 10136 if (!targetDocument.head) { 10137 return; 10138 } 10139 const runtime = getRuntime14(); 10140 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10141 if (!injectedStyles) { 10142 injectedStyles = /* @__PURE__ */ new Set(); 10143 runtime.injectedStyles.set(targetDocument, injectedStyles); 10144 } 10145 if (injectedStyles.has(hash)) { 10146 return; 10147 } 10148 if (documentContainsStyleHash14(targetDocument, hash)) { 10149 injectedStyles.add(hash); 10150 return; 10151 } 10152 const style = targetDocument.createElement("style"); 10153 style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 10154 style.appendChild(targetDocument.createTextNode(css)); 10155 targetDocument.head.appendChild(style); 10156 injectedStyles.add(hash); 10157 } 10158 function registerDocument14(targetDocument) { 10159 const runtime = getRuntime14(); 10160 runtime.documents.set( 10161 targetDocument, 10162 (runtime.documents.get(targetDocument) ?? 0) + 1 10163 ); 10164 for (const [hash, css] of runtime.styles) { 10165 injectStyle14(targetDocument, hash, css); 10166 } 10167 return () => { 10168 const count = runtime.documents.get(targetDocument); 10169 if (count === void 0) { 10170 return; 10171 } 10172 if (count <= 1) { 10173 runtime.documents.delete(targetDocument); 10174 return; 10175 } 10176 runtime.documents.set(targetDocument, count - 1); 10177 }; 10178 } 10179 function registerStyle14(hash, css) { 10180 const runtime = getRuntime14(); 10181 runtime.styles.set(hash, css); 10182 for (const targetDocument of runtime.documents.keys()) { 10183 injectStyle14(targetDocument, hash, css); 10184 } 10185 } 10186 if (typeof process === "undefined" || true) { 10187 registerStyle14("72ef022400", ".bfb5a2dd8cceebd3__list{--focus-ring-size:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*2);list-style:none;margin:calc(var(--focus-ring-size)*-1);overflow-x:auto;padding:var(--focus-ring-size);scroll-padding:var(--focus-ring-size)}.a4759b4cb2c8bd92__li{flex-shrink:0}._07da506d3f2d9afe__item{align-items:center;color:var(--wpds-color-foreground-interactive-neutral-weak,#707070);display:flex;font-weight:var(--wpds-typography-font-weight-default,400);min-block-size:44px;min-inline-size:44px;text-decoration:none}._07da506d3f2d9afe__item:hover,._07da506d3f2d9afe__item[aria-current=page]{color:var(--wpds-color-foreground-interactive-neutral-weak-active,#1e1e1e)}._07da506d3f2d9afe__item[aria-current=page]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}"); 10188 } 10189 var style_default13 = { "list": "bfb5a2dd8cceebd3__list", "li": "a4759b4cb2c8bd92__li", "item": "_07da506d3f2d9afe__item" }; 10190 var Navigation = ({ 10191 items, 10192 currentHref, 10193 ariaLabel = (0, import_i18n4.__)("Sections"), 10194 linkComponent, 10195 className 10196 }) => { 10197 if (!items.length) { 10198 return null; 10199 } 10200 const LinkComponent = linkComponent ?? "a"; 10201 if (true) { 10202 const invalidItem = items.find( 10203 (item) => typeof item.href !== "string" 10204 ); 10205 if (invalidItem) { 10206 throw new Error( 10207 `Navigation: item "$invalidItem.label}" is missing an \`href\` prop.` 10208 ); 10209 } 10210 const duplicate = items.find( 10211 (item, index2) => items.findIndex((other) => other.href === item.href) !== index2 10212 ); 10213 if (duplicate) { 10214 throw new Error( 10215 `Navigation: duplicate \`href\` "$duplicate.href}". Each item must have a unique \`href\` so a single item receives \`aria-current="page"\`.` 10216 ); 10217 } 10218 } 10219 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { "aria-label": ariaLabel, className, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10220 Stack, 10221 { 10222 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("ul", { role: "list" }), 10223 direction: "row", 10224 align: "center", 10225 gap: "md", 10226 className: style_default13.list, 10227 children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { className: style_default13.li, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10228 Text, 10229 { 10230 variant: "body-md", 10231 className: style_default13.item, 10232 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10233 Link, 10234 { 10235 variant: "unstyled", 10236 "aria-current": item.href === currentHref ? "page" : void 0, 10237 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LinkComponent, { href: item.href }) 10238 } 10239 ), 10240 children: item.label 10241 } 10242 ) }, item.href)) 10243 } 10244 ) }); 10245 }; 10246 var navigation_default = Navigation; 10247 10248 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs 10249 var import_components = __toESM(require_components(), 1); 10250 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); 10251 10252 // packages/admin-ui/build-module/page/header.mjs 10253 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 10254 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 10255 function getRuntime15() { 10256 const globalScope = globalThis; 10257 if (globalScope.__wpStyleRuntime) { 10258 return globalScope.__wpStyleRuntime; 10259 } 10260 globalScope.__wpStyleRuntime = { 10261 documents: /* @__PURE__ */ new Map(), 10262 styles: /* @__PURE__ */ new Map(), 10263 injectedStyles: /* @__PURE__ */ new WeakMap() 10264 }; 10265 if (typeof document !== "undefined") { 10266 registerDocument15(document); 10267 } 10268 return globalScope.__wpStyleRuntime; 10269 } 10270 function documentContainsStyleHash15(targetDocument, hash) { 10271 if (!targetDocument.head) { 10272 return false; 10273 } 10274 for (const style of targetDocument.head.querySelectorAll( 10275 `style[$STYLE_HASH_ATTRIBUTE15}]` 10276 )) { 10277 if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 10278 return true; 10279 } 10280 } 10281 return false; 10282 } 10283 function injectStyle15(targetDocument, hash, css) { 10284 if (!targetDocument.head) { 10285 return; 10286 } 10287 const runtime = getRuntime15(); 10288 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10289 if (!injectedStyles) { 10290 injectedStyles = /* @__PURE__ */ new Set(); 10291 runtime.injectedStyles.set(targetDocument, injectedStyles); 10292 } 10293 if (injectedStyles.has(hash)) { 10294 return; 10295 } 10296 if (documentContainsStyleHash15(targetDocument, hash)) { 10297 injectedStyles.add(hash); 10298 return; 10299 } 10300 const style = targetDocument.createElement("style"); 10301 style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 10302 style.appendChild(targetDocument.createTextNode(css)); 10303 targetDocument.head.appendChild(style); 10304 injectedStyles.add(hash); 10305 } 10306 function registerDocument15(targetDocument) { 10307 const runtime = getRuntime15(); 10308 runtime.documents.set( 10309 targetDocument, 10310 (runtime.documents.get(targetDocument) ?? 0) + 1 10311 ); 10312 for (const [hash, css] of runtime.styles) { 10313 injectStyle15(targetDocument, hash, css); 10314 } 10315 return () => { 10316 const count = runtime.documents.get(targetDocument); 10317 if (count === void 0) { 10318 return; 10319 } 10320 if (count <= 1) { 10321 runtime.documents.delete(targetDocument); 10322 return; 10323 } 10324 runtime.documents.set(targetDocument, count - 1); 10325 }; 10326 } 10327 function registerStyle15(hash, css) { 10328 const runtime = getRuntime15(); 10329 runtime.styles.set(hash, css); 10330 for (const targetDocument of runtime.documents.keys()) { 10331 injectStyle15(targetDocument, hash, css); 10332 } 10333 } 10334 if (typeof process === "undefined" || true) { 10335 registerStyle15("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 10336 } 10337 var style_default14 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 10338 function Header({ 10339 headingLevel = 1, 10340 breadcrumbs, 10341 badges, 10342 visual, 10343 title, 10344 subTitle, 10345 actions, 10346 navigation, 10347 components, 10348 showSidebarToggle = true 10349 }) { 10350 const HeadingTag = `h$headingLevel}`; 10351 const hasNavigation = !!navigation?.items?.length; 10352 return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10353 Stack, 10354 { 10355 direction: "column", 10356 className: clsx_default( 10357 style_default14.header, 10358 hasNavigation && style_default14["has-navigation"] 10359 ), 10360 children: [ 10361 /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10362 Stack, 10363 { 10364 className: style_default14["header-content"], 10365 direction: "row", 10366 gap: "sm", 10367 justify: "space-between", 10368 children: [ 10369 /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10370 Stack, 10371 { 10372 direction: "row", 10373 gap: "sm", 10374 align: "center", 10375 justify: "start", 10376 className: style_default14["header-lockup"], 10377 children: [ 10378 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10379 SidebarToggleSlot, 10380 { 10381 bubblesVirtually: true, 10382 className: style_default14["sidebar-toggle-slot"] 10383 } 10384 ), 10385 visual && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10386 "div", 10387 { 10388 className: style_default14["header-visual"], 10389 "aria-hidden": "true", 10390 children: visual 10391 } 10392 ), 10393 title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10394 Text, 10395 { 10396 className: style_default14["header-title"], 10397 render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(HeadingTag, {}), 10398 variant: "heading-lg", 10399 children: title 10400 } 10401 ), 10402 breadcrumbs, 10403 badges 10404 ] 10405 } 10406 ), 10407 actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10408 Stack, 10409 { 10410 align: "center", 10411 className: style_default14["header-actions"], 10412 direction: "row", 10413 gap: "sm", 10414 children: actions 10415 } 10416 ) 10417 ] 10418 } 10419 ), 10420 subTitle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10421 Text, 10422 { 10423 render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", {}), 10424 variant: "body-md", 10425 className: style_default14["header-subtitle"], 10426 children: subTitle 10427 } 10428 ), 10429 hasNavigation && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10430 navigation_default, 10431 { 10432 ...navigation, 10433 linkComponent: components?.link, 10434 className: style_default14["header-navigation"] 10435 } 10436 ) 10437 ] 10438 } 10439 ); 10440 } 10441 10442 // packages/admin-ui/build-module/page/index.mjs 10443 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 10444 var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash"; 10445 function getRuntime16() { 10446 const globalScope = globalThis; 10447 if (globalScope.__wpStyleRuntime) { 10448 return globalScope.__wpStyleRuntime; 10449 } 10450 globalScope.__wpStyleRuntime = { 10451 documents: /* @__PURE__ */ new Map(), 10452 styles: /* @__PURE__ */ new Map(), 10453 injectedStyles: /* @__PURE__ */ new WeakMap() 10454 }; 10455 if (typeof document !== "undefined") { 10456 registerDocument16(document); 10457 } 10458 return globalScope.__wpStyleRuntime; 10459 } 10460 function documentContainsStyleHash16(targetDocument, hash) { 10461 if (!targetDocument.head) { 10462 return false; 10463 } 10464 for (const style of targetDocument.head.querySelectorAll( 10465 `style[$STYLE_HASH_ATTRIBUTE16}]` 10466 )) { 10467 if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) { 10468 return true; 10469 } 10470 } 10471 return false; 10472 } 10473 function injectStyle16(targetDocument, hash, css) { 10474 if (!targetDocument.head) { 10475 return; 10476 } 10477 const runtime = getRuntime16(); 10478 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10479 if (!injectedStyles) { 10480 injectedStyles = /* @__PURE__ */ new Set(); 10481 runtime.injectedStyles.set(targetDocument, injectedStyles); 10482 } 10483 if (injectedStyles.has(hash)) { 10484 return; 10485 } 10486 if (documentContainsStyleHash16(targetDocument, hash)) { 10487 injectedStyles.add(hash); 10488 return; 10489 } 10490 const style = targetDocument.createElement("style"); 10491 style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash); 10492 style.appendChild(targetDocument.createTextNode(css)); 10493 targetDocument.head.appendChild(style); 10494 injectedStyles.add(hash); 10495 } 10496 function registerDocument16(targetDocument) { 10497 const runtime = getRuntime16(); 10498 runtime.documents.set( 10499 targetDocument, 10500 (runtime.documents.get(targetDocument) ?? 0) + 1 10501 ); 10502 for (const [hash, css] of runtime.styles) { 10503 injectStyle16(targetDocument, hash, css); 10504 } 10505 return () => { 10506 const count = runtime.documents.get(targetDocument); 10507 if (count === void 0) { 10508 return; 10509 } 10510 if (count <= 1) { 10511 runtime.documents.delete(targetDocument); 10512 return; 10513 } 10514 runtime.documents.set(targetDocument, count - 1); 10515 }; 10516 } 10517 function registerStyle16(hash, css) { 10518 const runtime = getRuntime16(); 10519 runtime.styles.set(hash, css); 10520 for (const targetDocument of runtime.documents.keys()) { 10521 injectStyle16(targetDocument, hash, css); 10522 } 10523 } 10524 if (typeof process === "undefined" || true) { 10525 registerStyle16("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 10526 } 10527 var style_default15 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 10528 function Page({ 10529 headingLevel, 10530 breadcrumbs, 10531 badges, 10532 visual, 10533 title, 10534 subTitle, 10535 children, 10536 className, 10537 actions, 10538 navigation, 10539 components, 10540 ariaLabel, 10541 hasPadding = false, 10542 showSidebarToggle = true 10543 }) { 10544 const classes = clsx_default(style_default15.page, className); 10545 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : ""); 10546 return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [ 10547 (title || breadcrumbs || badges || actions || visual || !!navigation?.items?.length) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 10548 Header, 10549 { 10550 headingLevel, 10551 breadcrumbs, 10552 badges, 10553 visual, 10554 title, 10555 subTitle, 10556 actions, 10557 navigation, 10558 components, 10559 showSidebarToggle 10560 } 10561 ), 10562 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 10563 "div", 10564 { 10565 className: clsx_default( 10566 style_default15.content, 10567 style_default15["has-padding"] 10568 ), 10569 children 10570 } 10571 ) : children 10572 ] }); 10573 } 10574 Page.SidebarToggleFill = SidebarToggleFill; 10575 var page_default = Page; 10576 10577 // packages/admin-ui/build-module/admin-theme-colors/index.mjs 10578 var DEFAULT_THEME_COLORS = { 10579 primary: "#3858e9", 10580 background: "#222524" 10581 }; 10582 var ADMIN_THEME_COLORS = /* @__PURE__ */ new Map([ 10583 ["modern", DEFAULT_THEME_COLORS], 10584 ["fresh", { primary: "#007cba", background: "#25292b" }], 10585 ["midnight", { primary: "#cf4339", background: "#3d4042" }], 10586 ["coffee", { primary: "#916745", background: "#5b534d" }], 10587 ["ocean", { primary: "#567958", background: "#5f787f" }], 10588 ["blue", { primary: "#437aa8", background: "#3876a8" }], 10589 ["ectoplasm", { primary: "#646c3e", background: "#4f386e" }], 10590 ["sunrise", { primary: "#ad631e", background: "#cc4541" }], 10591 ["light", { primary: "#007cba", background: "#eaeeed" }] 10592 ]); 10593 function getAdminThemeColors() { 10594 const scheme = document.body.className.match(/admin-color-([\w-]+)/)?.[1] ?? "modern"; 10595 return ADMIN_THEME_COLORS.get(scheme) ?? DEFAULT_THEME_COLORS; 10596 } 10597 10598 // packages/boot/build-module/components/app/router.mjs 10599 var import_data13 = __toESM(require_data(), 1); 10600 var import_core_data7 = __toESM(require_core_data(), 1); 10601 import { 10602 privateApis as routePrivateApis6 10603 } from "@wordpress/route"; 10604 10605 // packages/boot/build-module/components/root/index.mjs 10606 var import_notices3 = __toESM(require_notices(), 1); 10607 var import_compose5 = __toESM(require_compose(), 1); 10608 var import_components14 = __toESM(require_components(), 1); 10609 import { privateApis as routePrivateApis5 } from "@wordpress/route"; 10610 var import_element41 = __toESM(require_element(), 1); 10611 var import_i18n18 = __toESM(require_i18n(), 1); 10612 var import_editor5 = __toESM(require_editor(), 1); 10613 var import_theme = __toESM(require_theme(), 1); 10614 10615 // packages/boot/build-module/components/sidebar/index.mjs 10616 var import_components9 = __toESM(require_components(), 1); 10617 var import_data7 = __toESM(require_data(), 1); 10618 var import_i18n9 = __toESM(require_i18n(), 1); 10619 10620 // packages/boot/build-module/components/navigation/index.mjs 10621 var import_element31 = __toESM(require_element(), 1); 10622 var import_data4 = __toESM(require_data(), 1); 10623 10624 // packages/boot/build-module/store/index.mjs 10625 var import_data = __toESM(require_data(), 1); 10626 10627 // packages/boot/build-module/store/reducer.mjs 10628 var initialState = { 10629 menuItems: {}, 10630 routes: [], 10631 dashboardLink: void 0, 10632 entityLinks: {} 10633 }; 10634 function reducer(state = initialState, action) { 10635 switch (action.type) { 10636 case "REGISTER_MENU_ITEM": 10637 return { 10638 ...state, 10639 menuItems: { 10640 ...state.menuItems, 10641 [action.id]: action.menuItem 10642 } 10643 }; 10644 case "UPDATE_MENU_ITEM": 10645 if (!state.menuItems[action.id]) { 10646 return state; 10647 } 10648 return { 10649 ...state, 10650 menuItems: { 10651 ...state.menuItems, 10652 [action.id]: { 10653 ...state.menuItems[action.id], 10654 ...action.updates 10655 } 10656 } 10657 }; 10658 case "REGISTER_ROUTE": 10659 return { 10660 ...state, 10661 routes: [...state.routes, action.route] 10662 }; 10663 case "REGISTER_ENTITY_LINKS": 10664 return { 10665 ...state, 10666 entityLinks: { 10667 ...state.entityLinks, 10668 [action.postType]: { 10669 ...state.entityLinks[action.postType], 10670 ...action.links 10671 } 10672 } 10673 }; 10674 case "SET_DASHBOARD_LINK": 10675 return { 10676 ...state, 10677 dashboardLink: action.dashboardLink 10678 }; 10679 } 10680 return state; 10681 } 10682 10683 // packages/boot/build-module/store/actions.mjs 10684 var actions_exports = {}; 10685 __export(actions_exports, { 10686 registerEntityLinks: () => registerEntityLinks, 10687 registerMenuItem: () => registerMenuItem, 10688 registerRoute: () => registerRoute, 10689 setDashboardLink: () => setDashboardLink, 10690 updateMenuItem: () => updateMenuItem 10691 }); 10692 function registerMenuItem(id, menuItem) { 10693 return { 10694 type: "REGISTER_MENU_ITEM", 10695 id, 10696 menuItem 10697 }; 10698 } 10699 function updateMenuItem(id, updates) { 10700 return { 10701 type: "UPDATE_MENU_ITEM", 10702 id, 10703 updates 10704 }; 10705 } 10706 function registerRoute(route) { 10707 return { 10708 type: "REGISTER_ROUTE", 10709 route 10710 }; 10711 } 10712 function registerEntityLinks(postType, links) { 10713 return { 10714 type: "REGISTER_ENTITY_LINKS", 10715 postType, 10716 links 10717 }; 10718 } 10719 function setDashboardLink(dashboardLink) { 10720 return { 10721 type: "SET_DASHBOARD_LINK", 10722 dashboardLink 10723 }; 10724 } 10725 10726 // packages/boot/build-module/store/selectors.mjs 10727 var selectors_exports = {}; 10728 __export(selectors_exports, { 10729 getDashboardLink: () => getDashboardLink, 10730 getEntityLink: () => getEntityLink, 10731 getMenuItems: () => getMenuItems, 10732 getRoutes: () => getRoutes 10733 }); 10734 function getMenuItems(state) { 10735 return Object.values(state.menuItems); 10736 } 10737 function getRoutes(state) { 10738 return state.routes; 10739 } 10740 function getDashboardLink(state) { 10741 return state.dashboardLink; 10742 } 10743 function getEntityLink(state, postType, postId) { 10744 const links = state.entityLinks[postType] ?? state.entityLinks.default; 10745 const path = postId === void 0 ? links?.list : links?.edit; 10746 if (!path) { 10747 return void 0; 10748 } 10749 return path.replace("{type}", encodeURIComponent(postType)).replace("{id}", encodeURIComponent(postId ?? "")); 10750 } 10751 10752 // packages/boot/build-module/store/index.mjs 10753 var STORE_NAME = "wordpress/boot"; 10754 var store = (0, import_data.createReduxStore)(STORE_NAME, { 10755 reducer, 10756 actions: actions_exports, 10757 selectors: selectors_exports 10758 }); 10759 (0, import_data.register)(store); 10760 10761 // packages/boot/build-module/components/navigation/navigation-item/index.mjs 10762 var import_components4 = __toESM(require_components(), 1); 10763 10764 // packages/boot/build-module/components/navigation/router-link-item.mjs 10765 var import_element28 = __toESM(require_element(), 1); 10766 var import_components2 = __toESM(require_components(), 1); 10767 import { privateApis as routePrivateApis } from "@wordpress/route"; 10768 10769 // packages/boot/build-module/lock-unlock.mjs 10770 var import_private_apis2 = __toESM(require_private_apis(), 1); 10771 var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 10772 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 10773 "@wordpress/boot" 10774 ); 10775 10776 // packages/boot/build-module/components/navigation/router-link-item.mjs 10777 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 10778 var { createLink } = unlock2(routePrivateApis); 10779 function AnchorOnlyItem(props, forwardedRef) { 10780 return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components2.__experimentalItem, { as: "a", ref: forwardedRef, ...props }); 10781 } 10782 var RouterLinkItem = createLink((0, import_element28.forwardRef)(AnchorOnlyItem)); 10783 var router_link_item_default = RouterLinkItem; 10784 10785 // packages/boot/build-module/components/navigation/items.mjs 10786 var import_element29 = __toESM(require_element(), 1); 10787 var import_components3 = __toESM(require_components(), 1); 10788 var import_primitives10 = __toESM(require_primitives(), 1); 10789 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 10790 function isSvg(element) { 10791 return (0, import_element29.isValidElement)(element) && (element.type === import_primitives10.SVG || element.type === "svg"); 10792 } 10793 function wrapIcon(icon, shouldShowPlaceholder = true) { 10794 if (isSvg(icon)) { 10795 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components3.Icon, { icon }); 10796 } 10797 if (typeof icon === "string" && icon.startsWith("dashicons-")) { 10798 const iconKey = icon.replace( 10799 /^dashicons-/, 10800 "" 10801 ); 10802 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10803 import_components3.Dashicon, 10804 { 10805 style: { padding: "2px" }, 10806 icon: iconKey, 10807 "aria-hidden": "true" 10808 } 10809 ); 10810 } 10811 if (typeof icon === "string" && icon.startsWith("data:")) { 10812 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10813 "img", 10814 { 10815 src: icon, 10816 alt: "", 10817 "aria-hidden": "true", 10818 style: { 10819 width: "20px", 10820 height: "20px", 10821 display: "block", 10822 padding: "2px" 10823 } 10824 } 10825 ); 10826 } 10827 if (icon) { 10828 return icon; 10829 } 10830 if (shouldShowPlaceholder) { 10831 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10832 "div", 10833 { 10834 style: { width: "24px", height: "24px" }, 10835 "aria-hidden": "true" 10836 } 10837 ); 10838 } 10839 return null; 10840 } 10841 10842 // packages/boot/build-module/components/navigation/navigation-item/index.mjs 10843 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 10844 var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash"; 10845 function getRuntime17() { 10846 const globalScope = globalThis; 10847 if (globalScope.__wpStyleRuntime) { 10848 return globalScope.__wpStyleRuntime; 10849 } 10850 globalScope.__wpStyleRuntime = { 10851 documents: /* @__PURE__ */ new Map(), 10852 styles: /* @__PURE__ */ new Map(), 10853 injectedStyles: /* @__PURE__ */ new WeakMap() 10854 }; 10855 if (typeof document !== "undefined") { 10856 registerDocument17(document); 10857 } 10858 return globalScope.__wpStyleRuntime; 10859 } 10860 function documentContainsStyleHash17(targetDocument, hash) { 10861 if (!targetDocument.head) { 10862 return false; 10863 } 10864 for (const style of targetDocument.head.querySelectorAll( 10865 `style[$STYLE_HASH_ATTRIBUTE17}]` 10866 )) { 10867 if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) { 10868 return true; 10869 } 10870 } 10871 return false; 10872 } 10873 function injectStyle17(targetDocument, hash, css) { 10874 if (!targetDocument.head) { 10875 return; 10876 } 10877 const runtime = getRuntime17(); 10878 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10879 if (!injectedStyles) { 10880 injectedStyles = /* @__PURE__ */ new Set(); 10881 runtime.injectedStyles.set(targetDocument, injectedStyles); 10882 } 10883 if (injectedStyles.has(hash)) { 10884 return; 10885 } 10886 if (documentContainsStyleHash17(targetDocument, hash)) { 10887 injectedStyles.add(hash); 10888 return; 10889 } 10890 const style = targetDocument.createElement("style"); 10891 style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash); 10892 style.appendChild(targetDocument.createTextNode(css)); 10893 targetDocument.head.appendChild(style); 10894 injectedStyles.add(hash); 10895 } 10896 function registerDocument17(targetDocument) { 10897 const runtime = getRuntime17(); 10898 runtime.documents.set( 10899 targetDocument, 10900 (runtime.documents.get(targetDocument) ?? 0) + 1 10901 ); 10902 for (const [hash, css] of runtime.styles) { 10903 injectStyle17(targetDocument, hash, css); 10904 } 10905 return () => { 10906 const count = runtime.documents.get(targetDocument); 10907 if (count === void 0) { 10908 return; 10909 } 10910 if (count <= 1) { 10911 runtime.documents.delete(targetDocument); 10912 return; 10913 } 10914 runtime.documents.set(targetDocument, count - 1); 10915 }; 10916 } 10917 function registerStyle17(hash, css) { 10918 const runtime = getRuntime17(); 10919 runtime.styles.set(hash, css); 10920 for (const targetDocument of runtime.documents.keys()) { 10921 injectStyle17(targetDocument, hash, css); 10922 } 10923 } 10924 if (typeof process === "undefined" || true) { 10925 registerStyle17("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 10926 } 10927 var style_module_default = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 10928 function NavigationItem({ 10929 className, 10930 icon, 10931 shouldShowPlaceholder = true, 10932 children, 10933 to 10934 }) { 10935 const isExternal = !String( 10936 new URL(to, window.location.origin) 10937 ).startsWith(window.location.origin); 10938 const content = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_components4.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [ 10939 wrapIcon(icon, shouldShowPlaceholder), 10940 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components4.FlexBlock, { children }) 10941 ] }); 10942 if (isExternal) { 10943 return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 10944 import_components4.__experimentalItem, 10945 { 10946 as: "a", 10947 href: to, 10948 className: clsx_default(style_module_default.item, className), 10949 children: content 10950 } 10951 ); 10952 } 10953 return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(router_link_item_default, { to, className: clsx_default(style_module_default.item, className), children: content }); 10954 } 10955 10956 // packages/boot/build-module/components/navigation/drilldown-item/index.mjs 10957 var import_components5 = __toESM(require_components(), 1); 10958 var import_i18n5 = __toESM(require_i18n(), 1); 10959 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 10960 var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash"; 10961 function getRuntime18() { 10962 const globalScope = globalThis; 10963 if (globalScope.__wpStyleRuntime) { 10964 return globalScope.__wpStyleRuntime; 10965 } 10966 globalScope.__wpStyleRuntime = { 10967 documents: /* @__PURE__ */ new Map(), 10968 styles: /* @__PURE__ */ new Map(), 10969 injectedStyles: /* @__PURE__ */ new WeakMap() 10970 }; 10971 if (typeof document !== "undefined") { 10972 registerDocument18(document); 10973 } 10974 return globalScope.__wpStyleRuntime; 10975 } 10976 function documentContainsStyleHash18(targetDocument, hash) { 10977 if (!targetDocument.head) { 10978 return false; 10979 } 10980 for (const style of targetDocument.head.querySelectorAll( 10981 `style[$STYLE_HASH_ATTRIBUTE18}]` 10982 )) { 10983 if (style.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) { 10984 return true; 10985 } 10986 } 10987 return false; 10988 } 10989 function injectStyle18(targetDocument, hash, css) { 10990 if (!targetDocument.head) { 10991 return; 10992 } 10993 const runtime = getRuntime18(); 10994 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10995 if (!injectedStyles) { 10996 injectedStyles = /* @__PURE__ */ new Set(); 10997 runtime.injectedStyles.set(targetDocument, injectedStyles); 10998 } 10999 if (injectedStyles.has(hash)) { 11000 return; 11001 } 11002 if (documentContainsStyleHash18(targetDocument, hash)) { 11003 injectedStyles.add(hash); 11004 return; 11005 } 11006 const style = targetDocument.createElement("style"); 11007 style.setAttribute(STYLE_HASH_ATTRIBUTE18, hash); 11008 style.appendChild(targetDocument.createTextNode(css)); 11009 targetDocument.head.appendChild(style); 11010 injectedStyles.add(hash); 11011 } 11012 function registerDocument18(targetDocument) { 11013 const runtime = getRuntime18(); 11014 runtime.documents.set( 11015 targetDocument, 11016 (runtime.documents.get(targetDocument) ?? 0) + 1 11017 ); 11018 for (const [hash, css] of runtime.styles) { 11019 injectStyle18(targetDocument, hash, css); 11020 } 11021 return () => { 11022 const count = runtime.documents.get(targetDocument); 11023 if (count === void 0) { 11024 return; 11025 } 11026 if (count <= 1) { 11027 runtime.documents.delete(targetDocument); 11028 return; 11029 } 11030 runtime.documents.set(targetDocument, count - 1); 11031 }; 11032 } 11033 function registerStyle18(hash, css) { 11034 const runtime = getRuntime18(); 11035 runtime.styles.set(hash, css); 11036 for (const targetDocument of runtime.documents.keys()) { 11037 injectStyle18(targetDocument, hash, css); 11038 } 11039 } 11040 if (typeof process === "undefined" || true) { 11041 registerStyle18("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 11042 } 11043 var style_module_default2 = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 11044 function DrilldownItem({ 11045 className, 11046 id, 11047 icon, 11048 shouldShowPlaceholder = true, 11049 children, 11050 onNavigate 11051 }) { 11052 const handleClick = (e) => { 11053 e.preventDefault(); 11054 onNavigate({ id, direction: "forward" }); 11055 }; 11056 return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 11057 import_components5.__experimentalItem, 11058 { 11059 className: clsx_default(style_module_default2.item, className), 11060 onClick: handleClick, 11061 children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)( 11062 import_components5.__experimentalHStack, 11063 { 11064 justify: "flex-start", 11065 spacing: 2, 11066 style: { flexGrow: "1" }, 11067 children: [ 11068 wrapIcon(icon, shouldShowPlaceholder), 11069 /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components5.FlexBlock, { children }), 11070 /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 11071 import_components5.Icon, 11072 { 11073 icon: (0, import_i18n5.isRTL)() ? chevron_left_small_default : chevron_right_small_default 11074 } 11075 ) 11076 ] 11077 } 11078 ) 11079 } 11080 ); 11081 } 11082 11083 // packages/boot/build-module/components/navigation/dropdown-item/index.mjs 11084 var import_components6 = __toESM(require_components(), 1); 11085 var import_compose = __toESM(require_compose(), 1); 11086 var import_data2 = __toESM(require_data(), 1); 11087 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 11088 var STYLE_HASH_ATTRIBUTE19 = "data-wp-hash"; 11089 function getRuntime19() { 11090 const globalScope = globalThis; 11091 if (globalScope.__wpStyleRuntime) { 11092 return globalScope.__wpStyleRuntime; 11093 } 11094 globalScope.__wpStyleRuntime = { 11095 documents: /* @__PURE__ */ new Map(), 11096 styles: /* @__PURE__ */ new Map(), 11097 injectedStyles: /* @__PURE__ */ new WeakMap() 11098 }; 11099 if (typeof document !== "undefined") { 11100 registerDocument19(document); 11101 } 11102 return globalScope.__wpStyleRuntime; 11103 } 11104 function documentContainsStyleHash19(targetDocument, hash) { 11105 if (!targetDocument.head) { 11106 return false; 11107 } 11108 for (const style of targetDocument.head.querySelectorAll( 11109 `style[$STYLE_HASH_ATTRIBUTE19}]` 11110 )) { 11111 if (style.getAttribute(STYLE_HASH_ATTRIBUTE19) === hash) { 11112 return true; 11113 } 11114 } 11115 return false; 11116 } 11117 function injectStyle19(targetDocument, hash, css) { 11118 if (!targetDocument.head) { 11119 return; 11120 } 11121 const runtime = getRuntime19(); 11122 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11123 if (!injectedStyles) { 11124 injectedStyles = /* @__PURE__ */ new Set(); 11125 runtime.injectedStyles.set(targetDocument, injectedStyles); 11126 } 11127 if (injectedStyles.has(hash)) { 11128 return; 11129 } 11130 if (documentContainsStyleHash19(targetDocument, hash)) { 11131 injectedStyles.add(hash); 11132 return; 11133 } 11134 const style = targetDocument.createElement("style"); 11135 style.setAttribute(STYLE_HASH_ATTRIBUTE19, hash); 11136 style.appendChild(targetDocument.createTextNode(css)); 11137 targetDocument.head.appendChild(style); 11138 injectedStyles.add(hash); 11139 } 11140 function registerDocument19(targetDocument) { 11141 const runtime = getRuntime19(); 11142 runtime.documents.set( 11143 targetDocument, 11144 (runtime.documents.get(targetDocument) ?? 0) + 1 11145 ); 11146 for (const [hash, css] of runtime.styles) { 11147 injectStyle19(targetDocument, hash, css); 11148 } 11149 return () => { 11150 const count = runtime.documents.get(targetDocument); 11151 if (count === void 0) { 11152 return; 11153 } 11154 if (count <= 1) { 11155 runtime.documents.delete(targetDocument); 11156 return; 11157 } 11158 runtime.documents.set(targetDocument, count - 1); 11159 }; 11160 } 11161 function registerStyle19(hash, css) { 11162 const runtime = getRuntime19(); 11163 runtime.styles.set(hash, css); 11164 for (const targetDocument of runtime.documents.keys()) { 11165 injectStyle19(targetDocument, hash, css); 11166 } 11167 } 11168 if (typeof process === "undefined" || true) { 11169 registerStyle19("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 11170 } 11171 var style_module_default3 = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 11172 if (typeof process === "undefined" || true) { 11173 registerStyle19("1a6b086e6c", "._093b894bfb82e8de__dropdown{display:block}._5954dba25ac6e16f__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._9a14116ec9dae0e2__chevron.a9ebdaa3f36d6986__is-up{transform:rotate(180deg)}"); 11174 } 11175 var style_module_default22 = { "dropdown": "_093b894bfb82e8de__dropdown", "dropdown-children": "_5954dba25ac6e16f__dropdown-children", "chevron": "_9a14116ec9dae0e2__chevron", "is-up": "a9ebdaa3f36d6986__is-up" }; 11176 var ANIMATION_DURATION = 0.2; 11177 function DropdownItem({ 11178 className, 11179 id, 11180 icon, 11181 children, 11182 isExpanded, 11183 onToggle 11184 }) { 11185 const menuItems = (0, import_data2.useSelect)( 11186 (select) => ( 11187 // @ts-expect-error Store types are not available when selecting by store name. 11188 select(STORE_NAME).getMenuItems() 11189 ), 11190 [] 11191 ); 11192 const items = menuItems.filter((item) => item.parent === id); 11193 const disableMotion = (0, import_compose.useReducedMotion)(); 11194 return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: style_module_default22.dropdown, children: [ 11195 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11196 import_components6.__experimentalItem, 11197 { 11198 className: clsx_default(style_module_default3.item, className), 11199 onClick: (e) => { 11200 e.preventDefault(); 11201 e.stopPropagation(); 11202 onToggle(); 11203 }, 11204 onMouseDown: (e) => e.preventDefault(), 11205 children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( 11206 import_components6.__experimentalHStack, 11207 { 11208 justify: "flex-start", 11209 spacing: 2, 11210 style: { flexGrow: "1" }, 11211 children: [ 11212 wrapIcon(icon, false), 11213 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components6.FlexBlock, { children }), 11214 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11215 import_components6.Icon, 11216 { 11217 icon: chevron_down_small_default, 11218 className: clsx_default(style_module_default22.chevron, { 11219 [style_module_default22["is-up"]]: isExpanded 11220 }) 11221 } 11222 ) 11223 ] 11224 } 11225 ) 11226 } 11227 ), 11228 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components6.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11229 import_components6.__unstableMotion.div, 11230 { 11231 initial: { height: 0 }, 11232 animate: { height: "auto" }, 11233 exit: { height: 0 }, 11234 transition: { 11235 type: "tween", 11236 duration: disableMotion ? 0 : ANIMATION_DURATION, 11237 ease: "easeOut" 11238 }, 11239 className: style_module_default22["dropdown-children"], 11240 children: items.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11241 NavigationItem, 11242 { 11243 className: style_module_default3["is-compact"], 11244 to: item.to, 11245 shouldShowPlaceholder: false, 11246 children: item.label 11247 }, 11248 index2 11249 )) 11250 } 11251 ) }) 11252 ] }); 11253 } 11254 11255 // packages/boot/build-module/components/navigation/navigation-screen/index.mjs 11256 var import_components7 = __toESM(require_components(), 1); 11257 var import_i18n6 = __toESM(require_i18n(), 1); 11258 var import_compose2 = __toESM(require_compose(), 1); 11259 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 11260 var STYLE_HASH_ATTRIBUTE20 = "data-wp-hash"; 11261 function getRuntime20() { 11262 const globalScope = globalThis; 11263 if (globalScope.__wpStyleRuntime) { 11264 return globalScope.__wpStyleRuntime; 11265 } 11266 globalScope.__wpStyleRuntime = { 11267 documents: /* @__PURE__ */ new Map(), 11268 styles: /* @__PURE__ */ new Map(), 11269 injectedStyles: /* @__PURE__ */ new WeakMap() 11270 }; 11271 if (typeof document !== "undefined") { 11272 registerDocument20(document); 11273 } 11274 return globalScope.__wpStyleRuntime; 11275 } 11276 function documentContainsStyleHash20(targetDocument, hash) { 11277 if (!targetDocument.head) { 11278 return false; 11279 } 11280 for (const style of targetDocument.head.querySelectorAll( 11281 `style[$STYLE_HASH_ATTRIBUTE20}]` 11282 )) { 11283 if (style.getAttribute(STYLE_HASH_ATTRIBUTE20) === hash) { 11284 return true; 11285 } 11286 } 11287 return false; 11288 } 11289 function injectStyle20(targetDocument, hash, css) { 11290 if (!targetDocument.head) { 11291 return; 11292 } 11293 const runtime = getRuntime20(); 11294 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11295 if (!injectedStyles) { 11296 injectedStyles = /* @__PURE__ */ new Set(); 11297 runtime.injectedStyles.set(targetDocument, injectedStyles); 11298 } 11299 if (injectedStyles.has(hash)) { 11300 return; 11301 } 11302 if (documentContainsStyleHash20(targetDocument, hash)) { 11303 injectedStyles.add(hash); 11304 return; 11305 } 11306 const style = targetDocument.createElement("style"); 11307 style.setAttribute(STYLE_HASH_ATTRIBUTE20, hash); 11308 style.appendChild(targetDocument.createTextNode(css)); 11309 targetDocument.head.appendChild(style); 11310 injectedStyles.add(hash); 11311 } 11312 function registerDocument20(targetDocument) { 11313 const runtime = getRuntime20(); 11314 runtime.documents.set( 11315 targetDocument, 11316 (runtime.documents.get(targetDocument) ?? 0) + 1 11317 ); 11318 for (const [hash, css] of runtime.styles) { 11319 injectStyle20(targetDocument, hash, css); 11320 } 11321 return () => { 11322 const count = runtime.documents.get(targetDocument); 11323 if (count === void 0) { 11324 return; 11325 } 11326 if (count <= 1) { 11327 runtime.documents.delete(targetDocument); 11328 return; 11329 } 11330 runtime.documents.set(targetDocument, count - 1); 11331 }; 11332 } 11333 function registerStyle20(hash, css) { 11334 const runtime = getRuntime20(); 11335 runtime.styles.set(hash, css); 11336 for (const targetDocument of runtime.documents.keys()) { 11337 injectStyle20(targetDocument, hash, css); 11338 } 11339 } 11340 if (typeof process === "undefined" || true) { 11341 registerStyle20("9bfc8fef50", ".c93eb5f7b870f29c__screen{padding-block-end:4px}.c93eb5f7b870f29c__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.bee113ef4a391bcd__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}._2f6050d2407c9dee__title{flex-grow:1;overflow-wrap:break-word}._2f6050d2407c9dee__title._2f6050d2407c9dee__title,._2f6050d2407c9dee__title._2f6050d2407c9dee__title ._2f6050d2407c9dee__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.e78f7a9cf7e91164__actions{display:flex;flex-shrink:0}"); 11342 } 11343 var style_module_default4 = { "screen": "c93eb5f7b870f29c__screen", "title-icon": "bee113ef4a391bcd__title-icon", "title": "_2f6050d2407c9dee__title", "actions": "e78f7a9cf7e91164__actions" }; 11344 var ANIMATION_DURATION2 = 0.3; 11345 var slideVariants = { 11346 initial: (direction) => ({ 11347 x: direction === "forward" ? 100 : -100, 11348 opacity: 0 11349 }), 11350 animate: { 11351 x: 0, 11352 opacity: 1 11353 }, 11354 exit: (direction) => ({ 11355 x: direction === "forward" ? 100 : -100, 11356 opacity: 0 11357 }) 11358 }; 11359 function NavigationScreen({ 11360 isRoot, 11361 title, 11362 actions, 11363 content, 11364 description, 11365 animationDirection, 11366 backMenuItem, 11367 backButtonRef, 11368 navigationKey, 11369 onNavigate 11370 }) { 11371 const icon = (0, import_i18n6.isRTL)() ? chevron_right_default : chevron_left_default; 11372 const disableMotion = (0, import_compose2.useReducedMotion)(); 11373 const handleBackClick = (e) => { 11374 e.preventDefault(); 11375 onNavigate({ id: backMenuItem, direction: "backward" }); 11376 }; 11377 return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11378 "div", 11379 { 11380 className: style_module_default4.screen, 11381 style: { 11382 overflow: "hidden", 11383 position: "relative", 11384 display: "grid", 11385 gridTemplateColumns: "1fr", 11386 gridTemplateRows: "1fr" 11387 }, 11388 children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components7.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)( 11389 import_components7.__unstableMotion.div, 11390 { 11391 custom: animationDirection, 11392 variants: slideVariants, 11393 initial: "initial", 11394 animate: "animate", 11395 exit: "exit", 11396 transition: { 11397 type: "tween", 11398 duration: disableMotion ? 0 : ANIMATION_DURATION2, 11399 ease: [0.33, 0, 0, 1] 11400 }, 11401 style: { 11402 width: "100%", 11403 gridColumn: "1", 11404 gridRow: "1" 11405 }, 11406 children: [ 11407 /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_components7.__experimentalHStack, { spacing: 2, className: style_module_default4["title-icon"], children: [ 11408 !isRoot && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11409 import_components7.Button, 11410 { 11411 ref: backButtonRef, 11412 icon, 11413 onClick: handleBackClick, 11414 label: (0, import_i18n6.__)("Back"), 11415 size: "small", 11416 variant: "tertiary" 11417 } 11418 ), 11419 /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11420 import_components7.__experimentalHeading, 11421 { 11422 className: style_module_default4.title, 11423 level: 1, 11424 size: "15px", 11425 children: title 11426 } 11427 ), 11428 actions && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: style_module_default4.actions, children: actions }) 11429 ] }), 11430 description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { children: description }), 11431 content 11432 ] 11433 }, 11434 navigationKey 11435 ) }) 11436 } 11437 ); 11438 } 11439 11440 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs 11441 var import_element30 = __toESM(require_element(), 1); 11442 var import_data3 = __toESM(require_data(), 1); 11443 import { privateApis as routePrivateApis2 } from "@wordpress/route"; 11444 11445 // packages/boot/build-module/components/navigation/path-matching.mjs 11446 var isValidParentPath = (currentPath, menuPath) => { 11447 if (!menuPath || menuPath === currentPath) { 11448 return false; 11449 } 11450 const normalizePath = (path) => { 11451 const normalized = path.startsWith("/") ? path : "/" + path; 11452 return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized; 11453 }; 11454 const normalizedCurrent = normalizePath(currentPath); 11455 const normalizedMenu = normalizePath(menuPath); 11456 return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/"); 11457 }; 11458 var findClosestMenuItem = (currentPath, menuItems) => { 11459 const exactMatch = menuItems.find((item) => item.to === currentPath); 11460 if (exactMatch) { 11461 return exactMatch; 11462 } 11463 let bestMatch = null; 11464 let bestPathLength = 0; 11465 for (const item of menuItems) { 11466 if (!item.to) { 11467 continue; 11468 } 11469 if (isValidParentPath(currentPath, item.to)) { 11470 if (item.to.length > bestPathLength) { 11471 bestMatch = item; 11472 bestPathLength = item.to.length; 11473 } 11474 } 11475 } 11476 return bestMatch; 11477 }; 11478 var findDrilldownParent = (id, menuItems) => { 11479 if (!id) { 11480 return void 0; 11481 } 11482 const currentItem = menuItems.find((item) => item.id === id); 11483 if (!currentItem) { 11484 return void 0; 11485 } 11486 if (currentItem.parent) { 11487 const parentItem = menuItems.find( 11488 (item) => item.id === currentItem.parent 11489 ); 11490 if (parentItem?.parent_type === "drilldown") { 11491 return parentItem.id; 11492 } 11493 if (parentItem) { 11494 return findDrilldownParent(parentItem.id, menuItems); 11495 } 11496 } 11497 return void 0; 11498 }; 11499 var findDropdownParent = (id, menuItems) => { 11500 if (!id) { 11501 return void 0; 11502 } 11503 const currentItem = menuItems.find((item) => item.id === id); 11504 if (!currentItem) { 11505 return void 0; 11506 } 11507 if (currentItem.parent) { 11508 const parentItem = menuItems.find( 11509 (item) => item.id === currentItem.parent 11510 ); 11511 if (parentItem?.parent_type === "dropdown") { 11512 return parentItem.id; 11513 } 11514 } 11515 return void 0; 11516 }; 11517 11518 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs 11519 var { useRouter, useMatches } = unlock2(routePrivateApis2); 11520 function useSidebarParent() { 11521 const matches = useMatches(); 11522 const router = useRouter(); 11523 const menuItems = (0, import_data3.useSelect)( 11524 (select) => ( 11525 // @ts-expect-error Store types are not available when selecting by store name. 11526 select(STORE_NAME).getMenuItems() 11527 ), 11528 [] 11529 ); 11530 const currentPath = matches[matches.length - 1].pathname.slice( 11531 router.options.basepath?.length ?? 0 11532 ); 11533 const currentMenuItem = findClosestMenuItem(currentPath, menuItems); 11534 const [parentId, setParentId] = (0, import_element30.useState)( 11535 findDrilldownParent(currentMenuItem?.id, menuItems) 11536 ); 11537 const [parentDropdownId, setParentDropdownId] = (0, import_element30.useState)(findDropdownParent(currentMenuItem?.id, menuItems)); 11538 (0, import_element30.useEffect)(() => { 11539 const matchedMenuItem = findClosestMenuItem(currentPath, menuItems); 11540 const updatedParentId = findDrilldownParent( 11541 matchedMenuItem?.id, 11542 menuItems 11543 ); 11544 const updatedDropdownParent = findDropdownParent( 11545 matchedMenuItem?.id, 11546 menuItems 11547 ); 11548 setParentId(updatedParentId); 11549 setParentDropdownId(updatedDropdownParent); 11550 }, [currentPath, menuItems]); 11551 return [ 11552 parentId, 11553 setParentId, 11554 parentDropdownId, 11555 setParentDropdownId 11556 ]; 11557 } 11558 11559 // packages/boot/build-module/components/navigation/index.mjs 11560 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 11561 function Navigation2() { 11562 const backButtonRef = (0, import_element31.useRef)(null); 11563 const [animationDirection, setAnimationDirection] = (0, import_element31.useState)(null); 11564 const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent(); 11565 const menuItems = (0, import_data4.useSelect)( 11566 (select) => ( 11567 // @ts-expect-error Store types are not available when selecting by store name. 11568 select(STORE_NAME).getMenuItems() 11569 ), 11570 [] 11571 ); 11572 const parent = (0, import_element31.useMemo)( 11573 () => menuItems.find((item) => item.id === parentId), 11574 [menuItems, parentId] 11575 ); 11576 const navigationKey = parent ? `drilldown-$parent.id}` : "root"; 11577 const handleNavigate = ({ 11578 id, 11579 direction 11580 }) => { 11581 setAnimationDirection(direction); 11582 setParentId(id); 11583 }; 11584 const handleDropdownToggle = (dropdownId) => { 11585 setParentDropdownId( 11586 parentDropdownId === dropdownId ? void 0 : dropdownId 11587 ); 11588 }; 11589 const items = (0, import_element31.useMemo)( 11590 () => menuItems.filter((item) => item.parent === parentId), 11591 [menuItems, parentId] 11592 ); 11593 const hasRealIcons = items.some((item) => !!item.icon); 11594 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11595 NavigationScreen, 11596 { 11597 isRoot: !parent, 11598 title: parent ? parent.label : "", 11599 backMenuItem: parent?.parent, 11600 backButtonRef, 11601 animationDirection: animationDirection || void 0, 11602 navigationKey, 11603 onNavigate: handleNavigate, 11604 content: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "list", children: items.map((item) => { 11605 if (item.parent_type === "dropdown") { 11606 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11607 DropdownItem, 11608 { 11609 id: item.id, 11610 icon: item.icon, 11611 shouldShowPlaceholder: hasRealIcons, 11612 isExpanded: parentDropdownId === item.id, 11613 onToggle: () => handleDropdownToggle(item.id), 11614 children: item.label 11615 }, 11616 item.id 11617 ); 11618 } 11619 if (item.parent_type === "drilldown") { 11620 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11621 DrilldownItem, 11622 { 11623 id: item.id, 11624 icon: item.icon, 11625 shouldShowPlaceholder: hasRealIcons, 11626 onNavigate: handleNavigate, 11627 children: item.label 11628 }, 11629 item.id 11630 ); 11631 } 11632 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11633 NavigationItem, 11634 { 11635 to: item.to, 11636 icon: item.icon, 11637 shouldShowPlaceholder: hasRealIcons, 11638 children: item.label 11639 }, 11640 item.id 11641 ); 11642 }) }) 11643 } 11644 ); 11645 } 11646 var navigation_default2 = Navigation2; 11647 11648 // packages/boot/build-module/components/save-button/index.mjs 11649 var import_element33 = __toESM(require_element(), 1); 11650 var import_data6 = __toESM(require_data(), 1); 11651 var import_i18n8 = __toESM(require_i18n(), 1); 11652 var import_core_data2 = __toESM(require_core_data(), 1); 11653 var import_keycodes = __toESM(require_keycodes(), 1); 11654 var import_editor2 = __toESM(require_editor(), 1); 11655 var import_components8 = __toESM(require_components(), 1); 11656 11657 // packages/boot/build-module/components/save-panel/use-save-shortcut.mjs 11658 var import_element32 = __toESM(require_element(), 1); 11659 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); 11660 var import_i18n7 = __toESM(require_i18n(), 1); 11661 var import_data5 = __toESM(require_data(), 1); 11662 var import_core_data = __toESM(require_core_data(), 1); 11663 var import_editor = __toESM(require_editor(), 1); 11664 var shortcutName = "core/boot/save"; 11665 function useSaveShortcut({ 11666 openSavePanel 11667 }) { 11668 const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data5.useSelect)(import_core_data.store); 11669 const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data5.useSelect)(import_editor.store); 11670 const { savePost } = (0, import_data5.useDispatch)(import_editor.store); 11671 const { registerShortcut, unregisterShortcut } = (0, import_data5.useDispatch)( 11672 import_keyboard_shortcuts.store 11673 ); 11674 (0, import_element32.useEffect)(() => { 11675 registerShortcut({ 11676 name: shortcutName, 11677 category: "global", 11678 description: (0, import_i18n7.__)("Save your changes."), 11679 keyCombination: { 11680 modifier: "primary", 11681 character: "s" 11682 } 11683 }); 11684 return () => { 11685 unregisterShortcut(shortcutName); 11686 }; 11687 }, [registerShortcut, unregisterShortcut]); 11688 (0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => { 11689 event.preventDefault(); 11690 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); 11691 const hasDirtyEntities = !!dirtyEntityRecords.length; 11692 const isSaving = dirtyEntityRecords.some( 11693 (record) => isSavingEntityRecord(record.kind, record.name, record.key) 11694 ); 11695 if (!hasDirtyEntities || isSaving) { 11696 return; 11697 } 11698 if (hasNonPostEntityChanges()) { 11699 openSavePanel(); 11700 } else if (!isPostSavingLocked()) { 11701 savePost(); 11702 } 11703 }); 11704 } 11705 11706 // packages/boot/build-module/components/save-button/index.mjs 11707 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 11708 var STYLE_HASH_ATTRIBUTE21 = "data-wp-hash"; 11709 function getRuntime21() { 11710 const globalScope = globalThis; 11711 if (globalScope.__wpStyleRuntime) { 11712 return globalScope.__wpStyleRuntime; 11713 } 11714 globalScope.__wpStyleRuntime = { 11715 documents: /* @__PURE__ */ new Map(), 11716 styles: /* @__PURE__ */ new Map(), 11717 injectedStyles: /* @__PURE__ */ new WeakMap() 11718 }; 11719 if (typeof document !== "undefined") { 11720 registerDocument21(document); 11721 } 11722 return globalScope.__wpStyleRuntime; 11723 } 11724 function documentContainsStyleHash21(targetDocument, hash) { 11725 if (!targetDocument.head) { 11726 return false; 11727 } 11728 for (const style of targetDocument.head.querySelectorAll( 11729 `style[$STYLE_HASH_ATTRIBUTE21}]` 11730 )) { 11731 if (style.getAttribute(STYLE_HASH_ATTRIBUTE21) === hash) { 11732 return true; 11733 } 11734 } 11735 return false; 11736 } 11737 function injectStyle21(targetDocument, hash, css) { 11738 if (!targetDocument.head) { 11739 return; 11740 } 11741 const runtime = getRuntime21(); 11742 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11743 if (!injectedStyles) { 11744 injectedStyles = /* @__PURE__ */ new Set(); 11745 runtime.injectedStyles.set(targetDocument, injectedStyles); 11746 } 11747 if (injectedStyles.has(hash)) { 11748 return; 11749 } 11750 if (documentContainsStyleHash21(targetDocument, hash)) { 11751 injectedStyles.add(hash); 11752 return; 11753 } 11754 const style = targetDocument.createElement("style"); 11755 style.setAttribute(STYLE_HASH_ATTRIBUTE21, hash); 11756 style.appendChild(targetDocument.createTextNode(css)); 11757 targetDocument.head.appendChild(style); 11758 injectedStyles.add(hash); 11759 } 11760 function registerDocument21(targetDocument) { 11761 const runtime = getRuntime21(); 11762 runtime.documents.set( 11763 targetDocument, 11764 (runtime.documents.get(targetDocument) ?? 0) + 1 11765 ); 11766 for (const [hash, css] of runtime.styles) { 11767 injectStyle21(targetDocument, hash, css); 11768 } 11769 return () => { 11770 const count = runtime.documents.get(targetDocument); 11771 if (count === void 0) { 11772 return; 11773 } 11774 if (count <= 1) { 11775 runtime.documents.delete(targetDocument); 11776 return; 11777 } 11778 runtime.documents.set(targetDocument, count - 1); 11779 }; 11780 } 11781 function registerStyle21(hash, css) { 11782 const runtime = getRuntime21(); 11783 runtime.styles.set(hash, css); 11784 for (const targetDocument of runtime.documents.keys()) { 11785 injectStyle21(targetDocument, hash, css); 11786 } 11787 } 11788 if (typeof process === "undefined" || true) { 11789 registerStyle21("1c6bdcf0b8", "._9c7a13851fe5f446__save-button{width:100%}._266ea24d4569bd10__shortcut:not(:first-child){margin-inline-start:8px}"); 11790 } 11791 var style_module_default5 = { "save-button": "_9c7a13851fe5f446__save-button", "shortcut": "_266ea24d4569bd10__shortcut" }; 11792 function SaveButton() { 11793 const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element33.useState)(false); 11794 const { isSaving, dirtyEntityRecordsCount } = (0, import_data6.useSelect)((select) => { 11795 const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data2.store); 11796 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); 11797 return { 11798 isSaving: dirtyEntityRecords.some( 11799 (record) => isSavingEntityRecord(record.kind, record.name, record.key) 11800 ), 11801 dirtyEntityRecordsCount: dirtyEntityRecords.length 11802 }; 11803 }, []); 11804 const [showSavedState, setShowSavedState] = (0, import_element33.useState)(false); 11805 (0, import_element33.useEffect)(() => { 11806 if (isSaving) { 11807 setShowSavedState(true); 11808 } 11809 }, [isSaving]); 11810 const hasChanges = dirtyEntityRecordsCount > 0; 11811 (0, import_element33.useEffect)(() => { 11812 if (!isSaving && hasChanges) { 11813 setShowSavedState(false); 11814 } 11815 }, [isSaving, hasChanges]); 11816 function hideSavedState() { 11817 if (showSavedState) { 11818 setShowSavedState(false); 11819 } 11820 } 11821 const shouldShowButton = hasChanges || showSavedState; 11822 useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) }); 11823 const shortcut = { 11824 displayShortcut: import_keycodes.displayShortcut.primary("s"), 11825 ariaKeyShortcut: import_keycodes.ariaKeyShortcut.primary("s"), 11826 label: import_keycodes.shortcutAriaLabel.primary("s") 11827 }; 11828 const { descriptionId, targetProps } = useKeyboardShortcutProps({ 11829 shortcut 11830 }); 11831 if (!shouldShowButton) { 11832 return null; 11833 } 11834 const isInSavedState = showSavedState && !hasChanges; 11835 const disabled2 = isSaving || isInSavedState; 11836 const getLabel = () => { 11837 if (isInSavedState) { 11838 return (0, import_i18n8.__)("Saved"); 11839 } 11840 return (0, import_i18n8.sprintf)( 11841 // translators: %d: number of unsaved changes (number). 11842 (0, import_i18n8._n)( 11843 "Review %d change…", 11844 "Review %d changes…", 11845 dirtyEntityRecordsCount 11846 ), 11847 dirtyEntityRecordsCount 11848 ); 11849 }; 11850 const label = getLabel(); 11851 return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [ 11852 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(tooltip_exports.Root, { children: [ 11853 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)( 11854 tooltip_exports.Trigger, 11855 { 11856 ...targetProps, 11857 render: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11858 import_components8.Button, 11859 { 11860 variant: "primary", 11861 size: "compact", 11862 onClick: () => setIsSaveViewOpened(true), 11863 onBlur: hideSavedState, 11864 disabled: disabled2, 11865 accessibleWhenDisabled: true, 11866 isBusy: isSaving, 11867 className: style_module_default5["save-button"], 11868 icon: isInSavedState ? check_default : void 0 11869 } 11870 ), 11871 children: [ 11872 label, 11873 descriptionId && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11874 KeyboardShortcutDescription, 11875 { 11876 descriptionId, 11877 shortcut 11878 } 11879 ) 11880 ] 11881 } 11882 ), 11883 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(tooltip_exports.Popup, { children: [ 11884 hasChanges && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }), 11885 /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11886 KeyboardShortcutDisplay, 11887 { 11888 className: style_module_default5.shortcut, 11889 shortcut 11890 } 11891 ) 11892 ] }) 11893 ] }), 11894 isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11895 import_components8.Modal, 11896 { 11897 title: (0, import_i18n8.__)("Review changes"), 11898 onRequestClose: () => setIsSaveViewOpened(false), 11899 size: "small", 11900 children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11901 import_editor2.EntitiesSavedStates, 11902 { 11903 close: () => setIsSaveViewOpened(false), 11904 variant: "inline" 11905 } 11906 ) 11907 } 11908 ) 11909 ] }); 11910 } 11911 11912 // packages/boot/build-module/components/sidebar/index.mjs 11913 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 11914 var STYLE_HASH_ATTRIBUTE22 = "data-wp-hash"; 11915 function getRuntime22() { 11916 const globalScope = globalThis; 11917 if (globalScope.__wpStyleRuntime) { 11918 return globalScope.__wpStyleRuntime; 11919 } 11920 globalScope.__wpStyleRuntime = { 11921 documents: /* @__PURE__ */ new Map(), 11922 styles: /* @__PURE__ */ new Map(), 11923 injectedStyles: /* @__PURE__ */ new WeakMap() 11924 }; 11925 if (typeof document !== "undefined") { 11926 registerDocument22(document); 11927 } 11928 return globalScope.__wpStyleRuntime; 11929 } 11930 function documentContainsStyleHash22(targetDocument, hash) { 11931 if (!targetDocument.head) { 11932 return false; 11933 } 11934 for (const style of targetDocument.head.querySelectorAll( 11935 `style[$STYLE_HASH_ATTRIBUTE22}]` 11936 )) { 11937 if (style.getAttribute(STYLE_HASH_ATTRIBUTE22) === hash) { 11938 return true; 11939 } 11940 } 11941 return false; 11942 } 11943 function injectStyle22(targetDocument, hash, css) { 11944 if (!targetDocument.head) { 11945 return; 11946 } 11947 const runtime = getRuntime22(); 11948 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11949 if (!injectedStyles) { 11950 injectedStyles = /* @__PURE__ */ new Set(); 11951 runtime.injectedStyles.set(targetDocument, injectedStyles); 11952 } 11953 if (injectedStyles.has(hash)) { 11954 return; 11955 } 11956 if (documentContainsStyleHash22(targetDocument, hash)) { 11957 injectedStyles.add(hash); 11958 return; 11959 } 11960 const style = targetDocument.createElement("style"); 11961 style.setAttribute(STYLE_HASH_ATTRIBUTE22, hash); 11962 style.appendChild(targetDocument.createTextNode(css)); 11963 targetDocument.head.appendChild(style); 11964 injectedStyles.add(hash); 11965 } 11966 function registerDocument22(targetDocument) { 11967 const runtime = getRuntime22(); 11968 runtime.documents.set( 11969 targetDocument, 11970 (runtime.documents.get(targetDocument) ?? 0) + 1 11971 ); 11972 for (const [hash, css] of runtime.styles) { 11973 injectStyle22(targetDocument, hash, css); 11974 } 11975 return () => { 11976 const count = runtime.documents.get(targetDocument); 11977 if (count === void 0) { 11978 return; 11979 } 11980 if (count <= 1) { 11981 runtime.documents.delete(targetDocument); 11982 return; 11983 } 11984 runtime.documents.set(targetDocument, count - 1); 11985 }; 11986 } 11987 function registerStyle22(hash, css) { 11988 const runtime = getRuntime22(); 11989 runtime.styles.set(hash, css); 11990 for (const targetDocument of runtime.documents.keys()) { 11991 injectStyle22(targetDocument, hash, css); 11992 } 11993 } 11994 if (typeof process === "undefined" || true) { 11995 registerStyle22("2f8ba86269", "._52f77809bed01e5e__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}._6d2e23af506664fb__content{contain:content;flex-grow:1;position:relative}.c95a8ac9c6876d6e__footer{padding-block-end:8px;padding-block-start:16px;padding-inline-end:8px;padding-inline-start:16px}._28ec24681975e557__back-button{margin-block-end:8px;margin-block-start:16px;margin-inline-end:12px;margin-inline-start:12px}"); 11996 } 11997 var style_module_default6 = { "scrollable": "_52f77809bed01e5e__scrollable", "content": "_6d2e23af506664fb__content", "footer": "c95a8ac9c6876d6e__footer", "back-button": "_28ec24681975e557__back-button" }; 11998 function DashboardBackButton() { 11999 const dashboardLink = (0, import_data7.useSelect)( 12000 (select) => select(store).getDashboardLink(), 12001 [] 12002 ); 12003 return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( 12004 import_components9.Button, 12005 { 12006 __next40pxDefaultSize: true, 12007 className: style_module_default6["back-button"], 12008 href: dashboardLink || "/", 12009 icon: (0, import_i18n9.isRTL)() ? chevron_right_default : chevron_left_default, 12010 label: (0, import_i18n9.__)("Go to the Dashboard"), 12011 children: (0, import_i18n9.__)("Dashboard") 12012 } 12013 ); 12014 } 12015 function Sidebar() { 12016 return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: style_module_default6.scrollable, children: [ 12017 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DashboardBackButton, {}), 12018 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: style_module_default6.content, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(navigation_default2, {}) }), 12019 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: style_module_default6.footer, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SaveButton, {}) }) 12020 ] }); 12021 } 12022 12023 // packages/boot/build-module/components/save-panel/index.mjs 12024 var import_element34 = __toESM(require_element(), 1); 12025 var import_components10 = __toESM(require_components(), 1); 12026 var import_editor3 = __toESM(require_editor(), 1); 12027 var import_i18n10 = __toESM(require_i18n(), 1); 12028 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 12029 var STYLE_HASH_ATTRIBUTE23 = "data-wp-hash"; 12030 function getRuntime23() { 12031 const globalScope = globalThis; 12032 if (globalScope.__wpStyleRuntime) { 12033 return globalScope.__wpStyleRuntime; 12034 } 12035 globalScope.__wpStyleRuntime = { 12036 documents: /* @__PURE__ */ new Map(), 12037 styles: /* @__PURE__ */ new Map(), 12038 injectedStyles: /* @__PURE__ */ new WeakMap() 12039 }; 12040 if (typeof document !== "undefined") { 12041 registerDocument23(document); 12042 } 12043 return globalScope.__wpStyleRuntime; 12044 } 12045 function documentContainsStyleHash23(targetDocument, hash) { 12046 if (!targetDocument.head) { 12047 return false; 12048 } 12049 for (const style of targetDocument.head.querySelectorAll( 12050 `style[$STYLE_HASH_ATTRIBUTE23}]` 12051 )) { 12052 if (style.getAttribute(STYLE_HASH_ATTRIBUTE23) === hash) { 12053 return true; 12054 } 12055 } 12056 return false; 12057 } 12058 function injectStyle23(targetDocument, hash, css) { 12059 if (!targetDocument.head) { 12060 return; 12061 } 12062 const runtime = getRuntime23(); 12063 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12064 if (!injectedStyles) { 12065 injectedStyles = /* @__PURE__ */ new Set(); 12066 runtime.injectedStyles.set(targetDocument, injectedStyles); 12067 } 12068 if (injectedStyles.has(hash)) { 12069 return; 12070 } 12071 if (documentContainsStyleHash23(targetDocument, hash)) { 12072 injectedStyles.add(hash); 12073 return; 12074 } 12075 const style = targetDocument.createElement("style"); 12076 style.setAttribute(STYLE_HASH_ATTRIBUTE23, hash); 12077 style.appendChild(targetDocument.createTextNode(css)); 12078 targetDocument.head.appendChild(style); 12079 injectedStyles.add(hash); 12080 } 12081 function registerDocument23(targetDocument) { 12082 const runtime = getRuntime23(); 12083 runtime.documents.set( 12084 targetDocument, 12085 (runtime.documents.get(targetDocument) ?? 0) + 1 12086 ); 12087 for (const [hash, css] of runtime.styles) { 12088 injectStyle23(targetDocument, hash, css); 12089 } 12090 return () => { 12091 const count = runtime.documents.get(targetDocument); 12092 if (count === void 0) { 12093 return; 12094 } 12095 if (count <= 1) { 12096 runtime.documents.delete(targetDocument); 12097 return; 12098 } 12099 runtime.documents.set(targetDocument, count - 1); 12100 }; 12101 } 12102 function registerStyle23(hash, css) { 12103 const runtime = getRuntime23(); 12104 runtime.styles.set(hash, css); 12105 for (const targetDocument of runtime.documents.keys()) { 12106 injectStyle23(targetDocument, hash, css); 12107 } 12108 } 12109 if (typeof process === "undefined" || true) { 12110 registerStyle23("df1a59bc40", "@media (min-width:600px){._77efcb9ca06f5774__modal{width:600px}}"); 12111 } 12112 var style_module_default7 = { "modal": "_77efcb9ca06f5774__modal" }; 12113 function SavePanel() { 12114 const [isOpen, setIsOpen] = (0, import_element34.useState)(false); 12115 useSaveShortcut({ 12116 openSavePanel: () => setIsOpen(true) 12117 }); 12118 if (!isOpen) { 12119 return false; 12120 } 12121 return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12122 import_components10.Modal, 12123 { 12124 className: style_module_default7.modal, 12125 onRequestClose: () => setIsOpen(false), 12126 title: (0, import_i18n10.__)("Review changes"), 12127 size: "small", 12128 children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12129 import_editor3.EntitiesSavedStates, 12130 { 12131 close: () => setIsOpen(false), 12132 variant: "inline" 12133 } 12134 ) 12135 } 12136 ); 12137 } 12138 12139 // packages/boot/build-module/components/canvas-renderer/index.mjs 12140 var import_element37 = __toESM(require_element(), 1); 12141 12142 // packages/boot/build-module/components/canvas/index.mjs 12143 var import_element36 = __toESM(require_element(), 1); 12144 var import_components12 = __toESM(require_components(), 1); 12145 var import_i18n14 = __toESM(require_i18n(), 1); 12146 var import_data10 = __toESM(require_data(), 1); 12147 var import_core_data5 = __toESM(require_core_data(), 1); 12148 import { useNavigate as useNavigate2, useSearch as useSearch2 } from "@wordpress/route"; 12149 12150 // packages/boot/build-module/components/canvas/back-button.mjs 12151 var import_components11 = __toESM(require_components(), 1); 12152 var import_i18n11 = __toESM(require_i18n(), 1); 12153 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 12154 function BootBackButton({ length }) { 12155 const handleBack = () => { 12156 window.history.back(); 12157 }; 12158 if (length > 1) { 12159 return null; 12160 } 12161 return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( 12162 import_components11.Button, 12163 { 12164 size: "compact", 12165 onClick: handleBack, 12166 label: (0, import_i18n11.__)("Back"), 12167 icon: (0, import_i18n11.isRTL)() ? chevron_right_default : chevron_left_default 12168 } 12169 ); 12170 } 12171 12172 // packages/boot/build-module/components/canvas/site-preview.mjs 12173 var import_i18n12 = __toESM(require_i18n(), 1); 12174 var import_data8 = __toESM(require_data(), 1); 12175 var import_core_data3 = __toESM(require_core_data(), 1); 12176 var import_dom20 = __toESM(require_dom(), 1); 12177 var import_url = __toESM(require_url(), 1); 12178 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 12179 function SitePreview() { 12180 const siteUrl = (0, import_data8.useSelect)((select) => { 12181 const siteData = select(import_core_data3.store).getEntityRecord( 12182 "root", 12183 "__unstableBase" 12184 ); 12185 return siteData?.home; 12186 }, []); 12187 if (typeof siteUrl !== "string" || !siteUrl) { 12188 return null; 12189 } 12190 return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 12191 "iframe", 12192 { 12193 src: (0, import_url.addQueryArgs)(siteUrl, { 12194 // Parameter for hiding the admin bar. 12195 wp_site_preview: 1 12196 }), 12197 title: (0, import_i18n12.__)("Site Preview"), 12198 style: { 12199 display: "block", 12200 width: "100%", 12201 height: "100%", 12202 backgroundColor: "#fff" 12203 }, 12204 onLoad: (event) => { 12205 const iframeDocument = event.target.contentDocument; 12206 if (!iframeDocument) { 12207 return; 12208 } 12209 import_dom20.focus.focusable.find(iframeDocument.documentElement).forEach((element) => { 12210 element.style.pointerEvents = "none"; 12211 element.tabIndex = -1; 12212 element.setAttribute("aria-hidden", "true"); 12213 }); 12214 } 12215 } 12216 ); 12217 } 12218 12219 // packages/boot/build-module/components/canvas/use-navigate-to-entity-record.mjs 12220 var import_element35 = __toESM(require_element(), 1); 12221 var import_data9 = __toESM(require_data(), 1); 12222 var import_core_data4 = __toESM(require_core_data(), 1); 12223 var import_editor4 = __toESM(require_editor(), 1); 12224 var import_notices = __toESM(require_notices(), 1); 12225 var import_html_entities = __toESM(require_html_entities(), 1); 12226 var import_i18n13 = __toESM(require_i18n(), 1); 12227 import { 12228 useNavigate, 12229 useSearch, 12230 privateApis as routePrivateApis3 12231 } from "@wordpress/route"; 12232 12233 // packages/boot/build-module/components/canvas/viewport.mjs 12234 var DEFAULT_DEVICE_TYPE = "Desktop"; 12235 var VALID_VIEWPORTS = ["desktop", "tablet", "mobile"]; 12236 function isValidViewport(viewport) { 12237 return !!viewport && VALID_VIEWPORTS.includes(viewport.toLowerCase()); 12238 } 12239 function getDeviceType(viewport) { 12240 if (!isValidViewport(viewport)) { 12241 return DEFAULT_DEVICE_TYPE; 12242 } 12243 const value = viewport.toLowerCase(); 12244 return value.charAt(0).toUpperCase() + value.slice(1); 12245 } 12246 12247 // packages/boot/build-module/components/canvas/use-navigate-to-entity-record.mjs 12248 var { useCanGoBack, useRouter: useRouter2 } = unlock2(routePrivateApis3); 12249 function useNavigateToEntityRecord() { 12250 const navigate = useNavigate(); 12251 const search = useSearch({ strict: false }); 12252 const registry = (0, import_data9.useRegistry)(); 12253 const getEntityLink2 = (0, import_data9.useSelect)( 12254 (select) => select(store).getEntityLink, 12255 [] 12256 ); 12257 const router = useRouter2(); 12258 const canGoBack = useCanGoBack(); 12259 const onNavigateToEntityRecord = (0, import_element35.useCallback)( 12260 (params) => { 12261 const currentPostType = registry.select(import_editor4.store).getCurrentPostType(); 12262 const currentPostId = registry.select(import_editor4.store).getCurrentPostId(); 12263 const edits = registry.select(import_core_data4.store).getEntityRecordEdits( 12264 "postType", 12265 currentPostType, 12266 currentPostId 12267 ); 12268 const selectedBlock = edits?.selection?.selectionStart?.clientId; 12269 if (selectedBlock) { 12270 navigate({ 12271 search: (previous) => ({ 12272 ...previous, 12273 selectedBlock 12274 }), 12275 replace: true 12276 }); 12277 } 12278 const requestedViewport = params.viewport?.toLowerCase(); 12279 const hasRequestedViewport = isValidViewport(requestedViewport); 12280 const to = getEntityLink2(params.postType, params.postId); 12281 if (to) { 12282 navigate({ 12283 to, 12284 search: () => ({ 12285 focusMode: true, 12286 ...hasRequestedViewport ? { viewport: requestedViewport } : {} 12287 }) 12288 }); 12289 } 12290 }, 12291 [navigate, registry, getEntityLink2] 12292 ); 12293 const isFocusMode = !!search.focusMode; 12294 const onNavigateToPreviousEntityRecord = (0, import_element35.useMemo)( 12295 () => isFocusMode && canGoBack ? () => router.history.back() : void 0, 12296 [isFocusMode, canGoBack, router] 12297 ); 12298 return { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord }; 12299 } 12300 function useActionPerformed(postType) { 12301 const navigate = useNavigate(); 12302 const { createSuccessNotice } = (0, import_data9.useDispatch)(import_notices.store); 12303 const getEntityLink2 = (0, import_data9.useSelect)( 12304 (select) => select(store).getEntityLink, 12305 [] 12306 ); 12307 return (0, import_element35.useCallback)( 12308 (actionId, items) => { 12309 switch (actionId) { 12310 case "move-to-trash": 12311 case "delete-post": { 12312 const to = postType && getEntityLink2(postType); 12313 if (to) { 12314 navigate({ to, search: () => ({}) }); 12315 } 12316 break; 12317 } 12318 case "duplicate-post": { 12319 const newItem = items[0]; 12320 const to = getEntityLink2(newItem.type, newItem.id); 12321 if (!to) { 12322 break; 12323 } 12324 const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; 12325 createSuccessNotice( 12326 (0, import_i18n13.sprintf)( 12327 // translators: %s: Title of the created post, e.g: "Hello world". 12328 (0, import_i18n13.__)('"%s" successfully created.'), 12329 (0, import_html_entities.decodeEntities)(title ?? "") || (0, import_i18n13.__)("(no title)") 12330 ), 12331 { 12332 type: "snackbar", 12333 id: "duplicate-post-action", 12334 actions: [ 12335 { 12336 label: (0, import_i18n13.__)("Edit"), 12337 onClick: () => navigate({ to }) 12338 } 12339 ] 12340 } 12341 ); 12342 break; 12343 } 12344 } 12345 }, 12346 [navigate, createSuccessNotice, getEntityLink2, postType] 12347 ); 12348 } 12349 12350 // packages/boot/build-module/components/canvas/index.mjs 12351 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 12352 function Canvas({ canvas }) { 12353 const [Editor, setEditor] = (0, import_element36.useState)(null); 12354 const navigate = useNavigate2(); 12355 const { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord(); 12356 const onActionPerformed = useActionPerformed(canvas.postType); 12357 const viewport = useSearch2({ 12358 strict: false, 12359 select: (search) => search.viewport 12360 }); 12361 const hasEntity = !!(canvas.postType && canvas.postId); 12362 const isBlockTheme = (0, import_data10.useSelect)( 12363 (select) => select(import_core_data5.store).getCurrentTheme()?.is_block_theme, 12364 [] 12365 ); 12366 const { editLink, isTrashed } = (0, import_data10.useSelect)( 12367 (select) => { 12368 if (!canvas.postType || !canvas.postId) { 12369 return { editLink: void 0, isTrashed: false }; 12370 } 12371 const record = select(import_core_data5.store).getEntityRecord( 12372 "postType", 12373 canvas.postType, 12374 canvas.postId 12375 ); 12376 return { 12377 editLink: select(store).getEntityLink( 12378 canvas.postType, 12379 canvas.postId 12380 ), 12381 isTrashed: record?.status === "trash" 12382 }; 12383 }, 12384 [canvas.postType, canvas.postId] 12385 ); 12386 const settings = (0, import_element36.useMemo)( 12387 () => ({ 12388 isPreviewMode: canvas.isPreview, 12389 styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : [], 12390 onNavigateToEntityRecord, 12391 onNavigateToPreviousEntityRecord 12392 }), 12393 [ 12394 canvas.isPreview, 12395 onNavigateToEntityRecord, 12396 onNavigateToPreviousEntityRecord 12397 ] 12398 ); 12399 (0, import_element36.useEffect)(() => { 12400 import("@wordpress/lazy-editor").then((module) => { 12401 setEditor(() => module.Editor); 12402 }).catch((error) => { 12403 console.error("Failed to load lazy editor:", error); 12404 }); 12405 }, []); 12406 if (!hasEntity && isBlockTheme === false) { 12407 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SitePreview, {}); 12408 } 12409 if (!Editor || !hasEntity && isBlockTheme === void 0) { 12410 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12411 "div", 12412 { 12413 style: { 12414 display: "flex", 12415 justifyContent: "center", 12416 alignItems: "center", 12417 height: "100%", 12418 padding: "2rem" 12419 }, 12420 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components12.Spinner, {}) 12421 } 12422 ); 12423 } 12424 const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BootBackButton, { length }) : void 0; 12425 return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [ 12426 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12427 "div", 12428 { 12429 style: { height: "100%" }, 12430 inert: canvas.isPreview ? "true" : void 0, 12431 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12432 Editor, 12433 { 12434 postType: canvas.postType, 12435 postId: canvas.postId, 12436 settings, 12437 backButton, 12438 onActionPerformed, 12439 initialViewport: getDeviceType(viewport) 12440 } 12441 ) 12442 } 12443 ), 12444 canvas.isPreview && editLink && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12445 "div", 12446 { 12447 onClick: isTrashed ? void 0 : () => navigate({ to: editLink }), 12448 onKeyDown: (e) => { 12449 if (isTrashed) { 12450 return; 12451 } 12452 if (e.key === "Enter" || e.key === " ") { 12453 e.preventDefault(); 12454 navigate({ to: editLink }); 12455 } 12456 }, 12457 style: { 12458 position: "absolute", 12459 inset: 0, 12460 cursor: isTrashed ? "default" : "pointer", 12461 zIndex: 1 12462 }, 12463 role: "button", 12464 tabIndex: 0, 12465 "aria-disabled": isTrashed, 12466 "aria-label": (0, import_i18n14.__)("Edit") 12467 } 12468 ) 12469 ] }); 12470 } 12471 12472 // packages/boot/build-module/components/canvas-renderer/index.mjs 12473 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 12474 function CanvasRenderer({ 12475 canvas, 12476 routeContentModule 12477 }) { 12478 const [CustomCanvas, setCustomCanvas] = (0, import_element37.useState)(null); 12479 (0, import_element37.useEffect)(() => { 12480 if (canvas === null && routeContentModule) { 12481 import(routeContentModule).then((module) => { 12482 setCustomCanvas(() => module.canvas); 12483 }).catch((error) => { 12484 console.error("Failed to load custom canvas:", error); 12485 }); 12486 } else { 12487 setCustomCanvas(null); 12488 } 12489 }, [canvas, routeContentModule]); 12490 if (canvas === void 0) { 12491 return null; 12492 } 12493 if (canvas === null) { 12494 if (!CustomCanvas) { 12495 return null; 12496 } 12497 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CustomCanvas, {}); 12498 } 12499 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Canvas, { canvas }); 12500 } 12501 12502 // packages/boot/build-module/components/error-boundary/index.mjs 12503 var import_element38 = __toESM(require_element(), 1); 12504 var import_i18n15 = __toESM(require_i18n(), 1); 12505 var import_components13 = __toESM(require_components(), 1); 12506 var import_compose3 = __toESM(require_compose(), 1); 12507 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 12508 var STYLE_HASH_ATTRIBUTE24 = "data-wp-hash"; 12509 function getRuntime24() { 12510 const globalScope = globalThis; 12511 if (globalScope.__wpStyleRuntime) { 12512 return globalScope.__wpStyleRuntime; 12513 } 12514 globalScope.__wpStyleRuntime = { 12515 documents: /* @__PURE__ */ new Map(), 12516 styles: /* @__PURE__ */ new Map(), 12517 injectedStyles: /* @__PURE__ */ new WeakMap() 12518 }; 12519 if (typeof document !== "undefined") { 12520 registerDocument24(document); 12521 } 12522 return globalScope.__wpStyleRuntime; 12523 } 12524 function documentContainsStyleHash24(targetDocument, hash) { 12525 if (!targetDocument.head) { 12526 return false; 12527 } 12528 for (const style of targetDocument.head.querySelectorAll( 12529 `style[$STYLE_HASH_ATTRIBUTE24}]` 12530 )) { 12531 if (style.getAttribute(STYLE_HASH_ATTRIBUTE24) === hash) { 12532 return true; 12533 } 12534 } 12535 return false; 12536 } 12537 function injectStyle24(targetDocument, hash, css) { 12538 if (!targetDocument.head) { 12539 return; 12540 } 12541 const runtime = getRuntime24(); 12542 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12543 if (!injectedStyles) { 12544 injectedStyles = /* @__PURE__ */ new Set(); 12545 runtime.injectedStyles.set(targetDocument, injectedStyles); 12546 } 12547 if (injectedStyles.has(hash)) { 12548 return; 12549 } 12550 if (documentContainsStyleHash24(targetDocument, hash)) { 12551 injectedStyles.add(hash); 12552 return; 12553 } 12554 const style = targetDocument.createElement("style"); 12555 style.setAttribute(STYLE_HASH_ATTRIBUTE24, hash); 12556 style.appendChild(targetDocument.createTextNode(css)); 12557 targetDocument.head.appendChild(style); 12558 injectedStyles.add(hash); 12559 } 12560 function registerDocument24(targetDocument) { 12561 const runtime = getRuntime24(); 12562 runtime.documents.set( 12563 targetDocument, 12564 (runtime.documents.get(targetDocument) ?? 0) + 1 12565 ); 12566 for (const [hash, css] of runtime.styles) { 12567 injectStyle24(targetDocument, hash, css); 12568 } 12569 return () => { 12570 const count = runtime.documents.get(targetDocument); 12571 if (count === void 0) { 12572 return; 12573 } 12574 if (count <= 1) { 12575 runtime.documents.delete(targetDocument); 12576 return; 12577 } 12578 runtime.documents.set(targetDocument, count - 1); 12579 }; 12580 } 12581 function registerStyle24(hash, css) { 12582 const runtime = getRuntime24(); 12583 runtime.styles.set(hash, css); 12584 for (const targetDocument of runtime.documents.keys()) { 12585 injectStyle24(targetDocument, hash, css); 12586 } 12587 } 12588 if (typeof process === "undefined" || true) { 12589 registerStyle24("4780fe0b1b", "._4d71ad18128c9cb8__error-boundary{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-height:100%;padding:16px}"); 12590 } 12591 var style_module_default8 = { "error-boundary": "_4d71ad18128c9cb8__error-boundary" }; 12592 function CopyErrorButton({ error }) { 12593 const ref = (0, import_compose3.useCopyToClipboard)(() => error.stack ?? String(error)); 12594 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components13.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children: (0, import_i18n15.__)("Copy error") }); 12595 } 12596 var ErrorBoundary = class extends import_element38.Component { 12597 constructor(props) { 12598 super(props); 12599 this.state = { error: null }; 12600 } 12601 static getDerivedStateFromError(error) { 12602 return { error }; 12603 } 12604 render() { 12605 const { error } = this.state; 12606 if (!error) { 12607 return this.props.children; 12608 } 12609 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: style_module_default8["error-boundary"], children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(empty_state_exports.Root, { children: [ 12610 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Icon, { icon: caution_default }), 12611 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Title, { children: (0, import_i18n15.__)("Something went wrong") }), 12612 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Description, { children: (0, import_i18n15.__)( 12613 "This part of the screen could not be displayed. Reloading the page may help." 12614 ) }), 12615 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CopyErrorButton, { error }) }) 12616 ] }) }); 12617 } 12618 }; 12619 12620 // packages/boot/build-module/components/plugin-area/index.mjs 12621 var import_data11 = __toESM(require_data(), 1); 12622 var import_i18n16 = __toESM(require_i18n(), 1); 12623 var import_notices2 = __toESM(require_notices(), 1); 12624 var import_plugins = __toESM(require_plugins(), 1); 12625 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 12626 function PluginArea() { 12627 const { createErrorNotice } = (0, import_data11.useDispatch)(import_notices2.store); 12628 return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 12629 import_plugins.PluginArea, 12630 { 12631 onError: (name) => { 12632 createErrorNotice( 12633 (0, import_i18n16.sprintf)( 12634 /* translators: %s: plugin name */ 12635 (0, import_i18n16.__)( 12636 'The "%s" plugin has encountered an error and cannot be rendered.' 12637 ), 12638 name 12639 ) 12640 ); 12641 } 12642 } 12643 ); 12644 } 12645 12646 // packages/boot/build-module/components/app/use-route-title.mjs 12647 var import_element39 = __toESM(require_element(), 1); 12648 var import_data12 = __toESM(require_data(), 1); 12649 var import_core_data6 = __toESM(require_core_data(), 1); 12650 var import_i18n17 = __toESM(require_i18n(), 1); 12651 var import_html_entities2 = __toESM(require_html_entities(), 1); 12652 import { speak } from "@wordpress/a11y"; 12653 import { privateApis as routePrivateApis4 } from "@wordpress/route"; 12654 var { useLocation, useMatches: useMatches2 } = unlock2(routePrivateApis4); 12655 function useRouteTitle() { 12656 const location = useLocation(); 12657 const matches = useMatches2(); 12658 const currentMatch = matches[matches.length - 1]; 12659 const routeTitle = currentMatch?.loaderData?.title; 12660 const siteTitle = (0, import_data12.useSelect)( 12661 (select) => select(import_core_data6.store).getEntityRecord( 12662 "root", 12663 "__unstableBase" 12664 )?.name, 12665 [] 12666 ); 12667 const isInitialLocationRef = (0, import_element39.useRef)(true); 12668 (0, import_element39.useEffect)(() => { 12669 isInitialLocationRef.current = false; 12670 }, [location]); 12671 (0, import_element39.useEffect)(() => { 12672 if (isInitialLocationRef.current) { 12673 return; 12674 } 12675 if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") { 12676 const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle); 12677 const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle); 12678 const formattedTitle = (0, import_i18n17.sprintf)( 12679 /* translators: Admin document title. 1: Admin screen name, 2: Site name. */ 12680 (0, import_i18n17.__)("%1$s ‹ %2$s — WordPress"), 12681 decodedRouteTitle, 12682 decodedSiteTitle 12683 ); 12684 document.title = formattedTitle; 12685 if (decodedRouteTitle) { 12686 speak(decodedRouteTitle, "assertive"); 12687 } 12688 } 12689 }, [routeTitle, siteTitle, location]); 12690 } 12691 12692 // packages/boot/build-module/components/root/use-sync-body-background.mjs 12693 var import_element40 = __toESM(require_element(), 1); 12694 var import_compose4 = __toESM(require_compose(), 1); 12695 function useSyncBodyBackground() { 12696 const layoutRef = (0, import_element40.useRef)(null); 12697 (0, import_compose4.useIsomorphicLayoutEffect)(() => { 12698 if (!layoutRef.current) { 12699 return; 12700 } 12701 const body = layoutRef.current.ownerDocument.body; 12702 const bg = getComputedStyle(layoutRef.current).backgroundColor; 12703 if (!bg) { 12704 return; 12705 } 12706 const previousBackground = body.style.background; 12707 body.style.background = bg; 12708 return () => { 12709 body.style.background = previousBackground; 12710 }; 12711 }, []); 12712 return layoutRef; 12713 } 12714 12715 // packages/boot/build-module/components/root/index.mjs 12716 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 12717 var STYLE_HASH_ATTRIBUTE25 = "data-wp-hash"; 12718 function getRuntime25() { 12719 const globalScope = globalThis; 12720 if (globalScope.__wpStyleRuntime) { 12721 return globalScope.__wpStyleRuntime; 12722 } 12723 globalScope.__wpStyleRuntime = { 12724 documents: /* @__PURE__ */ new Map(), 12725 styles: /* @__PURE__ */ new Map(), 12726 injectedStyles: /* @__PURE__ */ new WeakMap() 12727 }; 12728 if (typeof document !== "undefined") { 12729 registerDocument25(document); 12730 } 12731 return globalScope.__wpStyleRuntime; 12732 } 12733 function documentContainsStyleHash25(targetDocument, hash) { 12734 if (!targetDocument.head) { 12735 return false; 12736 } 12737 for (const style of targetDocument.head.querySelectorAll( 12738 `style[$STYLE_HASH_ATTRIBUTE25}]` 12739 )) { 12740 if (style.getAttribute(STYLE_HASH_ATTRIBUTE25) === hash) { 12741 return true; 12742 } 12743 } 12744 return false; 12745 } 12746 function injectStyle25(targetDocument, hash, css) { 12747 if (!targetDocument.head) { 12748 return; 12749 } 12750 const runtime = getRuntime25(); 12751 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12752 if (!injectedStyles) { 12753 injectedStyles = /* @__PURE__ */ new Set(); 12754 runtime.injectedStyles.set(targetDocument, injectedStyles); 12755 } 12756 if (injectedStyles.has(hash)) { 12757 return; 12758 } 12759 if (documentContainsStyleHash25(targetDocument, hash)) { 12760 injectedStyles.add(hash); 12761 return; 12762 } 12763 const style = targetDocument.createElement("style"); 12764 style.setAttribute(STYLE_HASH_ATTRIBUTE25, hash); 12765 style.appendChild(targetDocument.createTextNode(css)); 12766 targetDocument.head.appendChild(style); 12767 injectedStyles.add(hash); 12768 } 12769 function registerDocument25(targetDocument) { 12770 const runtime = getRuntime25(); 12771 runtime.documents.set( 12772 targetDocument, 12773 (runtime.documents.get(targetDocument) ?? 0) + 1 12774 ); 12775 for (const [hash, css] of runtime.styles) { 12776 injectStyle25(targetDocument, hash, css); 12777 } 12778 return () => { 12779 const count = runtime.documents.get(targetDocument); 12780 if (count === void 0) { 12781 return; 12782 } 12783 if (count <= 1) { 12784 runtime.documents.delete(targetDocument); 12785 return; 12786 } 12787 runtime.documents.set(targetDocument, count - 1); 12788 }; 12789 } 12790 function registerStyle25(hash, css) { 12791 const runtime = getRuntime25(); 12792 runtime.styles.set(hash, css); 12793 for (const targetDocument of runtime.documents.keys()) { 12794 injectStyle25(targetDocument, hash, css); 12795 } 12796 } 12797 if (typeof process === "undefined" || true) { 12798 registerStyle25("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 12799 } 12800 var style_module_default9 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 12801 var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock2(routePrivateApis5); 12802 function Root3() { 12803 const matches = useMatches3(); 12804 const location = useLocation2(); 12805 const currentMatch = matches[matches.length - 1]; 12806 const canvas = currentMatch?.loaderData?.canvas; 12807 const routeContentModule = currentMatch?.loaderData?.routeContentModule; 12808 const isFullScreen = canvas && !canvas.isPreview; 12809 useRouteTitle(); 12810 const isMobileViewport = (0, import_compose5.useViewportMatch)("medium", "<"); 12811 const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element41.useState)(false); 12812 const disableMotion = (0, import_compose5.useReducedMotion)(); 12813 (0, import_element41.useEffect)(() => { 12814 setIsMobileSidebarOpen(false); 12815 }, [location.pathname, isMobileViewport]); 12816 const themeColors = (0, import_element41.useMemo)(getAdminThemeColors, []); 12817 const layoutRef = useSyncBodyBackground(); 12818 return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(tooltip_exports.Provider, { children: [ 12819 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PluginArea, {}), 12820 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12821 import_theme.ThemeProvider, 12822 { 12823 isRoot: true, 12824 color: { ...themeColors, background: "#f8f8f8" }, 12825 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_theme.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 12826 "div", 12827 { 12828 ref: layoutRef, 12829 className: clsx_default(style_module_default9.layout, { 12830 [style_module_default9["has-canvas"]]: !!canvas || canvas === null, 12831 [style_module_default9["has-full-canvas"]]: isFullScreen 12832 }), 12833 children: [ 12834 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_editor5.UnsavedChangesWarning, {}), 12835 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SavePanel, {}), 12836 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12837 import_notices3.SnackbarNotices, 12838 { 12839 className: style_module_default9["notices-snackbar"] 12840 } 12841 ), 12842 isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12843 import_components14.Button, 12844 { 12845 icon: menu_default, 12846 onClick: () => setIsMobileSidebarOpen(true), 12847 label: (0, import_i18n18.__)("Open navigation panel"), 12848 size: "compact" 12849 } 12850 ) }), 12851 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12852 import_components14.__unstableMotion.div, 12853 { 12854 initial: { opacity: 0 }, 12855 animate: { opacity: 1 }, 12856 exit: { opacity: 0 }, 12857 transition: { 12858 type: "tween", 12859 duration: disableMotion ? 0 : 0.2, 12860 ease: "easeOut" 12861 }, 12862 className: style_module_default9["sidebar-backdrop"], 12863 onClick: () => setIsMobileSidebarOpen(false), 12864 onKeyDown: (event) => { 12865 if (event.key === "Escape") { 12866 setIsMobileSidebarOpen( 12867 false 12868 ); 12869 } 12870 }, 12871 role: "button", 12872 tabIndex: -1, 12873 "aria-label": (0, import_i18n18.__)( 12874 "Close navigation panel" 12875 ) 12876 } 12877 ) }), 12878 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12879 import_components14.__unstableMotion.div, 12880 { 12881 initial: { x: "-100%" }, 12882 animate: { x: 0 }, 12883 exit: { x: "-100%" }, 12884 transition: { 12885 type: "tween", 12886 duration: disableMotion ? 0 : 0.2, 12887 ease: "easeOut" 12888 }, 12889 className: clsx_default( 12890 style_module_default9.sidebar, 12891 style_module_default9["is-mobile"] 12892 ), 12893 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Sidebar, {}) 12894 } 12895 ) }), 12896 !isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: style_module_default9.sidebar, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Sidebar, {}) }), 12897 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: style_module_default9.surfaces, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 12898 import_theme.ThemeProvider, 12899 { 12900 color: { 12901 ...themeColors, 12902 // Reset to the default background color. 12903 background: "#fcfcfc" 12904 }, 12905 children: [ 12906 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Outlet, {}), 12907 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 12908 "div", 12909 { 12910 className: clsx_default(style_module_default9.canvas, { 12911 [style_module_default9["has-mobile-drawer"]]: canvas?.isPreview && isMobileViewport 12912 }), 12913 children: [ 12914 canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12915 "div", 12916 { 12917 className: style_module_default9["mobile-sidebar-drawer"], 12918 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12919 import_components14.Button, 12920 { 12921 icon: menu_default, 12922 onClick: () => setIsMobileSidebarOpen( 12923 true 12924 ), 12925 label: (0, import_i18n18.__)( 12926 "Open navigation panel" 12927 ), 12928 size: "compact" 12929 } 12930 ) 12931 } 12932 ), 12933 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12934 CanvasRenderer, 12935 { 12936 canvas, 12937 routeContentModule 12938 } 12939 ) }) 12940 ] 12941 } 12942 ) 12943 ] 12944 } 12945 ) }) 12946 ] 12947 } 12948 ) }) 12949 } 12950 ) 12951 ] }) }); 12952 } 12953 12954 // packages/boot/build-module/components/app/router.mjs 12955 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 12956 var STYLE_HASH_ATTRIBUTE26 = "data-wp-hash"; 12957 function getRuntime26() { 12958 const globalScope = globalThis; 12959 if (globalScope.__wpStyleRuntime) { 12960 return globalScope.__wpStyleRuntime; 12961 } 12962 globalScope.__wpStyleRuntime = { 12963 documents: /* @__PURE__ */ new Map(), 12964 styles: /* @__PURE__ */ new Map(), 12965 injectedStyles: /* @__PURE__ */ new WeakMap() 12966 }; 12967 if (typeof document !== "undefined") { 12968 registerDocument26(document); 12969 } 12970 return globalScope.__wpStyleRuntime; 12971 } 12972 function documentContainsStyleHash26(targetDocument, hash) { 12973 if (!targetDocument.head) { 12974 return false; 12975 } 12976 for (const style of targetDocument.head.querySelectorAll( 12977 `style[$STYLE_HASH_ATTRIBUTE26}]` 12978 )) { 12979 if (style.getAttribute(STYLE_HASH_ATTRIBUTE26) === hash) { 12980 return true; 12981 } 12982 } 12983 return false; 12984 } 12985 function injectStyle26(targetDocument, hash, css) { 12986 if (!targetDocument.head) { 12987 return; 12988 } 12989 const runtime = getRuntime26(); 12990 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12991 if (!injectedStyles) { 12992 injectedStyles = /* @__PURE__ */ new Set(); 12993 runtime.injectedStyles.set(targetDocument, injectedStyles); 12994 } 12995 if (injectedStyles.has(hash)) { 12996 return; 12997 } 12998 if (documentContainsStyleHash26(targetDocument, hash)) { 12999 injectedStyles.add(hash); 13000 return; 13001 } 13002 const style = targetDocument.createElement("style"); 13003 style.setAttribute(STYLE_HASH_ATTRIBUTE26, hash); 13004 style.appendChild(targetDocument.createTextNode(css)); 13005 targetDocument.head.appendChild(style); 13006 injectedStyles.add(hash); 13007 } 13008 function registerDocument26(targetDocument) { 13009 const runtime = getRuntime26(); 13010 runtime.documents.set( 13011 targetDocument, 13012 (runtime.documents.get(targetDocument) ?? 0) + 1 13013 ); 13014 for (const [hash, css] of runtime.styles) { 13015 injectStyle26(targetDocument, hash, css); 13016 } 13017 return () => { 13018 const count = runtime.documents.get(targetDocument); 13019 if (count === void 0) { 13020 return; 13021 } 13022 if (count <= 1) { 13023 runtime.documents.delete(targetDocument); 13024 return; 13025 } 13026 runtime.documents.set(targetDocument, count - 1); 13027 }; 13028 } 13029 function registerStyle26(hash, css) { 13030 const runtime = getRuntime26(); 13031 runtime.styles.set(hash, css); 13032 for (const targetDocument of runtime.documents.keys()) { 13033 injectStyle26(targetDocument, hash, css); 13034 } 13035 } 13036 if (typeof process === "undefined" || true) { 13037 registerStyle26("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 13038 } 13039 var style_module_default10 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 13040 var { 13041 createLazyRoute, 13042 createRouter, 13043 createRootRoute, 13044 createRoute, 13045 RouterProvider, 13046 createBrowserHistory, 13047 parseHref, 13048 useLoaderData 13049 } = unlock2(routePrivateApis6); 13050 function NotFoundComponent() { 13051 return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.stage, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(page_default, { title: (0, import_i18n19.__)("Route not found"), hasPadding: true, children: (0, import_i18n19.__)("The page you're looking for does not exist") }) }); 13052 } 13053 function createRouteFromDefinition(route, parentRoute) { 13054 let tanstackRoute = createRoute({ 13055 getParentRoute: () => parentRoute, 13056 path: route.path, 13057 beforeLoad: async (opts) => { 13058 if (route.route_module) { 13059 const module = await import(route.route_module); 13060 const routeConfig = module.route || {}; 13061 if (routeConfig.beforeLoad) { 13062 return routeConfig.beforeLoad({ 13063 params: opts.params || {}, 13064 search: opts.search || {} 13065 }); 13066 } 13067 } 13068 }, 13069 loader: async (opts) => { 13070 let routeConfig = {}; 13071 if (route.route_module) { 13072 const module = await import(route.route_module); 13073 routeConfig = module.route || {}; 13074 } 13075 const context = { 13076 params: opts.params || {}, 13077 search: opts.deps || {} 13078 }; 13079 const [, loaderData, canvasData, titleData] = await Promise.all([ 13080 (0, import_data13.resolveSelect)(import_core_data7.store).getEntityRecord( 13081 "root", 13082 "__unstableBase" 13083 ), 13084 routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0), 13085 routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0), 13086 routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0) 13087 ]); 13088 let inspector = true; 13089 if (routeConfig.inspector) { 13090 inspector = await routeConfig.inspector(context); 13091 } 13092 let stage = true; 13093 if (routeConfig.stage) { 13094 stage = await routeConfig.stage(context); 13095 } 13096 return { 13097 ...loaderData, 13098 canvas: canvasData, 13099 inspector, 13100 stage, 13101 title: titleData, 13102 routeContentModule: route.content_module 13103 }; 13104 }, 13105 loaderDeps: (opts) => opts.search 13106 }); 13107 tanstackRoute = tanstackRoute.lazy(async () => { 13108 const module = route.content_module ? await import(route.content_module) : {}; 13109 const Stage = module.stage; 13110 const Inspector = module.inspector; 13111 return createLazyRoute(route.path)({ 13112 component: function RouteComponent() { 13113 const { inspector: showInspector, stage: showStage } = useLoaderData({ from: route.path }) ?? {}; 13114 return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [ 13115 Stage && showStage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.stage, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Stage, {}) }) }), 13116 Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.inspector, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Inspector, {}) }) }) 13117 ] }); 13118 } 13119 }); 13120 }); 13121 return tanstackRoute; 13122 } 13123 function createRouteTree(routes, rootComponent = Root3) { 13124 const rootRoute = createRootRoute({ 13125 component: rootComponent, 13126 context: () => ({}) 13127 }); 13128 const dynamicRoutes = routes.map( 13129 (route) => createRouteFromDefinition(route, rootRoute) 13130 ); 13131 return rootRoute.addChildren(dynamicRoutes); 13132 } 13133 function createPathHistory() { 13134 return createBrowserHistory({ 13135 parseLocation: () => { 13136 const url = new URL(window.location.href); 13137 const path = url.searchParams.get("p") || "/"; 13138 const pathHref = `$path}$url.hash}`; 13139 return parseHref(pathHref, window.history.state); 13140 }, 13141 createHref: (href) => { 13142 const searchParams = new URLSearchParams(window.location.search); 13143 searchParams.set("p", href); 13144 return `$window.location.pathname}?$searchParams}`; 13145 } 13146 }); 13147 } 13148 function Router({ 13149 routes, 13150 rootComponent = Root3 13151 }) { 13152 const router = (0, import_element42.useMemo)(() => { 13153 const history = createPathHistory(); 13154 const routeTree = createRouteTree(routes, rootComponent); 13155 return createRouter({ 13156 history, 13157 routeTree, 13158 defaultPreload: "intent", 13159 defaultNotFoundComponent: NotFoundComponent, 13160 defaultViewTransition: { 13161 types: ({ 13162 fromLocation 13163 }) => { 13164 if (!fromLocation) { 13165 return false; 13166 } 13167 return ["navigate"]; 13168 } 13169 } 13170 }); 13171 }, [routes, rootComponent]); 13172 return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RouterProvider, { router }); 13173 } 13174 13175 // packages/boot/build-module/components/root/single-page.mjs 13176 var import_notices4 = __toESM(require_notices(), 1); 13177 var import_components15 = __toESM(require_components(), 1); 13178 var import_element43 = __toESM(require_element(), 1); 13179 import { privateApis as routePrivateApis7 } from "@wordpress/route"; 13180 var import_theme2 = __toESM(require_theme(), 1); 13181 var import_editor6 = __toESM(require_editor(), 1); 13182 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 13183 var STYLE_HASH_ATTRIBUTE27 = "data-wp-hash"; 13184 function getRuntime27() { 13185 const globalScope = globalThis; 13186 if (globalScope.__wpStyleRuntime) { 13187 return globalScope.__wpStyleRuntime; 13188 } 13189 globalScope.__wpStyleRuntime = { 13190 documents: /* @__PURE__ */ new Map(), 13191 styles: /* @__PURE__ */ new Map(), 13192 injectedStyles: /* @__PURE__ */ new WeakMap() 13193 }; 13194 if (typeof document !== "undefined") { 13195 registerDocument27(document); 13196 } 13197 return globalScope.__wpStyleRuntime; 13198 } 13199 function documentContainsStyleHash27(targetDocument, hash) { 13200 if (!targetDocument.head) { 13201 return false; 13202 } 13203 for (const style of targetDocument.head.querySelectorAll( 13204 `style[$STYLE_HASH_ATTRIBUTE27}]` 13205 )) { 13206 if (style.getAttribute(STYLE_HASH_ATTRIBUTE27) === hash) { 13207 return true; 13208 } 13209 } 13210 return false; 13211 } 13212 function injectStyle27(targetDocument, hash, css) { 13213 if (!targetDocument.head) { 13214 return; 13215 } 13216 const runtime = getRuntime27(); 13217 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13218 if (!injectedStyles) { 13219 injectedStyles = /* @__PURE__ */ new Set(); 13220 runtime.injectedStyles.set(targetDocument, injectedStyles); 13221 } 13222 if (injectedStyles.has(hash)) { 13223 return; 13224 } 13225 if (documentContainsStyleHash27(targetDocument, hash)) { 13226 injectedStyles.add(hash); 13227 return; 13228 } 13229 const style = targetDocument.createElement("style"); 13230 style.setAttribute(STYLE_HASH_ATTRIBUTE27, hash); 13231 style.appendChild(targetDocument.createTextNode(css)); 13232 targetDocument.head.appendChild(style); 13233 injectedStyles.add(hash); 13234 } 13235 function registerDocument27(targetDocument) { 13236 const runtime = getRuntime27(); 13237 runtime.documents.set( 13238 targetDocument, 13239 (runtime.documents.get(targetDocument) ?? 0) + 1 13240 ); 13241 for (const [hash, css] of runtime.styles) { 13242 injectStyle27(targetDocument, hash, css); 13243 } 13244 return () => { 13245 const count = runtime.documents.get(targetDocument); 13246 if (count === void 0) { 13247 return; 13248 } 13249 if (count <= 1) { 13250 runtime.documents.delete(targetDocument); 13251 return; 13252 } 13253 runtime.documents.set(targetDocument, count - 1); 13254 }; 13255 } 13256 function registerStyle27(hash, css) { 13257 const runtime = getRuntime27(); 13258 runtime.styles.set(hash, css); 13259 for (const targetDocument of runtime.documents.keys()) { 13260 injectStyle27(targetDocument, hash, css); 13261 } 13262 } 13263 if (typeof process === "undefined" || true) { 13264 registerStyle27("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 13265 } 13266 var style_module_default11 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 13267 var { useMatches: useMatches4, Outlet: Outlet2 } = unlock2(routePrivateApis7); 13268 function RootSinglePage() { 13269 const matches = useMatches4(); 13270 const currentMatch = matches[matches.length - 1]; 13271 const canvas = currentMatch?.loaderData?.canvas; 13272 const routeContentModule = currentMatch?.loaderData?.routeContentModule; 13273 const isFullScreen = canvas && !canvas.isPreview; 13274 useRouteTitle(); 13275 const themeColors = (0, import_element43.useMemo)(getAdminThemeColors, []); 13276 const layoutRef = useSyncBodyBackground(); 13277 return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_components15.SlotFillProvider, { children: [ 13278 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PluginArea, {}), 13279 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13280 import_theme2.ThemeProvider, 13281 { 13282 isRoot: true, 13283 color: { ...themeColors, background: "#f8f8f8" }, 13284 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_theme2.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)( 13285 "div", 13286 { 13287 ref: layoutRef, 13288 className: clsx_default( 13289 style_module_default11.layout, 13290 style_module_default11["layout-single-page"], 13291 { 13292 [style_module_default11["has-canvas"]]: !!canvas || canvas === null, 13293 [style_module_default11["has-full-canvas"]]: isFullScreen 13294 } 13295 ), 13296 children: [ 13297 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_editor6.UnsavedChangesWarning, {}), 13298 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SavePanel, {}), 13299 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13300 import_notices4.SnackbarNotices, 13301 { 13302 className: style_module_default11["notices-snackbar"] 13303 } 13304 ), 13305 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: style_module_default11.surfaces, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)( 13306 import_theme2.ThemeProvider, 13307 { 13308 color: { 13309 ...themeColors, 13310 // Reset to the default background color. 13311 background: "#fcfcfc" 13312 }, 13313 children: [ 13314 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Outlet2, {}), 13315 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: style_module_default11.canvas, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13316 CanvasRenderer, 13317 { 13318 canvas, 13319 routeContentModule 13320 } 13321 ) }) 13322 ] 13323 } 13324 ) }) 13325 ] 13326 } 13327 ) }) 13328 } 13329 ) 13330 ] }); 13331 } 13332 13333 // packages/boot/build-module/components/app/index.mjs 13334 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 13335 function App({ rootComponent }) { 13336 const routes = (0, import_data14.useSelect)((select) => select(store).getRoutes(), []); 13337 return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Router, { routes, rootComponent }); 13338 } 13339 async function runInitModules(initModules) { 13340 for (const moduleId of initModules ?? []) { 13341 const module = await import(moduleId); 13342 await module.init(); 13343 } 13344 } 13345 async function init({ 13346 mountId, 13347 menuItems, 13348 routes, 13349 initModules, 13350 dashboardLink 13351 }) { 13352 (menuItems ?? []).forEach((menuItem) => { 13353 (0, import_data14.dispatch)(store).registerMenuItem(menuItem.id, menuItem); 13354 }); 13355 (routes ?? []).forEach((route) => { 13356 (0, import_data14.dispatch)(store).registerRoute(route); 13357 }); 13358 if (dashboardLink) { 13359 (0, import_data14.dispatch)(store).setDashboardLink(dashboardLink); 13360 } 13361 await runInitModules(initModules); 13362 const rootElement = document.getElementById(mountId); 13363 if (rootElement) { 13364 const root = (0, import_element44.createRoot)(rootElement); 13365 root.render( 13366 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_element44.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(App, {}) }) 13367 ); 13368 } 13369 } 13370 async function initSinglePage({ 13371 mountId, 13372 routes, 13373 initModules 13374 }) { 13375 (routes ?? []).forEach((route) => { 13376 (0, import_data14.dispatch)(store).registerRoute(route); 13377 }); 13378 await runInitModules(initModules); 13379 const rootElement = document.getElementById(mountId); 13380 if (rootElement) { 13381 const root = (0, import_element44.createRoot)(rootElement); 13382 root.render( 13383 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_element44.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(App, { rootComponent: RootSinglePage }) }) 13384 ); 13385 } 13386 } 13387 export { 13388 init, 13389 initSinglePage, 13390 store 13391 }; 13392 /*! Bundled license information: 13393 13394 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 13395 (** 13396 * @license React 13397 * use-sync-external-store-shim.development.js 13398 * 13399 * Copyright (c) Meta Platforms, Inc. and affiliates. 13400 * 13401 * This source code is licensed under the MIT license found in the 13402 * LICENSE file in the root directory of this source tree. 13403 *) 13404 13405 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 13406 (** 13407 * @license React 13408 * use-sync-external-store-shim/with-selector.development.js 13409 * 13410 * Copyright (c) Meta Platforms, Inc. and affiliates. 13411 * 13412 * This source code is licensed under the MIT license found in the 13413 * LICENSE file in the root directory of this source tree. 13414 *) 13415 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Thu Sep 24 08:20:34 2026 | Cross-referenced by PHPXref |