[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 66: 5 /***/ ((module) => { 6 7 "use strict"; 8 9 10 var isMergeableObject = function isMergeableObject(value) { 11 return isNonNullObject(value) 12 && !isSpecial(value) 13 }; 14 15 function isNonNullObject(value) { 16 return !!value && typeof value === 'object' 17 } 18 19 function isSpecial(value) { 20 var stringValue = Object.prototype.toString.call(value); 21 22 return stringValue === '[object RegExp]' 23 || stringValue === '[object Date]' 24 || isReactElement(value) 25 } 26 27 // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 28 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; 29 var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; 30 31 function isReactElement(value) { 32 return value.$$typeof === REACT_ELEMENT_TYPE 33 } 34 35 function emptyTarget(val) { 36 return Array.isArray(val) ? [] : {} 37 } 38 39 function cloneUnlessOtherwiseSpecified(value, options) { 40 return (options.clone !== false && options.isMergeableObject(value)) 41 ? deepmerge(emptyTarget(value), value, options) 42 : value 43 } 44 45 function defaultArrayMerge(target, source, options) { 46 return target.concat(source).map(function(element) { 47 return cloneUnlessOtherwiseSpecified(element, options) 48 }) 49 } 50 51 function getMergeFunction(key, options) { 52 if (!options.customMerge) { 53 return deepmerge 54 } 55 var customMerge = options.customMerge(key); 56 return typeof customMerge === 'function' ? customMerge : deepmerge 57 } 58 59 function getEnumerableOwnPropertySymbols(target) { 60 return Object.getOwnPropertySymbols 61 ? Object.getOwnPropertySymbols(target).filter(function(symbol) { 62 return Object.propertyIsEnumerable.call(target, symbol) 63 }) 64 : [] 65 } 66 67 function getKeys(target) { 68 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) 69 } 70 71 function propertyIsOnObject(object, property) { 72 try { 73 return property in object 74 } catch(_) { 75 return false 76 } 77 } 78 79 // Protects from prototype poisoning and unexpected merging up the prototype chain. 80 function propertyIsUnsafe(target, key) { 81 return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, 82 && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, 83 && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. 84 } 85 86 function mergeObject(target, source, options) { 87 var destination = {}; 88 if (options.isMergeableObject(target)) { 89 getKeys(target).forEach(function(key) { 90 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); 91 }); 92 } 93 getKeys(source).forEach(function(key) { 94 if (propertyIsUnsafe(target, key)) { 95 return 96 } 97 98 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { 99 destination[key] = getMergeFunction(key, options)(target[key], source[key], options); 100 } else { 101 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); 102 } 103 }); 104 return destination 105 } 106 107 function deepmerge(target, source, options) { 108 options = options || {}; 109 options.arrayMerge = options.arrayMerge || defaultArrayMerge; 110 options.isMergeableObject = options.isMergeableObject || isMergeableObject; 111 // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() 112 // implementations can use it. The caller may not replace it. 113 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; 114 115 var sourceIsArray = Array.isArray(source); 116 var targetIsArray = Array.isArray(target); 117 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 118 119 if (!sourceAndTargetTypesMatch) { 120 return cloneUnlessOtherwiseSpecified(source, options) 121 } else if (sourceIsArray) { 122 return options.arrayMerge(target, source, options) 123 } else { 124 return mergeObject(target, source, options) 125 } 126 } 127 128 deepmerge.all = function deepmergeAll(array, options) { 129 if (!Array.isArray(array)) { 130 throw new Error('first argument should be an array') 131 } 132 133 return array.reduce(function(prev, next) { 134 return deepmerge(prev, next, options) 135 }, {}) 136 }; 137 138 var deepmerge_1 = deepmerge; 139 140 module.exports = deepmerge_1; 141 142 143 /***/ }), 144 145 /***/ 2287: 146 /***/ ((__unused_webpack_module, exports) => { 147 148 "use strict"; 149 var __webpack_unused_export__; 150 /** @license React v17.0.2 151 * react-is.production.min.js 152 * 153 * Copyright (c) Facebook, Inc. and its affiliates. 154 * 155 * This source code is licensed under the MIT license found in the 156 * LICENSE file in the root directory of this source tree. 157 */ 158 var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131; 159 if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")} 160 function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;__webpack_unused_export__=h;__webpack_unused_export__=z;__webpack_unused_export__=A;__webpack_unused_export__=B;__webpack_unused_export__=C;__webpack_unused_export__=D;__webpack_unused_export__=E;__webpack_unused_export__=F;__webpack_unused_export__=G;__webpack_unused_export__=H; 161 __webpack_unused_export__=I;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return y(a)===h};__webpack_unused_export__=function(a){return y(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return y(a)===k};__webpack_unused_export__=function(a){return y(a)===d};__webpack_unused_export__=function(a){return y(a)===p};__webpack_unused_export__=function(a){return y(a)===n}; 162 __webpack_unused_export__=function(a){return y(a)===c};__webpack_unused_export__=function(a){return y(a)===f};__webpack_unused_export__=function(a){return y(a)===e};__webpack_unused_export__=function(a){return y(a)===l};__webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1}; 163 __webpack_unused_export__=y; 164 165 166 /***/ }), 167 168 /***/ 1915: 169 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 170 171 "use strict"; 172 173 174 if (true) { 175 /* unused reexport */ __webpack_require__(2287); 176 } else {} 177 178 179 /***/ }), 180 181 /***/ 7734: 182 /***/ ((module) => { 183 184 "use strict"; 185 186 187 // do not edit .js files directly - edit src/index.jst 188 189 190 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 191 192 193 module.exports = function equal(a, b) { 194 if (a === b) return true; 195 196 if (a && b && typeof a == 'object' && typeof b == 'object') { 197 if (a.constructor !== b.constructor) return false; 198 199 var length, i, keys; 200 if (Array.isArray(a)) { 201 length = a.length; 202 if (length != b.length) return false; 203 for (i = length; i-- !== 0;) 204 if (!equal(a[i], b[i])) return false; 205 return true; 206 } 207 208 209 if ((a instanceof Map) && (b instanceof Map)) { 210 if (a.size !== b.size) return false; 211 for (i of a.entries()) 212 if (!b.has(i[0])) return false; 213 for (i of a.entries()) 214 if (!equal(i[1], b.get(i[0]))) return false; 215 return true; 216 } 217 218 if ((a instanceof Set) && (b instanceof Set)) { 219 if (a.size !== b.size) return false; 220 for (i of a.entries()) 221 if (!b.has(i[0])) return false; 222 return true; 223 } 224 225 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 226 length = a.length; 227 if (length != b.length) return false; 228 for (i = length; i-- !== 0;) 229 if (a[i] !== b[i]) return false; 230 return true; 231 } 232 233 234 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 235 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 236 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 237 238 keys = Object.keys(a); 239 length = keys.length; 240 if (length !== Object.keys(b).length) return false; 241 242 for (i = length; i-- !== 0;) 243 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 244 245 for (i = length; i-- !== 0;) { 246 var key = keys[i]; 247 248 if (!equal(a[key], b[key])) return false; 249 } 250 251 return true; 252 } 253 254 // true if both NaN, false otherwise 255 return a!==a && b!==b; 256 }; 257 258 259 /***/ }), 260 261 /***/ 8924: 262 /***/ ((__unused_webpack_module, exports) => { 263 264 // Copyright (c) 2014 Rafael Caricio. All rights reserved. 265 // Use of this source code is governed by a BSD-style license that can be 266 // found in the LICENSE file. 267 268 var GradientParser = {}; 269 270 GradientParser.parse = (function() { 271 272 var tokens = { 273 linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, 274 repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, 275 radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, 276 repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, 277 sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, 278 extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, 279 positionKeywords: /^(left|center|right|top|bottom)/i, 280 pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, 281 percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, 282 emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, 283 angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, 284 startCall: /^\(/, 285 endCall: /^\)/, 286 comma: /^,/, 287 hexColor: /^\#([0-9a-fA-F]+)/, 288 literalColor: /^([a-zA-Z]+)/, 289 rgbColor: /^rgb/i, 290 rgbaColor: /^rgba/i, 291 number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ 292 }; 293 294 var input = ''; 295 296 function error(msg) { 297 var err = new Error(input + ': ' + msg); 298 err.source = input; 299 throw err; 300 } 301 302 function getAST() { 303 var ast = matchListDefinitions(); 304 305 if (input.length > 0) { 306 error('Invalid input not EOF'); 307 } 308 309 return ast; 310 } 311 312 function matchListDefinitions() { 313 return matchListing(matchDefinition); 314 } 315 316 function matchDefinition() { 317 return matchGradient( 318 'linear-gradient', 319 tokens.linearGradient, 320 matchLinearOrientation) || 321 322 matchGradient( 323 'repeating-linear-gradient', 324 tokens.repeatingLinearGradient, 325 matchLinearOrientation) || 326 327 matchGradient( 328 'radial-gradient', 329 tokens.radialGradient, 330 matchListRadialOrientations) || 331 332 matchGradient( 333 'repeating-radial-gradient', 334 tokens.repeatingRadialGradient, 335 matchListRadialOrientations); 336 } 337 338 function matchGradient(gradientType, pattern, orientationMatcher) { 339 return matchCall(pattern, function(captures) { 340 341 var orientation = orientationMatcher(); 342 if (orientation) { 343 if (!scan(tokens.comma)) { 344 error('Missing comma before color stops'); 345 } 346 } 347 348 return { 349 type: gradientType, 350 orientation: orientation, 351 colorStops: matchListing(matchColorStop) 352 }; 353 }); 354 } 355 356 function matchCall(pattern, callback) { 357 var captures = scan(pattern); 358 359 if (captures) { 360 if (!scan(tokens.startCall)) { 361 error('Missing ('); 362 } 363 364 result = callback(captures); 365 366 if (!scan(tokens.endCall)) { 367 error('Missing )'); 368 } 369 370 return result; 371 } 372 } 373 374 function matchLinearOrientation() { 375 return matchSideOrCorner() || 376 matchAngle(); 377 } 378 379 function matchSideOrCorner() { 380 return match('directional', tokens.sideOrCorner, 1); 381 } 382 383 function matchAngle() { 384 return match('angular', tokens.angleValue, 1); 385 } 386 387 function matchListRadialOrientations() { 388 var radialOrientations, 389 radialOrientation = matchRadialOrientation(), 390 lookaheadCache; 391 392 if (radialOrientation) { 393 radialOrientations = []; 394 radialOrientations.push(radialOrientation); 395 396 lookaheadCache = input; 397 if (scan(tokens.comma)) { 398 radialOrientation = matchRadialOrientation(); 399 if (radialOrientation) { 400 radialOrientations.push(radialOrientation); 401 } else { 402 input = lookaheadCache; 403 } 404 } 405 } 406 407 return radialOrientations; 408 } 409 410 function matchRadialOrientation() { 411 var radialType = matchCircle() || 412 matchEllipse(); 413 414 if (radialType) { 415 radialType.at = matchAtPosition(); 416 } else { 417 var defaultPosition = matchPositioning(); 418 if (defaultPosition) { 419 radialType = { 420 type: 'default-radial', 421 at: defaultPosition 422 }; 423 } 424 } 425 426 return radialType; 427 } 428 429 function matchCircle() { 430 var circle = match('shape', /^(circle)/i, 0); 431 432 if (circle) { 433 circle.style = matchLength() || matchExtentKeyword(); 434 } 435 436 return circle; 437 } 438 439 function matchEllipse() { 440 var ellipse = match('shape', /^(ellipse)/i, 0); 441 442 if (ellipse) { 443 ellipse.style = matchDistance() || matchExtentKeyword(); 444 } 445 446 return ellipse; 447 } 448 449 function matchExtentKeyword() { 450 return match('extent-keyword', tokens.extentKeywords, 1); 451 } 452 453 function matchAtPosition() { 454 if (match('position', /^at/, 0)) { 455 var positioning = matchPositioning(); 456 457 if (!positioning) { 458 error('Missing positioning value'); 459 } 460 461 return positioning; 462 } 463 } 464 465 function matchPositioning() { 466 var location = matchCoordinates(); 467 468 if (location.x || location.y) { 469 return { 470 type: 'position', 471 value: location 472 }; 473 } 474 } 475 476 function matchCoordinates() { 477 return { 478 x: matchDistance(), 479 y: matchDistance() 480 }; 481 } 482 483 function matchListing(matcher) { 484 var captures = matcher(), 485 result = []; 486 487 if (captures) { 488 result.push(captures); 489 while (scan(tokens.comma)) { 490 captures = matcher(); 491 if (captures) { 492 result.push(captures); 493 } else { 494 error('One extra comma'); 495 } 496 } 497 } 498 499 return result; 500 } 501 502 function matchColorStop() { 503 var color = matchColor(); 504 505 if (!color) { 506 error('Expected color definition'); 507 } 508 509 color.length = matchDistance(); 510 return color; 511 } 512 513 function matchColor() { 514 return matchHexColor() || 515 matchRGBAColor() || 516 matchRGBColor() || 517 matchLiteralColor(); 518 } 519 520 function matchLiteralColor() { 521 return match('literal', tokens.literalColor, 0); 522 } 523 524 function matchHexColor() { 525 return match('hex', tokens.hexColor, 1); 526 } 527 528 function matchRGBColor() { 529 return matchCall(tokens.rgbColor, function() { 530 return { 531 type: 'rgb', 532 value: matchListing(matchNumber) 533 }; 534 }); 535 } 536 537 function matchRGBAColor() { 538 return matchCall(tokens.rgbaColor, function() { 539 return { 540 type: 'rgba', 541 value: matchListing(matchNumber) 542 }; 543 }); 544 } 545 546 function matchNumber() { 547 return scan(tokens.number)[1]; 548 } 549 550 function matchDistance() { 551 return match('%', tokens.percentageValue, 1) || 552 matchPositionKeyword() || 553 matchLength(); 554 } 555 556 function matchPositionKeyword() { 557 return match('position-keyword', tokens.positionKeywords, 1); 558 } 559 560 function matchLength() { 561 return match('px', tokens.pixelValue, 1) || 562 match('em', tokens.emValue, 1); 563 } 564 565 function match(type, pattern, captureIndex) { 566 var captures = scan(pattern); 567 if (captures) { 568 return { 569 type: type, 570 value: captures[captureIndex] 571 }; 572 } 573 } 574 575 function scan(regexp) { 576 var captures, 577 blankCaptures; 578 579 blankCaptures = /^[\n\r\t\s]+/.exec(input); 580 if (blankCaptures) { 581 consume(blankCaptures[0].length); 582 } 583 584 captures = regexp.exec(input); 585 if (captures) { 586 consume(captures[0].length); 587 } 588 589 return captures; 590 } 591 592 function consume(size) { 593 input = input.substr(size); 594 } 595 596 return function(code) { 597 input = code.toString(); 598 return getAST(); 599 }; 600 })(); 601 602 exports.parse = (GradientParser || {}).parse; 603 604 605 /***/ }), 606 607 /***/ 9664: 608 /***/ ((module) => { 609 610 module.exports = 611 /******/ (function(modules) { // webpackBootstrap 612 /******/ // The module cache 613 /******/ var installedModules = {}; 614 /******/ 615 /******/ // The require function 616 /******/ function __nested_webpack_require_187__(moduleId) { 617 /******/ 618 /******/ // Check if module is in cache 619 /******/ if(installedModules[moduleId]) 620 /******/ return installedModules[moduleId].exports; 621 /******/ 622 /******/ // Create a new module (and put it into the cache) 623 /******/ var module = installedModules[moduleId] = { 624 /******/ exports: {}, 625 /******/ id: moduleId, 626 /******/ loaded: false 627 /******/ }; 628 /******/ 629 /******/ // Execute the module function 630 /******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__); 631 /******/ 632 /******/ // Flag the module as loaded 633 /******/ module.loaded = true; 634 /******/ 635 /******/ // Return the exports of the module 636 /******/ return module.exports; 637 /******/ } 638 /******/ 639 /******/ 640 /******/ // expose the modules object (__webpack_modules__) 641 /******/ __nested_webpack_require_187__.m = modules; 642 /******/ 643 /******/ // expose the module cache 644 /******/ __nested_webpack_require_187__.c = installedModules; 645 /******/ 646 /******/ // __webpack_public_path__ 647 /******/ __nested_webpack_require_187__.p = ""; 648 /******/ 649 /******/ // Load entry module and return exports 650 /******/ return __nested_webpack_require_187__(0); 651 /******/ }) 652 /************************************************************************/ 653 /******/ ([ 654 /* 0 */ 655 /***/ (function(module, exports, __nested_webpack_require_1468__) { 656 657 module.exports = __nested_webpack_require_1468__(1); 658 659 660 /***/ }), 661 /* 1 */ 662 /***/ (function(module, exports, __nested_webpack_require_1587__) { 663 664 'use strict'; 665 666 Object.defineProperty(exports, "__esModule", { 667 value: true 668 }); 669 670 var _utils = __nested_webpack_require_1587__(2); 671 672 Object.defineProperty(exports, 'combineChunks', { 673 enumerable: true, 674 get: function get() { 675 return _utils.combineChunks; 676 } 677 }); 678 Object.defineProperty(exports, 'fillInChunks', { 679 enumerable: true, 680 get: function get() { 681 return _utils.fillInChunks; 682 } 683 }); 684 Object.defineProperty(exports, 'findAll', { 685 enumerable: true, 686 get: function get() { 687 return _utils.findAll; 688 } 689 }); 690 Object.defineProperty(exports, 'findChunks', { 691 enumerable: true, 692 get: function get() { 693 return _utils.findChunks; 694 } 695 }); 696 697 /***/ }), 698 /* 2 */ 699 /***/ (function(module, exports) { 700 701 'use strict'; 702 703 Object.defineProperty(exports, "__esModule", { 704 value: true 705 }); 706 707 708 /** 709 * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. 710 * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) 711 */ 712 var findAll = exports.findAll = function findAll(_ref) { 713 var autoEscape = _ref.autoEscape, 714 _ref$caseSensitive = _ref.caseSensitive, 715 caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive, 716 _ref$findChunks = _ref.findChunks, 717 findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks, 718 sanitize = _ref.sanitize, 719 searchWords = _ref.searchWords, 720 textToHighlight = _ref.textToHighlight; 721 return fillInChunks({ 722 chunksToHighlight: combineChunks({ 723 chunks: findChunks({ 724 autoEscape: autoEscape, 725 caseSensitive: caseSensitive, 726 sanitize: sanitize, 727 searchWords: searchWords, 728 textToHighlight: textToHighlight 729 }) 730 }), 731 totalLength: textToHighlight ? textToHighlight.length : 0 732 }); 733 }; 734 735 /** 736 * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. 737 * @return {start:number, end:number}[] 738 */ 739 740 741 var combineChunks = exports.combineChunks = function combineChunks(_ref2) { 742 var chunks = _ref2.chunks; 743 744 chunks = chunks.sort(function (first, second) { 745 return first.start - second.start; 746 }).reduce(function (processedChunks, nextChunk) { 747 // First chunk just goes straight in the array... 748 if (processedChunks.length === 0) { 749 return [nextChunk]; 750 } else { 751 // ... subsequent chunks get checked to see if they overlap... 752 var prevChunk = processedChunks.pop(); 753 if (nextChunk.start <= prevChunk.end) { 754 // It may be the case that prevChunk completely surrounds nextChunk, so take the 755 // largest of the end indeces. 756 var endIndex = Math.max(prevChunk.end, nextChunk.end); 757 processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); 758 } else { 759 processedChunks.push(prevChunk, nextChunk); 760 } 761 return processedChunks; 762 } 763 }, []); 764 765 return chunks; 766 }; 767 768 /** 769 * Examine text for any matches. 770 * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). 771 * @return {start:number, end:number}[] 772 */ 773 var defaultFindChunks = function defaultFindChunks(_ref3) { 774 var autoEscape = _ref3.autoEscape, 775 caseSensitive = _ref3.caseSensitive, 776 _ref3$sanitize = _ref3.sanitize, 777 sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize, 778 searchWords = _ref3.searchWords, 779 textToHighlight = _ref3.textToHighlight; 780 781 textToHighlight = sanitize(textToHighlight); 782 783 return searchWords.filter(function (searchWord) { 784 return searchWord; 785 }) // Remove empty words 786 .reduce(function (chunks, searchWord) { 787 searchWord = sanitize(searchWord); 788 789 if (autoEscape) { 790 searchWord = escapeRegExpFn(searchWord); 791 } 792 793 var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); 794 795 var match = void 0; 796 while (match = regex.exec(textToHighlight)) { 797 var _start = match.index; 798 var _end = regex.lastIndex; 799 // We do not return zero-length matches 800 if (_end > _start) { 801 chunks.push({ highlight: false, start: _start, end: _end }); 802 } 803 804 // Prevent browsers like Firefox from getting stuck in an infinite loop 805 // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ 806 if (match.index === regex.lastIndex) { 807 regex.lastIndex++; 808 } 809 } 810 811 return chunks; 812 }, []); 813 }; 814 // Allow the findChunks to be overridden in findAll, 815 // but for backwards compatibility we export as the old name 816 exports.findChunks = defaultFindChunks; 817 818 /** 819 * Given a set of chunks to highlight, create an additional set of chunks 820 * to represent the bits of text between the highlighted text. 821 * @param chunksToHighlight {start:number, end:number}[] 822 * @param totalLength number 823 * @return {start:number, end:number, highlight:boolean}[] 824 */ 825 826 var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) { 827 var chunksToHighlight = _ref4.chunksToHighlight, 828 totalLength = _ref4.totalLength; 829 830 var allChunks = []; 831 var append = function append(start, end, highlight) { 832 if (end - start > 0) { 833 allChunks.push({ 834 start: start, 835 end: end, 836 highlight: highlight 837 }); 838 } 839 }; 840 841 if (chunksToHighlight.length === 0) { 842 append(0, totalLength, false); 843 } else { 844 var lastIndex = 0; 845 chunksToHighlight.forEach(function (chunk) { 846 append(lastIndex, chunk.start, false); 847 append(chunk.start, chunk.end, true); 848 lastIndex = chunk.end; 849 }); 850 append(lastIndex, totalLength, false); 851 } 852 return allChunks; 853 }; 854 855 function defaultSanitize(string) { 856 return string; 857 } 858 859 function escapeRegExpFn(string) { 860 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); 861 } 862 863 /***/ }) 864 /******/ ]); 865 866 867 /***/ }), 868 869 /***/ 1880: 870 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 871 872 "use strict"; 873 874 875 var reactIs = __webpack_require__(1178); 876 877 /** 878 * Copyright 2015, Yahoo! Inc. 879 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 880 */ 881 var REACT_STATICS = { 882 childContextTypes: true, 883 contextType: true, 884 contextTypes: true, 885 defaultProps: true, 886 displayName: true, 887 getDefaultProps: true, 888 getDerivedStateFromError: true, 889 getDerivedStateFromProps: true, 890 mixins: true, 891 propTypes: true, 892 type: true 893 }; 894 var KNOWN_STATICS = { 895 name: true, 896 length: true, 897 prototype: true, 898 caller: true, 899 callee: true, 900 arguments: true, 901 arity: true 902 }; 903 var FORWARD_REF_STATICS = { 904 '$$typeof': true, 905 render: true, 906 defaultProps: true, 907 displayName: true, 908 propTypes: true 909 }; 910 var MEMO_STATICS = { 911 '$$typeof': true, 912 compare: true, 913 defaultProps: true, 914 displayName: true, 915 propTypes: true, 916 type: true 917 }; 918 var TYPE_STATICS = {}; 919 TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; 920 TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; 921 922 function getStatics(component) { 923 // React v16.11 and below 924 if (reactIs.isMemo(component)) { 925 return MEMO_STATICS; 926 } // React v16.12 and above 927 928 929 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; 930 } 931 932 var defineProperty = Object.defineProperty; 933 var getOwnPropertyNames = Object.getOwnPropertyNames; 934 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 935 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 936 var getPrototypeOf = Object.getPrototypeOf; 937 var objectPrototype = Object.prototype; 938 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { 939 if (typeof sourceComponent !== 'string') { 940 // don't hoist over string (html) components 941 if (objectPrototype) { 942 var inheritedComponent = getPrototypeOf(sourceComponent); 943 944 if (inheritedComponent && inheritedComponent !== objectPrototype) { 945 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 946 } 947 } 948 949 var keys = getOwnPropertyNames(sourceComponent); 950 951 if (getOwnPropertySymbols) { 952 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 953 } 954 955 var targetStatics = getStatics(targetComponent); 956 var sourceStatics = getStatics(sourceComponent); 957 958 for (var i = 0; i < keys.length; ++i) { 959 var key = keys[i]; 960 961 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 962 var descriptor = getOwnPropertyDescriptor(sourceComponent, key); 963 964 try { 965 // Avoid failures from read-only properties 966 defineProperty(targetComponent, key, descriptor); 967 } catch (e) {} 968 } 969 } 970 } 971 972 return targetComponent; 973 } 974 975 module.exports = hoistNonReactStatics; 976 977 978 /***/ }), 979 980 /***/ 2950: 981 /***/ ((__unused_webpack_module, exports) => { 982 983 "use strict"; 984 /** @license React v16.13.1 985 * react-is.production.min.js 986 * 987 * Copyright (c) Facebook, Inc. and its affiliates. 988 * 989 * This source code is licensed under the MIT license found in the 990 * LICENSE file in the root directory of this source tree. 991 */ 992 993 var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? 994 Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; 995 function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; 996 exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; 997 exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; 998 exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; 999 1000 1001 /***/ }), 1002 1003 /***/ 1178: 1004 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1005 1006 "use strict"; 1007 1008 1009 if (true) { 1010 module.exports = __webpack_require__(2950); 1011 } else {} 1012 1013 1014 /***/ }), 1015 1016 /***/ 628: 1017 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1018 1019 "use strict"; 1020 /** 1021 * Copyright (c) 2013-present, Facebook, Inc. 1022 * 1023 * This source code is licensed under the MIT license found in the 1024 * LICENSE file in the root directory of this source tree. 1025 */ 1026 1027 1028 1029 var ReactPropTypesSecret = __webpack_require__(4067); 1030 1031 function emptyFunction() {} 1032 function emptyFunctionWithReset() {} 1033 emptyFunctionWithReset.resetWarningCache = emptyFunction; 1034 1035 module.exports = function() { 1036 function shim(props, propName, componentName, location, propFullName, secret) { 1037 if (secret === ReactPropTypesSecret) { 1038 // It is still safe when called from React. 1039 return; 1040 } 1041 var err = new Error( 1042 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 1043 'Use PropTypes.checkPropTypes() to call them. ' + 1044 'Read more at http://fb.me/use-check-prop-types' 1045 ); 1046 err.name = 'Invariant Violation'; 1047 throw err; 1048 }; 1049 shim.isRequired = shim; 1050 function getShim() { 1051 return shim; 1052 }; 1053 // Important! 1054 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. 1055 var ReactPropTypes = { 1056 array: shim, 1057 bigint: shim, 1058 bool: shim, 1059 func: shim, 1060 number: shim, 1061 object: shim, 1062 string: shim, 1063 symbol: shim, 1064 1065 any: shim, 1066 arrayOf: getShim, 1067 element: shim, 1068 elementType: shim, 1069 instanceOf: getShim, 1070 node: shim, 1071 objectOf: getShim, 1072 oneOf: getShim, 1073 oneOfType: getShim, 1074 shape: getShim, 1075 exact: getShim, 1076 1077 checkPropTypes: emptyFunctionWithReset, 1078 resetWarningCache: emptyFunction 1079 }; 1080 1081 ReactPropTypes.PropTypes = ReactPropTypes; 1082 1083 return ReactPropTypes; 1084 }; 1085 1086 1087 /***/ }), 1088 1089 /***/ 5826: 1090 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1091 1092 /** 1093 * Copyright (c) 2013-present, Facebook, Inc. 1094 * 1095 * This source code is licensed under the MIT license found in the 1096 * LICENSE file in the root directory of this source tree. 1097 */ 1098 1099 if (false) { var throwOnDirectAccess, ReactIs; } else { 1100 // By explicitly using `prop-types` you are opting into new production behavior. 1101 // http://fb.me/prop-types-in-prod 1102 module.exports = __webpack_require__(628)(); 1103 } 1104 1105 1106 /***/ }), 1107 1108 /***/ 4067: 1109 /***/ ((module) => { 1110 1111 "use strict"; 1112 /** 1113 * Copyright (c) 2013-present, Facebook, Inc. 1114 * 1115 * This source code is licensed under the MIT license found in the 1116 * LICENSE file in the root directory of this source tree. 1117 */ 1118 1119 1120 1121 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 1122 1123 module.exports = ReactPropTypesSecret; 1124 1125 1126 /***/ }), 1127 1128 /***/ 9681: 1129 /***/ ((module) => { 1130 1131 var characterMap = { 1132 "À": "A", 1133 "Á": "A", 1134 "Â": "A", 1135 "Ã": "A", 1136 "Ä": "A", 1137 "Å": "A", 1138 "Ấ": "A", 1139 "Ắ": "A", 1140 "Ẳ": "A", 1141 "Ẵ": "A", 1142 "Ặ": "A", 1143 "Æ": "AE", 1144 "Ầ": "A", 1145 "Ằ": "A", 1146 "Ȃ": "A", 1147 "Ả": "A", 1148 "Ạ": "A", 1149 "Ẩ": "A", 1150 "Ẫ": "A", 1151 "Ậ": "A", 1152 "Ç": "C", 1153 "Ḉ": "C", 1154 "È": "E", 1155 "É": "E", 1156 "Ê": "E", 1157 "Ë": "E", 1158 "Ế": "E", 1159 "Ḗ": "E", 1160 "Ề": "E", 1161 "Ḕ": "E", 1162 "Ḝ": "E", 1163 "Ȇ": "E", 1164 "Ẻ": "E", 1165 "Ẽ": "E", 1166 "Ẹ": "E", 1167 "Ể": "E", 1168 "Ễ": "E", 1169 "Ệ": "E", 1170 "Ì": "I", 1171 "Í": "I", 1172 "Î": "I", 1173 "Ï": "I", 1174 "Ḯ": "I", 1175 "Ȋ": "I", 1176 "Ỉ": "I", 1177 "Ị": "I", 1178 "Ð": "D", 1179 "Ñ": "N", 1180 "Ò": "O", 1181 "Ó": "O", 1182 "Ô": "O", 1183 "Õ": "O", 1184 "Ö": "O", 1185 "Ø": "O", 1186 "Ố": "O", 1187 "Ṍ": "O", 1188 "Ṓ": "O", 1189 "Ȏ": "O", 1190 "Ỏ": "O", 1191 "Ọ": "O", 1192 "Ổ": "O", 1193 "Ỗ": "O", 1194 "Ộ": "O", 1195 "Ờ": "O", 1196 "Ở": "O", 1197 "Ỡ": "O", 1198 "Ớ": "O", 1199 "Ợ": "O", 1200 "Ù": "U", 1201 "Ú": "U", 1202 "Û": "U", 1203 "Ü": "U", 1204 "Ủ": "U", 1205 "Ụ": "U", 1206 "Ử": "U", 1207 "Ữ": "U", 1208 "Ự": "U", 1209 "Ý": "Y", 1210 "à": "a", 1211 "á": "a", 1212 "â": "a", 1213 "ã": "a", 1214 "ä": "a", 1215 "å": "a", 1216 "ấ": "a", 1217 "ắ": "a", 1218 "ẳ": "a", 1219 "ẵ": "a", 1220 "ặ": "a", 1221 "æ": "ae", 1222 "ầ": "a", 1223 "ằ": "a", 1224 "ȃ": "a", 1225 "ả": "a", 1226 "ạ": "a", 1227 "ẩ": "a", 1228 "ẫ": "a", 1229 "ậ": "a", 1230 "ç": "c", 1231 "ḉ": "c", 1232 "è": "e", 1233 "é": "e", 1234 "ê": "e", 1235 "ë": "e", 1236 "ế": "e", 1237 "ḗ": "e", 1238 "ề": "e", 1239 "ḕ": "e", 1240 "ḝ": "e", 1241 "ȇ": "e", 1242 "ẻ": "e", 1243 "ẽ": "e", 1244 "ẹ": "e", 1245 "ể": "e", 1246 "ễ": "e", 1247 "ệ": "e", 1248 "ì": "i", 1249 "í": "i", 1250 "î": "i", 1251 "ï": "i", 1252 "ḯ": "i", 1253 "ȋ": "i", 1254 "ỉ": "i", 1255 "ị": "i", 1256 "ð": "d", 1257 "ñ": "n", 1258 "ò": "o", 1259 "ó": "o", 1260 "ô": "o", 1261 "õ": "o", 1262 "ö": "o", 1263 "ø": "o", 1264 "ố": "o", 1265 "ṍ": "o", 1266 "ṓ": "o", 1267 "ȏ": "o", 1268 "ỏ": "o", 1269 "ọ": "o", 1270 "ổ": "o", 1271 "ỗ": "o", 1272 "ộ": "o", 1273 "ờ": "o", 1274 "ở": "o", 1275 "ỡ": "o", 1276 "ớ": "o", 1277 "ợ": "o", 1278 "ù": "u", 1279 "ú": "u", 1280 "û": "u", 1281 "ü": "u", 1282 "ủ": "u", 1283 "ụ": "u", 1284 "ử": "u", 1285 "ữ": "u", 1286 "ự": "u", 1287 "ý": "y", 1288 "ÿ": "y", 1289 "Ā": "A", 1290 "ā": "a", 1291 "Ă": "A", 1292 "ă": "a", 1293 "Ą": "A", 1294 "ą": "a", 1295 "Ć": "C", 1296 "ć": "c", 1297 "Ĉ": "C", 1298 "ĉ": "c", 1299 "Ċ": "C", 1300 "ċ": "c", 1301 "Č": "C", 1302 "č": "c", 1303 "C̆": "C", 1304 "c̆": "c", 1305 "Ď": "D", 1306 "ď": "d", 1307 "Đ": "D", 1308 "đ": "d", 1309 "Ē": "E", 1310 "ē": "e", 1311 "Ĕ": "E", 1312 "ĕ": "e", 1313 "Ė": "E", 1314 "ė": "e", 1315 "Ę": "E", 1316 "ę": "e", 1317 "Ě": "E", 1318 "ě": "e", 1319 "Ĝ": "G", 1320 "Ǵ": "G", 1321 "ĝ": "g", 1322 "ǵ": "g", 1323 "Ğ": "G", 1324 "ğ": "g", 1325 "Ġ": "G", 1326 "ġ": "g", 1327 "Ģ": "G", 1328 "ģ": "g", 1329 "Ĥ": "H", 1330 "ĥ": "h", 1331 "Ħ": "H", 1332 "ħ": "h", 1333 "Ḫ": "H", 1334 "ḫ": "h", 1335 "Ĩ": "I", 1336 "ĩ": "i", 1337 "Ī": "I", 1338 "ī": "i", 1339 "Ĭ": "I", 1340 "ĭ": "i", 1341 "Į": "I", 1342 "į": "i", 1343 "İ": "I", 1344 "ı": "i", 1345 "IJ": "IJ", 1346 "ij": "ij", 1347 "Ĵ": "J", 1348 "ĵ": "j", 1349 "Ķ": "K", 1350 "ķ": "k", 1351 "Ḱ": "K", 1352 "ḱ": "k", 1353 "K̆": "K", 1354 "k̆": "k", 1355 "Ĺ": "L", 1356 "ĺ": "l", 1357 "Ļ": "L", 1358 "ļ": "l", 1359 "Ľ": "L", 1360 "ľ": "l", 1361 "Ŀ": "L", 1362 "ŀ": "l", 1363 "Ł": "l", 1364 "ł": "l", 1365 "Ḿ": "M", 1366 "ḿ": "m", 1367 "M̆": "M", 1368 "m̆": "m", 1369 "Ń": "N", 1370 "ń": "n", 1371 "Ņ": "N", 1372 "ņ": "n", 1373 "Ň": "N", 1374 "ň": "n", 1375 "ʼn": "n", 1376 "N̆": "N", 1377 "n̆": "n", 1378 "Ō": "O", 1379 "ō": "o", 1380 "Ŏ": "O", 1381 "ŏ": "o", 1382 "Ő": "O", 1383 "ő": "o", 1384 "Œ": "OE", 1385 "œ": "oe", 1386 "P̆": "P", 1387 "p̆": "p", 1388 "Ŕ": "R", 1389 "ŕ": "r", 1390 "Ŗ": "R", 1391 "ŗ": "r", 1392 "Ř": "R", 1393 "ř": "r", 1394 "R̆": "R", 1395 "r̆": "r", 1396 "Ȓ": "R", 1397 "ȓ": "r", 1398 "Ś": "S", 1399 "ś": "s", 1400 "Ŝ": "S", 1401 "ŝ": "s", 1402 "Ş": "S", 1403 "Ș": "S", 1404 "ș": "s", 1405 "ş": "s", 1406 "Š": "S", 1407 "š": "s", 1408 "Ţ": "T", 1409 "ţ": "t", 1410 "ț": "t", 1411 "Ț": "T", 1412 "Ť": "T", 1413 "ť": "t", 1414 "Ŧ": "T", 1415 "ŧ": "t", 1416 "T̆": "T", 1417 "t̆": "t", 1418 "Ũ": "U", 1419 "ũ": "u", 1420 "Ū": "U", 1421 "ū": "u", 1422 "Ŭ": "U", 1423 "ŭ": "u", 1424 "Ů": "U", 1425 "ů": "u", 1426 "Ű": "U", 1427 "ű": "u", 1428 "Ų": "U", 1429 "ų": "u", 1430 "Ȗ": "U", 1431 "ȗ": "u", 1432 "V̆": "V", 1433 "v̆": "v", 1434 "Ŵ": "W", 1435 "ŵ": "w", 1436 "Ẃ": "W", 1437 "ẃ": "w", 1438 "X̆": "X", 1439 "x̆": "x", 1440 "Ŷ": "Y", 1441 "ŷ": "y", 1442 "Ÿ": "Y", 1443 "Y̆": "Y", 1444 "y̆": "y", 1445 "Ź": "Z", 1446 "ź": "z", 1447 "Ż": "Z", 1448 "ż": "z", 1449 "Ž": "Z", 1450 "ž": "z", 1451 "ſ": "s", 1452 "ƒ": "f", 1453 "Ơ": "O", 1454 "ơ": "o", 1455 "Ư": "U", 1456 "ư": "u", 1457 "Ǎ": "A", 1458 "ǎ": "a", 1459 "Ǐ": "I", 1460 "ǐ": "i", 1461 "Ǒ": "O", 1462 "ǒ": "o", 1463 "Ǔ": "U", 1464 "ǔ": "u", 1465 "Ǖ": "U", 1466 "ǖ": "u", 1467 "Ǘ": "U", 1468 "ǘ": "u", 1469 "Ǚ": "U", 1470 "ǚ": "u", 1471 "Ǜ": "U", 1472 "ǜ": "u", 1473 "Ứ": "U", 1474 "ứ": "u", 1475 "Ṹ": "U", 1476 "ṹ": "u", 1477 "Ǻ": "A", 1478 "ǻ": "a", 1479 "Ǽ": "AE", 1480 "ǽ": "ae", 1481 "Ǿ": "O", 1482 "ǿ": "o", 1483 "Þ": "TH", 1484 "þ": "th", 1485 "Ṕ": "P", 1486 "ṕ": "p", 1487 "Ṥ": "S", 1488 "ṥ": "s", 1489 "X́": "X", 1490 "x́": "x", 1491 "Ѓ": "Г", 1492 "ѓ": "г", 1493 "Ќ": "К", 1494 "ќ": "к", 1495 "A̋": "A", 1496 "a̋": "a", 1497 "E̋": "E", 1498 "e̋": "e", 1499 "I̋": "I", 1500 "i̋": "i", 1501 "Ǹ": "N", 1502 "ǹ": "n", 1503 "Ồ": "O", 1504 "ồ": "o", 1505 "Ṑ": "O", 1506 "ṑ": "o", 1507 "Ừ": "U", 1508 "ừ": "u", 1509 "Ẁ": "W", 1510 "ẁ": "w", 1511 "Ỳ": "Y", 1512 "ỳ": "y", 1513 "Ȁ": "A", 1514 "ȁ": "a", 1515 "Ȅ": "E", 1516 "ȅ": "e", 1517 "Ȉ": "I", 1518 "ȉ": "i", 1519 "Ȍ": "O", 1520 "ȍ": "o", 1521 "Ȑ": "R", 1522 "ȑ": "r", 1523 "Ȕ": "U", 1524 "ȕ": "u", 1525 "B̌": "B", 1526 "b̌": "b", 1527 "Č̣": "C", 1528 "č̣": "c", 1529 "Ê̌": "E", 1530 "ê̌": "e", 1531 "F̌": "F", 1532 "f̌": "f", 1533 "Ǧ": "G", 1534 "ǧ": "g", 1535 "Ȟ": "H", 1536 "ȟ": "h", 1537 "J̌": "J", 1538 "ǰ": "j", 1539 "Ǩ": "K", 1540 "ǩ": "k", 1541 "M̌": "M", 1542 "m̌": "m", 1543 "P̌": "P", 1544 "p̌": "p", 1545 "Q̌": "Q", 1546 "q̌": "q", 1547 "Ř̩": "R", 1548 "ř̩": "r", 1549 "Ṧ": "S", 1550 "ṧ": "s", 1551 "V̌": "V", 1552 "v̌": "v", 1553 "W̌": "W", 1554 "w̌": "w", 1555 "X̌": "X", 1556 "x̌": "x", 1557 "Y̌": "Y", 1558 "y̌": "y", 1559 "A̧": "A", 1560 "a̧": "a", 1561 "B̧": "B", 1562 "b̧": "b", 1563 "Ḑ": "D", 1564 "ḑ": "d", 1565 "Ȩ": "E", 1566 "ȩ": "e", 1567 "Ɛ̧": "E", 1568 "ɛ̧": "e", 1569 "Ḩ": "H", 1570 "ḩ": "h", 1571 "I̧": "I", 1572 "i̧": "i", 1573 "Ɨ̧": "I", 1574 "ɨ̧": "i", 1575 "M̧": "M", 1576 "m̧": "m", 1577 "O̧": "O", 1578 "o̧": "o", 1579 "Q̧": "Q", 1580 "q̧": "q", 1581 "U̧": "U", 1582 "u̧": "u", 1583 "X̧": "X", 1584 "x̧": "x", 1585 "Z̧": "Z", 1586 "z̧": "z", 1587 "й":"и", 1588 "Й":"И", 1589 "ё":"е", 1590 "Ё":"Е", 1591 }; 1592 1593 var chars = Object.keys(characterMap).join('|'); 1594 var allAccents = new RegExp(chars, 'g'); 1595 var firstAccent = new RegExp(chars, ''); 1596 1597 function matcher(match) { 1598 return characterMap[match]; 1599 } 1600 1601 var removeAccents = function(string) { 1602 return string.replace(allAccents, matcher); 1603 }; 1604 1605 var hasAccents = function(string) { 1606 return !!string.match(firstAccent); 1607 }; 1608 1609 module.exports = removeAccents; 1610 module.exports.has = hasAccents; 1611 module.exports.remove = removeAccents; 1612 1613 1614 /***/ }), 1615 1616 /***/ 8477: 1617 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 1618 1619 "use strict"; 1620 /** 1621 * @license React 1622 * use-sync-external-store-shim.production.min.js 1623 * 1624 * Copyright (c) Facebook, Inc. and its affiliates. 1625 * 1626 * This source code is licensed under the MIT license found in the 1627 * LICENSE file in the root directory of this source tree. 1628 */ 1629 var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} 1630 function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; 1631 1632 1633 /***/ }), 1634 1635 /***/ 422: 1636 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1637 1638 "use strict"; 1639 1640 1641 if (true) { 1642 module.exports = __webpack_require__(8477); 1643 } else {} 1644 1645 1646 /***/ }), 1647 1648 /***/ 1609: 1649 /***/ ((module) => { 1650 1651 "use strict"; 1652 module.exports = window["React"]; 1653 1654 /***/ }) 1655 1656 /******/ }); 1657 /************************************************************************/ 1658 /******/ // The module cache 1659 /******/ var __webpack_module_cache__ = {}; 1660 /******/ 1661 /******/ // The require function 1662 /******/ function __webpack_require__(moduleId) { 1663 /******/ // Check if module is in cache 1664 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 1665 /******/ if (cachedModule !== undefined) { 1666 /******/ return cachedModule.exports; 1667 /******/ } 1668 /******/ // Create a new module (and put it into the cache) 1669 /******/ var module = __webpack_module_cache__[moduleId] = { 1670 /******/ // no module.id needed 1671 /******/ // no module.loaded needed 1672 /******/ exports: {} 1673 /******/ }; 1674 /******/ 1675 /******/ // Execute the module function 1676 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 1677 /******/ 1678 /******/ // Return the exports of the module 1679 /******/ return module.exports; 1680 /******/ } 1681 /******/ 1682 /************************************************************************/ 1683 /******/ /* webpack/runtime/compat get default export */ 1684 /******/ (() => { 1685 /******/ // getDefaultExport function for compatibility with non-harmony modules 1686 /******/ __webpack_require__.n = (module) => { 1687 /******/ var getter = module && module.__esModule ? 1688 /******/ () => (module['default']) : 1689 /******/ () => (module); 1690 /******/ __webpack_require__.d(getter, { a: getter }); 1691 /******/ return getter; 1692 /******/ }; 1693 /******/ })(); 1694 /******/ 1695 /******/ /* webpack/runtime/create fake namespace object */ 1696 /******/ (() => { 1697 /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); 1698 /******/ var leafPrototypes; 1699 /******/ // create a fake namespace object 1700 /******/ // mode & 1: value is a module id, require it 1701 /******/ // mode & 2: merge all properties of value into the ns 1702 /******/ // mode & 4: return value when already ns object 1703 /******/ // mode & 16: return value when it's Promise-like 1704 /******/ // mode & 8|1: behave like require 1705 /******/ __webpack_require__.t = function(value, mode) { 1706 /******/ if(mode & 1) value = this(value); 1707 /******/ if(mode & 8) return value; 1708 /******/ if(typeof value === 'object' && value) { 1709 /******/ if((mode & 4) && value.__esModule) return value; 1710 /******/ if((mode & 16) && typeof value.then === 'function') return value; 1711 /******/ } 1712 /******/ var ns = Object.create(null); 1713 /******/ __webpack_require__.r(ns); 1714 /******/ var def = {}; 1715 /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; 1716 /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { 1717 /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); 1718 /******/ } 1719 /******/ def['default'] = () => (value); 1720 /******/ __webpack_require__.d(ns, def); 1721 /******/ return ns; 1722 /******/ }; 1723 /******/ })(); 1724 /******/ 1725 /******/ /* webpack/runtime/define property getters */ 1726 /******/ (() => { 1727 /******/ // define getter functions for harmony exports 1728 /******/ __webpack_require__.d = (exports, definition) => { 1729 /******/ for(var key in definition) { 1730 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 1731 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 1732 /******/ } 1733 /******/ } 1734 /******/ }; 1735 /******/ })(); 1736 /******/ 1737 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 1738 /******/ (() => { 1739 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 1740 /******/ })(); 1741 /******/ 1742 /******/ /* webpack/runtime/make namespace object */ 1743 /******/ (() => { 1744 /******/ // define __esModule on exports 1745 /******/ __webpack_require__.r = (exports) => { 1746 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 1747 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 1748 /******/ } 1749 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 1750 /******/ }; 1751 /******/ })(); 1752 /******/ 1753 /******/ /* webpack/runtime/nonce */ 1754 /******/ (() => { 1755 /******/ __webpack_require__.nc = undefined; 1756 /******/ })(); 1757 /******/ 1758 /************************************************************************/ 1759 var __webpack_exports__ = {}; 1760 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 1761 (() => { 1762 "use strict"; 1763 // ESM COMPAT FLAG 1764 __webpack_require__.r(__webpack_exports__); 1765 1766 // EXPORTS 1767 __webpack_require__.d(__webpack_exports__, { 1768 AnglePickerControl: () => (/* reexport */ angle_picker_control), 1769 Animate: () => (/* reexport */ animate), 1770 Autocomplete: () => (/* reexport */ Autocomplete), 1771 BaseControl: () => (/* reexport */ base_control), 1772 BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation), 1773 Button: () => (/* reexport */ build_module_button), 1774 ButtonGroup: () => (/* reexport */ button_group), 1775 Card: () => (/* reexport */ card_component), 1776 CardBody: () => (/* reexport */ card_body_component), 1777 CardDivider: () => (/* reexport */ card_divider_component), 1778 CardFooter: () => (/* reexport */ card_footer_component), 1779 CardHeader: () => (/* reexport */ card_header_component), 1780 CardMedia: () => (/* reexport */ card_media_component), 1781 CheckboxControl: () => (/* reexport */ checkbox_control), 1782 Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle), 1783 ClipboardButton: () => (/* reexport */ ClipboardButton), 1784 ColorIndicator: () => (/* reexport */ color_indicator), 1785 ColorPalette: () => (/* reexport */ color_palette), 1786 ColorPicker: () => (/* reexport */ LegacyAdapter), 1787 ComboboxControl: () => (/* reexport */ combobox_control), 1788 CustomGradientPicker: () => (/* reexport */ custom_gradient_picker), 1789 CustomSelectControl: () => (/* reexport */ StableCustomSelectControl), 1790 Dashicon: () => (/* reexport */ dashicon), 1791 DatePicker: () => (/* reexport */ date), 1792 DateTimePicker: () => (/* reexport */ build_module_date_time), 1793 Disabled: () => (/* reexport */ disabled), 1794 Draggable: () => (/* reexport */ draggable), 1795 DropZone: () => (/* reexport */ drop_zone), 1796 DropZoneProvider: () => (/* reexport */ DropZoneProvider), 1797 Dropdown: () => (/* reexport */ dropdown), 1798 DropdownMenu: () => (/* reexport */ dropdown_menu), 1799 DuotonePicker: () => (/* reexport */ duotone_picker), 1800 DuotoneSwatch: () => (/* reexport */ duotone_swatch), 1801 ExternalLink: () => (/* reexport */ external_link), 1802 Fill: () => (/* reexport */ slot_fill_Fill), 1803 Flex: () => (/* reexport */ flex_component), 1804 FlexBlock: () => (/* reexport */ flex_block_component), 1805 FlexItem: () => (/* reexport */ flex_item_component), 1806 FocalPointPicker: () => (/* reexport */ focal_point_picker), 1807 FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider), 1808 FocusableIframe: () => (/* reexport */ FocusableIframe), 1809 FontSizePicker: () => (/* reexport */ font_size_picker), 1810 FormFileUpload: () => (/* reexport */ form_file_upload), 1811 FormToggle: () => (/* reexport */ form_toggle), 1812 FormTokenField: () => (/* reexport */ form_token_field), 1813 G: () => (/* reexport */ external_wp_primitives_namespaceObject.G), 1814 GradientPicker: () => (/* reexport */ gradient_picker), 1815 Guide: () => (/* reexport */ guide), 1816 GuidePage: () => (/* reexport */ GuidePage), 1817 HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule), 1818 Icon: () => (/* reexport */ build_module_icon), 1819 IconButton: () => (/* reexport */ deprecated), 1820 IsolatedEventContainer: () => (/* reexport */ isolated_event_container), 1821 KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), 1822 Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line), 1823 MenuGroup: () => (/* reexport */ menu_group), 1824 MenuItem: () => (/* reexport */ menu_item), 1825 MenuItemsChoice: () => (/* reexport */ menu_items_choice), 1826 Modal: () => (/* reexport */ modal), 1827 NavigableMenu: () => (/* reexport */ navigable_container_menu), 1828 Notice: () => (/* reexport */ build_module_notice), 1829 NoticeList: () => (/* reexport */ list), 1830 Panel: () => (/* reexport */ panel), 1831 PanelBody: () => (/* reexport */ body), 1832 PanelHeader: () => (/* reexport */ panel_header), 1833 PanelRow: () => (/* reexport */ row), 1834 Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path), 1835 Placeholder: () => (/* reexport */ placeholder), 1836 Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon), 1837 Popover: () => (/* reexport */ popover), 1838 ProgressBar: () => (/* reexport */ progress_bar), 1839 QueryControls: () => (/* reexport */ query_controls), 1840 RadioControl: () => (/* reexport */ radio_control), 1841 RangeControl: () => (/* reexport */ range_control), 1842 Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect), 1843 ResizableBox: () => (/* reexport */ resizable_box), 1844 ResponsiveWrapper: () => (/* reexport */ responsive_wrapper), 1845 SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG), 1846 SandBox: () => (/* reexport */ sandbox), 1847 ScrollLock: () => (/* reexport */ scroll_lock), 1848 SearchControl: () => (/* reexport */ search_control), 1849 SelectControl: () => (/* reexport */ select_control), 1850 Slot: () => (/* reexport */ slot_fill_Slot), 1851 SlotFillProvider: () => (/* reexport */ Provider), 1852 Snackbar: () => (/* reexport */ snackbar), 1853 SnackbarList: () => (/* reexport */ snackbar_list), 1854 Spinner: () => (/* reexport */ spinner), 1855 TabPanel: () => (/* reexport */ tab_panel), 1856 TabbableContainer: () => (/* reexport */ tabbable), 1857 TextControl: () => (/* reexport */ text_control), 1858 TextHighlight: () => (/* reexport */ text_highlight), 1859 TextareaControl: () => (/* reexport */ textarea_control), 1860 TimePicker: () => (/* reexport */ date_time_time), 1861 Tip: () => (/* reexport */ build_module_tip), 1862 ToggleControl: () => (/* reexport */ toggle_control), 1863 Toolbar: () => (/* reexport */ toolbar), 1864 ToolbarButton: () => (/* reexport */ toolbar_button), 1865 ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu), 1866 ToolbarGroup: () => (/* reexport */ toolbar_group), 1867 ToolbarItem: () => (/* reexport */ toolbar_item), 1868 Tooltip: () => (/* reexport */ tooltip), 1869 TreeSelect: () => (/* reexport */ tree_select), 1870 VisuallyHidden: () => (/* reexport */ visually_hidden_component), 1871 __experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control), 1872 __experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides), 1873 __experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component), 1874 __experimentalBorderControl: () => (/* reexport */ border_control_component), 1875 __experimentalBoxControl: () => (/* reexport */ box_control), 1876 __experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component), 1877 __experimentalDimensionControl: () => (/* reexport */ dimension_control), 1878 __experimentalDivider: () => (/* reexport */ divider_component), 1879 __experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper), 1880 __experimentalElevation: () => (/* reexport */ elevation_component), 1881 __experimentalGrid: () => (/* reexport */ grid_component), 1882 __experimentalHStack: () => (/* reexport */ h_stack_component), 1883 __experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders), 1884 __experimentalHeading: () => (/* reexport */ heading_component), 1885 __experimentalInputControl: () => (/* reexport */ input_control), 1886 __experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper), 1887 __experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper), 1888 __experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder), 1889 __experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder), 1890 __experimentalItem: () => (/* reexport */ item_component), 1891 __experimentalItemGroup: () => (/* reexport */ item_group_component), 1892 __experimentalNavigation: () => (/* reexport */ navigation), 1893 __experimentalNavigationBackButton: () => (/* reexport */ back_button), 1894 __experimentalNavigationGroup: () => (/* reexport */ group), 1895 __experimentalNavigationItem: () => (/* reexport */ navigation_item), 1896 __experimentalNavigationMenu: () => (/* reexport */ navigation_menu), 1897 __experimentalNavigatorBackButton: () => (/* reexport */ navigator_back_button_component), 1898 __experimentalNavigatorButton: () => (/* reexport */ navigator_button_component), 1899 __experimentalNavigatorProvider: () => (/* reexport */ navigator_provider_component), 1900 __experimentalNavigatorScreen: () => (/* reexport */ navigator_screen_component), 1901 __experimentalNavigatorToParentButton: () => (/* reexport */ navigator_to_parent_button_component), 1902 __experimentalNumberControl: () => (/* reexport */ number_control), 1903 __experimentalPaletteEdit: () => (/* reexport */ palette_edit), 1904 __experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue), 1905 __experimentalRadio: () => (/* reexport */ radio_group_radio), 1906 __experimentalRadioGroup: () => (/* reexport */ radio_group), 1907 __experimentalScrollable: () => (/* reexport */ scrollable_component), 1908 __experimentalSpacer: () => (/* reexport */ spacer_component), 1909 __experimentalStyleProvider: () => (/* reexport */ style_provider), 1910 __experimentalSurface: () => (/* reexport */ surface_component), 1911 __experimentalText: () => (/* reexport */ text_component), 1912 __experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component), 1913 __experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component), 1914 __experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component), 1915 __experimentalToolbarContext: () => (/* reexport */ toolbar_context), 1916 __experimentalToolsPanel: () => (/* reexport */ tools_panel_component), 1917 __experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext), 1918 __experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component), 1919 __experimentalTreeGrid: () => (/* reexport */ tree_grid), 1920 __experimentalTreeGridCell: () => (/* reexport */ cell), 1921 __experimentalTreeGridItem: () => (/* reexport */ tree_grid_item), 1922 __experimentalTreeGridRow: () => (/* reexport */ tree_grid_row), 1923 __experimentalTruncate: () => (/* reexport */ truncate_component), 1924 __experimentalUnitControl: () => (/* reexport */ unit_control), 1925 __experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits), 1926 __experimentalUseNavigator: () => (/* reexport */ use_navigator), 1927 __experimentalUseSlot: () => (/* reexport */ useSlot), 1928 __experimentalUseSlotFills: () => (/* reexport */ useSlotFills), 1929 __experimentalVStack: () => (/* reexport */ v_stack_component), 1930 __experimentalView: () => (/* reexport */ component), 1931 __experimentalZStack: () => (/* reexport */ z_stack_component), 1932 __unstableAnimatePresence: () => (/* reexport */ AnimatePresence), 1933 __unstableComposite: () => (/* reexport */ legacy_Composite), 1934 __unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup), 1935 __unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem), 1936 __unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent), 1937 __unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName), 1938 __unstableMotion: () => (/* reexport */ motion), 1939 __unstableMotionContext: () => (/* reexport */ MotionContext), 1940 __unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps), 1941 __unstableUseCompositeState: () => (/* reexport */ useCompositeState), 1942 __unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions), 1943 createSlotFill: () => (/* reexport */ createSlotFill), 1944 navigateRegions: () => (/* reexport */ navigate_regions), 1945 privateApis: () => (/* reexport */ privateApis), 1946 useBaseControlProps: () => (/* reexport */ useBaseControlProps), 1947 withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing), 1948 withFallbackStyles: () => (/* reexport */ with_fallback_styles), 1949 withFilters: () => (/* reexport */ withFilters), 1950 withFocusOutside: () => (/* reexport */ with_focus_outside), 1951 withFocusReturn: () => (/* reexport */ with_focus_return), 1952 withNotices: () => (/* reexport */ with_notices), 1953 withSpokenMessages: () => (/* reexport */ with_spoken_messages) 1954 }); 1955 1956 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js 1957 var text_styles_namespaceObject = {}; 1958 __webpack_require__.r(text_styles_namespaceObject); 1959 __webpack_require__.d(text_styles_namespaceObject, { 1960 Text: () => (Text), 1961 block: () => (styles_block), 1962 destructive: () => (destructive), 1963 highlighterText: () => (highlighterText), 1964 muted: () => (muted), 1965 positive: () => (positive), 1966 upperCase: () => (upperCase) 1967 }); 1968 1969 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js 1970 var toggle_group_control_option_base_styles_namespaceObject = {}; 1971 __webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject); 1972 __webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, { 1973 ButtonContentView: () => (ButtonContentView), 1974 LabelView: () => (LabelView), 1975 ou: () => (backdropView), 1976 uG: () => (buttonView), 1977 eh: () => (labelBlock) 1978 }); 1979 1980 ;// CONCATENATED MODULE: external ["wp","primitives"] 1981 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 1982 ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs 1983 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); 1984 ;// CONCATENATED MODULE: external ["wp","i18n"] 1985 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 1986 ;// CONCATENATED MODULE: external ["wp","compose"] 1987 const external_wp_compose_namespaceObject = window["wp"]["compose"]; 1988 // EXTERNAL MODULE: external "React" 1989 var external_React_ = __webpack_require__(1609); 1990 var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); 1991 var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); 1992 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SHA3WOPI.js 1993 "use client"; 1994 1995 // src/focusable/focusable-context.ts 1996 1997 var FocusableContext = (0,external_React_.createContext)(true); 1998 1999 2000 2001 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4R3V3JGP.js 2002 "use client"; 2003 var __defProp = Object.defineProperty; 2004 var __defProps = Object.defineProperties; 2005 var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 2006 var __getOwnPropSymbols = Object.getOwnPropertySymbols; 2007 var __hasOwnProp = Object.prototype.hasOwnProperty; 2008 var __propIsEnum = Object.prototype.propertyIsEnumerable; 2009 var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 2010 var _4R3V3JGP_spreadValues = (a, b) => { 2011 for (var prop in b || (b = {})) 2012 if (__hasOwnProp.call(b, prop)) 2013 __defNormalProp(a, prop, b[prop]); 2014 if (__getOwnPropSymbols) 2015 for (var prop of __getOwnPropSymbols(b)) { 2016 if (__propIsEnum.call(b, prop)) 2017 __defNormalProp(a, prop, b[prop]); 2018 } 2019 return a; 2020 }; 2021 var _4R3V3JGP_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 2022 var __objRest = (source, exclude) => { 2023 var target = {}; 2024 for (var prop in source) 2025 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 2026 target[prop] = source[prop]; 2027 if (source != null && __getOwnPropSymbols) 2028 for (var prop of __getOwnPropSymbols(source)) { 2029 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 2030 target[prop] = source[prop]; 2031 } 2032 return target; 2033 }; 2034 2035 2036 2037 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/4R3V3JGP.js 2038 "use client"; 2039 var _4R3V3JGP_defProp = Object.defineProperty; 2040 var _4R3V3JGP_defProps = Object.defineProperties; 2041 var _4R3V3JGP_getOwnPropDescs = Object.getOwnPropertyDescriptors; 2042 var _4R3V3JGP_getOwnPropSymbols = Object.getOwnPropertySymbols; 2043 var _4R3V3JGP_hasOwnProp = Object.prototype.hasOwnProperty; 2044 var _4R3V3JGP_propIsEnum = Object.prototype.propertyIsEnumerable; 2045 var _4R3V3JGP_defNormalProp = (obj, key, value) => key in obj ? _4R3V3JGP_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 2046 var _chunks_4R3V3JGP_spreadValues = (a, b) => { 2047 for (var prop in b || (b = {})) 2048 if (_4R3V3JGP_hasOwnProp.call(b, prop)) 2049 _4R3V3JGP_defNormalProp(a, prop, b[prop]); 2050 if (_4R3V3JGP_getOwnPropSymbols) 2051 for (var prop of _4R3V3JGP_getOwnPropSymbols(b)) { 2052 if (_4R3V3JGP_propIsEnum.call(b, prop)) 2053 _4R3V3JGP_defNormalProp(a, prop, b[prop]); 2054 } 2055 return a; 2056 }; 2057 var _chunks_4R3V3JGP_spreadProps = (a, b) => _4R3V3JGP_defProps(a, _4R3V3JGP_getOwnPropDescs(b)); 2058 var _4R3V3JGP_objRest = (source, exclude) => { 2059 var target = {}; 2060 for (var prop in source) 2061 if (_4R3V3JGP_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 2062 target[prop] = source[prop]; 2063 if (source != null && _4R3V3JGP_getOwnPropSymbols) 2064 for (var prop of _4R3V3JGP_getOwnPropSymbols(source)) { 2065 if (exclude.indexOf(prop) < 0 && _4R3V3JGP_propIsEnum.call(source, prop)) 2066 target[prop] = source[prop]; 2067 } 2068 return target; 2069 }; 2070 2071 2072 2073 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Y3OOHFCN.js 2074 "use client"; 2075 2076 2077 // src/utils/misc.ts 2078 function noop(..._) { 2079 } 2080 function shallowEqual(a, b) { 2081 if (a === b) 2082 return true; 2083 if (!a) 2084 return false; 2085 if (!b) 2086 return false; 2087 if (typeof a !== "object") 2088 return false; 2089 if (typeof b !== "object") 2090 return false; 2091 const aKeys = Object.keys(a); 2092 const bKeys = Object.keys(b); 2093 const { length } = aKeys; 2094 if (bKeys.length !== length) 2095 return false; 2096 for (const key of aKeys) { 2097 if (a[key] !== b[key]) { 2098 return false; 2099 } 2100 } 2101 return true; 2102 } 2103 function Y3OOHFCN_applyState(argument, currentValue) { 2104 if (isUpdater(argument)) { 2105 const value = isLazyValue(currentValue) ? currentValue() : currentValue; 2106 return argument(value); 2107 } 2108 return argument; 2109 } 2110 function isUpdater(argument) { 2111 return typeof argument === "function"; 2112 } 2113 function isLazyValue(value) { 2114 return typeof value === "function"; 2115 } 2116 function isObject(arg) { 2117 return typeof arg === "object" && arg != null; 2118 } 2119 function isEmpty(arg) { 2120 if (Array.isArray(arg)) 2121 return !arg.length; 2122 if (isObject(arg)) 2123 return !Object.keys(arg).length; 2124 if (arg == null) 2125 return true; 2126 if (arg === "") 2127 return true; 2128 return false; 2129 } 2130 function isInteger(arg) { 2131 if (typeof arg === "number") { 2132 return Math.floor(arg) === arg; 2133 } 2134 return String(Math.floor(Number(arg))) === arg; 2135 } 2136 function Y3OOHFCN_hasOwnProperty(object, prop) { 2137 if (typeof Object.hasOwn === "function") { 2138 return Object.hasOwn(object, prop); 2139 } 2140 return Object.prototype.hasOwnProperty.call(object, prop); 2141 } 2142 function chain(...fns) { 2143 return (...args) => { 2144 for (const fn of fns) { 2145 if (typeof fn === "function") { 2146 fn(...args); 2147 } 2148 } 2149 }; 2150 } 2151 function cx(...args) { 2152 return args.filter(Boolean).join(" ") || void 0; 2153 } 2154 function normalizeString(str) { 2155 return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); 2156 } 2157 function omit(object, keys) { 2158 const result = _chunks_4R3V3JGP_spreadValues({}, object); 2159 for (const key of keys) { 2160 if (Y3OOHFCN_hasOwnProperty(result, key)) { 2161 delete result[key]; 2162 } 2163 } 2164 return result; 2165 } 2166 function pick(object, paths) { 2167 const result = {}; 2168 for (const key of paths) { 2169 if (Y3OOHFCN_hasOwnProperty(object, key)) { 2170 result[key] = object[key]; 2171 } 2172 } 2173 return result; 2174 } 2175 function identity(value) { 2176 return value; 2177 } 2178 function beforePaint(cb = noop) { 2179 const raf = requestAnimationFrame(cb); 2180 return () => cancelAnimationFrame(raf); 2181 } 2182 function afterPaint(cb = noop) { 2183 let raf = requestAnimationFrame(() => { 2184 raf = requestAnimationFrame(cb); 2185 }); 2186 return () => cancelAnimationFrame(raf); 2187 } 2188 function invariant(condition, message) { 2189 if (condition) 2190 return; 2191 if (typeof message !== "string") 2192 throw new Error("Invariant failed"); 2193 throw new Error(message); 2194 } 2195 function getKeys(obj) { 2196 return Object.keys(obj); 2197 } 2198 function isFalsyBooleanCallback(booleanOrCallback, ...args) { 2199 const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; 2200 if (result == null) 2201 return false; 2202 return !result; 2203 } 2204 function disabledFromProps(props) { 2205 return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; 2206 } 2207 function defaultValue(...values) { 2208 for (const value of values) { 2209 if (value !== void 0) 2210 return value; 2211 } 2212 return void 0; 2213 } 2214 2215 2216 2217 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XM66DUTO.js 2218 "use client"; 2219 2220 2221 // src/utils/misc.ts 2222 2223 2224 function setRef(ref, value) { 2225 if (typeof ref === "function") { 2226 ref(value); 2227 } else if (ref) { 2228 ref.current = value; 2229 } 2230 } 2231 function isValidElementWithRef(element) { 2232 if (!element) 2233 return false; 2234 if (!(0,external_React_.isValidElement)(element)) 2235 return false; 2236 if (!("ref" in element)) 2237 return false; 2238 return true; 2239 } 2240 function getRefProperty(element) { 2241 if (!isValidElementWithRef(element)) 2242 return null; 2243 return element.ref; 2244 } 2245 function mergeProps(base, overrides) { 2246 const props = _4R3V3JGP_spreadValues({}, base); 2247 for (const key in overrides) { 2248 if (!Y3OOHFCN_hasOwnProperty(overrides, key)) 2249 continue; 2250 if (key === "className") { 2251 const prop = "className"; 2252 props[prop] = base[prop] ? `$base[prop]} $overrides[prop]}` : overrides[prop]; 2253 continue; 2254 } 2255 if (key === "style") { 2256 const prop = "style"; 2257 props[prop] = base[prop] ? _4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; 2258 continue; 2259 } 2260 const overrideValue = overrides[key]; 2261 if (typeof overrideValue === "function" && key.startsWith("on")) { 2262 const baseValue = base[key]; 2263 if (typeof baseValue === "function") { 2264 props[key] = (...args) => { 2265 overrideValue(...args); 2266 baseValue(...args); 2267 }; 2268 continue; 2269 } 2270 } 2271 props[key] = overrideValue; 2272 } 2273 return props; 2274 } 2275 2276 2277 2278 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/DLOEKDPY.js 2279 "use client"; 2280 2281 // src/utils/dom.ts 2282 var canUseDOM = checkIsBrowser(); 2283 function checkIsBrowser() { 2284 var _a; 2285 return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); 2286 } 2287 function DLOEKDPY_getDocument(node) { 2288 return node ? node.ownerDocument || node : document; 2289 } 2290 function getWindow(node) { 2291 return DLOEKDPY_getDocument(node).defaultView || window; 2292 } 2293 function getActiveElement(node, activeDescendant = false) { 2294 const { activeElement } = DLOEKDPY_getDocument(node); 2295 if (!(activeElement == null ? void 0 : activeElement.nodeName)) { 2296 return null; 2297 } 2298 if (isFrame(activeElement) && activeElement.contentDocument) { 2299 return getActiveElement( 2300 activeElement.contentDocument.body, 2301 activeDescendant 2302 ); 2303 } 2304 if (activeDescendant) { 2305 const id = activeElement.getAttribute("aria-activedescendant"); 2306 if (id) { 2307 const element = DLOEKDPY_getDocument(activeElement).getElementById(id); 2308 if (element) { 2309 return element; 2310 } 2311 } 2312 } 2313 return activeElement; 2314 } 2315 function contains(parent, child) { 2316 return parent === child || parent.contains(child); 2317 } 2318 function isFrame(element) { 2319 return element.tagName === "IFRAME"; 2320 } 2321 function isButton(element) { 2322 const tagName = element.tagName.toLowerCase(); 2323 if (tagName === "button") 2324 return true; 2325 if (tagName === "input" && element.type) { 2326 return buttonInputTypes.indexOf(element.type) !== -1; 2327 } 2328 return false; 2329 } 2330 var buttonInputTypes = [ 2331 "button", 2332 "color", 2333 "file", 2334 "image", 2335 "reset", 2336 "submit" 2337 ]; 2338 function matches(element, selectors) { 2339 if ("matches" in element) { 2340 return element.matches(selectors); 2341 } 2342 if ("msMatchesSelector" in element) { 2343 return element.msMatchesSelector(selectors); 2344 } 2345 return element.webkitMatchesSelector(selectors); 2346 } 2347 function isVisible(element) { 2348 const htmlElement = element; 2349 return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; 2350 } 2351 function DLOEKDPY_closest(element, selectors) { 2352 if ("closest" in element) 2353 return element.closest(selectors); 2354 do { 2355 if (matches(element, selectors)) 2356 return element; 2357 element = element.parentElement || element.parentNode; 2358 } while (element !== null && element.nodeType === 1); 2359 return null; 2360 } 2361 function DLOEKDPY_isTextField(element) { 2362 try { 2363 const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; 2364 const isTextArea = element.tagName === "TEXTAREA"; 2365 return isTextInput || isTextArea || false; 2366 } catch (error) { 2367 return false; 2368 } 2369 } 2370 function getPopupRole(element, fallback) { 2371 const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; 2372 const role = element == null ? void 0 : element.getAttribute("role"); 2373 if (role && allowedPopupRoles.indexOf(role) !== -1) { 2374 return role; 2375 } 2376 return fallback; 2377 } 2378 function getPopupItemRole(element, fallback) { 2379 var _a; 2380 const itemRoleByPopupRole = { 2381 menu: "menuitem", 2382 listbox: "option", 2383 tree: "treeitem", 2384 grid: "gridcell" 2385 }; 2386 const popupRole = getPopupRole(element); 2387 if (!popupRole) 2388 return fallback; 2389 const key = popupRole; 2390 return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback; 2391 } 2392 function getTextboxSelection(element) { 2393 let start = 0; 2394 let end = 0; 2395 if (DLOEKDPY_isTextField(element)) { 2396 start = element.selectionStart || 0; 2397 end = element.selectionEnd || 0; 2398 } else if (element.isContentEditable) { 2399 const selection = DLOEKDPY_getDocument(element).getSelection(); 2400 if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { 2401 const range = selection.getRangeAt(0); 2402 const nextRange = range.cloneRange(); 2403 nextRange.selectNodeContents(element); 2404 nextRange.setEnd(range.startContainer, range.startOffset); 2405 start = nextRange.toString().length; 2406 nextRange.setEnd(range.endContainer, range.endOffset); 2407 end = nextRange.toString().length; 2408 } 2409 } 2410 return { start, end }; 2411 } 2412 function scrollIntoViewIfNeeded(element, arg) { 2413 if (isPartiallyHidden(element) && "scrollIntoView" in element) { 2414 element.scrollIntoView(arg); 2415 } 2416 } 2417 function getScrollingElement(element) { 2418 if (!element) 2419 return null; 2420 if (element.clientHeight && element.scrollHeight > element.clientHeight) { 2421 const { overflowY } = getComputedStyle(element); 2422 const isScrollable = overflowY !== "visible" && overflowY !== "hidden"; 2423 if (isScrollable) 2424 return element; 2425 } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { 2426 const { overflowX } = getComputedStyle(element); 2427 const isScrollable = overflowX !== "visible" && overflowX !== "hidden"; 2428 if (isScrollable) 2429 return element; 2430 } 2431 return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; 2432 } 2433 function isPartiallyHidden(element) { 2434 const elementRect = element.getBoundingClientRect(); 2435 const scroller = getScrollingElement(element); 2436 if (!scroller) 2437 return false; 2438 const scrollerRect = scroller.getBoundingClientRect(); 2439 const isHTML = scroller.tagName === "HTML"; 2440 const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top; 2441 const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom; 2442 const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left; 2443 const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right; 2444 const top = elementRect.top < scrollerTop; 2445 const left = elementRect.left < scrollerLeft; 2446 const bottom = elementRect.bottom > scrollerBottom; 2447 const right = elementRect.right > scrollerRight; 2448 return top || left || bottom || right; 2449 } 2450 function setSelectionRange(element, ...args) { 2451 if (/text|search|password|tel|url/i.test(element.type)) { 2452 element.setSelectionRange(...args); 2453 } 2454 } 2455 2456 2457 2458 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/MHPO2BXA.js 2459 "use client"; 2460 2461 2462 // src/utils/platform.ts 2463 function isTouchDevice() { 2464 return canUseDOM && !!navigator.maxTouchPoints; 2465 } 2466 function isApple() { 2467 if (!canUseDOM) 2468 return false; 2469 return /mac|iphone|ipad|ipod/i.test(navigator.platform); 2470 } 2471 function isSafari() { 2472 return canUseDOM && isApple() && /apple/i.test(navigator.vendor); 2473 } 2474 function isFirefox() { 2475 return canUseDOM && /firefox\//i.test(navigator.userAgent); 2476 } 2477 function isMac() { 2478 return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); 2479 } 2480 2481 2482 2483 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/events.js 2484 "use client"; 2485 2486 2487 2488 2489 // src/utils/events.ts 2490 function isPortalEvent(event) { 2491 return Boolean( 2492 event.currentTarget && !contains(event.currentTarget, event.target) 2493 ); 2494 } 2495 function isSelfTarget(event) { 2496 return event.target === event.currentTarget; 2497 } 2498 function isOpeningInNewTab(event) { 2499 const element = event.currentTarget; 2500 if (!element) 2501 return false; 2502 const isAppleDevice = isApple(); 2503 if (isAppleDevice && !event.metaKey) 2504 return false; 2505 if (!isAppleDevice && !event.ctrlKey) 2506 return false; 2507 const tagName = element.tagName.toLowerCase(); 2508 if (tagName === "a") 2509 return true; 2510 if (tagName === "button" && element.type === "submit") 2511 return true; 2512 if (tagName === "input" && element.type === "submit") 2513 return true; 2514 return false; 2515 } 2516 function isDownloading(event) { 2517 const element = event.currentTarget; 2518 if (!element) 2519 return false; 2520 const tagName = element.tagName.toLowerCase(); 2521 if (!event.altKey) 2522 return false; 2523 if (tagName === "a") 2524 return true; 2525 if (tagName === "button" && element.type === "submit") 2526 return true; 2527 if (tagName === "input" && element.type === "submit") 2528 return true; 2529 return false; 2530 } 2531 function fireEvent(element, type, eventInit) { 2532 const event = new Event(type, eventInit); 2533 return element.dispatchEvent(event); 2534 } 2535 function fireBlurEvent(element, eventInit) { 2536 const event = new FocusEvent("blur", eventInit); 2537 const defaultAllowed = element.dispatchEvent(event); 2538 const bubbleInit = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, eventInit), { bubbles: true }); 2539 element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); 2540 return defaultAllowed; 2541 } 2542 function fireFocusEvent(element, eventInit) { 2543 const event = new FocusEvent("focus", eventInit); 2544 const defaultAllowed = element.dispatchEvent(event); 2545 const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); 2546 element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); 2547 return defaultAllowed; 2548 } 2549 function fireKeyboardEvent(element, type, eventInit) { 2550 const event = new KeyboardEvent(type, eventInit); 2551 return element.dispatchEvent(event); 2552 } 2553 function fireClickEvent(element, eventInit) { 2554 const event = new MouseEvent("click", eventInit); 2555 return element.dispatchEvent(event); 2556 } 2557 function isFocusEventOutside(event, container) { 2558 const containerElement = container || event.currentTarget; 2559 const relatedTarget = event.relatedTarget; 2560 return !relatedTarget || !contains(containerElement, relatedTarget); 2561 } 2562 function queueBeforeEvent(element, type, callback) { 2563 const raf = requestAnimationFrame(() => { 2564 element.removeEventListener(type, callImmediately, true); 2565 callback(); 2566 }); 2567 const callImmediately = () => { 2568 cancelAnimationFrame(raf); 2569 callback(); 2570 }; 2571 element.addEventListener(type, callImmediately, { 2572 once: true, 2573 capture: true 2574 }); 2575 return raf; 2576 } 2577 function addGlobalEventListener(type, listener, options, scope = window) { 2578 const children = []; 2579 try { 2580 scope.document.addEventListener(type, listener, options); 2581 for (const frame of Array.from(scope.frames)) { 2582 children.push(addGlobalEventListener(type, listener, options, frame)); 2583 } 2584 } catch (e) { 2585 } 2586 const removeEventListener = () => { 2587 try { 2588 scope.document.removeEventListener(type, listener, options); 2589 } catch (e) { 2590 } 2591 children.forEach((remove) => remove()); 2592 }; 2593 return removeEventListener; 2594 } 2595 2596 2597 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6O5OEQGF.js 2598 "use client"; 2599 2600 2601 2602 // src/utils/hooks.ts 2603 2604 2605 2606 2607 2608 var _React = _4R3V3JGP_spreadValues({}, external_React_namespaceObject); 2609 var useReactId = _React.useId; 2610 var useReactDeferredValue = _React.useDeferredValue; 2611 var useReactInsertionEffect = _React.useInsertionEffect; 2612 var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; 2613 function useInitialValue(value) { 2614 const [initialValue] = (0,external_React_.useState)(value); 2615 return initialValue; 2616 } 2617 function useLazyValue(init) { 2618 const ref = useRef(); 2619 if (ref.current === void 0) { 2620 ref.current = init(); 2621 } 2622 return ref.current; 2623 } 2624 function useLiveRef(value) { 2625 const ref = (0,external_React_.useRef)(value); 2626 useSafeLayoutEffect(() => { 2627 ref.current = value; 2628 }); 2629 return ref; 2630 } 2631 function usePreviousValue(value) { 2632 const [previousValue, setPreviousValue] = useState(value); 2633 if (value !== previousValue) { 2634 setPreviousValue(value); 2635 } 2636 return previousValue; 2637 } 2638 function useEvent(callback) { 2639 const ref = (0,external_React_.useRef)(() => { 2640 throw new Error("Cannot call an event handler while rendering."); 2641 }); 2642 if (useReactInsertionEffect) { 2643 useReactInsertionEffect(() => { 2644 ref.current = callback; 2645 }); 2646 } else { 2647 ref.current = callback; 2648 } 2649 return (0,external_React_.useCallback)((...args) => { 2650 var _a; 2651 return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); 2652 }, []); 2653 } 2654 function useMergeRefs(...refs) { 2655 return (0,external_React_.useMemo)(() => { 2656 if (!refs.some(Boolean)) 2657 return; 2658 return (value) => { 2659 refs.forEach((ref) => setRef(ref, value)); 2660 }; 2661 }, refs); 2662 } 2663 function useRefId(ref, deps) { 2664 const [id, setId] = useState(void 0); 2665 useSafeLayoutEffect(() => { 2666 var _a; 2667 setId((_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.id); 2668 }, deps); 2669 return id; 2670 } 2671 function useId(defaultId) { 2672 if (useReactId) { 2673 const reactId = useReactId(); 2674 if (defaultId) 2675 return defaultId; 2676 return reactId; 2677 } 2678 const [id, setId] = (0,external_React_.useState)(defaultId); 2679 useSafeLayoutEffect(() => { 2680 if (defaultId || id) 2681 return; 2682 const random = Math.random().toString(36).substr(2, 6); 2683 setId(`id-$random}`); 2684 }, [defaultId, id]); 2685 return defaultId || id; 2686 } 2687 function useDeferredValue(value) { 2688 if (useReactDeferredValue) { 2689 return useReactDeferredValue(value); 2690 } 2691 const [deferredValue, setDeferredValue] = useState(value); 2692 useEffect(() => { 2693 const raf = requestAnimationFrame(() => setDeferredValue(value)); 2694 return () => cancelAnimationFrame(raf); 2695 }, [value]); 2696 return deferredValue; 2697 } 2698 function useTagName(refOrElement, type) { 2699 const stringOrUndefined = (type2) => { 2700 if (typeof type2 !== "string") 2701 return; 2702 return type2; 2703 }; 2704 const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type)); 2705 useSafeLayoutEffect(() => { 2706 const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; 2707 setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); 2708 }, [refOrElement, type]); 2709 return tagName; 2710 } 2711 function useAttribute(refOrElement, attributeName, defaultValue) { 2712 const [attribute, setAttribute] = useState(defaultValue); 2713 useSafeLayoutEffect(() => { 2714 const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; 2715 const value = element == null ? void 0 : element.getAttribute(attributeName); 2716 if (value == null) 2717 return; 2718 setAttribute(value); 2719 }, [refOrElement, attributeName]); 2720 return attribute; 2721 } 2722 function useUpdateEffect(effect, deps) { 2723 const mounted = (0,external_React_.useRef)(false); 2724 (0,external_React_.useEffect)(() => { 2725 if (mounted.current) { 2726 return effect(); 2727 } 2728 mounted.current = true; 2729 }, deps); 2730 (0,external_React_.useEffect)( 2731 () => () => { 2732 mounted.current = false; 2733 }, 2734 [] 2735 ); 2736 } 2737 function useUpdateLayoutEffect(effect, deps) { 2738 const mounted = useRef(false); 2739 useSafeLayoutEffect(() => { 2740 if (mounted.current) { 2741 return effect(); 2742 } 2743 mounted.current = true; 2744 }, deps); 2745 useSafeLayoutEffect( 2746 () => () => { 2747 mounted.current = false; 2748 }, 2749 [] 2750 ); 2751 } 2752 function useControlledState(defaultState, state, setState) { 2753 const [localState, setLocalState] = useState(defaultState); 2754 const nextState = state !== void 0 ? state : localState; 2755 const stateRef = useLiveRef(state); 2756 const setStateRef = useLiveRef(setState); 2757 const nextStateRef = useLiveRef(nextState); 2758 const setNextState = useCallback((prevValue) => { 2759 const setStateProp = setStateRef.current; 2760 if (setStateProp) { 2761 if (isSetNextState(setStateProp)) { 2762 setStateProp(prevValue); 2763 } else { 2764 const nextValue = applyState(prevValue, nextStateRef.current); 2765 nextStateRef.current = nextValue; 2766 setStateProp(nextValue); 2767 } 2768 } 2769 if (stateRef.current === void 0) { 2770 setLocalState(prevValue); 2771 } 2772 }, []); 2773 defineSetNextState(setNextState); 2774 return [nextState, setNextState]; 2775 } 2776 var SET_NEXT_STATE = Symbol("setNextState"); 2777 function isSetNextState(arg) { 2778 return arg[SET_NEXT_STATE] === true; 2779 } 2780 function defineSetNextState(arg) { 2781 if (!isSetNextState(arg)) { 2782 Object.defineProperty(arg, SET_NEXT_STATE, { value: true }); 2783 } 2784 } 2785 function useForceUpdate() { 2786 return (0,external_React_.useReducer)(() => [], []); 2787 } 2788 function useBooleanEvent(booleanOrCallback) { 2789 return useEvent( 2790 typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback 2791 ); 2792 } 2793 function useWrapElement(props, callback, deps = []) { 2794 const wrapElement = (0,external_React_.useCallback)( 2795 (element) => { 2796 if (props.wrapElement) { 2797 element = props.wrapElement(element); 2798 } 2799 return callback(element); 2800 }, 2801 [...deps, props.wrapElement] 2802 ); 2803 return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { wrapElement }); 2804 } 2805 function usePortalRef(portalProp = false, portalRefProp) { 2806 const [portalNode, setPortalNode] = (0,external_React_.useState)(null); 2807 const portalRef = useMergeRefs(setPortalNode, portalRefProp); 2808 const domReady = !portalProp || portalNode; 2809 return { portalRef, portalNode, domReady }; 2810 } 2811 function useMetadataProps(props, key, value) { 2812 const parent = props.onLoadedMetadataCapture; 2813 const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { 2814 return Object.assign(() => { 2815 }, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, parent), { [key]: value })); 2816 }, [parent, key, value]); 2817 return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; 2818 } 2819 function useIsMouseMoving() { 2820 (0,external_React_.useEffect)(() => { 2821 addGlobalEventListener("mousemove", setMouseMoving, true); 2822 addGlobalEventListener("mousedown", resetMouseMoving, true); 2823 addGlobalEventListener("mouseup", resetMouseMoving, true); 2824 addGlobalEventListener("keydown", resetMouseMoving, true); 2825 addGlobalEventListener("scroll", resetMouseMoving, true); 2826 }, []); 2827 const isMouseMoving = useEvent(() => mouseMoving); 2828 return isMouseMoving; 2829 } 2830 var mouseMoving = false; 2831 var previousScreenX = 0; 2832 var previousScreenY = 0; 2833 function hasMouseMovement(event) { 2834 const movementX = event.movementX || event.screenX - previousScreenX; 2835 const movementY = event.movementY || event.screenY - previousScreenY; 2836 previousScreenX = event.screenX; 2837 previousScreenY = event.screenY; 2838 return movementX || movementY || "production" === "test"; 2839 } 2840 function setMouseMoving(event) { 2841 if (!hasMouseMovement(event)) 2842 return; 2843 mouseMoving = true; 2844 } 2845 function resetMouseMoving() { 2846 mouseMoving = false; 2847 } 2848 2849 2850 2851 ;// CONCATENATED MODULE: external "ReactJSXRuntime" 2852 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 2853 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3ORBWXWF.js 2854 "use client"; 2855 2856 2857 2858 2859 // src/utils/system.tsx 2860 2861 2862 2863 function isRenderProp(children) { 2864 return typeof children === "function"; 2865 } 2866 function forwardRef2(render) { 2867 const Role = React.forwardRef((props, ref) => render(__spreadProps(__spreadValues({}, props), { ref }))); 2868 Role.displayName = render.displayName || render.name; 2869 return Role; 2870 } 2871 function memo2(Component, propsAreEqual) { 2872 const Role = React.memo(Component, propsAreEqual); 2873 Role.displayName = Component.displayName || Component.name; 2874 return Role; 2875 } 2876 function createComponent(render) { 2877 const Role = (props, ref) => render(_4R3V3JGP_spreadValues({ ref }, props)); 2878 return external_React_.forwardRef(Role); 2879 } 2880 function createMemoComponent(render) { 2881 const Role = createComponent(render); 2882 return external_React_.memo(Role); 2883 } 2884 function _3ORBWXWF_createElement(Type, props) { 2885 const _a = props, { as: As, wrapElement, render } = _a, rest = __objRest(_a, ["as", "wrapElement", "render"]); 2886 let element; 2887 const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); 2888 if (false) {} 2889 if (As && typeof As !== "string") { 2890 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(As, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rest), { render })); 2891 } else if (external_React_.isValidElement(render)) { 2892 const renderProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, render.props), { ref: mergedRef }); 2893 element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); 2894 } else if (render) { 2895 element = render(rest); 2896 } else if (isRenderProp(props.children)) { 2897 if (false) {} 2898 const _b = rest, { children } = _b, otherProps = __objRest(_b, ["children"]); 2899 element = props.children(otherProps); 2900 } else if (As) { 2901 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(As, _4R3V3JGP_spreadValues({}, rest)); 2902 } else { 2903 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _4R3V3JGP_spreadValues({}, rest)); 2904 } 2905 if (wrapElement) { 2906 return wrapElement(element); 2907 } 2908 return element; 2909 } 2910 function createHook(useProps) { 2911 const useRole = (props = {}) => { 2912 const htmlProps = useProps(props); 2913 const copy = {}; 2914 for (const prop in htmlProps) { 2915 if (Y3OOHFCN_hasOwnProperty(htmlProps, prop) && htmlProps[prop] !== void 0) { 2916 copy[prop] = htmlProps[prop]; 2917 } 2918 } 2919 return copy; 2920 }; 2921 return useRole; 2922 } 2923 function createStoreContext(providers = [], scopedProviders = []) { 2924 const context = external_React_.createContext(void 0); 2925 const scopedContext = external_React_.createContext(void 0); 2926 const useContext2 = () => external_React_.useContext(context); 2927 const useScopedContext = (onlyScoped = false) => { 2928 const scoped = external_React_.useContext(scopedContext); 2929 const store = useContext2(); 2930 if (onlyScoped) 2931 return scoped; 2932 return scoped || store; 2933 }; 2934 const useProviderContext = () => { 2935 const scoped = external_React_.useContext(scopedContext); 2936 const store = useContext2(); 2937 if (scoped && scoped === store) 2938 return; 2939 return store; 2940 }; 2941 const ContextProvider = (props) => { 2942 return providers.reduceRight( 2943 (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), 2944 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _4R3V3JGP_spreadValues({}, props)) 2945 ); 2946 }; 2947 const ScopedContextProvider = (props) => { 2948 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children: scopedProviders.reduceRight( 2949 (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), 2950 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _4R3V3JGP_spreadValues({}, props)) 2951 ) })); 2952 }; 2953 return { 2954 context, 2955 scopedContext, 2956 useContext: useContext2, 2957 useScopedContext, 2958 useProviderContext, 2959 ContextProvider, 2960 ScopedContextProvider 2961 }; 2962 } 2963 2964 2965 2966 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/focus.js 2967 "use client"; 2968 2969 2970 2971 // src/utils/focus.ts 2972 var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; 2973 function hasNegativeTabIndex(element) { 2974 const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); 2975 return tabIndex < 0; 2976 } 2977 function isFocusable(element) { 2978 if (!matches(element, selector)) 2979 return false; 2980 if (!isVisible(element)) 2981 return false; 2982 if (DLOEKDPY_closest(element, "[inert]")) 2983 return false; 2984 return true; 2985 } 2986 function isTabbable(element) { 2987 if (!isFocusable(element)) 2988 return false; 2989 if (hasNegativeTabIndex(element)) 2990 return false; 2991 if (!("form" in element)) 2992 return true; 2993 if (!element.form) 2994 return true; 2995 if (element.checked) 2996 return true; 2997 if (element.type !== "radio") 2998 return true; 2999 const radioGroup = element.form.elements.namedItem(element.name); 3000 if (!radioGroup) 3001 return true; 3002 if (!("length" in radioGroup)) 3003 return true; 3004 const activeElement = getActiveElement(element); 3005 if (!activeElement) 3006 return true; 3007 if (activeElement === element) 3008 return true; 3009 if (!("form" in activeElement)) 3010 return true; 3011 if (activeElement.form !== element.form) 3012 return true; 3013 if (activeElement.name !== element.name) 3014 return true; 3015 return false; 3016 } 3017 function getAllFocusableIn(container, includeContainer) { 3018 const elements = Array.from( 3019 container.querySelectorAll(selector) 3020 ); 3021 if (includeContainer) { 3022 elements.unshift(container); 3023 } 3024 const focusableElements = elements.filter(isFocusable); 3025 focusableElements.forEach((element, i) => { 3026 if (isFrame(element) && element.contentDocument) { 3027 const frameBody = element.contentDocument.body; 3028 focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody)); 3029 } 3030 }); 3031 return focusableElements; 3032 } 3033 function getAllFocusable(includeBody) { 3034 return getAllFocusableIn(document.body, includeBody); 3035 } 3036 function getFirstFocusableIn(container, includeContainer) { 3037 const [first] = getAllFocusableIn(container, includeContainer); 3038 return first || null; 3039 } 3040 function getFirstFocusable(includeBody) { 3041 return getFirstFocusableIn(document.body, includeBody); 3042 } 3043 function getAllTabbableIn(container, includeContainer, fallbackToFocusable) { 3044 const elements = Array.from( 3045 container.querySelectorAll(selector) 3046 ); 3047 const tabbableElements = elements.filter(isTabbable); 3048 if (includeContainer && isTabbable(container)) { 3049 tabbableElements.unshift(container); 3050 } 3051 tabbableElements.forEach((element, i) => { 3052 if (isFrame(element) && element.contentDocument) { 3053 const frameBody = element.contentDocument.body; 3054 const allFrameTabbable = getAllTabbableIn( 3055 frameBody, 3056 false, 3057 fallbackToFocusable 3058 ); 3059 tabbableElements.splice(i, 1, ...allFrameTabbable); 3060 } 3061 }); 3062 if (!tabbableElements.length && fallbackToFocusable) { 3063 return elements; 3064 } 3065 return tabbableElements; 3066 } 3067 function getAllTabbable(fallbackToFocusable) { 3068 return getAllTabbableIn(document.body, false, fallbackToFocusable); 3069 } 3070 function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) { 3071 const [first] = getAllTabbableIn( 3072 container, 3073 includeContainer, 3074 fallbackToFocusable 3075 ); 3076 return first || null; 3077 } 3078 function getFirstTabbable(fallbackToFocusable) { 3079 return getFirstTabbableIn(document.body, false, fallbackToFocusable); 3080 } 3081 function getLastTabbableIn(container, includeContainer, fallbackToFocusable) { 3082 const allTabbable = getAllTabbableIn( 3083 container, 3084 includeContainer, 3085 fallbackToFocusable 3086 ); 3087 return allTabbable[allTabbable.length - 1] || null; 3088 } 3089 function getLastTabbable(fallbackToFocusable) { 3090 return getLastTabbableIn(document.body, false, fallbackToFocusable); 3091 } 3092 function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) { 3093 const activeElement = getActiveElement(container); 3094 const allFocusable = getAllFocusableIn(container, includeContainer); 3095 const activeIndex = allFocusable.indexOf(activeElement); 3096 const nextFocusableElements = allFocusable.slice(activeIndex + 1); 3097 return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null; 3098 } 3099 function getNextTabbable(fallbackToFirst, fallbackToFocusable) { 3100 return getNextTabbableIn( 3101 document.body, 3102 false, 3103 fallbackToFirst, 3104 fallbackToFocusable 3105 ); 3106 } 3107 function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) { 3108 const activeElement = getActiveElement(container); 3109 const allFocusable = getAllFocusableIn(container, includeContainer).reverse(); 3110 const activeIndex = allFocusable.indexOf(activeElement); 3111 const previousFocusableElements = allFocusable.slice(activeIndex + 1); 3112 return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null; 3113 } 3114 function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) { 3115 return getPreviousTabbableIn( 3116 document.body, 3117 false, 3118 fallbackToFirst, 3119 fallbackToFocusable 3120 ); 3121 } 3122 function getClosestFocusable(element) { 3123 while (element && !isFocusable(element)) { 3124 element = closest(element, selector); 3125 } 3126 return element || null; 3127 } 3128 function hasFocus(element) { 3129 const activeElement = getActiveElement(element); 3130 if (!activeElement) 3131 return false; 3132 if (activeElement === element) 3133 return true; 3134 const activeDescendant = activeElement.getAttribute("aria-activedescendant"); 3135 if (!activeDescendant) 3136 return false; 3137 return activeDescendant === element.id; 3138 } 3139 function hasFocusWithin(element) { 3140 const activeElement = getActiveElement(element); 3141 if (!activeElement) 3142 return false; 3143 if (contains(element, activeElement)) 3144 return true; 3145 const activeDescendant = activeElement.getAttribute("aria-activedescendant"); 3146 if (!activeDescendant) 3147 return false; 3148 if (!("id" in element)) 3149 return false; 3150 if (activeDescendant === element.id) 3151 return true; 3152 return !!element.querySelector(`#$CSS.escape(activeDescendant)}`); 3153 } 3154 function focusIfNeeded(element) { 3155 if (!hasFocusWithin(element) && isFocusable(element)) { 3156 element.focus(); 3157 } 3158 } 3159 function disableFocus(element) { 3160 var _a; 3161 const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : ""; 3162 element.setAttribute("data-tabindex", currentTabindex); 3163 element.setAttribute("tabindex", "-1"); 3164 } 3165 function disableFocusIn(container, includeContainer) { 3166 const tabbableElements = getAllTabbableIn(container, includeContainer); 3167 tabbableElements.forEach(disableFocus); 3168 } 3169 function restoreFocusIn(container) { 3170 const elements = container.querySelectorAll("[data-tabindex]"); 3171 const restoreTabIndex = (element) => { 3172 const tabindex = element.getAttribute("data-tabindex"); 3173 element.removeAttribute("data-tabindex"); 3174 if (tabindex) { 3175 element.setAttribute("tabindex", tabindex); 3176 } else { 3177 element.removeAttribute("tabindex"); 3178 } 3179 }; 3180 if (container.hasAttribute("data-tabindex")) { 3181 restoreTabIndex(container); 3182 } 3183 elements.forEach(restoreTabIndex); 3184 } 3185 function focusIntoView(element, options) { 3186 if (!("scrollIntoView" in element)) { 3187 element.focus(); 3188 } else { 3189 element.focus({ preventScroll: true }); 3190 element.scrollIntoView(_chunks_4R3V3JGP_spreadValues({ block: "nearest", inline: "nearest" }, options)); 3191 } 3192 } 3193 3194 3195 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KK7H3W2B.js 3196 "use client"; 3197 3198 3199 3200 3201 3202 // src/focusable/focusable.ts 3203 3204 3205 3206 3207 3208 3209 var isSafariBrowser = isSafari(); 3210 var alwaysFocusVisibleInputTypes = [ 3211 "text", 3212 "search", 3213 "url", 3214 "tel", 3215 "email", 3216 "password", 3217 "number", 3218 "date", 3219 "month", 3220 "week", 3221 "time", 3222 "datetime", 3223 "datetime-local" 3224 ]; 3225 function isAlwaysFocusVisible(element) { 3226 const { tagName, readOnly, type } = element; 3227 if (tagName === "TEXTAREA" && !readOnly) 3228 return true; 3229 if (tagName === "SELECT" && !readOnly) 3230 return true; 3231 if (tagName === "INPUT" && !readOnly) { 3232 return alwaysFocusVisibleInputTypes.includes(type); 3233 } 3234 if (element.isContentEditable) 3235 return true; 3236 return false; 3237 } 3238 function isAlwaysFocusVisibleDelayed(element) { 3239 const role = element.getAttribute("role"); 3240 if (role !== "combobox") 3241 return false; 3242 return !!element.dataset.name; 3243 } 3244 function getLabels(element) { 3245 if ("labels" in element) { 3246 return element.labels; 3247 } 3248 return null; 3249 } 3250 function isNativeCheckboxOrRadio(element) { 3251 const tagName = element.tagName.toLowerCase(); 3252 if (tagName === "input" && element.type) { 3253 return element.type === "radio" || element.type === "checkbox"; 3254 } 3255 return false; 3256 } 3257 function isNativeTabbable(tagName) { 3258 if (!tagName) 3259 return true; 3260 return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; 3261 } 3262 function supportsDisabledAttribute(tagName) { 3263 if (!tagName) 3264 return true; 3265 return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; 3266 } 3267 function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { 3268 if (!focusable) { 3269 return tabIndexProp; 3270 } 3271 if (trulyDisabled) { 3272 if (nativeTabbable && !supportsDisabled) { 3273 return -1; 3274 } 3275 return; 3276 } 3277 if (nativeTabbable) { 3278 return tabIndexProp; 3279 } 3280 return tabIndexProp || 0; 3281 } 3282 function useDisableEvent(onEvent, disabled) { 3283 return useEvent((event) => { 3284 onEvent == null ? void 0 : onEvent(event); 3285 if (event.defaultPrevented) 3286 return; 3287 if (disabled) { 3288 event.stopPropagation(); 3289 event.preventDefault(); 3290 } 3291 }); 3292 } 3293 var isKeyboardModality = true; 3294 function onGlobalMouseDown(event) { 3295 const target = event.target; 3296 if (target && "hasAttribute" in target) { 3297 if (!target.hasAttribute("data-focus-visible")) { 3298 isKeyboardModality = false; 3299 } 3300 } 3301 } 3302 function onGlobalKeyDown(event) { 3303 if (event.metaKey) 3304 return; 3305 if (event.ctrlKey) 3306 return; 3307 if (event.altKey) 3308 return; 3309 isKeyboardModality = true; 3310 } 3311 var useFocusable = createHook( 3312 (_a) => { 3313 var _b = _a, { 3314 focusable = true, 3315 accessibleWhenDisabled, 3316 autoFocus, 3317 onFocusVisible 3318 } = _b, props = __objRest(_b, [ 3319 "focusable", 3320 "accessibleWhenDisabled", 3321 "autoFocus", 3322 "onFocusVisible" 3323 ]); 3324 const ref = (0,external_React_.useRef)(null); 3325 (0,external_React_.useEffect)(() => { 3326 if (!focusable) 3327 return; 3328 addGlobalEventListener("mousedown", onGlobalMouseDown, true); 3329 addGlobalEventListener("keydown", onGlobalKeyDown, true); 3330 }, [focusable]); 3331 if (isSafariBrowser) { 3332 (0,external_React_.useEffect)(() => { 3333 if (!focusable) 3334 return; 3335 const element = ref.current; 3336 if (!element) 3337 return; 3338 if (!isNativeCheckboxOrRadio(element)) 3339 return; 3340 const labels = getLabels(element); 3341 if (!labels) 3342 return; 3343 const onMouseUp = () => queueMicrotask(() => element.focus()); 3344 labels.forEach((label) => label.addEventListener("mouseup", onMouseUp)); 3345 return () => { 3346 labels.forEach( 3347 (label) => label.removeEventListener("mouseup", onMouseUp) 3348 ); 3349 }; 3350 }, [focusable]); 3351 } 3352 const disabled = focusable && disabledFromProps(props); 3353 const trulyDisabled = !!disabled && !accessibleWhenDisabled; 3354 const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false); 3355 (0,external_React_.useEffect)(() => { 3356 if (!focusable) 3357 return; 3358 if (trulyDisabled && focusVisible) { 3359 setFocusVisible(false); 3360 } 3361 }, [focusable, trulyDisabled, focusVisible]); 3362 (0,external_React_.useEffect)(() => { 3363 if (!focusable) 3364 return; 3365 if (!focusVisible) 3366 return; 3367 const element = ref.current; 3368 if (!element) 3369 return; 3370 if (typeof IntersectionObserver === "undefined") 3371 return; 3372 const observer = new IntersectionObserver(() => { 3373 if (!isFocusable(element)) { 3374 setFocusVisible(false); 3375 } 3376 }); 3377 observer.observe(element); 3378 return () => observer.disconnect(); 3379 }, [focusable, focusVisible]); 3380 const onKeyPressCapture = useDisableEvent( 3381 props.onKeyPressCapture, 3382 disabled 3383 ); 3384 const onMouseDownCapture = useDisableEvent( 3385 props.onMouseDownCapture, 3386 disabled 3387 ); 3388 const onClickCapture = useDisableEvent(props.onClickCapture, disabled); 3389 const onMouseDownProp = props.onMouseDown; 3390 const onMouseDown = useEvent((event) => { 3391 onMouseDownProp == null ? void 0 : onMouseDownProp(event); 3392 if (event.defaultPrevented) 3393 return; 3394 if (!focusable) 3395 return; 3396 const element = event.currentTarget; 3397 if (!isSafariBrowser) 3398 return; 3399 if (isPortalEvent(event)) 3400 return; 3401 if (!isButton(element) && !isNativeCheckboxOrRadio(element)) 3402 return; 3403 let receivedFocus = false; 3404 const onFocus = () => { 3405 receivedFocus = true; 3406 }; 3407 const options = { capture: true, once: true }; 3408 element.addEventListener("focusin", onFocus, options); 3409 queueBeforeEvent(element, "mouseup", () => { 3410 element.removeEventListener("focusin", onFocus, true); 3411 if (receivedFocus) 3412 return; 3413 focusIfNeeded(element); 3414 }); 3415 }); 3416 const handleFocusVisible = (event, currentTarget) => { 3417 if (currentTarget) { 3418 event.currentTarget = currentTarget; 3419 } 3420 if (!focusable) 3421 return; 3422 const element = event.currentTarget; 3423 if (!element) 3424 return; 3425 if (!hasFocus(element)) 3426 return; 3427 onFocusVisible == null ? void 0 : onFocusVisible(event); 3428 if (event.defaultPrevented) 3429 return; 3430 setFocusVisible(true); 3431 }; 3432 const onKeyDownCaptureProp = props.onKeyDownCapture; 3433 const onKeyDownCapture = useEvent( 3434 (event) => { 3435 onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); 3436 if (event.defaultPrevented) 3437 return; 3438 if (!focusable) 3439 return; 3440 if (focusVisible) 3441 return; 3442 if (event.metaKey) 3443 return; 3444 if (event.altKey) 3445 return; 3446 if (event.ctrlKey) 3447 return; 3448 if (!isSelfTarget(event)) 3449 return; 3450 const element = event.currentTarget; 3451 queueMicrotask(() => handleFocusVisible(event, element)); 3452 } 3453 ); 3454 const onFocusCaptureProp = props.onFocusCapture; 3455 const onFocusCapture = useEvent((event) => { 3456 onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); 3457 if (event.defaultPrevented) 3458 return; 3459 if (!focusable) 3460 return; 3461 if (!isSelfTarget(event)) { 3462 setFocusVisible(false); 3463 return; 3464 } 3465 const element = event.currentTarget; 3466 const applyFocusVisible = () => handleFocusVisible(event, element); 3467 if (isKeyboardModality || isAlwaysFocusVisible(event.target)) { 3468 queueMicrotask(applyFocusVisible); 3469 } else if (isAlwaysFocusVisibleDelayed(event.target)) { 3470 queueBeforeEvent(event.target, "focusout", applyFocusVisible); 3471 } else { 3472 setFocusVisible(false); 3473 } 3474 }); 3475 const onBlurProp = props.onBlur; 3476 const onBlur = useEvent((event) => { 3477 onBlurProp == null ? void 0 : onBlurProp(event); 3478 if (!focusable) 3479 return; 3480 if (!isFocusEventOutside(event)) 3481 return; 3482 setFocusVisible(false); 3483 }); 3484 const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext); 3485 const autoFocusRef = useEvent((element) => { 3486 if (!focusable) 3487 return; 3488 if (!autoFocus) 3489 return; 3490 if (!element) 3491 return; 3492 if (!autoFocusOnShow) 3493 return; 3494 queueMicrotask(() => { 3495 if (hasFocus(element)) 3496 return; 3497 if (!isFocusable(element)) 3498 return; 3499 element.focus(); 3500 }); 3501 }); 3502 const tagName = useTagName(ref, props.as); 3503 const nativeTabbable = focusable && isNativeTabbable(tagName); 3504 const supportsDisabled = focusable && supportsDisabledAttribute(tagName); 3505 const style = trulyDisabled ? _4R3V3JGP_spreadValues({ pointerEvents: "none" }, props.style) : props.style; 3506 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 3507 "data-focus-visible": focusable && focusVisible ? "" : void 0, 3508 "data-autofocus": autoFocus ? true : void 0, 3509 "aria-disabled": disabled ? true : void 0 3510 }, props), { 3511 ref: useMergeRefs(ref, autoFocusRef, props.ref), 3512 style, 3513 tabIndex: getTabIndex( 3514 focusable, 3515 trulyDisabled, 3516 nativeTabbable, 3517 supportsDisabled, 3518 props.tabIndex 3519 ), 3520 disabled: supportsDisabled && trulyDisabled ? true : void 0, 3521 // TODO: Test Focusable contentEditable. 3522 contentEditable: disabled ? void 0 : props.contentEditable, 3523 onKeyPressCapture, 3524 onClickCapture, 3525 onMouseDownCapture, 3526 onMouseDown, 3527 onKeyDownCapture, 3528 onFocusCapture, 3529 onBlur 3530 }); 3531 return props; 3532 } 3533 ); 3534 var Focusable = createComponent((props) => { 3535 props = useFocusable(props); 3536 return _3ORBWXWF_createElement("div", props); 3537 }); 3538 if (false) {} 3539 3540 3541 3542 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NWCBQ4CV.js 3543 "use client"; 3544 3545 3546 3547 3548 3549 // src/command/command.ts 3550 3551 3552 3553 3554 3555 function isNativeClick(event) { 3556 if (!event.isTrusted) 3557 return false; 3558 const element = event.currentTarget; 3559 if (event.key === "Enter") { 3560 return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; 3561 } 3562 if (event.key === " ") { 3563 return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; 3564 } 3565 return false; 3566 } 3567 var symbol = Symbol("command"); 3568 var useCommand = createHook( 3569 (_a) => { 3570 var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); 3571 const ref = (0,external_React_.useRef)(null); 3572 const tagName = useTagName(ref, props.as); 3573 const type = props.type; 3574 const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( 3575 () => !!tagName && isButton({ tagName, type }) 3576 ); 3577 (0,external_React_.useEffect)(() => { 3578 if (!ref.current) 3579 return; 3580 setIsNativeButton(isButton(ref.current)); 3581 }, []); 3582 const [active, setActive] = (0,external_React_.useState)(false); 3583 const activeRef = (0,external_React_.useRef)(false); 3584 const disabled = disabledFromProps(props); 3585 const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true); 3586 const onKeyDownProp = props.onKeyDown; 3587 const onKeyDown = useEvent((event) => { 3588 onKeyDownProp == null ? void 0 : onKeyDownProp(event); 3589 const element = event.currentTarget; 3590 if (event.defaultPrevented) 3591 return; 3592 if (isDuplicate) 3593 return; 3594 if (disabled) 3595 return; 3596 if (!isSelfTarget(event)) 3597 return; 3598 if (DLOEKDPY_isTextField(element)) 3599 return; 3600 if (element.isContentEditable) 3601 return; 3602 const isEnter = clickOnEnter && event.key === "Enter"; 3603 const isSpace = clickOnSpace && event.key === " "; 3604 const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; 3605 const shouldPreventSpace = event.key === " " && !clickOnSpace; 3606 if (shouldPreventEnter || shouldPreventSpace) { 3607 event.preventDefault(); 3608 return; 3609 } 3610 if (isEnter || isSpace) { 3611 const nativeClick = isNativeClick(event); 3612 if (isEnter) { 3613 if (!nativeClick) { 3614 event.preventDefault(); 3615 const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); 3616 const click = () => fireClickEvent(element, eventInit); 3617 if (isFirefox()) { 3618 queueBeforeEvent(element, "keyup", click); 3619 } else { 3620 queueMicrotask(click); 3621 } 3622 } 3623 } else if (isSpace) { 3624 activeRef.current = true; 3625 if (!nativeClick) { 3626 event.preventDefault(); 3627 setActive(true); 3628 } 3629 } 3630 } 3631 }); 3632 const onKeyUpProp = props.onKeyUp; 3633 const onKeyUp = useEvent((event) => { 3634 onKeyUpProp == null ? void 0 : onKeyUpProp(event); 3635 if (event.defaultPrevented) 3636 return; 3637 if (isDuplicate) 3638 return; 3639 if (disabled) 3640 return; 3641 if (event.metaKey) 3642 return; 3643 const isSpace = clickOnSpace && event.key === " "; 3644 if (activeRef.current && isSpace) { 3645 activeRef.current = false; 3646 if (!isNativeClick(event)) { 3647 event.preventDefault(); 3648 setActive(false); 3649 const element = event.currentTarget; 3650 const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); 3651 queueMicrotask(() => fireClickEvent(element, eventInit)); 3652 } 3653 } 3654 }); 3655 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({ 3656 "data-active": active ? "" : void 0, 3657 type: isNativeButton ? "button" : void 0 3658 }, metadataProps), props), { 3659 ref: useMergeRefs(ref, props.ref), 3660 onKeyDown, 3661 onKeyUp 3662 }); 3663 props = useFocusable(props); 3664 return props; 3665 } 3666 ); 3667 var Command = createComponent((props) => { 3668 props = useCommand(props); 3669 return _3ORBWXWF_createElement("button", props); 3670 }); 3671 if (false) {} 3672 3673 3674 3675 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4UUKJZ4V.js 3676 "use client"; 3677 3678 3679 // src/collection/collection-context.tsx 3680 var ctx = createStoreContext(); 3681 var useCollectionContext = ctx.useContext; 3682 var useCollectionScopedContext = ctx.useScopedContext; 3683 var useCollectionProviderContext = ctx.useProviderContext; 3684 var CollectionContextProvider = ctx.ContextProvider; 3685 var CollectionScopedContextProvider = ctx.ScopedContextProvider; 3686 3687 3688 3689 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UH3I23HL.js 3690 "use client"; 3691 3692 3693 3694 3695 3696 // src/collection/collection-item.ts 3697 3698 3699 var useCollectionItem = createHook( 3700 (_a) => { 3701 var _b = _a, { 3702 store, 3703 shouldRegisterItem = true, 3704 getItem = identity, 3705 element: element 3706 } = _b, props = __objRest(_b, [ 3707 "store", 3708 "shouldRegisterItem", 3709 "getItem", 3710 // @ts-expect-error This prop may come from a collection renderer. 3711 "element" 3712 ]); 3713 const context = useCollectionContext(); 3714 store = store || context; 3715 const id = useId(props.id); 3716 const ref = (0,external_React_.useRef)(element); 3717 (0,external_React_.useEffect)(() => { 3718 const element2 = ref.current; 3719 if (!id) 3720 return; 3721 if (!element2) 3722 return; 3723 if (!shouldRegisterItem) 3724 return; 3725 const item = getItem({ id, element: element2 }); 3726 return store == null ? void 0 : store.renderItem(item); 3727 }, [id, shouldRegisterItem, getItem, store]); 3728 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 3729 ref: useMergeRefs(ref, props.ref) 3730 }); 3731 return props; 3732 } 3733 ); 3734 var CollectionItem = createComponent( 3735 (props) => { 3736 const htmlProps = useCollectionItem(props); 3737 return _3ORBWXWF_createElement("div", htmlProps); 3738 } 3739 ); 3740 if (false) {} 3741 3742 3743 3744 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3IEDWLST.js 3745 "use client"; 3746 3747 // src/composite/utils.ts 3748 3749 var NULL_ITEM = { id: null }; 3750 function flipItems(items, activeId, shouldInsertNullItem = false) { 3751 const index = items.findIndex((item) => item.id === activeId); 3752 return [ 3753 ...items.slice(index + 1), 3754 ...shouldInsertNullItem ? [NULL_ITEM] : [], 3755 ...items.slice(0, index) 3756 ]; 3757 } 3758 function findFirstEnabledItem(items, excludeId) { 3759 return items.find((item) => { 3760 if (excludeId) { 3761 return !item.disabled && item.id !== excludeId; 3762 } 3763 return !item.disabled; 3764 }); 3765 } 3766 function getEnabledItem(store, id) { 3767 if (!id) 3768 return null; 3769 return store.item(id) || null; 3770 } 3771 function groupItemsByRows(items) { 3772 const rows = []; 3773 for (const item of items) { 3774 const row = rows.find((currentRow) => { 3775 var _a; 3776 return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; 3777 }); 3778 if (row) { 3779 row.push(item); 3780 } else { 3781 rows.push([item]); 3782 } 3783 } 3784 return rows; 3785 } 3786 function selectTextField(element, collapseToEnd = false) { 3787 if (isTextField(element)) { 3788 element.setSelectionRange( 3789 collapseToEnd ? element.value.length : 0, 3790 element.value.length 3791 ); 3792 } else if (element.isContentEditable) { 3793 const selection = getDocument(element).getSelection(); 3794 selection == null ? void 0 : selection.selectAllChildren(element); 3795 if (collapseToEnd) { 3796 selection == null ? void 0 : selection.collapseToEnd(); 3797 } 3798 } 3799 } 3800 var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY"); 3801 function focusSilently(element) { 3802 element[FOCUS_SILENTLY] = true; 3803 element.focus({ preventScroll: true }); 3804 } 3805 function silentlyFocused(element) { 3806 const isSilentlyFocused = element[FOCUS_SILENTLY]; 3807 delete element[FOCUS_SILENTLY]; 3808 return isSilentlyFocused; 3809 } 3810 function isItem(store, element, exclude) { 3811 if (!element) 3812 return false; 3813 if (element === exclude) 3814 return false; 3815 const item = store.item(element.id); 3816 if (!item) 3817 return false; 3818 if (exclude && item.element === exclude) 3819 return false; 3820 return true; 3821 } 3822 3823 3824 3825 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IB7YUKH5.js 3826 "use client"; 3827 3828 3829 3830 // src/composite/composite-context.tsx 3831 3832 var IB7YUKH5_ctx = createStoreContext( 3833 [CollectionContextProvider], 3834 [CollectionScopedContextProvider] 3835 ); 3836 var useCompositeContext = IB7YUKH5_ctx.useContext; 3837 var useCompositeScopedContext = IB7YUKH5_ctx.useScopedContext; 3838 var useCompositeProviderContext = IB7YUKH5_ctx.useProviderContext; 3839 var CompositeContextProvider = IB7YUKH5_ctx.ContextProvider; 3840 var CompositeScopedContextProvider = IB7YUKH5_ctx.ScopedContextProvider; 3841 var CompositeItemContext = (0,external_React_.createContext)( 3842 void 0 3843 ); 3844 var CompositeRowContext = (0,external_React_.createContext)( 3845 void 0 3846 ); 3847 3848 3849 3850 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EAHJFCU4.js 3851 "use client"; 3852 3853 3854 3855 // src/utils/store.ts 3856 function getInternal(store, key) { 3857 const internals = store.__unstableInternals; 3858 invariant(internals, "Invalid store"); 3859 return internals[key]; 3860 } 3861 function createStore(initialState, ...stores) { 3862 let state = initialState; 3863 let prevStateBatch = state; 3864 let lastUpdate = Symbol(); 3865 let destroy = noop; 3866 const instances = /* @__PURE__ */ new Set(); 3867 const updatedKeys = /* @__PURE__ */ new Set(); 3868 const setups = /* @__PURE__ */ new Set(); 3869 const listeners = /* @__PURE__ */ new Set(); 3870 const batchListeners = /* @__PURE__ */ new Set(); 3871 const disposables = /* @__PURE__ */ new WeakMap(); 3872 const listenerKeys = /* @__PURE__ */ new WeakMap(); 3873 const storeSetup = (callback) => { 3874 setups.add(callback); 3875 return () => setups.delete(callback); 3876 }; 3877 const storeInit = () => { 3878 const initialized = instances.size; 3879 const instance = Symbol(); 3880 instances.add(instance); 3881 const maybeDestroy = () => { 3882 instances.delete(instance); 3883 if (instances.size) 3884 return; 3885 destroy(); 3886 }; 3887 if (initialized) 3888 return maybeDestroy; 3889 const desyncs = getKeys(state).map( 3890 (key) => chain( 3891 ...stores.map((store) => { 3892 var _a; 3893 const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); 3894 if (!storeState) 3895 return; 3896 if (!Y3OOHFCN_hasOwnProperty(storeState, key)) 3897 return; 3898 return sync(store, [key], (state2) => { 3899 setState( 3900 key, 3901 state2[key], 3902 // @ts-expect-error - Not public API. This is just to prevent 3903 // infinite loops. 3904 true 3905 ); 3906 }); 3907 }) 3908 ) 3909 ); 3910 const teardowns = []; 3911 setups.forEach((setup2) => teardowns.push(setup2())); 3912 const cleanups = stores.map(init); 3913 destroy = chain(...desyncs, ...teardowns, ...cleanups); 3914 return maybeDestroy; 3915 }; 3916 const sub = (keys, listener, set = listeners) => { 3917 set.add(listener); 3918 listenerKeys.set(listener, keys); 3919 return () => { 3920 var _a; 3921 (_a = disposables.get(listener)) == null ? void 0 : _a(); 3922 disposables.delete(listener); 3923 listenerKeys.delete(listener); 3924 set.delete(listener); 3925 }; 3926 }; 3927 const storeSubscribe = (keys, listener) => sub(keys, listener); 3928 const storeSync = (keys, listener) => { 3929 disposables.set(listener, listener(state, state)); 3930 return sub(keys, listener); 3931 }; 3932 const storeBatch = (keys, listener) => { 3933 disposables.set(listener, listener(state, prevStateBatch)); 3934 return sub(keys, listener, batchListeners); 3935 }; 3936 const storePick = (keys) => createStore(pick(state, keys), finalStore); 3937 const storeOmit = (keys) => createStore(omit(state, keys), finalStore); 3938 const getState = () => state; 3939 const setState = (key, value, fromStores = false) => { 3940 if (!Y3OOHFCN_hasOwnProperty(state, key)) 3941 return; 3942 const nextValue = Y3OOHFCN_applyState(value, state[key]); 3943 if (nextValue === state[key]) 3944 return; 3945 if (!fromStores) { 3946 stores.forEach((store) => { 3947 var _a; 3948 (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); 3949 }); 3950 } 3951 const prevState = state; 3952 state = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, state), { [key]: nextValue }); 3953 const thisUpdate = Symbol(); 3954 lastUpdate = thisUpdate; 3955 updatedKeys.add(key); 3956 const run = (listener, prev, uKeys) => { 3957 var _a; 3958 const keys = listenerKeys.get(listener); 3959 const updated = (k) => uKeys ? uKeys.has(k) : k === key; 3960 if (!keys || keys.some(updated)) { 3961 (_a = disposables.get(listener)) == null ? void 0 : _a(); 3962 disposables.set(listener, listener(state, prev)); 3963 } 3964 }; 3965 listeners.forEach((listener) => { 3966 run(listener, prevState); 3967 }); 3968 queueMicrotask(() => { 3969 if (lastUpdate !== thisUpdate) 3970 return; 3971 const snapshot = state; 3972 batchListeners.forEach((listener) => { 3973 run(listener, prevStateBatch, updatedKeys); 3974 }); 3975 prevStateBatch = snapshot; 3976 updatedKeys.clear(); 3977 }); 3978 }; 3979 const finalStore = { 3980 getState, 3981 setState, 3982 __unstableInternals: { 3983 setup: storeSetup, 3984 init: storeInit, 3985 subscribe: storeSubscribe, 3986 sync: storeSync, 3987 batch: storeBatch, 3988 pick: storePick, 3989 omit: storeOmit 3990 } 3991 }; 3992 return finalStore; 3993 } 3994 function setup(store, ...args) { 3995 if (!store) 3996 return; 3997 return getInternal(store, "setup")(...args); 3998 } 3999 function init(store, ...args) { 4000 if (!store) 4001 return; 4002 return getInternal(store, "init")(...args); 4003 } 4004 function subscribe(store, ...args) { 4005 if (!store) 4006 return; 4007 return getInternal(store, "subscribe")(...args); 4008 } 4009 function sync(store, ...args) { 4010 if (!store) 4011 return; 4012 return getInternal(store, "sync")(...args); 4013 } 4014 function batch(store, ...args) { 4015 if (!store) 4016 return; 4017 return getInternal(store, "batch")(...args); 4018 } 4019 function omit2(store, ...args) { 4020 if (!store) 4021 return; 4022 return getInternal(store, "omit")(...args); 4023 } 4024 function pick2(store, ...args) { 4025 if (!store) 4026 return; 4027 return getInternal(store, "pick")(...args); 4028 } 4029 function mergeStore(...stores) { 4030 const initialState = stores.reduce((state, store2) => { 4031 var _a; 4032 const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); 4033 if (!nextState) 4034 return state; 4035 return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, state), nextState); 4036 }, {}); 4037 const store = createStore(initialState, ...stores); 4038 return store; 4039 } 4040 function throwOnConflictingProps(props, store) { 4041 if (true) 4042 return; 4043 if (!store) 4044 return; 4045 const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { 4046 var _a; 4047 const stateKey = key.replace("default", ""); 4048 return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}$stateKey.slice(1)}`; 4049 }); 4050 if (!defaultKeys.length) 4051 return; 4052 const storeState = store.getState(); 4053 const conflictingProps = defaultKeys.filter( 4054 (key) => Y3OOHFCN_hasOwnProperty(storeState, key) 4055 ); 4056 if (!conflictingProps.length) 4057 return; 4058 throw new Error( 4059 `Passing a store prop in conjunction with a default state is not supported. 4060 4061 const store = useSelectStore(); 4062 <SelectProvider store={store} defaultValue="Apple" /> 4063 ^ ^ 4064 4065 Instead, pass the default state to the topmost store: 4066 4067 const store = useSelectStore({ defaultValue: "Apple" }); 4068 <SelectProvider store={store} /> 4069 4070 See https://github.com/ariakit/ariakit/pull/2745 for more details. 4071 4072 If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit 4073 ` 4074 ); 4075 } 4076 4077 4078 4079 // EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js 4080 var shim = __webpack_require__(422); 4081 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/EKQEJRUF.js 4082 "use client"; 4083 4084 4085 4086 // src/utils/store.tsx 4087 4088 4089 4090 4091 var { useSyncExternalStore } = shim; 4092 var noopSubscribe = () => () => { 4093 }; 4094 function useStoreState(store, keyOrSelector = identity) { 4095 const storeSubscribe = external_React_.useCallback( 4096 (callback) => { 4097 if (!store) 4098 return noopSubscribe(); 4099 return subscribe(store, null, callback); 4100 }, 4101 [store] 4102 ); 4103 const getSnapshot = () => { 4104 const key = typeof keyOrSelector === "string" ? keyOrSelector : null; 4105 const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; 4106 const state = store == null ? void 0 : store.getState(); 4107 if (selector) 4108 return selector(state); 4109 if (!state) 4110 return; 4111 if (!key) 4112 return; 4113 if (!Y3OOHFCN_hasOwnProperty(state, key)) 4114 return; 4115 return state[key]; 4116 }; 4117 return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); 4118 } 4119 function useStoreProps(store, props, key, setKey) { 4120 const value = Y3OOHFCN_hasOwnProperty(props, key) ? props[key] : void 0; 4121 const setValue = setKey ? props[setKey] : void 0; 4122 const propsRef = useLiveRef({ value, setValue }); 4123 useSafeLayoutEffect(() => { 4124 return sync(store, [key], (state, prev) => { 4125 const { value: value2, setValue: setValue2 } = propsRef.current; 4126 if (!setValue2) 4127 return; 4128 if (state[key] === prev[key]) 4129 return; 4130 if (state[key] === value2) 4131 return; 4132 setValue2(state[key]); 4133 }); 4134 }, [store, key]); 4135 useSafeLayoutEffect(() => { 4136 if (value === void 0) 4137 return; 4138 store.setState(key, value); 4139 return batch(store, [key], () => { 4140 if (value === void 0) 4141 return; 4142 store.setState(key, value); 4143 }); 4144 }); 4145 } 4146 function EKQEJRUF_useStore(createStore, props) { 4147 const [store, setStore] = external_React_.useState(() => createStore(props)); 4148 useSafeLayoutEffect(() => init(store), [store]); 4149 const useState2 = external_React_.useCallback( 4150 (keyOrSelector) => useStoreState(store, keyOrSelector), 4151 [store] 4152 ); 4153 const memoizedStore = external_React_.useMemo( 4154 () => _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, store), { useState: useState2 }), 4155 [store, useState2] 4156 ); 4157 const updateStore = useEvent(() => { 4158 setStore((store2) => createStore(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, props), store2.getState()))); 4159 }); 4160 return [memoizedStore, updateStore]; 4161 } 4162 4163 4164 4165 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QZLXIDNP.js 4166 "use client"; 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 // src/composite/composite-item.tsx 4177 4178 4179 4180 4181 4182 function isEditableElement(element) { 4183 if (element.isContentEditable) 4184 return true; 4185 if (DLOEKDPY_isTextField(element)) 4186 return true; 4187 return element.tagName === "INPUT" && !isButton(element); 4188 } 4189 function getNextPageOffset(scrollingElement, pageUp = false) { 4190 const height = scrollingElement.clientHeight; 4191 const { top } = scrollingElement.getBoundingClientRect(); 4192 const pageSize = Math.max(height * 0.875, height - 40) * 1.5; 4193 const pageOffset = pageUp ? height - pageSize + top : pageSize + top; 4194 if (scrollingElement.tagName === "HTML") { 4195 return pageOffset + scrollingElement.scrollTop; 4196 } 4197 return pageOffset; 4198 } 4199 function getItemOffset(itemElement, pageUp = false) { 4200 const { top } = itemElement.getBoundingClientRect(); 4201 if (pageUp) { 4202 return top + itemElement.clientHeight; 4203 } 4204 return top; 4205 } 4206 function findNextPageItemId(element, store, next, pageUp = false) { 4207 var _a; 4208 if (!store) 4209 return; 4210 if (!next) 4211 return; 4212 const { renderedItems } = store.getState(); 4213 const scrollingElement = getScrollingElement(element); 4214 if (!scrollingElement) 4215 return; 4216 const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); 4217 let id; 4218 let prevDifference; 4219 for (let i = 0; i < renderedItems.length; i += 1) { 4220 const previousId = id; 4221 id = next(i); 4222 if (!id) 4223 break; 4224 if (id === previousId) 4225 continue; 4226 const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; 4227 if (!itemElement) 4228 continue; 4229 const itemOffset = getItemOffset(itemElement, pageUp); 4230 const difference = itemOffset - nextPageOffset; 4231 const absDifference = Math.abs(difference); 4232 if (pageUp && difference <= 0 || !pageUp && difference >= 0) { 4233 if (prevDifference !== void 0 && prevDifference < absDifference) { 4234 id = previousId; 4235 } 4236 break; 4237 } 4238 prevDifference = absDifference; 4239 } 4240 return id; 4241 } 4242 function targetIsAnotherItem(event, store) { 4243 if (isSelfTarget(event)) 4244 return false; 4245 return isItem(store, event.target); 4246 } 4247 function useRole(ref, props) { 4248 const roleProp = props.role; 4249 const [role, setRole] = (0,external_React_.useState)(roleProp); 4250 useSafeLayoutEffect(() => { 4251 const element = ref.current; 4252 if (!element) 4253 return; 4254 setRole(element.getAttribute("role") || roleProp); 4255 }, [roleProp]); 4256 return role; 4257 } 4258 function requiresAriaSelected(role) { 4259 return role === "option" || role === "treeitem"; 4260 } 4261 function supportsAriaSelected(role) { 4262 if (role === "option") 4263 return true; 4264 if (role === "tab") 4265 return true; 4266 if (role === "treeitem") 4267 return true; 4268 if (role === "gridcell") 4269 return true; 4270 if (role === "row") 4271 return true; 4272 if (role === "columnheader") 4273 return true; 4274 if (role === "rowheader") 4275 return true; 4276 return false; 4277 } 4278 var useCompositeItem = createHook( 4279 (_a) => { 4280 var _b = _a, { 4281 store, 4282 rowId: rowIdProp, 4283 preventScrollOnKeyDown = false, 4284 moveOnKeyPress = true, 4285 tabbable = false, 4286 getItem: getItemProp, 4287 "aria-setsize": ariaSetSizeProp, 4288 "aria-posinset": ariaPosInSetProp 4289 } = _b, props = __objRest(_b, [ 4290 "store", 4291 "rowId", 4292 "preventScrollOnKeyDown", 4293 "moveOnKeyPress", 4294 "tabbable", 4295 "getItem", 4296 "aria-setsize", 4297 "aria-posinset" 4298 ]); 4299 const context = useCompositeContext(); 4300 store = store || context; 4301 const id = useId(props.id); 4302 const ref = (0,external_React_.useRef)(null); 4303 const row = (0,external_React_.useContext)(CompositeRowContext); 4304 const rowId = useStoreState(store, (state) => { 4305 if (rowIdProp) 4306 return rowIdProp; 4307 if (!state) 4308 return; 4309 if (!(row == null ? void 0 : row.baseElement)) 4310 return; 4311 if (row.baseElement !== state.baseElement) 4312 return; 4313 return row.id; 4314 }); 4315 const disabled = disabledFromProps(props); 4316 const trulyDisabled = disabled && !props.accessibleWhenDisabled; 4317 const getItem = (0,external_React_.useCallback)( 4318 (item) => { 4319 const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { 4320 id: id || item.id, 4321 rowId, 4322 disabled: !!trulyDisabled 4323 }); 4324 if (getItemProp) { 4325 return getItemProp(nextItem); 4326 } 4327 return nextItem; 4328 }, 4329 [id, rowId, trulyDisabled, getItemProp] 4330 ); 4331 const onFocusProp = props.onFocus; 4332 const hasFocusedComposite = (0,external_React_.useRef)(false); 4333 const onFocus = useEvent((event) => { 4334 onFocusProp == null ? void 0 : onFocusProp(event); 4335 if (event.defaultPrevented) 4336 return; 4337 if (isPortalEvent(event)) 4338 return; 4339 if (!id) 4340 return; 4341 if (!store) 4342 return; 4343 const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState(); 4344 if (targetIsAnotherItem(event, store)) 4345 return; 4346 if (activeId !== id) { 4347 store.setActiveId(id); 4348 } 4349 if (!virtualFocus2) 4350 return; 4351 if (!isSelfTarget(event)) 4352 return; 4353 if (isEditableElement(event.currentTarget)) 4354 return; 4355 if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) 4356 return; 4357 hasFocusedComposite.current = true; 4358 const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget); 4359 if (fromComposite) { 4360 focusSilently(baseElement2); 4361 } else { 4362 baseElement2.focus(); 4363 } 4364 }); 4365 const onBlurCaptureProp = props.onBlurCapture; 4366 const onBlurCapture = useEvent((event) => { 4367 onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); 4368 if (event.defaultPrevented) 4369 return; 4370 const state = store == null ? void 0 : store.getState(); 4371 if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { 4372 hasFocusedComposite.current = false; 4373 event.preventDefault(); 4374 event.stopPropagation(); 4375 } 4376 }); 4377 const onKeyDownProp = props.onKeyDown; 4378 const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); 4379 const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); 4380 const onKeyDown = useEvent((event) => { 4381 onKeyDownProp == null ? void 0 : onKeyDownProp(event); 4382 if (event.defaultPrevented) 4383 return; 4384 if (!isSelfTarget(event)) 4385 return; 4386 if (!store) 4387 return; 4388 const { currentTarget } = event; 4389 const state = store.getState(); 4390 const item = store.item(id); 4391 const isGrid = !!(item == null ? void 0 : item.rowId); 4392 const isVertical = state.orientation !== "horizontal"; 4393 const isHorizontal = state.orientation !== "vertical"; 4394 const canHomeEnd = () => { 4395 if (isGrid) 4396 return true; 4397 if (isHorizontal) 4398 return true; 4399 if (!state.baseElement) 4400 return true; 4401 if (!DLOEKDPY_isTextField(state.baseElement)) 4402 return true; 4403 return false; 4404 }; 4405 const keyMap = { 4406 ArrowUp: (isGrid || isVertical) && store.up, 4407 ArrowRight: (isGrid || isHorizontal) && store.next, 4408 ArrowDown: (isGrid || isVertical) && store.down, 4409 ArrowLeft: (isGrid || isHorizontal) && store.previous, 4410 Home: () => { 4411 if (!canHomeEnd()) 4412 return; 4413 if (!isGrid || event.ctrlKey) { 4414 return store == null ? void 0 : store.first(); 4415 } 4416 return store == null ? void 0 : store.previous(-1); 4417 }, 4418 End: () => { 4419 if (!canHomeEnd()) 4420 return; 4421 if (!isGrid || event.ctrlKey) { 4422 return store == null ? void 0 : store.last(); 4423 } 4424 return store == null ? void 0 : store.next(-1); 4425 }, 4426 PageUp: () => { 4427 return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true); 4428 }, 4429 PageDown: () => { 4430 return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down); 4431 } 4432 }; 4433 const action = keyMap[event.key]; 4434 if (action) { 4435 const nextId = action(); 4436 if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { 4437 if (!moveOnKeyPressProp(event)) 4438 return; 4439 event.preventDefault(); 4440 store.move(nextId); 4441 } 4442 } 4443 }); 4444 const baseElement = useStoreState( 4445 store, 4446 (state) => (state == null ? void 0 : state.baseElement) || void 0 4447 ); 4448 const providerValue = (0,external_React_.useMemo)( 4449 () => ({ id, baseElement }), 4450 [id, baseElement] 4451 ); 4452 props = useWrapElement( 4453 props, 4454 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), 4455 [providerValue] 4456 ); 4457 const isActiveItem = useStoreState( 4458 store, 4459 (state) => !!state && state.activeId === id 4460 ); 4461 const virtualFocus = useStoreState(store, "virtualFocus"); 4462 const role = useRole(ref, props); 4463 let ariaSelected; 4464 if (isActiveItem) { 4465 if (requiresAriaSelected(role)) { 4466 ariaSelected = true; 4467 } else if (virtualFocus && supportsAriaSelected(role)) { 4468 ariaSelected = true; 4469 } 4470 } 4471 const ariaSetSize = useStoreState(store, (state) => { 4472 if (ariaSetSizeProp != null) 4473 return ariaSetSizeProp; 4474 if (!state) 4475 return; 4476 if (!(row == null ? void 0 : row.ariaSetSize)) 4477 return; 4478 if (row.baseElement !== state.baseElement) 4479 return; 4480 return row.ariaSetSize; 4481 }); 4482 const ariaPosInSet = useStoreState(store, (state) => { 4483 if (ariaPosInSetProp != null) 4484 return ariaPosInSetProp; 4485 if (!state) 4486 return; 4487 if (!(row == null ? void 0 : row.ariaPosInSet)) 4488 return; 4489 if (row.baseElement !== state.baseElement) 4490 return; 4491 const itemsInRow = state.renderedItems.filter( 4492 (item) => item.rowId === rowId 4493 ); 4494 return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); 4495 }); 4496 const isTabbable = useStoreState(store, (state) => { 4497 if (!(state == null ? void 0 : state.renderedItems.length)) 4498 return true; 4499 if (state.virtualFocus) 4500 return false; 4501 if (tabbable) 4502 return true; 4503 return state.activeId === id; 4504 }); 4505 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 4506 id, 4507 "aria-selected": ariaSelected, 4508 "data-active-item": isActiveItem ? "" : void 0 4509 }, props), { 4510 ref: useMergeRefs(ref, props.ref), 4511 tabIndex: isTabbable ? props.tabIndex : -1, 4512 onFocus, 4513 onBlurCapture, 4514 onKeyDown 4515 }); 4516 props = useCommand(props); 4517 props = useCollectionItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 4518 store 4519 }, props), { 4520 getItem, 4521 shouldRegisterItem: !!id ? props.shouldRegisterItem : false 4522 })); 4523 return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 4524 "aria-setsize": ariaSetSize, 4525 "aria-posinset": ariaPosInSet 4526 }); 4527 } 4528 ); 4529 var CompositeItem = createMemoComponent( 4530 (props) => { 4531 const htmlProps = useCompositeItem(props); 4532 return _3ORBWXWF_createElement("button", htmlProps); 4533 } 4534 ); 4535 if (false) {} 4536 4537 4538 4539 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Z5IGYIPT.js 4540 "use client"; 4541 4542 4543 4544 4545 // src/disclosure/disclosure-store.ts 4546 function createDisclosureStore(props = {}) { 4547 const store = mergeStore( 4548 props.store, 4549 omit2(props.disclosure, ["contentElement", "disclosureElement"]) 4550 ); 4551 throwOnConflictingProps(props, store); 4552 const syncState = store == null ? void 0 : store.getState(); 4553 const open = defaultValue( 4554 props.open, 4555 syncState == null ? void 0 : syncState.open, 4556 props.defaultOpen, 4557 false 4558 ); 4559 const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); 4560 const initialState = { 4561 open, 4562 animated, 4563 animating: !!animated && open, 4564 mounted: open, 4565 contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), 4566 disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) 4567 }; 4568 const disclosure = createStore(initialState, store); 4569 setup( 4570 disclosure, 4571 () => sync(disclosure, ["animated", "animating"], (state) => { 4572 if (state.animated) 4573 return; 4574 disclosure.setState("animating", false); 4575 }) 4576 ); 4577 setup( 4578 disclosure, 4579 () => subscribe(disclosure, ["open"], () => { 4580 if (!disclosure.getState().animated) 4581 return; 4582 disclosure.setState("animating", true); 4583 }) 4584 ); 4585 setup( 4586 disclosure, 4587 () => sync(disclosure, ["open", "animating"], (state) => { 4588 disclosure.setState("mounted", state.open || state.animating); 4589 }) 4590 ); 4591 return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, disclosure), { 4592 setOpen: (value) => disclosure.setState("open", value), 4593 show: () => disclosure.setState("open", true), 4594 hide: () => disclosure.setState("open", false), 4595 toggle: () => disclosure.setState("open", (open2) => !open2), 4596 stopAnimation: () => disclosure.setState("animating", false), 4597 setContentElement: (value) => disclosure.setState("contentElement", value), 4598 setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) 4599 }); 4600 } 4601 4602 4603 4604 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SFCBA2JZ.js 4605 "use client"; 4606 4607 4608 4609 // src/disclosure/disclosure-store.ts 4610 4611 function useDisclosureStoreProps(store, update, props) { 4612 useUpdateEffect(update, [props.store, props.disclosure]); 4613 useStoreProps(store, props, "open", "setOpen"); 4614 useStoreProps(store, props, "mounted", "setMounted"); 4615 useStoreProps(store, props, "animated"); 4616 return store; 4617 } 4618 function useDisclosureStore(props = {}) { 4619 const [store, update] = EKQEJRUF_useStore(createDisclosureStore, props); 4620 return useDisclosureStoreProps(store, update, props); 4621 } 4622 4623 4624 4625 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SX2XFD6A.js 4626 "use client"; 4627 4628 4629 // src/dialog/dialog-store.ts 4630 function createDialogStore(props = {}) { 4631 return createDisclosureStore(props); 4632 } 4633 4634 4635 4636 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZSELSBRM.js 4637 "use client"; 4638 4639 4640 4641 // src/dialog/dialog-store.ts 4642 4643 function useDialogStoreProps(store, update, props) { 4644 return useDisclosureStoreProps(store, update, props); 4645 } 4646 function useDialogStore(props = {}) { 4647 const [store, update] = EKQEJRUF_useStore(createDialogStore, props); 4648 return useDialogStoreProps(store, update, props); 4649 } 4650 4651 4652 4653 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MG4P3223.js 4654 "use client"; 4655 4656 4657 4658 4659 // src/popover/popover-store.ts 4660 4661 function usePopoverStoreProps(store, update, props) { 4662 useUpdateEffect(update, [props.popover]); 4663 store = useDialogStoreProps(store, update, props); 4664 useStoreProps(store, props, "placement"); 4665 return store; 4666 } 4667 function usePopoverStore(props = {}) { 4668 const [store, update] = useStore(Core.createPopoverStore, props); 4669 return usePopoverStoreProps(store, update, props); 4670 } 4671 4672 4673 4674 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZU7LQC5V.js 4675 "use client"; 4676 4677 4678 4679 // src/hovercard/hovercard-store.ts 4680 4681 function useHovercardStoreProps(store, update, props) { 4682 store = usePopoverStoreProps(store, update, props); 4683 useStoreProps(store, props, "timeout"); 4684 useStoreProps(store, props, "showTimeout"); 4685 useStoreProps(store, props, "hideTimeout"); 4686 return store; 4687 } 4688 function useHovercardStore(props = {}) { 4689 const [store, update] = useStore(Core.createHovercardStore, props); 4690 return useHovercardStoreProps(store, update, props); 4691 } 4692 4693 4694 4695 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/AF6IUUFN.js 4696 "use client"; 4697 4698 4699 4700 4701 4702 // src/popover/popover-store.ts 4703 function createPopoverStore(_a = {}) { 4704 var _b = _a, { 4705 popover: otherPopover 4706 } = _b, props = _4R3V3JGP_objRest(_b, [ 4707 "popover" 4708 ]); 4709 const store = mergeStore( 4710 props.store, 4711 omit2(otherPopover, [ 4712 "arrowElement", 4713 "anchorElement", 4714 "contentElement", 4715 "popoverElement", 4716 "disclosureElement" 4717 ]) 4718 ); 4719 throwOnConflictingProps(props, store); 4720 const syncState = store == null ? void 0 : store.getState(); 4721 const dialog = createDialogStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { store })); 4722 const placement = defaultValue( 4723 props.placement, 4724 syncState == null ? void 0 : syncState.placement, 4725 "bottom" 4726 ); 4727 const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, dialog.getState()), { 4728 placement, 4729 currentPlacement: placement, 4730 anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), 4731 popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), 4732 arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), 4733 rendered: Symbol("rendered") 4734 }); 4735 const popover = createStore(initialState, dialog, store); 4736 return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, dialog), popover), { 4737 setAnchorElement: (element) => popover.setState("anchorElement", element), 4738 setPopoverElement: (element) => popover.setState("popoverElement", element), 4739 setArrowElement: (element) => popover.setState("arrowElement", element), 4740 render: () => popover.setState("rendered", Symbol("rendered")) 4741 }); 4742 } 4743 4744 4745 4746 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SOLWE6E5.js 4747 "use client"; 4748 4749 4750 4751 4752 4753 // src/hovercard/hovercard-store.ts 4754 function createHovercardStore(props = {}) { 4755 var _a; 4756 const syncState = (_a = props.store) == null ? void 0 : _a.getState(); 4757 const popover = createPopoverStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { 4758 placement: defaultValue( 4759 props.placement, 4760 syncState == null ? void 0 : syncState.placement, 4761 "bottom" 4762 ) 4763 })); 4764 const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500); 4765 const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, popover.getState()), { 4766 timeout, 4767 showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout), 4768 hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout), 4769 autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false) 4770 }); 4771 const hovercard = createStore(initialState, popover, props.store); 4772 return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, popover), hovercard), { 4773 setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value) 4774 }); 4775 } 4776 4777 4778 4779 ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js 4780 "use client"; 4781 4782 4783 4784 4785 4786 4787 4788 4789 // src/tooltip/tooltip-store.ts 4790 function createTooltipStore(props = {}) { 4791 var _a; 4792 const syncState = (_a = props.store) == null ? void 0 : _a.getState(); 4793 const hovercard = createHovercardStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { 4794 placement: defaultValue( 4795 props.placement, 4796 syncState == null ? void 0 : syncState.placement, 4797 "top" 4798 ), 4799 hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0) 4800 })); 4801 const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, hovercard.getState()), { 4802 type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"), 4803 skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300) 4804 }); 4805 const tooltip = createStore(initialState, hovercard, props.store); 4806 return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, hovercard), tooltip); 4807 } 4808 4809 4810 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2QMN5E6B.js 4811 "use client"; 4812 4813 4814 4815 // src/tooltip/tooltip-store.ts 4816 4817 function useTooltipStoreProps(store, update, props) { 4818 store = useHovercardStoreProps(store, update, props); 4819 useStoreProps(store, props, "type"); 4820 useStoreProps(store, props, "skipTimeout"); 4821 return store; 4822 } 4823 function useTooltipStore(props = {}) { 4824 const [store, update] = EKQEJRUF_useStore(createTooltipStore, props); 4825 return useTooltipStoreProps(store, update, props); 4826 } 4827 4828 4829 4830 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FSFPRQFR.js 4831 "use client"; 4832 4833 4834 // src/role/role.ts 4835 var FSFPRQFR_elements = [ 4836 "a", 4837 "button", 4838 "details", 4839 "dialog", 4840 "div", 4841 "form", 4842 "h1", 4843 "h2", 4844 "h3", 4845 "h4", 4846 "h5", 4847 "h6", 4848 "header", 4849 "img", 4850 "input", 4851 "label", 4852 "li", 4853 "nav", 4854 "ol", 4855 "p", 4856 "section", 4857 "select", 4858 "span", 4859 "textarea", 4860 "ul", 4861 "svg" 4862 ]; 4863 var FSFPRQFR_useRole = createHook((props) => { 4864 return props; 4865 }); 4866 var Role = createComponent((props) => { 4867 return _3ORBWXWF_createElement("div", props); 4868 }); 4869 if (false) {} 4870 Object.assign( 4871 Role, 4872 FSFPRQFR_elements.reduce((acc, element) => { 4873 acc[element] = createComponent((props) => { 4874 return _3ORBWXWF_createElement(element, props); 4875 }); 4876 return acc; 4877 }, {}) 4878 ); 4879 4880 4881 4882 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OAYFXAQ2.js 4883 "use client"; 4884 4885 4886 // src/disclosure/disclosure-context.tsx 4887 var OAYFXAQ2_ctx = createStoreContext(); 4888 var useDisclosureContext = OAYFXAQ2_ctx.useContext; 4889 var useDisclosureScopedContext = OAYFXAQ2_ctx.useScopedContext; 4890 var useDisclosureProviderContext = OAYFXAQ2_ctx.useProviderContext; 4891 var DisclosureContextProvider = OAYFXAQ2_ctx.ContextProvider; 4892 var DisclosureScopedContextProvider = OAYFXAQ2_ctx.ScopedContextProvider; 4893 4894 4895 4896 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6BJYYBK.js 4897 "use client"; 4898 4899 4900 4901 // src/dialog/dialog-context.tsx 4902 4903 var G6BJYYBK_ctx = createStoreContext( 4904 [DisclosureContextProvider], 4905 [DisclosureScopedContextProvider] 4906 ); 4907 var useDialogContext = G6BJYYBK_ctx.useContext; 4908 var useDialogScopedContext = G6BJYYBK_ctx.useScopedContext; 4909 var useDialogProviderContext = G6BJYYBK_ctx.useProviderContext; 4910 var DialogContextProvider = G6BJYYBK_ctx.ContextProvider; 4911 var DialogScopedContextProvider = G6BJYYBK_ctx.ScopedContextProvider; 4912 var DialogHeadingContext = (0,external_React_.createContext)(void 0); 4913 var DialogDescriptionContext = (0,external_React_.createContext)(void 0); 4914 4915 4916 4917 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7H5KSHHF.js 4918 "use client"; 4919 4920 4921 4922 // src/popover/popover-context.tsx 4923 var _7H5KSHHF_ctx = createStoreContext( 4924 [DialogContextProvider], 4925 [DialogScopedContextProvider] 4926 ); 4927 var usePopoverContext = _7H5KSHHF_ctx.useContext; 4928 var usePopoverScopedContext = _7H5KSHHF_ctx.useScopedContext; 4929 var usePopoverProviderContext = _7H5KSHHF_ctx.useProviderContext; 4930 var PopoverContextProvider = _7H5KSHHF_ctx.ContextProvider; 4931 var PopoverScopedContextProvider = _7H5KSHHF_ctx.ScopedContextProvider; 4932 4933 4934 4935 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TI7CMBHW.js 4936 "use client"; 4937 4938 4939 4940 // src/hovercard/hovercard-context.tsx 4941 var TI7CMBHW_ctx = createStoreContext( 4942 [PopoverContextProvider], 4943 [PopoverScopedContextProvider] 4944 ); 4945 var useHovercardContext = TI7CMBHW_ctx.useContext; 4946 var useHovercardScopedContext = TI7CMBHW_ctx.useScopedContext; 4947 var useHovercardProviderContext = TI7CMBHW_ctx.useProviderContext; 4948 var HovercardContextProvider = TI7CMBHW_ctx.ContextProvider; 4949 var HovercardScopedContextProvider = TI7CMBHW_ctx.ScopedContextProvider; 4950 4951 4952 4953 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7X4DYKYU.js 4954 "use client"; 4955 4956 4957 4958 4959 4960 4961 // src/hovercard/hovercard-anchor.ts 4962 4963 4964 4965 var useHovercardAnchor = createHook( 4966 (_a) => { 4967 var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); 4968 const context = useHovercardProviderContext(); 4969 store = store || context; 4970 invariant( 4971 store, 4972 false && 0 4973 ); 4974 const disabled = disabledFromProps(props); 4975 const showTimeoutRef = (0,external_React_.useRef)(0); 4976 (0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []); 4977 (0,external_React_.useEffect)(() => { 4978 const onMouseLeave = (event) => { 4979 if (!store) 4980 return; 4981 const { anchorElement } = store.getState(); 4982 if (!anchorElement) 4983 return; 4984 if (event.target !== anchorElement) 4985 return; 4986 window.clearTimeout(showTimeoutRef.current); 4987 showTimeoutRef.current = 0; 4988 }; 4989 return addGlobalEventListener("mouseleave", onMouseLeave, true); 4990 }, [store]); 4991 const onMouseMoveProp = props.onMouseMove; 4992 const showOnHoverProp = useBooleanEvent(showOnHover); 4993 const isMouseMoving = useIsMouseMoving(); 4994 const onMouseMove = useEvent( 4995 (event) => { 4996 onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); 4997 if (disabled) 4998 return; 4999 if (!store) 5000 return; 5001 if (event.defaultPrevented) 5002 return; 5003 if (showTimeoutRef.current) 5004 return; 5005 if (!isMouseMoving()) 5006 return; 5007 if (!showOnHoverProp(event)) 5008 return; 5009 const element = event.currentTarget; 5010 store.setAnchorElement(element); 5011 store.setDisclosureElement(element); 5012 const { showTimeout, timeout } = store.getState(); 5013 const showHovercard = () => { 5014 showTimeoutRef.current = 0; 5015 if (!isMouseMoving()) 5016 return; 5017 store == null ? void 0 : store.setAnchorElement(element); 5018 store == null ? void 0 : store.show(); 5019 queueMicrotask(() => { 5020 store == null ? void 0 : store.setDisclosureElement(element); 5021 }); 5022 }; 5023 const timeoutMs = showTimeout != null ? showTimeout : timeout; 5024 if (timeoutMs === 0) { 5025 showHovercard(); 5026 } else { 5027 showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs); 5028 } 5029 } 5030 ); 5031 const ref = (0,external_React_.useCallback)( 5032 (element) => { 5033 if (!store) 5034 return; 5035 const { anchorElement } = store.getState(); 5036 if (anchorElement == null ? void 0 : anchorElement.isConnected) 5037 return; 5038 store.setAnchorElement(element); 5039 }, 5040 [store] 5041 ); 5042 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 5043 ref: useMergeRefs(ref, props.ref), 5044 onMouseMove 5045 }); 5046 props = useFocusable(props); 5047 return props; 5048 } 5049 ); 5050 var HovercardAnchor = createComponent( 5051 (props) => { 5052 const htmlProps = useHovercardAnchor(props); 5053 return _3ORBWXWF_createElement("a", htmlProps); 5054 } 5055 ); 5056 if (false) {} 5057 5058 5059 5060 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MNFF5YOJ.js 5061 "use client"; 5062 5063 5064 5065 // src/tooltip/tooltip-context.tsx 5066 var MNFF5YOJ_ctx = createStoreContext( 5067 [HovercardContextProvider], 5068 [HovercardScopedContextProvider] 5069 ); 5070 var useTooltipContext = MNFF5YOJ_ctx.useContext; 5071 var useTooltipScopedContext = MNFF5YOJ_ctx.useScopedContext; 5072 var useTooltipProviderContext = MNFF5YOJ_ctx.useProviderContext; 5073 var TooltipContextProvider = MNFF5YOJ_ctx.ContextProvider; 5074 var TooltipScopedContextProvider = MNFF5YOJ_ctx.ScopedContextProvider; 5075 5076 5077 5078 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js 5079 "use client"; 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 // src/tooltip/tooltip-anchor.ts 5094 5095 5096 5097 var globalStore = createStore({ 5098 activeStore: null 5099 }); 5100 var useTooltipAnchor = createHook( 5101 (_a) => { 5102 var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); 5103 const context = useTooltipProviderContext(); 5104 store = store || context; 5105 invariant( 5106 store, 5107 false && 0 5108 ); 5109 const canShowOnHoverRef = (0,external_React_.useRef)(false); 5110 (0,external_React_.useEffect)(() => { 5111 return sync(store, ["mounted"], (state) => { 5112 if (state.mounted) 5113 return; 5114 canShowOnHoverRef.current = false; 5115 }); 5116 }, [store]); 5117 (0,external_React_.useEffect)(() => { 5118 return sync(store, ["mounted", "skipTimeout"], (state) => { 5119 if (!store) 5120 return; 5121 if (state.mounted) { 5122 const { activeStore } = globalStore.getState(); 5123 if (activeStore !== store) { 5124 activeStore == null ? void 0 : activeStore.hide(); 5125 } 5126 return globalStore.setState("activeStore", store); 5127 } 5128 const id = setTimeout(() => { 5129 const { activeStore } = globalStore.getState(); 5130 if (activeStore !== store) 5131 return; 5132 globalStore.setState("activeStore", null); 5133 }, state.skipTimeout); 5134 return () => clearTimeout(id); 5135 }); 5136 }, [store]); 5137 const onMouseEnterProp = props.onMouseEnter; 5138 const onMouseEnter = useEvent((event) => { 5139 onMouseEnterProp == null ? void 0 : onMouseEnterProp(event); 5140 canShowOnHoverRef.current = true; 5141 }); 5142 const onFocusVisibleProp = props.onFocusVisible; 5143 const onFocusVisible = useEvent((event) => { 5144 onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event); 5145 if (event.defaultPrevented) 5146 return; 5147 store == null ? void 0 : store.setAnchorElement(event.currentTarget); 5148 store == null ? void 0 : store.show(); 5149 }); 5150 const onBlurProp = props.onBlur; 5151 const onBlur = useEvent((event) => { 5152 onBlurProp == null ? void 0 : onBlurProp(event); 5153 if (event.defaultPrevented) 5154 return; 5155 const { activeStore } = globalStore.getState(); 5156 if (activeStore === store) { 5157 globalStore.setState("activeStore", null); 5158 } 5159 }); 5160 const type = store.useState("type"); 5161 const contentId = store.useState((state) => { 5162 var _a2; 5163 return (_a2 = state.contentElement) == null ? void 0 : _a2.id; 5164 }); 5165 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 5166 "aria-labelledby": type === "label" ? contentId : void 0, 5167 "aria-describedby": type === "description" ? contentId : void 0 5168 }, props), { 5169 onMouseEnter, 5170 onFocusVisible, 5171 onBlur 5172 }); 5173 props = useHovercardAnchor(_4R3V3JGP_spreadValues({ 5174 store, 5175 showOnHover: (event) => { 5176 if (!canShowOnHoverRef.current) 5177 return false; 5178 if (isFalsyBooleanCallback(showOnHover, event)) 5179 return false; 5180 const { activeStore } = globalStore.getState(); 5181 if (!activeStore) 5182 return true; 5183 store == null ? void 0 : store.show(); 5184 return false; 5185 } 5186 }, props)); 5187 return props; 5188 } 5189 ); 5190 var TooltipAnchor = createComponent((props) => { 5191 const htmlProps = useTooltipAnchor(props); 5192 return _3ORBWXWF_createElement("div", htmlProps); 5193 }); 5194 if (false) {} 5195 5196 5197 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YMV43K4F.js 5198 "use client"; 5199 5200 // src/hovercard/utils/polygon.ts 5201 function getEventPoint(event) { 5202 return [event.clientX, event.clientY]; 5203 } 5204 function isPointInPolygon(point, polygon) { 5205 const [x, y] = point; 5206 let inside = false; 5207 const length = polygon.length; 5208 for (let l = length, i = 0, j = l - 1; i < l; j = i++) { 5209 const [xi, yi] = polygon[i]; 5210 const [xj, yj] = polygon[j]; 5211 const [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0]; 5212 const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi); 5213 if (yj < yi) { 5214 if (y >= yj && y < yi) { 5215 if (where === 0) 5216 return true; 5217 if (where > 0) { 5218 if (y === yj) { 5219 if (y > vy) { 5220 inside = !inside; 5221 } 5222 } else { 5223 inside = !inside; 5224 } 5225 } 5226 } 5227 } else if (yi < yj) { 5228 if (y > yi && y <= yj) { 5229 if (where === 0) 5230 return true; 5231 if (where < 0) { 5232 if (y === yj) { 5233 if (y < vy) { 5234 inside = !inside; 5235 } 5236 } else { 5237 inside = !inside; 5238 } 5239 } 5240 } 5241 } else if (y == yi && (x >= xj && x <= xi || x >= xi && x <= xj)) { 5242 return true; 5243 } 5244 } 5245 return inside; 5246 } 5247 function getEnterPointPlacement(enterPoint, rect) { 5248 const { top, right, bottom, left } = rect; 5249 const [x, y] = enterPoint; 5250 const placementX = x < left ? "left" : x > right ? "right" : null; 5251 const placementY = y < top ? "top" : y > bottom ? "bottom" : null; 5252 return [placementX, placementY]; 5253 } 5254 function getElementPolygon(element, enterPoint) { 5255 const rect = element.getBoundingClientRect(); 5256 const { top, right, bottom, left } = rect; 5257 const [x, y] = getEnterPointPlacement(enterPoint, rect); 5258 const polygon = [enterPoint]; 5259 if (x) { 5260 if (y !== "top") { 5261 polygon.push([x === "left" ? left : right, top]); 5262 } 5263 polygon.push([x === "left" ? right : left, top]); 5264 polygon.push([x === "left" ? right : left, bottom]); 5265 if (y !== "bottom") { 5266 polygon.push([x === "left" ? left : right, bottom]); 5267 } 5268 } else if (y === "top") { 5269 polygon.push([left, top]); 5270 polygon.push([left, bottom]); 5271 polygon.push([right, bottom]); 5272 polygon.push([right, top]); 5273 } else { 5274 polygon.push([left, bottom]); 5275 polygon.push([left, top]); 5276 polygon.push([right, top]); 5277 polygon.push([right, bottom]); 5278 } 5279 return polygon; 5280 } 5281 5282 5283 5284 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MKDDWKFK.js 5285 "use client"; 5286 5287 // src/dialog/utils/is-backdrop.ts 5288 function MKDDWKFK_isBackdrop(element, ...ids) { 5289 if (!element) 5290 return false; 5291 const backdrop = element.getAttribute("data-backdrop"); 5292 if (backdrop == null) 5293 return false; 5294 if (backdrop === "") 5295 return true; 5296 if (backdrop === "true") 5297 return true; 5298 if (!ids.length) 5299 return true; 5300 return ids.some((id) => backdrop === id); 5301 } 5302 5303 5304 5305 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X6WIMZJE.js 5306 "use client"; 5307 5308 // src/dialog/utils/orchestrate.ts 5309 var cleanups = /* @__PURE__ */ new WeakMap(); 5310 function orchestrate(element, key, setup) { 5311 if (!cleanups.has(element)) { 5312 cleanups.set(element, /* @__PURE__ */ new Map()); 5313 } 5314 const elementCleanups = cleanups.get(element); 5315 const prevCleanup = elementCleanups.get(key); 5316 if (!prevCleanup) { 5317 elementCleanups.set(key, setup()); 5318 return () => { 5319 var _a; 5320 (_a = elementCleanups.get(key)) == null ? void 0 : _a(); 5321 elementCleanups.delete(key); 5322 }; 5323 } 5324 const cleanup = setup(); 5325 const nextCleanup = () => { 5326 cleanup(); 5327 prevCleanup(); 5328 elementCleanups.delete(key); 5329 }; 5330 elementCleanups.set(key, nextCleanup); 5331 return () => { 5332 const isCurrent = elementCleanups.get(key) === nextCleanup; 5333 if (!isCurrent) 5334 return; 5335 cleanup(); 5336 elementCleanups.set(key, prevCleanup); 5337 }; 5338 } 5339 function setAttribute(element, attr, value) { 5340 const setup = () => { 5341 const previousValue = element.getAttribute(attr); 5342 element.setAttribute(attr, value); 5343 return () => { 5344 if (previousValue == null) { 5345 element.removeAttribute(attr); 5346 } else { 5347 element.setAttribute(attr, previousValue); 5348 } 5349 }; 5350 }; 5351 return orchestrate(element, attr, setup); 5352 } 5353 function setProperty(element, property, value) { 5354 const setup = () => { 5355 const exists = property in element; 5356 const previousValue = element[property]; 5357 element[property] = value; 5358 return () => { 5359 if (!exists) { 5360 delete element[property]; 5361 } else { 5362 element[property] = previousValue; 5363 } 5364 }; 5365 }; 5366 return orchestrate(element, property, setup); 5367 } 5368 function assignStyle(element, style) { 5369 if (!element) 5370 return () => { 5371 }; 5372 const setup = () => { 5373 const prevStyle = element.style.cssText; 5374 Object.assign(element.style, style); 5375 return () => { 5376 element.style.cssText = prevStyle; 5377 }; 5378 }; 5379 return orchestrate(element, "style", setup); 5380 } 5381 function setCSSProperty(element, property, value) { 5382 if (!element) 5383 return () => { 5384 }; 5385 const setup = () => { 5386 const previousValue = element.style.getPropertyValue(property); 5387 element.style.setProperty(property, value); 5388 return () => { 5389 if (previousValue) { 5390 element.style.setProperty(property, previousValue); 5391 } else { 5392 element.style.removeProperty(property); 5393 } 5394 }; 5395 }; 5396 return orchestrate(element, property, setup); 5397 } 5398 5399 5400 5401 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/72E5EPFF.js 5402 "use client"; 5403 5404 5405 // src/dialog/utils/walk-tree-outside.ts 5406 5407 5408 var ignoreTags = ["SCRIPT", "STYLE"]; 5409 function getSnapshotPropertyName(id) { 5410 return `__ariakit-dialog-snapshot-$id}`; 5411 } 5412 function inSnapshot(id, element) { 5413 const doc = DLOEKDPY_getDocument(element); 5414 const propertyName = getSnapshotPropertyName(id); 5415 if (!doc.body[propertyName]) 5416 return true; 5417 do { 5418 if (element === doc.body) 5419 return false; 5420 if (!!element[propertyName]) 5421 return true; 5422 if (!element.parentElement) 5423 return false; 5424 element = element.parentElement; 5425 } while (true); 5426 } 5427 function isValidElement(id, element, ignoredElements) { 5428 if (ignoreTags.includes(element.tagName)) 5429 return false; 5430 if (!inSnapshot(id, element)) 5431 return false; 5432 return !ignoredElements.some( 5433 (enabledElement) => enabledElement && contains(element, enabledElement) 5434 ); 5435 } 5436 function _72E5EPFF_walkTreeOutside(id, elements, callback, ancestorCallback) { 5437 for (let element of elements) { 5438 if (!(element == null ? void 0 : element.isConnected)) 5439 continue; 5440 const hasAncestorAlready = elements.some((maybeAncestor) => { 5441 if (!maybeAncestor) 5442 return false; 5443 if (maybeAncestor === element) 5444 return false; 5445 return maybeAncestor.contains(element); 5446 }); 5447 const doc = DLOEKDPY_getDocument(element); 5448 const originalElement = element; 5449 while (element.parentElement && element !== doc.body) { 5450 ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement); 5451 if (!hasAncestorAlready) { 5452 for (const child of element.parentElement.children) { 5453 if (isValidElement(id, child, elements)) { 5454 callback(child, originalElement); 5455 } 5456 } 5457 } 5458 element = element.parentElement; 5459 } 5460 } 5461 } 5462 function createWalkTreeSnapshot(id, elements) { 5463 const { body } = DLOEKDPY_getDocument(elements[0]); 5464 const cleanups = []; 5465 const markElement = (element) => { 5466 cleanups.push(setProperty(element, getSnapshotPropertyName(id), true)); 5467 }; 5468 _72E5EPFF_walkTreeOutside(id, elements, markElement); 5469 return chain( 5470 setProperty(body, getSnapshotPropertyName(id), true), 5471 () => cleanups.forEach((fn) => fn()) 5472 ); 5473 } 5474 5475 5476 5477 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TL67WVI6.js 5478 "use client"; 5479 5480 5481 5482 5483 // src/dialog/utils/mark-tree-outside.ts 5484 5485 function getPropertyName(id = "", ancestor = false) { 5486 return `__ariakit-dialog-$ancestor ? "ancestor" : "outside"}$id ? `-$id}` : ""}`; 5487 } 5488 function markElement(element, id = "") { 5489 return chain( 5490 setProperty(element, getPropertyName(), true), 5491 setProperty(element, getPropertyName(id), true) 5492 ); 5493 } 5494 function markAncestor(element, id = "") { 5495 return chain( 5496 setProperty(element, getPropertyName("", true), true), 5497 setProperty(element, getPropertyName(id, true), true) 5498 ); 5499 } 5500 function isElementMarked(element, id) { 5501 const ancestorProperty = getPropertyName(id, true); 5502 if (element[ancestorProperty]) 5503 return true; 5504 const elementProperty = getPropertyName(id); 5505 do { 5506 if (element[elementProperty]) 5507 return true; 5508 if (!element.parentElement) 5509 return false; 5510 element = element.parentElement; 5511 } while (true); 5512 } 5513 function markTreeOutside(id, elements) { 5514 const cleanups = []; 5515 const ids = elements.map((el) => el == null ? void 0 : el.id); 5516 _72E5EPFF_walkTreeOutside( 5517 id, 5518 elements, 5519 (element) => { 5520 if (MKDDWKFK_isBackdrop(element, ...ids)) 5521 return; 5522 cleanups.unshift(markElement(element, id)); 5523 }, 5524 (ancestor, element) => { 5525 const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id; 5526 if (isAnotherDialogAncestor) 5527 return; 5528 cleanups.unshift(markAncestor(ancestor, id)); 5529 } 5530 ); 5531 const restoreAccessibilityTree = () => { 5532 cleanups.forEach((fn) => fn()); 5533 }; 5534 return restoreAccessibilityTree; 5535 } 5536 5537 5538 5539 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CLE7NTOY.js 5540 "use client"; 5541 5542 5543 5544 5545 5546 5547 5548 // src/disclosure/disclosure-content.tsx 5549 5550 5551 5552 function afterTimeout(timeoutMs, cb) { 5553 const timeoutId = setTimeout(cb, timeoutMs); 5554 return () => clearTimeout(timeoutId); 5555 } 5556 function CLE7NTOY_afterPaint(cb) { 5557 let raf = requestAnimationFrame(() => { 5558 raf = requestAnimationFrame(cb); 5559 }); 5560 return () => cancelAnimationFrame(raf); 5561 } 5562 function parseCSSTime(...times) { 5563 return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => { 5564 const currentTime = parseFloat(currentTimeString || "0s") * 1e3; 5565 if (currentTime > longestTime) 5566 return currentTime; 5567 return longestTime; 5568 }, 0); 5569 } 5570 function isHidden(mounted, hidden, alwaysVisible) { 5571 return !alwaysVisible && hidden !== false && (!mounted || !!hidden); 5572 } 5573 var useDisclosureContent = createHook( 5574 (_a) => { 5575 var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); 5576 const context = useDisclosureProviderContext(); 5577 store = store || context; 5578 invariant( 5579 store, 5580 false && 0 5581 ); 5582 const id = useId(props.id); 5583 const [transition, setTransition] = (0,external_React_.useState)(null); 5584 const open = store.useState("open"); 5585 const mounted = store.useState("mounted"); 5586 const animated = store.useState("animated"); 5587 const contentElement = store.useState("contentElement"); 5588 useSafeLayoutEffect(() => { 5589 if (!animated) 5590 return; 5591 if (!(contentElement == null ? void 0 : contentElement.isConnected)) { 5592 setTransition(null); 5593 return; 5594 } 5595 return CLE7NTOY_afterPaint(() => { 5596 setTransition(open ? "enter" : "leave"); 5597 }); 5598 }, [animated, contentElement, open]); 5599 useSafeLayoutEffect(() => { 5600 if (!store) 5601 return; 5602 if (!animated) 5603 return; 5604 if (!contentElement) 5605 return; 5606 if (!transition) 5607 return; 5608 if (transition === "enter" && !open) 5609 return; 5610 if (transition === "leave" && open) 5611 return; 5612 if (typeof animated === "number") { 5613 const timeoutMs2 = animated; 5614 return afterTimeout(timeoutMs2, store.stopAnimation); 5615 } 5616 const { 5617 transitionDuration, 5618 animationDuration, 5619 transitionDelay, 5620 animationDelay 5621 } = getComputedStyle(contentElement); 5622 const delay = parseCSSTime(transitionDelay, animationDelay); 5623 const duration = parseCSSTime(transitionDuration, animationDuration); 5624 const timeoutMs = delay + duration; 5625 if (!timeoutMs) 5626 return; 5627 return afterTimeout(timeoutMs, store.stopAnimation); 5628 }, [store, animated, contentElement, open, transition]); 5629 props = useWrapElement( 5630 props, 5631 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }), 5632 [store] 5633 ); 5634 const hidden = isHidden(mounted, props.hidden, alwaysVisible); 5635 const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; 5636 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 5637 id, 5638 "data-enter": transition === "enter" ? "" : void 0, 5639 "data-leave": transition === "leave" ? "" : void 0, 5640 hidden 5641 }, props), { 5642 ref: useMergeRefs(id ? store.setContentElement : null, props.ref), 5643 style 5644 }); 5645 return props; 5646 } 5647 ); 5648 var DisclosureContentImpl = createComponent( 5649 (props) => { 5650 const htmlProps = useDisclosureContent(props); 5651 return _3ORBWXWF_createElement("div", htmlProps); 5652 } 5653 ); 5654 var DisclosureContent = createComponent( 5655 (_a) => { 5656 var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, ["unmountOnHide"]); 5657 const context = useDisclosureProviderContext(); 5658 const store = props.store || context; 5659 const mounted = useStoreState( 5660 store, 5661 (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) 5662 ); 5663 if (mounted === false) 5664 return null; 5665 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _4R3V3JGP_spreadValues({}, props)); 5666 } 5667 ); 5668 if (false) {} 5669 5670 5671 5672 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LWHPHW7Q.js 5673 "use client"; 5674 5675 5676 5677 5678 5679 5680 5681 // src/dialog/dialog-backdrop.tsx 5682 5683 5684 function DialogBackdrop({ 5685 store, 5686 backdrop, 5687 backdropProps, 5688 alwaysVisible, 5689 hidden 5690 }) { 5691 const ref = (0,external_React_.useRef)(null); 5692 const disclosure = useDisclosureStore({ disclosure: store }); 5693 const contentElement = store.useState("contentElement"); 5694 useSafeLayoutEffect(() => { 5695 const backdrop2 = ref.current; 5696 const dialog = contentElement; 5697 if (!backdrop2) 5698 return; 5699 if (!dialog) 5700 return; 5701 backdrop2.style.zIndex = getComputedStyle(dialog).zIndex; 5702 }, [contentElement]); 5703 useSafeLayoutEffect(() => { 5704 const id = contentElement == null ? void 0 : contentElement.id; 5705 if (!id) 5706 return; 5707 const backdrop2 = ref.current; 5708 if (!backdrop2) 5709 return; 5710 return markAncestor(backdrop2, id); 5711 }, [contentElement]); 5712 if (hidden != null) { 5713 backdropProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, backdropProps), { hidden }); 5714 } 5715 const props = useDisclosureContent(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 5716 store: disclosure, 5717 role: "presentation", 5718 "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "", 5719 alwaysVisible 5720 }, backdropProps), { 5721 ref: useMergeRefs(backdropProps == null ? void 0 : backdropProps.ref, ref), 5722 style: _4R3V3JGP_spreadValues({ 5723 position: "fixed", 5724 top: 0, 5725 right: 0, 5726 bottom: 0, 5727 left: 0 5728 }, backdropProps == null ? void 0 : backdropProps.style) 5729 })); 5730 if (!backdrop) 5731 return null; 5732 if ((0,external_React_.isValidElement)(backdrop)) { 5733 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: backdrop })); 5734 } 5735 const Component = typeof backdrop !== "boolean" ? backdrop : "div"; 5736 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {}) })); 5737 } 5738 5739 5740 5741 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BULCTPRV.js 5742 "use client"; 5743 5744 5745 5746 5747 // src/dialog/utils/disable-accessibility-tree-outside.ts 5748 function hideElementFromAccessibilityTree(element) { 5749 return setAttribute(element, "aria-hidden", "true"); 5750 } 5751 function disableAccessibilityTreeOutside(id, elements) { 5752 const cleanups = []; 5753 const ids = elements.map((el) => el == null ? void 0 : el.id); 5754 walkTreeOutside(id, elements, (element) => { 5755 if (isBackdrop(element, ...ids)) 5756 return; 5757 cleanups.unshift(hideElementFromAccessibilityTree(element)); 5758 }); 5759 const restoreAccessibilityTree = () => { 5760 cleanups.forEach((fn) => fn()); 5761 }; 5762 return restoreAccessibilityTree; 5763 } 5764 5765 5766 5767 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js 5768 "use client"; 5769 5770 // src/dialog/utils/supports-inert.ts 5771 function supportsInert() { 5772 return "inert" in HTMLElement.prototype; 5773 } 5774 5775 5776 5777 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TQYOGOE2.js 5778 "use client"; 5779 5780 5781 5782 5783 5784 5785 // src/dialog/utils/disable-tree.ts 5786 5787 5788 5789 function disableTree(element, ignoredElements) { 5790 if (!("style" in element)) 5791 return noop; 5792 if (supportsInert()) { 5793 return setProperty(element, "inert", true); 5794 } 5795 const tabbableElements = getAllTabbableIn(element, true); 5796 const enableElements = tabbableElements.map((element2) => { 5797 if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) 5798 return noop; 5799 return setAttribute(element2, "tabindex", "-1"); 5800 }); 5801 return chain( 5802 ...enableElements, 5803 hideElementFromAccessibilityTree(element), 5804 assignStyle(element, { 5805 pointerEvents: "none", 5806 userSelect: "none", 5807 cursor: "default" 5808 }) 5809 ); 5810 } 5811 function disableTreeOutside(id, elements) { 5812 const cleanups = []; 5813 const ids = elements.map((el) => el == null ? void 0 : el.id); 5814 _72E5EPFF_walkTreeOutside(id, elements, (element) => { 5815 if (MKDDWKFK_isBackdrop(element, ...ids)) 5816 return; 5817 cleanups.unshift(disableTree(element, elements)); 5818 }); 5819 const restoreTreeOutside = () => { 5820 cleanups.forEach((fn) => fn()); 5821 }; 5822 return restoreTreeOutside; 5823 } 5824 5825 5826 5827 ;// CONCATENATED MODULE: external "ReactDOM" 5828 const external_ReactDOM_namespaceObject = window["ReactDOM"]; 5829 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CS347UVZ.js 5830 "use client"; 5831 5832 5833 // src/dialog/utils/use-root-dialog.ts 5834 5835 5836 5837 function useRootDialog({ 5838 attribute, 5839 contentId, 5840 contentElement, 5841 enabled 5842 }) { 5843 const [updated, retry] = useForceUpdate(); 5844 const isRootDialog = (0,external_React_.useCallback)(() => { 5845 if (!enabled) 5846 return false; 5847 if (!contentElement) 5848 return false; 5849 const { body } = DLOEKDPY_getDocument(contentElement); 5850 const id = body.getAttribute(attribute); 5851 return !id || id === contentId; 5852 }, [updated, enabled, contentElement, attribute, contentId]); 5853 (0,external_React_.useEffect)(() => { 5854 if (!enabled) 5855 return; 5856 if (!contentId) 5857 return; 5858 if (!contentElement) 5859 return; 5860 const { body } = DLOEKDPY_getDocument(contentElement); 5861 if (isRootDialog()) { 5862 body.setAttribute(attribute, contentId); 5863 return () => body.removeAttribute(attribute); 5864 } 5865 const observer = new MutationObserver(() => (0,external_ReactDOM_namespaceObject.flushSync)(retry)); 5866 observer.observe(body, { attributeFilter: [attribute] }); 5867 return () => observer.disconnect(); 5868 }, [updated, enabled, contentId, contentElement, isRootDialog, attribute]); 5869 return isRootDialog; 5870 } 5871 5872 5873 5874 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6BJGLK2C.js 5875 "use client"; 5876 5877 5878 5879 // src/dialog/utils/use-prevent-body-scroll.ts 5880 5881 5882 5883 5884 function getPaddingProperty(documentElement) { 5885 const documentLeft = documentElement.getBoundingClientRect().left; 5886 const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft; 5887 return scrollbarX ? "paddingLeft" : "paddingRight"; 5888 } 5889 function usePreventBodyScroll(contentElement, contentId, enabled) { 5890 const isRootDialog = useRootDialog({ 5891 attribute: "data-dialog-prevent-body-scroll", 5892 contentElement, 5893 contentId, 5894 enabled 5895 }); 5896 (0,external_React_.useEffect)(() => { 5897 if (!isRootDialog()) 5898 return; 5899 if (!contentElement) 5900 return; 5901 const doc = DLOEKDPY_getDocument(contentElement); 5902 const win = getWindow(contentElement); 5903 const { documentElement, body } = doc; 5904 const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width"); 5905 const scrollbarWidth = cssScrollbarWidth ? parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth; 5906 const setScrollbarWidthProperty = () => setCSSProperty( 5907 documentElement, 5908 "--scrollbar-width", 5909 `$scrollbarWidth}px` 5910 ); 5911 const paddingProperty = getPaddingProperty(documentElement); 5912 const setStyle = () => assignStyle(body, { 5913 overflow: "hidden", 5914 [paddingProperty]: `$scrollbarWidth}px` 5915 }); 5916 const setIOSStyle = () => { 5917 var _a, _b; 5918 const { scrollX, scrollY, visualViewport } = win; 5919 const offsetLeft = (_a = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a : 0; 5920 const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0; 5921 const restoreStyle = assignStyle(body, { 5922 position: "fixed", 5923 overflow: "hidden", 5924 top: `${-(scrollY - Math.floor(offsetTop))}px`, 5925 left: `${-(scrollX - Math.floor(offsetLeft))}px`, 5926 right: "0", 5927 [paddingProperty]: `$scrollbarWidth}px` 5928 }); 5929 return () => { 5930 restoreStyle(); 5931 if (true) { 5932 win.scrollTo(scrollX, scrollY); 5933 } 5934 }; 5935 }; 5936 const isIOS = isApple() && !isMac(); 5937 return chain( 5938 setScrollbarWidthProperty(), 5939 isIOS ? setIOSStyle() : setStyle() 5940 ); 5941 }, [isRootDialog, contentElement]); 5942 } 5943 5944 5945 5946 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IUB2BTEK.js 5947 "use client"; 5948 5949 5950 // src/dialog/utils/use-nested-dialogs.tsx 5951 5952 5953 5954 5955 var NestedDialogsContext = (0,external_React_.createContext)({}); 5956 function useNestedDialogs(store) { 5957 const context = (0,external_React_.useContext)(NestedDialogsContext); 5958 const [dialogs, setDialogs] = (0,external_React_.useState)([]); 5959 const add = (0,external_React_.useCallback)( 5960 (dialog) => { 5961 var _a; 5962 setDialogs((dialogs2) => [...dialogs2, dialog]); 5963 return chain((_a = context.add) == null ? void 0 : _a.call(context, dialog), () => { 5964 setDialogs((dialogs2) => dialogs2.filter((d) => d !== dialog)); 5965 }); 5966 }, 5967 [context] 5968 ); 5969 useSafeLayoutEffect(() => { 5970 return sync(store, ["open", "contentElement"], (state) => { 5971 var _a; 5972 if (!state.open) 5973 return; 5974 if (!state.contentElement) 5975 return; 5976 return (_a = context.add) == null ? void 0 : _a.call(context, store); 5977 }); 5978 }, [store, context]); 5979 const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]); 5980 const wrapElement = (0,external_React_.useCallback)( 5981 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }), 5982 [providerValue] 5983 ); 5984 return { wrapElement, nestedDialogs: dialogs }; 5985 } 5986 5987 5988 5989 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OOBDFMJL.js 5990 "use client"; 5991 5992 // src/dialog/utils/use-previous-mouse-down-ref.ts 5993 5994 5995 function usePreviousMouseDownRef(enabled) { 5996 const previousMouseDownRef = (0,external_React_.useRef)(); 5997 (0,external_React_.useEffect)(() => { 5998 if (!enabled) { 5999 previousMouseDownRef.current = null; 6000 return; 6001 } 6002 const onMouseDown = (event) => { 6003 previousMouseDownRef.current = event.target; 6004 }; 6005 return addGlobalEventListener("mousedown", onMouseDown, true); 6006 }, [enabled]); 6007 return previousMouseDownRef; 6008 } 6009 6010 6011 6012 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XHJGS6Z5.js 6013 "use client"; 6014 6015 6016 6017 6018 6019 // src/dialog/utils/use-hide-on-interact-outside.ts 6020 6021 6022 6023 function isInDocument(target) { 6024 if (target.tagName === "HTML") 6025 return true; 6026 return contains(DLOEKDPY_getDocument(target).body, target); 6027 } 6028 function isDisclosure(disclosure, target) { 6029 if (!disclosure) 6030 return false; 6031 if (contains(disclosure, target)) 6032 return true; 6033 const activeId = target.getAttribute("aria-activedescendant"); 6034 if (activeId) { 6035 const activeElement = DLOEKDPY_getDocument(disclosure).getElementById(activeId); 6036 if (activeElement) { 6037 return contains(disclosure, activeElement); 6038 } 6039 } 6040 return false; 6041 } 6042 function isMouseEventOnDialog(event, dialog) { 6043 if (!("clientY" in event)) 6044 return false; 6045 const rect = dialog.getBoundingClientRect(); 6046 if (rect.width === 0 || rect.height === 0) 6047 return false; 6048 return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width; 6049 } 6050 function useEventOutside({ 6051 store, 6052 type, 6053 listener, 6054 capture, 6055 domReady 6056 }) { 6057 const callListener = useEvent(listener); 6058 const open = store.useState("open"); 6059 const focusedRef = (0,external_React_.useRef)(false); 6060 useSafeLayoutEffect(() => { 6061 if (!open) 6062 return; 6063 if (!domReady) 6064 return; 6065 const { contentElement } = store.getState(); 6066 if (!contentElement) 6067 return; 6068 const onFocus = () => { 6069 focusedRef.current = true; 6070 }; 6071 contentElement.addEventListener("focusin", onFocus, true); 6072 return () => contentElement.removeEventListener("focusin", onFocus, true); 6073 }, [store, open, domReady]); 6074 (0,external_React_.useEffect)(() => { 6075 if (!open) 6076 return; 6077 const onEvent = (event) => { 6078 const { contentElement, disclosureElement } = store.getState(); 6079 const target = event.target; 6080 if (!contentElement) 6081 return; 6082 if (!target) 6083 return; 6084 if (!isInDocument(target)) 6085 return; 6086 if (contains(contentElement, target)) 6087 return; 6088 if (isDisclosure(disclosureElement, target)) 6089 return; 6090 if (target.hasAttribute("data-focus-trap")) 6091 return; 6092 if (isMouseEventOnDialog(event, contentElement)) 6093 return; 6094 const focused = focusedRef.current; 6095 if (focused && !isElementMarked(target, contentElement.id)) 6096 return; 6097 callListener(event); 6098 }; 6099 return addGlobalEventListener(type, onEvent, capture); 6100 }, [open, capture]); 6101 } 6102 function shouldHideOnInteractOutside(hideOnInteractOutside, event) { 6103 if (typeof hideOnInteractOutside === "function") { 6104 return hideOnInteractOutside(event); 6105 } 6106 return !!hideOnInteractOutside; 6107 } 6108 function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) { 6109 const open = store.useState("open"); 6110 const previousMouseDownRef = usePreviousMouseDownRef(open); 6111 const props = { store, domReady, capture: true }; 6112 useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 6113 type: "click", 6114 listener: (event) => { 6115 const { contentElement } = store.getState(); 6116 const previousMouseDown = previousMouseDownRef.current; 6117 if (!previousMouseDown) 6118 return; 6119 if (!isVisible(previousMouseDown)) 6120 return; 6121 if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) 6122 return; 6123 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) 6124 return; 6125 store.hide(); 6126 } 6127 })); 6128 useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 6129 type: "focusin", 6130 listener: (event) => { 6131 const { contentElement } = store.getState(); 6132 if (!contentElement) 6133 return; 6134 if (event.target === DLOEKDPY_getDocument(contentElement)) 6135 return; 6136 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) 6137 return; 6138 store.hide(); 6139 } 6140 })); 6141 useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 6142 type: "contextmenu", 6143 listener: (event) => { 6144 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) 6145 return; 6146 store.hide(); 6147 } 6148 })); 6149 } 6150 6151 6152 6153 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js 6154 "use client"; 6155 6156 // src/dialog/utils/prepend-hidden-dismiss.ts 6157 6158 function prependHiddenDismiss(container, onClick) { 6159 const document = DLOEKDPY_getDocument(container); 6160 const button = document.createElement("button"); 6161 button.type = "button"; 6162 button.tabIndex = -1; 6163 button.textContent = "Dismiss popup"; 6164 Object.assign(button.style, { 6165 border: "0px", 6166 clip: "rect(0 0 0 0)", 6167 height: "1px", 6168 margin: "-1px", 6169 overflow: "hidden", 6170 padding: "0px", 6171 position: "absolute", 6172 whiteSpace: "nowrap", 6173 width: "1px" 6174 }); 6175 button.addEventListener("click", onClick); 6176 container.prepend(button); 6177 const removeHiddenDismiss = () => { 6178 button.removeEventListener("click", onClick); 6179 button.remove(); 6180 }; 6181 return removeHiddenDismiss; 6182 } 6183 6184 6185 6186 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HPP6CWMY.js 6187 "use client"; 6188 6189 6190 6191 6192 6193 // src/focusable/focusable-container.tsx 6194 6195 var useFocusableContainer = createHook( 6196 (_a) => { 6197 var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]); 6198 props = useWrapElement( 6199 props, 6200 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }), 6201 [autoFocusOnShow] 6202 ); 6203 return props; 6204 } 6205 ); 6206 var FocusableContainer = createComponent( 6207 (props) => { 6208 const htmlProps = useFocusableContainer(props); 6209 return _3ORBWXWF_createElement("div", htmlProps); 6210 } 6211 ); 6212 if (false) {} 6213 6214 6215 6216 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XPF5GU3Q.js 6217 "use client"; 6218 6219 // src/heading/heading-context.ts 6220 6221 var HeadingContext = (0,external_React_.createContext)(0); 6222 6223 6224 6225 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UYRJLDVS.js 6226 "use client"; 6227 6228 6229 // src/heading/heading-level.tsx 6230 6231 6232 function HeadingLevel({ level, children }) { 6233 const contextLevel = (0,external_React_.useContext)(HeadingContext); 6234 const nextLevel = Math.max( 6235 Math.min(level || contextLevel + 1, 6), 6236 1 6237 ); 6238 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingContext.Provider, { value: nextLevel, children }); 6239 } 6240 6241 6242 6243 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BG6HZDS7.js 6244 "use client"; 6245 6246 6247 6248 // src/visually-hidden/visually-hidden.ts 6249 var useVisuallyHidden = createHook((props) => { 6250 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 6251 style: _4R3V3JGP_spreadValues({ 6252 border: 0, 6253 clip: "rect(0 0 0 0)", 6254 height: "1px", 6255 margin: "-1px", 6256 overflow: "hidden", 6257 padding: 0, 6258 position: "absolute", 6259 whiteSpace: "nowrap", 6260 width: "1px" 6261 }, props.style) 6262 }); 6263 return props; 6264 }); 6265 var VisuallyHidden = createComponent( 6266 (props) => { 6267 const htmlProps = useVisuallyHidden(props); 6268 return _3ORBWXWF_createElement("span", htmlProps); 6269 } 6270 ); 6271 if (false) {} 6272 6273 6274 6275 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CHKJ74UC.js 6276 "use client"; 6277 6278 6279 6280 6281 // src/focus-trap/focus-trap.ts 6282 var useFocusTrap = createHook((props) => { 6283 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 6284 "data-focus-trap": "", 6285 tabIndex: 0, 6286 "aria-hidden": true 6287 }, props), { 6288 style: _4R3V3JGP_spreadValues({ 6289 // Prevents unintended scroll jumps. 6290 position: "fixed", 6291 top: 0, 6292 left: 0 6293 }, props.style) 6294 }); 6295 props = useVisuallyHidden(props); 6296 return props; 6297 }); 6298 var FocusTrap = createComponent((props) => { 6299 const htmlProps = useFocusTrap(props); 6300 return _3ORBWXWF_createElement("span", htmlProps); 6301 }); 6302 if (false) {} 6303 6304 6305 6306 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7452U3HH.js 6307 "use client"; 6308 6309 // src/portal/portal-context.ts 6310 6311 var PortalContext = (0,external_React_.createContext)(null); 6312 6313 6314 6315 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JPXNJYSO.js 6316 "use client"; 6317 6318 6319 6320 6321 6322 6323 6324 // src/portal/portal.tsx 6325 6326 6327 6328 6329 6330 6331 function getRootElement(element) { 6332 return DLOEKDPY_getDocument(element).body; 6333 } 6334 function getPortalElement(element, portalElement) { 6335 if (!portalElement) { 6336 return DLOEKDPY_getDocument(element).createElement("div"); 6337 } 6338 if (typeof portalElement === "function") { 6339 return portalElement(element); 6340 } 6341 return portalElement; 6342 } 6343 function getRandomId(prefix = "id") { 6344 return `$prefix ? `$prefix}-` : ""}$Math.random().toString(36).substr(2, 6)}`; 6345 } 6346 function queueFocus(element) { 6347 queueMicrotask(() => { 6348 element == null ? void 0 : element.focus(); 6349 }); 6350 } 6351 var usePortal = createHook( 6352 (_a) => { 6353 var _b = _a, { 6354 preserveTabOrder, 6355 preserveTabOrderAnchor, 6356 portalElement, 6357 portalRef, 6358 portal = true 6359 } = _b, props = __objRest(_b, [ 6360 "preserveTabOrder", 6361 "preserveTabOrderAnchor", 6362 "portalElement", 6363 "portalRef", 6364 "portal" 6365 ]); 6366 const ref = (0,external_React_.useRef)(null); 6367 const refProp = useMergeRefs(ref, props.ref); 6368 const context = (0,external_React_.useContext)(PortalContext); 6369 const [portalNode, setPortalNode] = (0,external_React_.useState)(null); 6370 const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(null); 6371 const outerBeforeRef = (0,external_React_.useRef)(null); 6372 const innerBeforeRef = (0,external_React_.useRef)(null); 6373 const innerAfterRef = (0,external_React_.useRef)(null); 6374 const outerAfterRef = (0,external_React_.useRef)(null); 6375 useSafeLayoutEffect(() => { 6376 const element = ref.current; 6377 if (!element || !portal) { 6378 setPortalNode(null); 6379 return; 6380 } 6381 const portalEl = getPortalElement(element, portalElement); 6382 if (!portalEl) { 6383 setPortalNode(null); 6384 return; 6385 } 6386 const isPortalInDocument = portalEl.isConnected; 6387 if (!isPortalInDocument) { 6388 const rootElement = context || getRootElement(element); 6389 rootElement.appendChild(portalEl); 6390 } 6391 if (!portalEl.id) { 6392 portalEl.id = element.id ? `portal/$element.id}` : getRandomId(); 6393 } 6394 setPortalNode(portalEl); 6395 setRef(portalRef, portalEl); 6396 if (isPortalInDocument) 6397 return; 6398 return () => { 6399 portalEl.remove(); 6400 setRef(portalRef, null); 6401 }; 6402 }, [portal, portalElement, context, portalRef]); 6403 useSafeLayoutEffect(() => { 6404 if (!preserveTabOrder) 6405 return; 6406 if (!preserveTabOrderAnchor) 6407 return; 6408 const doc = DLOEKDPY_getDocument(preserveTabOrderAnchor); 6409 const element = doc.createElement("span"); 6410 element.style.position = "fixed"; 6411 preserveTabOrderAnchor.insertAdjacentElement("afterend", element); 6412 setAnchorPortalNode(element); 6413 return () => { 6414 element.remove(); 6415 setAnchorPortalNode(null); 6416 }; 6417 }, [preserveTabOrder, preserveTabOrderAnchor]); 6418 (0,external_React_.useEffect)(() => { 6419 if (!portalNode) 6420 return; 6421 if (!preserveTabOrder) 6422 return; 6423 let raf = 0; 6424 const onFocus = (event) => { 6425 if (!isFocusEventOutside(event)) 6426 return; 6427 const focusing = event.type === "focusin"; 6428 cancelAnimationFrame(raf); 6429 if (focusing) { 6430 return restoreFocusIn(portalNode); 6431 } 6432 raf = requestAnimationFrame(() => { 6433 disableFocusIn(portalNode, true); 6434 }); 6435 }; 6436 portalNode.addEventListener("focusin", onFocus, true); 6437 portalNode.addEventListener("focusout", onFocus, true); 6438 return () => { 6439 cancelAnimationFrame(raf); 6440 portalNode.removeEventListener("focusin", onFocus, true); 6441 portalNode.removeEventListener("focusout", onFocus, true); 6442 }; 6443 }, [portalNode, preserveTabOrder]); 6444 props = useWrapElement( 6445 props, 6446 (element) => { 6447 element = // While the portal node is not in the DOM, we need to pass the 6448 // current context to the portal context, otherwise it's going to 6449 // reset to the body element on nested portals. 6450 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PortalContext.Provider, { value: portalNode || context, children: element }); 6451 if (!portal) 6452 return element; 6453 if (!portalNode) { 6454 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6455 "span", 6456 { 6457 ref: refProp, 6458 id: props.id, 6459 style: { position: "fixed" }, 6460 hidden: true 6461 } 6462 ); 6463 } 6464 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 6465 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6466 FocusTrap, 6467 { 6468 ref: innerBeforeRef, 6469 className: "__focus-trap-inner-before", 6470 onFocus: (event) => { 6471 if (isFocusEventOutside(event, portalNode)) { 6472 queueFocus(getNextTabbable()); 6473 } else { 6474 queueFocus(outerBeforeRef.current); 6475 } 6476 } 6477 } 6478 ), 6479 element, 6480 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6481 FocusTrap, 6482 { 6483 ref: innerAfterRef, 6484 className: "__focus-trap-inner-after", 6485 onFocus: (event) => { 6486 if (isFocusEventOutside(event, portalNode)) { 6487 queueFocus(getPreviousTabbable()); 6488 } else { 6489 queueFocus(outerAfterRef.current); 6490 } 6491 } 6492 } 6493 ) 6494 ] }); 6495 if (portalNode) { 6496 element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode); 6497 } 6498 let preserveTabOrderElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 6499 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6500 FocusTrap, 6501 { 6502 ref: outerBeforeRef, 6503 className: "__focus-trap-outer-before", 6504 onFocus: (event) => { 6505 const fromOuter = event.relatedTarget === outerAfterRef.current; 6506 if (!fromOuter && isFocusEventOutside(event, portalNode)) { 6507 queueFocus(innerBeforeRef.current); 6508 } else { 6509 queueFocus(getPreviousTabbable()); 6510 } 6511 } 6512 } 6513 ), 6514 preserveTabOrder && // We're using position: fixed here so that the browser doesn't 6515 // add margin to the element when setting gap on a parent element. 6516 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }), 6517 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6518 FocusTrap, 6519 { 6520 ref: outerAfterRef, 6521 className: "__focus-trap-outer-after", 6522 onFocus: (event) => { 6523 if (isFocusEventOutside(event, portalNode)) { 6524 queueFocus(innerAfterRef.current); 6525 } else { 6526 const nextTabbable = getNextTabbable(); 6527 if (nextTabbable === innerBeforeRef.current) { 6528 requestAnimationFrame(() => { 6529 var _a2; 6530 return (_a2 = getNextTabbable()) == null ? void 0 : _a2.focus(); 6531 }); 6532 return; 6533 } 6534 queueFocus(nextTabbable); 6535 } 6536 } 6537 } 6538 ) 6539 ] }); 6540 if (anchorPortalNode && preserveTabOrder) { 6541 preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)( 6542 preserveTabOrderElement, 6543 anchorPortalNode 6544 ); 6545 } 6546 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 6547 preserveTabOrderElement, 6548 element 6549 ] }); 6550 }, 6551 [ 6552 portalNode, 6553 context, 6554 portal, 6555 props.id, 6556 preserveTabOrder, 6557 anchorPortalNode 6558 ] 6559 ); 6560 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 6561 ref: refProp 6562 }); 6563 return props; 6564 } 6565 ); 6566 var Portal = createComponent((props) => { 6567 const htmlProps = usePortal(props); 6568 return _3ORBWXWF_createElement("div", htmlProps); 6569 }); 6570 if (false) {} 6571 6572 6573 6574 ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NERBASET.js 6575 "use client"; 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 // src/dialog/dialog.tsx 6597 6598 6599 6600 6601 6602 6603 6604 var NERBASET_isSafariBrowser = isSafari(); 6605 function isAlreadyFocusingAnotherElement(dialog) { 6606 const activeElement = getActiveElement(); 6607 if (!activeElement) 6608 return false; 6609 if (dialog && contains(dialog, activeElement)) 6610 return false; 6611 if (isFocusable(activeElement)) 6612 return true; 6613 return false; 6614 } 6615 function getElementFromProp(prop, focusable = false) { 6616 if (!prop) 6617 return null; 6618 const element = "current" in prop ? prop.current : prop; 6619 if (!element) 6620 return null; 6621 if (focusable) 6622 return isFocusable(element) ? element : null; 6623 return element; 6624 } 6625 var useDialog = createHook( 6626 (_a) => { 6627 var _b = _a, { 6628 store: storeProp, 6629 open: openProp, 6630 onClose, 6631 focusable = true, 6632 modal = true, 6633 portal = !!modal, 6634 backdrop = !!modal, 6635 backdropProps, 6636 hideOnEscape = true, 6637 hideOnInteractOutside = true, 6638 getPersistentElements, 6639 preventBodyScroll = !!modal, 6640 autoFocusOnShow = true, 6641 autoFocusOnHide = true, 6642 initialFocus, 6643 finalFocus, 6644 unmountOnHide 6645 } = _b, props = __objRest(_b, [ 6646 "store", 6647 "open", 6648 "onClose", 6649 "focusable", 6650 "modal", 6651 "portal", 6652 "backdrop", 6653 "backdropProps", 6654 "hideOnEscape", 6655 "hideOnInteractOutside", 6656 "getPersistentElements", 6657 "preventBodyScroll", 6658 "autoFocusOnShow", 6659 "autoFocusOnHide", 6660 "initialFocus", 6661 "finalFocus", 6662 "unmountOnHide" 6663 ]); 6664 const context = useDialogProviderContext(); 6665 const ref = (0,external_React_.useRef)(null); 6666 const store = useDialogStore({ 6667 store: storeProp || context, 6668 open: openProp, 6669 setOpen(open2) { 6670 if (open2) 6671 return; 6672 const dialog = ref.current; 6673 if (!dialog) 6674 return; 6675 const event = new Event("close", { bubbles: false, cancelable: true }); 6676 if (onClose) { 6677 dialog.addEventListener("close", onClose, { once: true }); 6678 } 6679 dialog.dispatchEvent(event); 6680 if (!event.defaultPrevented) 6681 return; 6682 store.setOpen(true); 6683 } 6684 }); 6685 const { portalRef, domReady } = usePortalRef(portal, props.portalRef); 6686 const preserveTabOrderProp = props.preserveTabOrder; 6687 const preserveTabOrder = store.useState( 6688 (state) => preserveTabOrderProp && !modal && state.mounted 6689 ); 6690 const id = useId(props.id); 6691 const open = store.useState("open"); 6692 const mounted = store.useState("mounted"); 6693 const contentElement = store.useState("contentElement"); 6694 const hidden = isHidden(mounted, props.hidden, props.alwaysVisible); 6695 usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden); 6696 useHideOnInteractOutside(store, hideOnInteractOutside, domReady); 6697 const { wrapElement, nestedDialogs } = useNestedDialogs(store); 6698 props = useWrapElement(props, wrapElement, [wrapElement]); 6699 if (false) {} 6700 useSafeLayoutEffect(() => { 6701 if (!open) 6702 return; 6703 const dialog = ref.current; 6704 const activeElement = getActiveElement(dialog, true); 6705 if (!activeElement) 6706 return; 6707 if (activeElement.tagName === "BODY") 6708 return; 6709 if (dialog && contains(dialog, activeElement)) 6710 return; 6711 store.setDisclosureElement(activeElement); 6712 }, [store, open]); 6713 if (NERBASET_isSafariBrowser) { 6714 (0,external_React_.useEffect)(() => { 6715 if (!mounted) 6716 return; 6717 const { disclosureElement } = store.getState(); 6718 if (!disclosureElement) 6719 return; 6720 if (!isButton(disclosureElement)) 6721 return; 6722 const onMouseDown = () => { 6723 let receivedFocus = false; 6724 const onFocus = () => { 6725 receivedFocus = true; 6726 }; 6727 const options = { capture: true, once: true }; 6728 disclosureElement.addEventListener("focusin", onFocus, options); 6729 queueBeforeEvent(disclosureElement, "mouseup", () => { 6730 disclosureElement.removeEventListener("focusin", onFocus, true); 6731 if (receivedFocus) 6732 return; 6733 focusIfNeeded(disclosureElement); 6734 }); 6735 }; 6736 disclosureElement.addEventListener("mousedown", onMouseDown); 6737 return () => { 6738 disclosureElement.removeEventListener("mousedown", onMouseDown); 6739 }; 6740 }, [store, mounted]); 6741 } 6742 (0,external_React_.useEffect)(() => { 6743 if (!modal) 6744 return; 6745 if (!mounted) 6746 return; 6747 if (!domReady) 6748 return; 6749 const dialog = ref.current; 6750 if (!dialog) 6751 return; 6752 const existingDismiss = dialog.querySelector("[data-dialog-dismiss]"); 6753 if (existingDismiss) 6754 return; 6755 return prependHiddenDismiss(dialog, store.hide); 6756 }, [store, modal, mounted, domReady]); 6757 useSafeLayoutEffect(() => { 6758 if (open) 6759 return; 6760 if (!mounted) 6761 return; 6762 if (!domReady) 6763 return; 6764 const dialog = ref.current; 6765 if (!dialog) 6766 return; 6767 return disableTree(dialog); 6768 }, [open, mounted, domReady]); 6769 const canTakeTreeSnapshot = open && domReady; 6770 useSafeLayoutEffect(() => { 6771 if (!id) 6772 return; 6773 if (!canTakeTreeSnapshot) 6774 return; 6775 const dialog = ref.current; 6776 return createWalkTreeSnapshot(id, [dialog]); 6777 }, [id, canTakeTreeSnapshot]); 6778 const getPersistentElementsProp = useEvent(getPersistentElements); 6779 useSafeLayoutEffect(() => { 6780 if (!id) 6781 return; 6782 if (!canTakeTreeSnapshot) 6783 return; 6784 const { disclosureElement } = store.getState(); 6785 const dialog = ref.current; 6786 const persistentElements = getPersistentElementsProp() || []; 6787 const allElements = [ 6788 dialog, 6789 ...persistentElements, 6790 ...nestedDialogs.map((dialog2) => dialog2.getState().contentElement) 6791 ]; 6792 if (modal) { 6793 return chain( 6794 markTreeOutside(id, allElements), 6795 disableTreeOutside(id, allElements) 6796 ); 6797 } 6798 return markTreeOutside(id, [disclosureElement, ...allElements]); 6799 }, [ 6800 id, 6801 store, 6802 canTakeTreeSnapshot, 6803 getPersistentElementsProp, 6804 nestedDialogs, 6805 modal 6806 ]); 6807 const mayAutoFocusOnShow = !!autoFocusOnShow; 6808 const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow); 6809 const [autoFocusEnabled, setAutoFocusEnabled] = (0,external_React_.useState)(false); 6810 (0,external_React_.useEffect)(() => { 6811 if (!open) 6812 return; 6813 if (!mayAutoFocusOnShow) 6814 return; 6815 if (!domReady) 6816 return; 6817 if (!(contentElement == null ? void 0 : contentElement.isConnected)) 6818 return; 6819 const element = getElementFromProp(initialFocus, true) || // If no initial focus is specified, we try to focus the first element 6820 // with the autofocus attribute. If it's an Ariakit component, the 6821 // Focusable component will consume the autoFocus prop and add the 6822 // data-autofocus attribute to the element instead. 6823 contentElement.querySelector( 6824 "[data-autofocus=true],[autofocus]" 6825 ) || // We have to fallback to the first focusable element otherwise portaled 6826 // dialogs with preserveTabOrder set to true will not receive focus 6827 // properly because the elements aren't tabbable until the dialog 6828 // receives focus. 6829 getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself. 6830 contentElement; 6831 const isElementFocusable = isFocusable(element); 6832 if (!autoFocusOnShowProp(isElementFocusable ? element : null)) 6833 return; 6834 setAutoFocusEnabled(true); 6835 queueMicrotask(() => { 6836 element.focus(); 6837 if (!NERBASET_isSafariBrowser) 6838 return; 6839 element.scrollIntoView({ block: "nearest", inline: "nearest" }); 6840 }); 6841 }, [ 6842 open, 6843 mayAutoFocusOnShow, 6844 domReady, 6845 contentElement, 6846 initialFocus, 6847 portal, 6848 preserveTabOrder, 6849 autoFocusOnShowProp 6850 ]); 6851 const mayAutoFocusOnHide = !!autoFocusOnHide; 6852 const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide); 6853 const [hasOpened, setHasOpened] = (0,external_React_.useState)(false); 6854 (0,external_React_.useEffect)(() => { 6855 if (!open) 6856 return; 6857 setHasOpened(true); 6858 return () => setHasOpened(false); 6859 }, [open]); 6860 const focusOnHide = (0,external_React_.useCallback)( 6861 (dialog, retry = true) => { 6862 const { disclosureElement } = store.getState(); 6863 if (isAlreadyFocusingAnotherElement(dialog)) 6864 return; 6865 let element = getElementFromProp(finalFocus) || disclosureElement; 6866 if (element == null ? void 0 : element.id) { 6867 const doc = DLOEKDPY_getDocument(element); 6868 const selector = `[aria-activedescendant="$element.id}"]`; 6869 const composite = doc.querySelector(selector); 6870 if (composite) { 6871 element = composite; 6872 } 6873 } 6874 if (element && !isFocusable(element)) { 6875 const maybeParentDialog = DLOEKDPY_closest(element, "[data-dialog]"); 6876 if (maybeParentDialog && maybeParentDialog.id) { 6877 const doc = DLOEKDPY_getDocument(maybeParentDialog); 6878 const selector = `[aria-controls~="$maybeParentDialog.id}"]`; 6879 const control = doc.querySelector(selector); 6880 if (control) { 6881 element = control; 6882 } 6883 } 6884 } 6885 const isElementFocusable = element && isFocusable(element); 6886 if (!isElementFocusable && retry) { 6887 requestAnimationFrame(() => focusOnHide(dialog, false)); 6888 return; 6889 } 6890 if (!autoFocusOnHideProp(isElementFocusable ? element : null)) 6891 return; 6892 if (!isElementFocusable) 6893 return; 6894 element == null ? void 0 : element.focus(); 6895 }, 6896 [store, finalFocus, autoFocusOnHideProp] 6897 ); 6898 useSafeLayoutEffect(() => { 6899 if (open) 6900 return; 6901 if (!hasOpened) 6902 return; 6903 if (!mayAutoFocusOnHide) 6904 return; 6905 const dialog = ref.current; 6906 focusOnHide(dialog); 6907 }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]); 6908 (0,external_React_.useEffect)(() => { 6909 if (!hasOpened) 6910 return; 6911 if (!mayAutoFocusOnHide) 6912 return; 6913 const dialog = ref.current; 6914 return () => focusOnHide(dialog); 6915 }, [hasOpened, mayAutoFocusOnHide, focusOnHide]); 6916 const hideOnEscapeProp = useBooleanEvent(hideOnEscape); 6917 (0,external_React_.useEffect)(() => { 6918 if (!domReady) 6919 return; 6920 if (!mounted) 6921 return; 6922 const onKeyDown = (event) => { 6923 if (event.key !== "Escape") 6924 return; 6925 if (event.defaultPrevented) 6926 return; 6927 const dialog = ref.current; 6928 if (!dialog) 6929 return; 6930 if (isElementMarked(dialog)) 6931 return; 6932 const target = event.target; 6933 if (!target) 6934 return; 6935 const { disclosureElement } = store.getState(); 6936 const isValidTarget = () => { 6937 if (target.tagName === "BODY") 6938 return true; 6939 if (contains(dialog, target)) 6940 return true; 6941 if (!disclosureElement) 6942 return true; 6943 if (contains(disclosureElement, target)) 6944 return true; 6945 return false; 6946 }; 6947 if (!isValidTarget()) 6948 return; 6949 if (!hideOnEscapeProp(event)) 6950 return; 6951 store.hide(); 6952 }; 6953 return addGlobalEventListener("keydown", onKeyDown, true); 6954 }, [store, domReady, mounted, hideOnEscapeProp]); 6955 props = useWrapElement( 6956 props, 6957 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }), 6958 [modal] 6959 ); 6960 const hiddenProp = props.hidden; 6961 const alwaysVisible = props.alwaysVisible; 6962 props = useWrapElement( 6963 props, 6964 (element) => { 6965 if (!backdrop) 6966 return element; 6967 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 6968 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 6969 DialogBackdrop, 6970 { 6971 store, 6972 backdrop, 6973 backdropProps, 6974 hidden: hiddenProp, 6975 alwaysVisible 6976 } 6977 ), 6978 element 6979 ] }); 6980 }, 6981 [store, backdrop, backdropProps, hiddenProp, alwaysVisible] 6982 ); 6983 const [headingId, setHeadingId] = (0,external_React_.useState)(); 6984 const [descriptionId, setDescriptionId] = (0,external_React_.useState)(); 6985 props = useWrapElement( 6986 props, 6987 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }), 6988 [store] 6989 ); 6990 props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ 6991 id, 6992 "data-dialog": "", 6993 role: "dialog", 6994 tabIndex: focusable ? -1 : void 0, 6995 "aria-labelledby": headingId, 6996 "aria-describedby": descriptionId 6997 }, props), { 6998 ref: useMergeRefs(ref, props.ref) 6999 }); 7000 props = useFocusableContainer(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { 7001 autoFocusOnShow: autoFocusEnabled 7002 })); 7003 props = useDisclosureContent(_4R3V3JGP_spreadValues({ store }, props)); 7004 props = useFocusable(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { focusable })); 7005 props = usePortal(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ portal }, props), { portalRef, preserveTabOrder })); 7006 return props; 7007 } 7008 ); 7009 function createDialogComponent(Component, useProviderContext = useDialogProviderContext) { 7010 return createComponent((props) => { 7011 const context = useProviderContext(); 7012 const store = props.store || context; 7013 const mounted = useStoreState( 7014 store, 7015 (state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open 7016 ); 7017 if (!mounted) 7018 return null; 7019 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, _4R3V3JGP_spreadValues({}, props)); 7020 }); 7021 } 7022 var Dialog = createDialogComponent( 7023 createComponent((props) => { 7024 const htmlProps = useDialog(props); 7025 return _3ORBWXWF_createElement("div", htmlProps); 7026 }), 7027 useDialogProviderContext 7028 ); 7029 if (false) {} 7030 7031 7032 7033 ;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 7034 const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); 7035 const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); 7036 const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); 7037 const floating_ui_utils_min = Math.min; 7038 const floating_ui_utils_max = Math.max; 7039 const round = Math.round; 7040 const floor = Math.floor; 7041 const createCoords = v => ({ 7042 x: v, 7043 y: v 7044 }); 7045 const oppositeSideMap = { 7046 left: 'right', 7047 right: 'left', 7048 bottom: 'top', 7049 top: 'bottom' 7050 }; 7051 const oppositeAlignmentMap = { 7052 start: 'end', 7053 end: 'start' 7054 }; 7055 function clamp(start, value, end) { 7056 return floating_ui_utils_max(start, floating_ui_utils_min(value, end)); 7057 } 7058 function floating_ui_utils_evaluate(value, param) { 7059 return typeof value === 'function' ? value(param) : value; 7060 } 7061 function floating_ui_utils_getSide(placement) { 7062 return placement.split('-')[0]; 7063 } 7064 function floating_ui_utils_getAlignment(placement) { 7065 return placement.split('-')[1]; 7066 } 7067 function getOppositeAxis(axis) { 7068 return axis === 'x' ? 'y' : 'x'; 7069 } 7070 function getAxisLength(axis) { 7071 return axis === 'y' ? 'height' : 'width'; 7072 } 7073 function floating_ui_utils_getSideAxis(placement) { 7074 return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x'; 7075 } 7076 function getAlignmentAxis(placement) { 7077 return getOppositeAxis(floating_ui_utils_getSideAxis(placement)); 7078 } 7079 function floating_ui_utils_getAlignmentSides(placement, rects, rtl) { 7080 if (rtl === void 0) { 7081 rtl = false; 7082 } 7083 const alignment = floating_ui_utils_getAlignment(placement); 7084 const alignmentAxis = getAlignmentAxis(placement); 7085 const length = getAxisLength(alignmentAxis); 7086 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 7087 if (rects.reference[length] > rects.floating[length]) { 7088 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 7089 } 7090 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 7091 } 7092 function getExpandedPlacements(placement) { 7093 const oppositePlacement = getOppositePlacement(placement); 7094 return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; 7095 } 7096 function floating_ui_utils_getOppositeAlignmentPlacement(placement) { 7097 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); 7098 } 7099 function getSideList(side, isStart, rtl) { 7100 const lr = ['left', 'right']; 7101 const rl = ['right', 'left']; 7102 const tb = ['top', 'bottom']; 7103 const bt = ['bottom', 'top']; 7104 switch (side) { 7105 case 'top': 7106 case 'bottom': 7107 if (rtl) return isStart ? rl : lr; 7108 return isStart ? lr : rl; 7109 case 'left': 7110 case 'right': 7111 return isStart ? tb : bt; 7112 default: 7113 return []; 7114 } 7115 } 7116 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 7117 const alignment = floating_ui_utils_getAlignment(placement); 7118 let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl); 7119 if (alignment) { 7120 list = list.map(side => side + "-" + alignment); 7121 if (flipAlignment) { 7122 list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement)); 7123 } 7124 } 7125 return list; 7126 } 7127 function getOppositePlacement(placement) { 7128 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); 7129 } 7130 function expandPaddingObject(padding) { 7131 return { 7132 top: 0, 7133 right: 0, 7134 bottom: 0, 7135 left: 0, 7136 ...padding 7137 }; 7138 } 7139 function floating_ui_utils_getPaddingObject(padding) { 7140 return typeof padding !== 'number' ? expandPaddingObject(padding) : { 7141 top: padding, 7142 right: padding, 7143 bottom: padding, 7144 left: padding 7145 }; 7146 } 7147 function floating_ui_utils_rectToClientRect(rect) { 7148 return { 7149 ...rect, 7150 top: rect.y, 7151 left: rect.x, 7152 right: rect.x + rect.width, 7153 bottom: rect.y + rect.height 7154 }; 7155 } 7156 7157 7158 7159 ;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs 7160 7161 7162 7163 function computeCoordsFromPlacement(_ref, placement, rtl) { 7164 let { 7165 reference, 7166 floating 7167 } = _ref; 7168 const sideAxis = floating_ui_utils_getSideAxis(placement); 7169 const alignmentAxis = getAlignmentAxis(placement); 7170 const alignLength = getAxisLength(alignmentAxis); 7171 const side = floating_ui_utils_getSide(placement); 7172 const isVertical = sideAxis === 'y'; 7173 const commonX = reference.x + reference.width / 2 - floating.width / 2; 7174 const commonY = reference.y + reference.height / 2 - floating.height / 2; 7175 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 7176 let coords; 7177 switch (side) { 7178 case 'top': 7179 coords = { 7180 x: commonX, 7181 y: reference.y - floating.height 7182 }; 7183 break; 7184 case 'bottom': 7185 coords = { 7186 x: commonX, 7187 y: reference.y + reference.height 7188 }; 7189 break; 7190 case 'right': 7191 coords = { 7192 x: reference.x + reference.width, 7193 y: commonY 7194 }; 7195 break; 7196 case 'left': 7197 coords = { 7198 x: reference.x - floating.width, 7199 y: commonY 7200 }; 7201 break; 7202 default: 7203 coords = { 7204 x: reference.x, 7205 y: reference.y 7206 }; 7207 } 7208 switch (floating_ui_utils_getAlignment(placement)) { 7209 case 'start': 7210 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 7211 break; 7212 case 'end': 7213 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 7214 break; 7215 } 7216 return coords; 7217 } 7218 7219 /** 7220 * Computes the `x` and `y` coordinates that will place the floating element 7221 * next to a reference element when it is given a certain positioning strategy. 7222 * 7223 * This export does not have any `platform` interface logic. You will need to 7224 * write one for the platform you are using Floating UI with. 7225 */ 7226 const computePosition = async (reference, floating, config) => { 7227 const { 7228 placement = 'bottom', 7229 strategy = 'absolute', 7230 middleware = [], 7231 platform 7232 } = config; 7233 const validMiddleware = middleware.filter(Boolean); 7234 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); 7235 let rects = await platform.getElementRects({ 7236 reference, 7237 floating, 7238 strategy 7239 }); 7240 let { 7241 x, 7242 y 7243 } = computeCoordsFromPlacement(rects, placement, rtl); 7244 let statefulPlacement = placement; 7245 let middlewareData = {}; 7246 let resetCount = 0; 7247 for (let i = 0; i < validMiddleware.length; i++) { 7248 const { 7249 name, 7250 fn 7251 } = validMiddleware[i]; 7252 const { 7253 x: nextX, 7254 y: nextY, 7255 data, 7256 reset 7257 } = await fn({ 7258 x, 7259 y, 7260 initialPlacement: placement, 7261 placement: statefulPlacement, 7262 strategy, 7263 middlewareData, 7264 rects, 7265 platform, 7266 elements: { 7267 reference, 7268 floating 7269 } 7270 }); 7271 x = nextX != null ? nextX : x; 7272 y = nextY != null ? nextY : y; 7273 middlewareData = { 7274 ...middlewareData, 7275 [name]: { 7276 ...middlewareData[name], 7277 ...data 7278 } 7279 }; 7280 if (reset && resetCount <= 50) { 7281 resetCount++; 7282 if (typeof reset === 'object') { 7283 if (reset.placement) { 7284 statefulPlacement = reset.placement; 7285 } 7286 if (reset.rects) { 7287 rects = reset.rects === true ? await platform.getElementRects({ 7288 reference, 7289 floating, 7290 strategy 7291 }) : reset.rects; 7292 } 7293 ({ 7294 x, 7295 y 7296 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 7297 } 7298 i = -1; 7299 continue; 7300 } 7301 } 7302 return { 7303 x, 7304 y, 7305 placement: statefulPlacement, 7306 strategy, 7307 middlewareData 7308 }; 7309 }; 7310 7311 /** 7312 * Resolves with an object of overflow side offsets that determine how much the 7313 * element is overflowing a given clipping boundary on each side. 7314 * - positive = overflowing the boundary by that number of pixels 7315 * - negative = how many pixels left before it will overflow 7316 * - 0 = lies flush with the boundary 7317 * @see https://floating-ui.com/docs/detectOverflow 7318 */ 7319 async function detectOverflow(state, options) { 7320 var _await$platform$isEle; 7321 if (options === void 0) { 7322 options = {}; 7323 } 7324 const { 7325 x, 7326 y, 7327 platform, 7328 rects, 7329 elements, 7330 strategy 7331 } = state; 7332 const { 7333 boundary = 'clippingAncestors', 7334 rootBoundary = 'viewport', 7335 elementContext = 'floating', 7336 altBoundary = false, 7337 padding = 0 7338 } = floating_ui_utils_evaluate(options, state); 7339 const paddingObject = floating_ui_utils_getPaddingObject(padding); 7340 const altContext = elementContext === 'floating' ? 'reference' : 'floating'; 7341 const element = elements[altBoundary ? altContext : elementContext]; 7342 const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({ 7343 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), 7344 boundary, 7345 rootBoundary, 7346 strategy 7347 })); 7348 const rect = elementContext === 'floating' ? { 7349 ...rects.floating, 7350 x, 7351 y 7352 } : rects.reference; 7353 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); 7354 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { 7355 x: 1, 7356 y: 1 7357 } : { 7358 x: 1, 7359 y: 1 7360 }; 7361 const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ 7362 rect, 7363 offsetParent, 7364 strategy 7365 }) : rect); 7366 return { 7367 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 7368 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 7369 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 7370 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 7371 }; 7372 } 7373 7374 /** 7375 * Provides data to position an inner element of the floating element so that it 7376 * appears centered to the reference element. 7377 * @see https://floating-ui.com/docs/arrow 7378 */ 7379 const arrow = options => ({ 7380 name: 'arrow', 7381 options, 7382 async fn(state) { 7383 const { 7384 x, 7385 y, 7386 placement, 7387 rects, 7388 platform, 7389 elements, 7390 middlewareData 7391 } = state; 7392 // Since `element` is required, we don't Partial<> the type. 7393 const { 7394 element, 7395 padding = 0 7396 } = floating_ui_utils_evaluate(options, state) || {}; 7397 if (element == null) { 7398 return {}; 7399 } 7400 const paddingObject = floating_ui_utils_getPaddingObject(padding); 7401 const coords = { 7402 x, 7403 y 7404 }; 7405 const axis = getAlignmentAxis(placement); 7406 const length = getAxisLength(axis); 7407 const arrowDimensions = await platform.getDimensions(element); 7408 const isYAxis = axis === 'y'; 7409 const minProp = isYAxis ? 'top' : 'left'; 7410 const maxProp = isYAxis ? 'bottom' : 'right'; 7411 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; 7412 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 7413 const startDiff = coords[axis] - rects.reference[axis]; 7414 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); 7415 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 7416 7417 // DOM platform can return `window` as the `offsetParent`. 7418 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { 7419 clientSize = elements.floating[clientProp] || rects.floating[length]; 7420 } 7421 const centerToReference = endDiff / 2 - startDiff / 2; 7422 7423 // If the padding is large enough that it causes the arrow to no longer be 7424 // centered, modify the padding so that it is centered. 7425 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 7426 const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding); 7427 const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding); 7428 7429 // Make sure the arrow doesn't overflow the floating element if the center 7430 // point is outside the floating element's bounds. 7431 const min$1 = minPadding; 7432 const max = clientSize - arrowDimensions[length] - maxPadding; 7433 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 7434 const offset = clamp(min$1, center, max); 7435 7436 // If the reference is small enough that the arrow's padding causes it to 7437 // to point to nothing for an aligned placement, adjust the offset of the 7438 // floating element itself. To ensure `shift()` continues to take action, 7439 // a single reset is performed when this is true. 7440 const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 7441 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; 7442 return { 7443 [axis]: coords[axis] + alignmentOffset, 7444 data: { 7445 [axis]: offset, 7446 centerOffset: center - offset - alignmentOffset, 7447 ...(shouldAddOffset && { 7448 alignmentOffset 7449 }) 7450 }, 7451 reset: shouldAddOffset 7452 }; 7453 } 7454 }); 7455 7456 function getPlacementList(alignment, autoAlignment, allowedPlacements) { 7457 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); 7458 return allowedPlacementsSortedByAlignment.filter(placement => { 7459 if (alignment) { 7460 return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); 7461 } 7462 return true; 7463 }); 7464 } 7465 /** 7466 * Optimizes the visibility of the floating element by choosing the placement 7467 * that has the most space available automatically, without needing to specify a 7468 * preferred placement. Alternative to `flip`. 7469 * @see https://floating-ui.com/docs/autoPlacement 7470 */ 7471 const autoPlacement = function (options) { 7472 if (options === void 0) { 7473 options = {}; 7474 } 7475 return { 7476 name: 'autoPlacement', 7477 options, 7478 async fn(state) { 7479 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; 7480 const { 7481 rects, 7482 middlewareData, 7483 placement, 7484 platform, 7485 elements 7486 } = state; 7487 const { 7488 crossAxis = false, 7489 alignment, 7490 allowedPlacements = placements, 7491 autoAlignment = true, 7492 ...detectOverflowOptions 7493 } = evaluate(options, state); 7494 const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; 7495 const overflow = await detectOverflow(state, detectOverflowOptions); 7496 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; 7497 const currentPlacement = placements$1[currentIndex]; 7498 if (currentPlacement == null) { 7499 return {}; 7500 } 7501 const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); 7502 7503 // Make `computeCoords` start from the right place. 7504 if (placement !== currentPlacement) { 7505 return { 7506 reset: { 7507 placement: placements$1[0] 7508 } 7509 }; 7510 } 7511 const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; 7512 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { 7513 placement: currentPlacement, 7514 overflows: currentOverflows 7515 }]; 7516 const nextPlacement = placements$1[currentIndex + 1]; 7517 7518 // There are more placements to check. 7519 if (nextPlacement) { 7520 return { 7521 data: { 7522 index: currentIndex + 1, 7523 overflows: allOverflows 7524 }, 7525 reset: { 7526 placement: nextPlacement 7527 } 7528 }; 7529 } 7530 const placementsSortedByMostSpace = allOverflows.map(d => { 7531 const alignment = getAlignment(d.placement); 7532 return [d.placement, alignment && crossAxis ? 7533 // Check along the mainAxis and main crossAxis side. 7534 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : 7535 // Check only the mainAxis. 7536 d.overflows[0], d.overflows]; 7537 }).sort((a, b) => a[1] - b[1]); 7538 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, 7539 // Aligned placements should not check their opposite crossAxis 7540 // side. 7541 getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); 7542 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; 7543 if (resetPlacement !== placement) { 7544 return { 7545 data: { 7546 index: currentIndex + 1, 7547 overflows: allOverflows 7548 }, 7549 reset: { 7550 placement: resetPlacement 7551 } 7552 }; 7553 } 7554 return {}; 7555 } 7556 }; 7557 }; 7558 7559 /** 7560 * Optimizes the visibility of the floating element by flipping the `placement` 7561 * in order to keep it in view when the preferred placement(s) will overflow the 7562 * clipping boundary. Alternative to `autoPlacement`. 7563 * @see https://floating-ui.com/docs/flip 7564 */ 7565 const flip = function (options) { 7566 if (options === void 0) { 7567 options = {}; 7568 } 7569 return { 7570 name: 'flip', 7571 options, 7572 async fn(state) { 7573 var _middlewareData$arrow, _middlewareData$flip; 7574 const { 7575 placement, 7576 middlewareData, 7577 rects, 7578 initialPlacement, 7579 platform, 7580 elements 7581 } = state; 7582 const { 7583 mainAxis: checkMainAxis = true, 7584 crossAxis: checkCrossAxis = true, 7585 fallbackPlacements: specifiedFallbackPlacements, 7586 fallbackStrategy = 'bestFit', 7587 fallbackAxisSideDirection = 'none', 7588 flipAlignment = true, 7589 ...detectOverflowOptions 7590 } = floating_ui_utils_evaluate(options, state); 7591 7592 // If a reset by the arrow was caused due to an alignment offset being 7593 // added, we should skip any logic now since `flip()` has already done its 7594 // work. 7595 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 7596 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 7597 return {}; 7598 } 7599 const side = floating_ui_utils_getSide(placement); 7600 const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement; 7601 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 7602 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 7603 if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') { 7604 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 7605 } 7606 const placements = [initialPlacement, ...fallbackPlacements]; 7607 const overflow = await detectOverflow(state, detectOverflowOptions); 7608 const overflows = []; 7609 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 7610 if (checkMainAxis) { 7611 overflows.push(overflow[side]); 7612 } 7613 if (checkCrossAxis) { 7614 const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl); 7615 overflows.push(overflow[sides[0]], overflow[sides[1]]); 7616 } 7617 overflowsData = [...overflowsData, { 7618 placement, 7619 overflows 7620 }]; 7621 7622 // One or more sides is overflowing. 7623 if (!overflows.every(side => side <= 0)) { 7624 var _middlewareData$flip2, _overflowsData$filter; 7625 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 7626 const nextPlacement = placements[nextIndex]; 7627 if (nextPlacement) { 7628 // Try next placement and re-run the lifecycle. 7629 return { 7630 data: { 7631 index: nextIndex, 7632 overflows: overflowsData 7633 }, 7634 reset: { 7635 placement: nextPlacement 7636 } 7637 }; 7638 } 7639 7640 // First, find the candidates that fit on the mainAxis side of overflow, 7641 // then find the placement that fits the best on the main crossAxis side. 7642 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; 7643 7644 // Otherwise fallback. 7645 if (!resetPlacement) { 7646 switch (fallbackStrategy) { 7647 case 'bestFit': 7648 { 7649 var _overflowsData$map$so; 7650 const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; 7651 if (placement) { 7652 resetPlacement = placement; 7653 } 7654 break; 7655 } 7656 case 'initialPlacement': 7657 resetPlacement = initialPlacement; 7658 break; 7659 } 7660 } 7661 if (placement !== resetPlacement) { 7662 return { 7663 reset: { 7664 placement: resetPlacement 7665 } 7666 }; 7667 } 7668 } 7669 return {}; 7670 } 7671 }; 7672 }; 7673 7674 function getSideOffsets(overflow, rect) { 7675 return { 7676 top: overflow.top - rect.height, 7677 right: overflow.right - rect.width, 7678 bottom: overflow.bottom - rect.height, 7679 left: overflow.left - rect.width 7680 }; 7681 } 7682 function isAnySideFullyClipped(overflow) { 7683 return sides.some(side => overflow[side] >= 0); 7684 } 7685 /** 7686 * Provides data to hide the floating element in applicable situations, such as 7687 * when it is not in the same clipping context as the reference element. 7688 * @see https://floating-ui.com/docs/hide 7689 */ 7690 const hide = function (options) { 7691 if (options === void 0) { 7692 options = {}; 7693 } 7694 return { 7695 name: 'hide', 7696 options, 7697 async fn(state) { 7698 const { 7699 rects 7700 } = state; 7701 const { 7702 strategy = 'referenceHidden', 7703 ...detectOverflowOptions 7704 } = evaluate(options, state); 7705 switch (strategy) { 7706 case 'referenceHidden': 7707 { 7708 const overflow = await detectOverflow(state, { 7709 ...detectOverflowOptions, 7710 elementContext: 'reference' 7711 }); 7712 const offsets = getSideOffsets(overflow, rects.reference); 7713 return { 7714 data: { 7715 referenceHiddenOffsets: offsets, 7716 referenceHidden: isAnySideFullyClipped(offsets) 7717 } 7718 }; 7719 } 7720 case 'escaped': 7721 { 7722 const overflow = await detectOverflow(state, { 7723 ...detectOverflowOptions, 7724 altBoundary: true 7725 }); 7726 const offsets = getSideOffsets(overflow, rects.floating); 7727 return { 7728 data: { 7729 escapedOffsets: offsets, 7730 escaped: isAnySideFullyClipped(offsets) 7731 } 7732 }; 7733 } 7734 default: 7735 { 7736 return {}; 7737 } 7738 } 7739 } 7740 }; 7741 }; 7742 7743 function getBoundingRect(rects) { 7744 const minX = min(...rects.map(rect => rect.left)); 7745 const minY = min(...rects.map(rect => rect.top)); 7746 const maxX = max(...rects.map(rect => rect.right)); 7747 const maxY = max(...rects.map(rect => rect.bottom)); 7748 return { 7749 x: minX, 7750 y: minY, 7751 width: maxX - minX, 7752 height: maxY - minY 7753 }; 7754 } 7755 function getRectsByLine(rects) { 7756 const sortedRects = rects.slice().sort((a, b) => a.y - b.y); 7757 const groups = []; 7758 let prevRect = null; 7759 for (let i = 0; i < sortedRects.length; i++) { 7760 const rect = sortedRects[i]; 7761 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { 7762 groups.push([rect]); 7763 } else { 7764 groups[groups.length - 1].push(rect); 7765 } 7766 prevRect = rect; 7767 } 7768 return groups.map(rect => rectToClientRect(getBoundingRect(rect))); 7769 } 7770 /** 7771 * Provides improved positioning for inline reference elements that can span 7772 * over multiple lines, such as hyperlinks or range selections. 7773 * @see https://floating-ui.com/docs/inline 7774 */ 7775 const inline = function (options) { 7776 if (options === void 0) { 7777 options = {}; 7778 } 7779 return { 7780 name: 'inline', 7781 options, 7782 async fn(state) { 7783 const { 7784 placement, 7785 elements, 7786 rects, 7787 platform, 7788 strategy 7789 } = state; 7790 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a 7791 // ClientRect's bounds, despite the event listener being triggered. A 7792 // padding of 2 seems to handle this issue. 7793 const { 7794 padding = 2, 7795 x, 7796 y 7797 } = evaluate(options, state); 7798 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); 7799 const clientRects = getRectsByLine(nativeClientRects); 7800 const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); 7801 const paddingObject = getPaddingObject(padding); 7802 function getBoundingClientRect() { 7803 // There are two rects and they are disjoined. 7804 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { 7805 // Find the first rect in which the point is fully inside. 7806 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; 7807 } 7808 7809 // There are 2 or more connected rects. 7810 if (clientRects.length >= 2) { 7811 if (getSideAxis(placement) === 'y') { 7812 const firstRect = clientRects[0]; 7813 const lastRect = clientRects[clientRects.length - 1]; 7814 const isTop = getSide(placement) === 'top'; 7815 const top = firstRect.top; 7816 const bottom = lastRect.bottom; 7817 const left = isTop ? firstRect.left : lastRect.left; 7818 const right = isTop ? firstRect.right : lastRect.right; 7819 const width = right - left; 7820 const height = bottom - top; 7821 return { 7822 top, 7823 bottom, 7824 left, 7825 right, 7826 width, 7827 height, 7828 x: left, 7829 y: top 7830 }; 7831 } 7832 const isLeftSide = getSide(placement) === 'left'; 7833 const maxRight = max(...clientRects.map(rect => rect.right)); 7834 const minLeft = min(...clientRects.map(rect => rect.left)); 7835 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); 7836 const top = measureRects[0].top; 7837 const bottom = measureRects[measureRects.length - 1].bottom; 7838 const left = minLeft; 7839 const right = maxRight; 7840 const width = right - left; 7841 const height = bottom - top; 7842 return { 7843 top, 7844 bottom, 7845 left, 7846 right, 7847 width, 7848 height, 7849 x: left, 7850 y: top 7851 }; 7852 } 7853 return fallback; 7854 } 7855 const resetRects = await platform.getElementRects({ 7856 reference: { 7857 getBoundingClientRect 7858 }, 7859 floating: elements.floating, 7860 strategy 7861 }); 7862 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { 7863 return { 7864 reset: { 7865 rects: resetRects 7866 } 7867 }; 7868 } 7869 return {}; 7870 } 7871 }; 7872 }; 7873 7874 // For type backwards-compatibility, the `OffsetOptions` type was also 7875 // Derivable. 7876 async function convertValueToCoords(state, options) { 7877 const { 7878 placement, 7879 platform, 7880 elements 7881 } = state; 7882 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 7883 const side = floating_ui_utils_getSide(placement); 7884 const alignment = floating_ui_utils_getAlignment(placement); 7885 const isVertical = floating_ui_utils_getSideAxis(placement) === 'y'; 7886 const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; 7887 const crossAxisMulti = rtl && isVertical ? -1 : 1; 7888 const rawValue = floating_ui_utils_evaluate(options, state); 7889 7890 // eslint-disable-next-line prefer-const 7891 let { 7892 mainAxis, 7893 crossAxis, 7894 alignmentAxis 7895 } = typeof rawValue === 'number' ? { 7896 mainAxis: rawValue, 7897 crossAxis: 0, 7898 alignmentAxis: null 7899 } : { 7900 mainAxis: 0, 7901 crossAxis: 0, 7902 alignmentAxis: null, 7903 ...rawValue 7904 }; 7905 if (alignment && typeof alignmentAxis === 'number') { 7906 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; 7907 } 7908 return isVertical ? { 7909 x: crossAxis * crossAxisMulti, 7910 y: mainAxis * mainAxisMulti 7911 } : { 7912 x: mainAxis * mainAxisMulti, 7913 y: crossAxis * crossAxisMulti 7914 }; 7915 } 7916 7917 /** 7918 * Modifies the placement by translating the floating element along the 7919 * specified axes. 7920 * A number (shorthand for `mainAxis` or distance), or an axes configuration 7921 * object may be passed. 7922 * @see https://floating-ui.com/docs/offset 7923 */ 7924 const offset = function (options) { 7925 if (options === void 0) { 7926 options = 0; 7927 } 7928 return { 7929 name: 'offset', 7930 options, 7931 async fn(state) { 7932 const { 7933 x, 7934 y 7935 } = state; 7936 const diffCoords = await convertValueToCoords(state, options); 7937 return { 7938 x: x + diffCoords.x, 7939 y: y + diffCoords.y, 7940 data: diffCoords 7941 }; 7942 } 7943 }; 7944 }; 7945 7946 /** 7947 * Optimizes the visibility of the floating element by shifting it in order to 7948 * keep it in view when it will overflow the clipping boundary. 7949 * @see https://floating-ui.com/docs/shift 7950 */ 7951 const shift = function (options) { 7952 if (options === void 0) { 7953 options = {}; 7954 } 7955 return { 7956 name: 'shift', 7957 options, 7958 async fn(state) { 7959 const { 7960 x, 7961 y, 7962 placement 7963 } = state; 7964 const { 7965 mainAxis: checkMainAxis = true, 7966 crossAxis: checkCrossAxis = false, 7967 limiter = { 7968 fn: _ref => { 7969 let { 7970 x, 7971 y 7972 } = _ref; 7973 return { 7974 x, 7975 y 7976 }; 7977 } 7978 }, 7979 ...detectOverflowOptions 7980 } = floating_ui_utils_evaluate(options, state); 7981 const coords = { 7982 x, 7983 y 7984 }; 7985 const overflow = await detectOverflow(state, detectOverflowOptions); 7986 const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement)); 7987 const mainAxis = getOppositeAxis(crossAxis); 7988 let mainAxisCoord = coords[mainAxis]; 7989 let crossAxisCoord = coords[crossAxis]; 7990 if (checkMainAxis) { 7991 const minSide = mainAxis === 'y' ? 'top' : 'left'; 7992 const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; 7993 const min = mainAxisCoord + overflow[minSide]; 7994 const max = mainAxisCoord - overflow[maxSide]; 7995 mainAxisCoord = clamp(min, mainAxisCoord, max); 7996 } 7997 if (checkCrossAxis) { 7998 const minSide = crossAxis === 'y' ? 'top' : 'left'; 7999 const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; 8000 const min = crossAxisCoord + overflow[minSide]; 8001 const max = crossAxisCoord - overflow[maxSide]; 8002 crossAxisCoord = clamp(min, crossAxisCoord, max); 8003 } 8004 const limitedCoords = limiter.fn({ 8005 ...state, 8006 [mainAxis]: mainAxisCoord, 8007 [crossAxis]: crossAxisCoord 8008 }); 8009 return { 8010 ...limitedCoords, 8011 data: { 8012 x: limitedCoords.x - x, 8013 y: limitedCoords.y - y 8014 } 8015 }; 8016 } 8017 }; 8018 }; 8019 /** 8020 * Built-in `limiter` that will stop `shift()` at a certain point. 8021 */ 8022 const limitShift = function (options) { 8023 if (options === void 0) { 8024 options = {}; 8025 } 8026 return { 8027 options, 8028 fn(state) { 8029 const { 8030 x, 8031 y, 8032 placement, 8033 rects, 8034 middlewareData 8035 } = state; 8036 const { 8037 offset = 0, 8038 mainAxis: checkMainAxis = true, 8039 crossAxis: checkCrossAxis = true 8040 } = floating_ui_utils_evaluate(options, state); 8041 const coords = { 8042 x, 8043 y 8044 }; 8045 const crossAxis = floating_ui_utils_getSideAxis(placement); 8046 const mainAxis = getOppositeAxis(crossAxis); 8047 let mainAxisCoord = coords[mainAxis]; 8048 let crossAxisCoord = coords[crossAxis]; 8049 const rawOffset = floating_ui_utils_evaluate(offset, state); 8050 const computedOffset = typeof rawOffset === 'number' ? { 8051 mainAxis: rawOffset, 8052 crossAxis: 0 8053 } : { 8054 mainAxis: 0, 8055 crossAxis: 0, 8056 ...rawOffset 8057 }; 8058 if (checkMainAxis) { 8059 const len = mainAxis === 'y' ? 'height' : 'width'; 8060 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 8061 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 8062 if (mainAxisCoord < limitMin) { 8063 mainAxisCoord = limitMin; 8064 } else if (mainAxisCoord > limitMax) { 8065 mainAxisCoord = limitMax; 8066 } 8067 } 8068 if (checkCrossAxis) { 8069 var _middlewareData$offse, _middlewareData$offse2; 8070 const len = mainAxis === 'y' ? 'width' : 'height'; 8071 const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement)); 8072 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); 8073 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); 8074 if (crossAxisCoord < limitMin) { 8075 crossAxisCoord = limitMin; 8076 } else if (crossAxisCoord > limitMax) { 8077 crossAxisCoord = limitMax; 8078 } 8079 } 8080 return { 8081 [mainAxis]: mainAxisCoord, 8082 [crossAxis]: crossAxisCoord 8083 }; 8084 } 8085 }; 8086 }; 8087 8088 /** 8089 * Provides data that allows you to change the size of the floating element — 8090 * for instance, prevent it from overflowing the clipping boundary or match the 8091 * width of the reference element. 8092 * @see https://floating-ui.com/docs/size 8093 */ 8094 const size = function (options) { 8095 if (options === void 0) { 8096 options = {}; 8097 } 8098 return { 8099 name: 'size', 8100 options, 8101 async fn(state) { 8102 const { 8103 placement, 8104 rects, 8105 platform, 8106 elements 8107 } = state; 8108 const { 8109 apply = () => {}, 8110 ...detectOverflowOptions 8111 } = floating_ui_utils_evaluate(options, state); 8112 const overflow = await detectOverflow(state, detectOverflowOptions); 8113 const side = floating_ui_utils_getSide(placement); 8114 const alignment = floating_ui_utils_getAlignment(placement); 8115 const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y'; 8116 const { 8117 width, 8118 height 8119 } = rects.floating; 8120 let heightSide; 8121 let widthSide; 8122 if (side === 'top' || side === 'bottom') { 8123 heightSide = side; 8124 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; 8125 } else { 8126 widthSide = side; 8127 heightSide = alignment === 'end' ? 'top' : 'bottom'; 8128 } 8129 const overflowAvailableHeight = height - overflow[heightSide]; 8130 const overflowAvailableWidth = width - overflow[widthSide]; 8131 const noShift = !state.middlewareData.shift; 8132 let availableHeight = overflowAvailableHeight; 8133 let availableWidth = overflowAvailableWidth; 8134 if (isYAxis) { 8135 const maximumClippingWidth = width - overflow.left - overflow.right; 8136 availableWidth = alignment || noShift ? floating_ui_utils_min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; 8137 } else { 8138 const maximumClippingHeight = height - overflow.top - overflow.bottom; 8139 availableHeight = alignment || noShift ? floating_ui_utils_min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; 8140 } 8141 if (noShift && !alignment) { 8142 const xMin = floating_ui_utils_max(overflow.left, 0); 8143 const xMax = floating_ui_utils_max(overflow.right, 0); 8144 const yMin = floating_ui_utils_max(overflow.top, 0); 8145 const yMax = floating_ui_utils_max(overflow.bottom, 0); 8146 if (isYAxis) { 8147 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right)); 8148 } else { 8149 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom)); 8150 } 8151 } 8152 await apply({ 8153 ...state, 8154 availableWidth, 8155 availableHeight 8156 }); 8157 const nextDimensions = await platform.getDimensions(elements.floating); 8158 if (width !== nextDimensions.width || height !== nextDimensions.height) { 8159 return { 8160 reset: { 8161 rects: true 8162 } 8163 }; 8164 } 8165 return {}; 8166 } 8167 }; 8168 }; 8169 8170 8171 8172 ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 8173 /** 8174 * Custom positioning reference element. 8175 * @see https://floating-ui.com/docs/virtual-elements 8176 */ 8177 8178 const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); 8179 const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end'])); 8180 const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), []))); 8181 const dist_floating_ui_utils_min = Math.min; 8182 const dist_floating_ui_utils_max = Math.max; 8183 const floating_ui_utils_round = Math.round; 8184 const floating_ui_utils_floor = Math.floor; 8185 const floating_ui_utils_createCoords = v => ({ 8186 x: v, 8187 y: v 8188 }); 8189 const floating_ui_utils_oppositeSideMap = { 8190 left: 'right', 8191 right: 'left', 8192 bottom: 'top', 8193 top: 'bottom' 8194 }; 8195 const floating_ui_utils_oppositeAlignmentMap = { 8196 start: 'end', 8197 end: 'start' 8198 }; 8199 function floating_ui_utils_clamp(start, value, end) { 8200 return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end)); 8201 } 8202 function dist_floating_ui_utils_evaluate(value, param) { 8203 return typeof value === 'function' ? value(param) : value; 8204 } 8205 function dist_floating_ui_utils_getSide(placement) { 8206 return placement.split('-')[0]; 8207 } 8208 function dist_floating_ui_utils_getAlignment(placement) { 8209 return placement.split('-')[1]; 8210 } 8211 function floating_ui_utils_getOppositeAxis(axis) { 8212 return axis === 'x' ? 'y' : 'x'; 8213 } 8214 function floating_ui_utils_getAxisLength(axis) { 8215 return axis === 'y' ? 'height' : 'width'; 8216 } 8217 function dist_floating_ui_utils_getSideAxis(placement) { 8218 return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x'; 8219 } 8220 function floating_ui_utils_getAlignmentAxis(placement) { 8221 return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement)); 8222 } 8223 function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) { 8224 if (rtl === void 0) { 8225 rtl = false; 8226 } 8227 const alignment = dist_floating_ui_utils_getAlignment(placement); 8228 const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement); 8229 const length = floating_ui_utils_getAxisLength(alignmentAxis); 8230 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 8231 if (rects.reference[length] > rects.floating[length]) { 8232 mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide); 8233 } 8234 return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)]; 8235 } 8236 function floating_ui_utils_getExpandedPlacements(placement) { 8237 const oppositePlacement = floating_ui_utils_getOppositePlacement(placement); 8238 return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; 8239 } 8240 function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) { 8241 return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]); 8242 } 8243 function floating_ui_utils_getSideList(side, isStart, rtl) { 8244 const lr = ['left', 'right']; 8245 const rl = ['right', 'left']; 8246 const tb = ['top', 'bottom']; 8247 const bt = ['bottom', 'top']; 8248 switch (side) { 8249 case 'top': 8250 case 'bottom': 8251 if (rtl) return isStart ? rl : lr; 8252 return isStart ? lr : rl; 8253 case 'left': 8254 case 'right': 8255 return isStart ? tb : bt; 8256 default: 8257 return []; 8258 } 8259 } 8260 function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 8261 const alignment = dist_floating_ui_utils_getAlignment(placement); 8262 let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl); 8263 if (alignment) { 8264 list = list.map(side => side + "-" + alignment); 8265 if (flipAlignment) { 8266 list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement)); 8267 } 8268 } 8269 return list; 8270 } 8271 function floating_ui_utils_getOppositePlacement(placement) { 8272 return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]); 8273 } 8274 function floating_ui_utils_expandPaddingObject(padding) { 8275 return { 8276 top: 0, 8277 right: 0, 8278 bottom: 0, 8279 left: 0, 8280 ...padding 8281 }; 8282 } 8283 function dist_floating_ui_utils_getPaddingObject(padding) { 8284 return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : { 8285 top: padding, 8286 right: padding, 8287 bottom: padding, 8288 left: padding 8289 }; 8290 } 8291 function dist_floating_ui_utils_rectToClientRect(rect) { 8292 return { 8293 ...rect, 8294 top: rect.y, 8295 left: rect.x, 8296 right: rect.x + rect.width, 8297 bottom: rect.y + rect.height 8298 }; 8299 } 8300 8301 8302 8303 ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 8304 function getNodeName(node) { 8305 if (isNode(node)) { 8306 return (node.nodeName || '').toLowerCase(); 8307 } 8308 // Mocked nodes in testing environments may not be instances of Node. By 8309 // returning `#document` an infinite loop won't occur. 8310 // https://github.com/floating-ui/floating-ui/issues/2317 8311 return '#document'; 8312 } 8313 function floating_ui_utils_dom_getWindow(node) { 8314 var _node$ownerDocument; 8315 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 8316 } 8317 function getDocumentElement(node) { 8318 var _ref; 8319 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 8320 } 8321 function isNode(value) { 8322 return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node; 8323 } 8324 function isElement(value) { 8325 return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element; 8326 } 8327 function isHTMLElement(value) { 8328 return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement; 8329 } 8330 function isShadowRoot(value) { 8331 // Browsers without `ShadowRoot` support. 8332 if (typeof ShadowRoot === 'undefined') { 8333 return false; 8334 } 8335 return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot; 8336 } 8337 function isOverflowElement(element) { 8338 const { 8339 overflow, 8340 overflowX, 8341 overflowY, 8342 display 8343 } = floating_ui_utils_dom_getComputedStyle(element); 8344 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); 8345 } 8346 function isTableElement(element) { 8347 return ['table', 'td', 'th'].includes(getNodeName(element)); 8348 } 8349 function isContainingBlock(element) { 8350 const webkit = isWebKit(); 8351 const css = floating_ui_utils_dom_getComputedStyle(element); 8352 8353 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 8354 return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); 8355 } 8356 function getContainingBlock(element) { 8357 let currentNode = getParentNode(element); 8358 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 8359 if (isContainingBlock(currentNode)) { 8360 return currentNode; 8361 } else { 8362 currentNode = getParentNode(currentNode); 8363 } 8364 } 8365 return null; 8366 } 8367 function isWebKit() { 8368 if (typeof CSS === 'undefined' || !CSS.supports) return false; 8369 return CSS.supports('-webkit-backdrop-filter', 'none'); 8370 } 8371 function isLastTraversableNode(node) { 8372 return ['html', 'body', '#document'].includes(getNodeName(node)); 8373 } 8374 function floating_ui_utils_dom_getComputedStyle(element) { 8375 return floating_ui_utils_dom_getWindow(element).getComputedStyle(element); 8376 } 8377 function getNodeScroll(element) { 8378 if (isElement(element)) { 8379 return { 8380 scrollLeft: element.scrollLeft, 8381 scrollTop: element.scrollTop 8382 }; 8383 } 8384 return { 8385 scrollLeft: element.pageXOffset, 8386 scrollTop: element.pageYOffset 8387 }; 8388 } 8389 function getParentNode(node) { 8390 if (getNodeName(node) === 'html') { 8391 return node; 8392 } 8393 const result = 8394 // Step into the shadow DOM of the parent of a slotted node. 8395 node.assignedSlot || 8396 // DOM Element detected. 8397 node.parentNode || 8398 // ShadowRoot detected. 8399 isShadowRoot(node) && node.host || 8400 // Fallback. 8401 getDocumentElement(node); 8402 return isShadowRoot(result) ? result.host : result; 8403 } 8404 function getNearestOverflowAncestor(node) { 8405 const parentNode = getParentNode(node); 8406 if (isLastTraversableNode(parentNode)) { 8407 return node.ownerDocument ? node.ownerDocument.body : node.body; 8408 } 8409 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 8410 return parentNode; 8411 } 8412 return getNearestOverflowAncestor(parentNode); 8413 } 8414 function getOverflowAncestors(node, list, traverseIframes) { 8415 var _node$ownerDocument2; 8416 if (list === void 0) { 8417 list = []; 8418 } 8419 if (traverseIframes === void 0) { 8420 traverseIframes = true; 8421 } 8422 const scrollableAncestor = getNearestOverflowAncestor(node); 8423 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 8424 const win = floating_ui_utils_dom_getWindow(scrollableAncestor); 8425 if (isBody) { 8426 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); 8427 } 8428 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 8429 } 8430 8431 8432 8433 ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 8434 8435 8436 8437 8438 8439 8440 function getCssDimensions(element) { 8441 const css = floating_ui_utils_dom_getComputedStyle(element); 8442 // In testing environments, the `width` and `height` properties are empty 8443 // strings for SVG elements, returning NaN. Fallback to `0` in this case. 8444 let width = parseFloat(css.width) || 0; 8445 let height = parseFloat(css.height) || 0; 8446 const hasOffset = isHTMLElement(element); 8447 const offsetWidth = hasOffset ? element.offsetWidth : width; 8448 const offsetHeight = hasOffset ? element.offsetHeight : height; 8449 const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight; 8450 if (shouldFallback) { 8451 width = offsetWidth; 8452 height = offsetHeight; 8453 } 8454 return { 8455 width, 8456 height, 8457 $: shouldFallback 8458 }; 8459 } 8460 8461 function unwrapElement(element) { 8462 return !isElement(element) ? element.contextElement : element; 8463 }