[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 5096: 5 /***/ (function(module) { 6 7 "use strict"; 8 9 10 function noop() { 11 return null; 12 } 13 14 noop.isRequired = noop; 15 16 function noopThunk() { 17 return noop; 18 } 19 20 module.exports = { 21 and: noopThunk, 22 between: noopThunk, 23 booleanSome: noopThunk, 24 childrenHavePropXorChildren: noopThunk, 25 childrenOf: noopThunk, 26 childrenOfType: noopThunk, 27 childrenSequenceOf: noopThunk, 28 componentWithName: noopThunk, 29 disallowedIf: noopThunk, 30 elementType: noopThunk, 31 empty: noopThunk, 32 explicitNull: noopThunk, 33 forbidExtraProps: Object, 34 integer: noopThunk, 35 keysOf: noopThunk, 36 mutuallyExclusiveProps: noopThunk, 37 mutuallyExclusiveTrueProps: noopThunk, 38 nChildren: noopThunk, 39 nonNegativeInteger: noop, 40 nonNegativeNumber: noopThunk, 41 numericString: noopThunk, 42 object: noopThunk, 43 or: noopThunk, 44 predicate: noopThunk, 45 range: noopThunk, 46 ref: noopThunk, 47 requiredBy: noopThunk, 48 restrictedProp: noopThunk, 49 sequenceOf: noopThunk, 50 shape: noopThunk, 51 stringEndsWith: noopThunk, 52 stringStartsWith: noopThunk, 53 uniqueArray: noopThunk, 54 uniqueArrayOf: noopThunk, 55 valuesOf: noopThunk, 56 withShape: noopThunk 57 }; 58 59 60 /***/ }), 61 62 /***/ 4882: 63 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 64 65 module.exports = true ? __webpack_require__(5096) : 0; 66 67 68 69 /***/ }), 70 71 /***/ 4485: 72 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 73 74 "use strict"; 75 76 77 var ArraySpeciesCreate = __webpack_require__(1539); 78 var FlattenIntoArray = __webpack_require__(6739); 79 var Get = __webpack_require__(6448); 80 var ToIntegerOrInfinity = __webpack_require__(1723); 81 var ToLength = __webpack_require__(6840); 82 var ToObject = __webpack_require__(1283); 83 84 module.exports = function flat() { 85 var O = ToObject(this); 86 var sourceLen = ToLength(Get(O, 'length')); 87 88 var depthNum = 1; 89 if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { 90 depthNum = ToIntegerOrInfinity(arguments[0]); 91 } 92 93 var A = ArraySpeciesCreate(O, 0); 94 FlattenIntoArray(A, O, sourceLen, 0, depthNum); 95 return A; 96 }; 97 98 99 /***/ }), 100 101 /***/ 116: 102 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 103 104 "use strict"; 105 106 107 var define = __webpack_require__(9170); 108 var callBind = __webpack_require__(9961); 109 110 var implementation = __webpack_require__(4485); 111 var getPolyfill = __webpack_require__(616); 112 var polyfill = getPolyfill(); 113 var shim = __webpack_require__(2059); 114 115 var boundFlat = callBind(polyfill); 116 117 define(boundFlat, { 118 getPolyfill: getPolyfill, 119 implementation: implementation, 120 shim: shim 121 }); 122 123 module.exports = boundFlat; 124 125 126 /***/ }), 127 128 /***/ 9630: 129 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 130 131 "use strict"; 132 133 134 var GetIntrinsic = __webpack_require__(1801); 135 136 var callBind = __webpack_require__(9961); 137 138 var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 139 140 module.exports = function callBoundIntrinsic(name, allowMissing) { 141 var intrinsic = GetIntrinsic(name, !!allowMissing); 142 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 143 return callBind(intrinsic); 144 } 145 return intrinsic; 146 }; 147 148 149 /***/ }), 150 151 /***/ 9961: 152 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 153 154 "use strict"; 155 156 157 var bind = __webpack_require__(1930); 158 var GetIntrinsic = __webpack_require__(1801); 159 160 var $apply = GetIntrinsic('%Function.prototype.apply%'); 161 var $call = GetIntrinsic('%Function.prototype.call%'); 162 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 163 164 var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); 165 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 166 var $max = GetIntrinsic('%Math.max%'); 167 168 if ($defineProperty) { 169 try { 170 $defineProperty({}, 'a', { value: 1 }); 171 } catch (e) { 172 // IE 8 has a broken defineProperty 173 $defineProperty = null; 174 } 175 } 176 177 module.exports = function callBind(originalFunction) { 178 var func = $reflectApply(bind, $call, arguments); 179 if ($gOPD && $defineProperty) { 180 var desc = $gOPD(func, 'length'); 181 if (desc.configurable) { 182 // original length, plus the receiver, minus any additional arguments (after the receiver) 183 $defineProperty( 184 func, 185 'length', 186 { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } 187 ); 188 } 189 } 190 return func; 191 }; 192 193 var applyBind = function applyBind() { 194 return $reflectApply(bind, $apply, arguments); 195 }; 196 197 if ($defineProperty) { 198 $defineProperty(module.exports, 'apply', { value: applyBind }); 199 } else { 200 module.exports.apply = applyBind; 201 } 202 203 204 /***/ }), 205 206 /***/ 4219: 207 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 208 209 "use strict"; 210 211 212 var undefined; 213 214 var $SyntaxError = SyntaxError; 215 var $Function = Function; 216 var $TypeError = TypeError; 217 218 // eslint-disable-next-line consistent-return 219 var getEvalledConstructor = function (expressionSyntax) { 220 try { 221 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 222 } catch (e) {} 223 }; 224 225 var $gOPD = Object.getOwnPropertyDescriptor; 226 if ($gOPD) { 227 try { 228 $gOPD({}, ''); 229 } catch (e) { 230 $gOPD = null; // this is IE 8, which has a broken gOPD 231 } 232 } 233 234 var throwTypeError = function () { 235 throw new $TypeError(); 236 }; 237 var ThrowTypeError = $gOPD 238 ? (function () { 239 try { 240 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 241 arguments.callee; // IE 8 does not throw here 242 return throwTypeError; 243 } catch (calleeThrows) { 244 try { 245 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 246 return $gOPD(arguments, 'callee').get; 247 } catch (gOPDthrows) { 248 return throwTypeError; 249 } 250 } 251 }()) 252 : throwTypeError; 253 254 var hasSymbols = __webpack_require__(9828)(); 255 256 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 257 258 var needsEval = {}; 259 260 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 261 262 var INTRINSICS = { 263 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 264 '%Array%': Array, 265 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 266 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 267 '%AsyncFromSyncIteratorPrototype%': undefined, 268 '%AsyncFunction%': needsEval, 269 '%AsyncGenerator%': needsEval, 270 '%AsyncGeneratorFunction%': needsEval, 271 '%AsyncIteratorPrototype%': needsEval, 272 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 273 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 274 '%Boolean%': Boolean, 275 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 276 '%Date%': Date, 277 '%decodeURI%': decodeURI, 278 '%decodeURIComponent%': decodeURIComponent, 279 '%encodeURI%': encodeURI, 280 '%encodeURIComponent%': encodeURIComponent, 281 '%Error%': Error, 282 '%eval%': eval, // eslint-disable-line no-eval 283 '%EvalError%': EvalError, 284 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 285 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 286 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 287 '%Function%': $Function, 288 '%GeneratorFunction%': needsEval, 289 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 290 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 291 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 292 '%isFinite%': isFinite, 293 '%isNaN%': isNaN, 294 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 295 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 296 '%Map%': typeof Map === 'undefined' ? undefined : Map, 297 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 298 '%Math%': Math, 299 '%Number%': Number, 300 '%Object%': Object, 301 '%parseFloat%': parseFloat, 302 '%parseInt%': parseInt, 303 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 304 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 305 '%RangeError%': RangeError, 306 '%ReferenceError%': ReferenceError, 307 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 308 '%RegExp%': RegExp, 309 '%Set%': typeof Set === 'undefined' ? undefined : Set, 310 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 311 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 312 '%String%': String, 313 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 314 '%Symbol%': hasSymbols ? Symbol : undefined, 315 '%SyntaxError%': $SyntaxError, 316 '%ThrowTypeError%': ThrowTypeError, 317 '%TypedArray%': TypedArray, 318 '%TypeError%': $TypeError, 319 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 320 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 321 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 322 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 323 '%URIError%': URIError, 324 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 325 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 326 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 327 }; 328 329 var doEval = function doEval(name) { 330 var value; 331 if (name === '%AsyncFunction%') { 332 value = getEvalledConstructor('async function () {}'); 333 } else if (name === '%GeneratorFunction%') { 334 value = getEvalledConstructor('function* () {}'); 335 } else if (name === '%AsyncGeneratorFunction%') { 336 value = getEvalledConstructor('async function* () {}'); 337 } else if (name === '%AsyncGenerator%') { 338 var fn = doEval('%AsyncGeneratorFunction%'); 339 if (fn) { 340 value = fn.prototype; 341 } 342 } else if (name === '%AsyncIteratorPrototype%') { 343 var gen = doEval('%AsyncGenerator%'); 344 if (gen) { 345 value = getProto(gen.prototype); 346 } 347 } 348 349 INTRINSICS[name] = value; 350 351 return value; 352 }; 353 354 var LEGACY_ALIASES = { 355 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 356 '%ArrayPrototype%': ['Array', 'prototype'], 357 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 358 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 359 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 360 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 361 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 362 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 363 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 364 '%BooleanPrototype%': ['Boolean', 'prototype'], 365 '%DataViewPrototype%': ['DataView', 'prototype'], 366 '%DatePrototype%': ['Date', 'prototype'], 367 '%ErrorPrototype%': ['Error', 'prototype'], 368 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 369 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 370 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 371 '%FunctionPrototype%': ['Function', 'prototype'], 372 '%Generator%': ['GeneratorFunction', 'prototype'], 373 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 374 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 375 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 376 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 377 '%JSONParse%': ['JSON', 'parse'], 378 '%JSONStringify%': ['JSON', 'stringify'], 379 '%MapPrototype%': ['Map', 'prototype'], 380 '%NumberPrototype%': ['Number', 'prototype'], 381 '%ObjectPrototype%': ['Object', 'prototype'], 382 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 383 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 384 '%PromisePrototype%': ['Promise', 'prototype'], 385 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 386 '%Promise_all%': ['Promise', 'all'], 387 '%Promise_reject%': ['Promise', 'reject'], 388 '%Promise_resolve%': ['Promise', 'resolve'], 389 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 390 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 391 '%RegExpPrototype%': ['RegExp', 'prototype'], 392 '%SetPrototype%': ['Set', 'prototype'], 393 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 394 '%StringPrototype%': ['String', 'prototype'], 395 '%SymbolPrototype%': ['Symbol', 'prototype'], 396 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 397 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 398 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 399 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 400 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 401 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 402 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 403 '%URIErrorPrototype%': ['URIError', 'prototype'], 404 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 405 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 406 }; 407 408 var bind = __webpack_require__(1930); 409 var hasOwn = __webpack_require__(9284); 410 var $concat = bind.call(Function.call, Array.prototype.concat); 411 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 412 var $replace = bind.call(Function.call, String.prototype.replace); 413 var $strSlice = bind.call(Function.call, String.prototype.slice); 414 415 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 416 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 417 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 418 var stringToPath = function stringToPath(string) { 419 var first = $strSlice(string, 0, 1); 420 var last = $strSlice(string, -1); 421 if (first === '%' && last !== '%') { 422 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 423 } else if (last === '%' && first !== '%') { 424 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 425 } 426 var result = []; 427 $replace(string, rePropName, function (match, number, quote, subString) { 428 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 429 }); 430 return result; 431 }; 432 /* end adaptation */ 433 434 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 435 var intrinsicName = name; 436 var alias; 437 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 438 alias = LEGACY_ALIASES[intrinsicName]; 439 intrinsicName = '%' + alias[0] + '%'; 440 } 441 442 if (hasOwn(INTRINSICS, intrinsicName)) { 443 var value = INTRINSICS[intrinsicName]; 444 if (value === needsEval) { 445 value = doEval(intrinsicName); 446 } 447 if (typeof value === 'undefined' && !allowMissing) { 448 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 449 } 450 451 return { 452 alias: alias, 453 name: intrinsicName, 454 value: value 455 }; 456 } 457 458 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 459 }; 460 461 module.exports = function GetIntrinsic(name, allowMissing) { 462 if (typeof name !== 'string' || name.length === 0) { 463 throw new $TypeError('intrinsic name must be a non-empty string'); 464 } 465 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 466 throw new $TypeError('"allowMissing" argument must be a boolean'); 467 } 468 469 var parts = stringToPath(name); 470 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 471 472 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 473 var intrinsicRealName = intrinsic.name; 474 var value = intrinsic.value; 475 var skipFurtherCaching = false; 476 477 var alias = intrinsic.alias; 478 if (alias) { 479 intrinsicBaseName = alias[0]; 480 $spliceApply(parts, $concat([0, 1], alias)); 481 } 482 483 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 484 var part = parts[i]; 485 var first = $strSlice(part, 0, 1); 486 var last = $strSlice(part, -1); 487 if ( 488 ( 489 (first === '"' || first === "'" || first === '`') 490 || (last === '"' || last === "'" || last === '`') 491 ) 492 && first !== last 493 ) { 494 throw new $SyntaxError('property names with quotes must have matching quotes'); 495 } 496 if (part === 'constructor' || !isOwn) { 497 skipFurtherCaching = true; 498 } 499 500 intrinsicBaseName += '.' + part; 501 intrinsicRealName = '%' + intrinsicBaseName + '%'; 502 503 if (hasOwn(INTRINSICS, intrinsicRealName)) { 504 value = INTRINSICS[intrinsicRealName]; 505 } else if (value != null) { 506 if (!(part in value)) { 507 if (!allowMissing) { 508 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 509 } 510 return void undefined; 511 } 512 if ($gOPD && (i + 1) >= parts.length) { 513 var desc = $gOPD(value, part); 514 isOwn = !!desc; 515 516 // By convention, when a data property is converted to an accessor 517 // property to emulate a data property that does not suffer from 518 // the override mistake, that accessor's getter is marked with 519 // an `originalValue` property. Here, when we detect this, we 520 // uphold the illusion by pretending to see that original data 521 // property, i.e., returning the value rather than the getter 522 // itself. 523 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 524 value = desc.get; 525 } else { 526 value = value[part]; 527 } 528 } else { 529 isOwn = hasOwn(value, part); 530 value = value[part]; 531 } 532 533 if (isOwn && !skipFurtherCaching) { 534 INTRINSICS[intrinsicRealName] = value; 535 } 536 } 537 } 538 return value; 539 }; 540 541 542 /***/ }), 543 544 /***/ 9828: 545 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 546 547 "use strict"; 548 549 550 var origSymbol = typeof Symbol !== 'undefined' && Symbol; 551 var hasSymbolSham = __webpack_require__(5960); 552 553 module.exports = function hasNativeSymbols() { 554 if (typeof origSymbol !== 'function') { return false; } 555 if (typeof Symbol !== 'function') { return false; } 556 if (typeof origSymbol('foo') !== 'symbol') { return false; } 557 if (typeof Symbol('bar') !== 'symbol') { return false; } 558 559 return hasSymbolSham(); 560 }; 561 562 563 /***/ }), 564 565 /***/ 5960: 566 /***/ (function(module) { 567 568 "use strict"; 569 570 571 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 572 module.exports = function hasSymbols() { 573 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 574 if (typeof Symbol.iterator === 'symbol') { return true; } 575 576 var obj = {}; 577 var sym = Symbol('test'); 578 var symObj = Object(sym); 579 if (typeof sym === 'string') { return false; } 580 581 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 582 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 583 584 // temp disabled per https://github.com/ljharb/object.assign/issues/17 585 // if (sym instanceof Symbol) { return false; } 586 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 587 // if (!(symObj instanceof Symbol)) { return false; } 588 589 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 590 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 591 592 var symVal = 42; 593 obj[sym] = symVal; 594 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 595 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 596 597 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 598 599 var syms = Object.getOwnPropertySymbols(obj); 600 if (syms.length !== 1 || syms[0] !== sym) { return false; } 601 602 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 603 604 if (typeof Object.getOwnPropertyDescriptor === 'function') { 605 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 606 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 607 } 608 609 return true; 610 }; 611 612 613 /***/ }), 614 615 /***/ 4363: 616 /***/ (function(module) { 617 618 "use strict"; 619 620 621 var fnToStr = Function.prototype.toString; 622 var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; 623 var badArrayLike; 624 var isCallableMarker; 625 if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { 626 try { 627 badArrayLike = Object.defineProperty({}, 'length', { 628 get: function () { 629 throw isCallableMarker; 630 } 631 }); 632 isCallableMarker = {}; 633 // eslint-disable-next-line no-throw-literal 634 reflectApply(function () { throw 42; }, null, badArrayLike); 635 } catch (_) { 636 if (_ !== isCallableMarker) { 637 reflectApply = null; 638 } 639 } 640 } else { 641 reflectApply = null; 642 } 643 644 var constructorRegex = /^\s*class\b/; 645 var isES6ClassFn = function isES6ClassFunction(value) { 646 try { 647 var fnStr = fnToStr.call(value); 648 return constructorRegex.test(fnStr); 649 } catch (e) { 650 return false; // not a function 651 } 652 }; 653 654 var tryFunctionObject = function tryFunctionToStr(value) { 655 try { 656 if (isES6ClassFn(value)) { return false; } 657 fnToStr.call(value); 658 return true; 659 } catch (e) { 660 return false; 661 } 662 }; 663 var toStr = Object.prototype.toString; 664 var fnClass = '[object Function]'; 665 var genClass = '[object GeneratorFunction]'; 666 var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` 667 /* globals document: false */ 668 var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {}; 669 670 module.exports = reflectApply 671 ? function isCallable(value) { 672 if (value === documentDotAll) { return true; } 673 if (!value) { return false; } 674 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 675 if (typeof value === 'function' && !value.prototype) { return true; } 676 try { 677 reflectApply(value, null, badArrayLike); 678 } catch (e) { 679 if (e !== isCallableMarker) { return false; } 680 } 681 return !isES6ClassFn(value); 682 } 683 : function isCallable(value) { 684 if (value === documentDotAll) { return true; } 685 if (!value) { return false; } 686 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 687 if (typeof value === 'function' && !value.prototype) { return true; } 688 if (hasToStringTag) { return tryFunctionObject(value); } 689 if (isES6ClassFn(value)) { return false; } 690 var strClass = toStr.call(value); 691 return strClass === fnClass || strClass === genClass; 692 }; 693 694 695 /***/ }), 696 697 /***/ 4221: 698 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 699 700 "use strict"; 701 702 703 var callBound = __webpack_require__(9630); 704 var hasToStringTag = __webpack_require__(4111)(); 705 var has; 706 var $exec; 707 var isRegexMarker; 708 var badStringifier; 709 710 if (hasToStringTag) { 711 has = callBound('Object.prototype.hasOwnProperty'); 712 $exec = callBound('RegExp.prototype.exec'); 713 isRegexMarker = {}; 714 715 var throwRegexMarker = function () { 716 throw isRegexMarker; 717 }; 718 badStringifier = { 719 toString: throwRegexMarker, 720 valueOf: throwRegexMarker 721 }; 722 723 if (typeof Symbol.toPrimitive === 'symbol') { 724 badStringifier[Symbol.toPrimitive] = throwRegexMarker; 725 } 726 } 727 728 var $toString = callBound('Object.prototype.toString'); 729 var gOPD = Object.getOwnPropertyDescriptor; 730 var regexClass = '[object RegExp]'; 731 732 module.exports = hasToStringTag 733 // eslint-disable-next-line consistent-return 734 ? function isRegex(value) { 735 if (!value || typeof value !== 'object') { 736 return false; 737 } 738 739 var descriptor = gOPD(value, 'lastIndex'); 740 var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); 741 if (!hasLastIndexDataProperty) { 742 return false; 743 } 744 745 try { 746 $exec(value, badStringifier); 747 } catch (e) { 748 return e === isRegexMarker; 749 } 750 } 751 : function isRegex(value) { 752 // In older browsers, typeof regex incorrectly returns 'function' 753 if (!value || (typeof value !== 'object' && typeof value !== 'function')) { 754 return false; 755 } 756 757 return $toString(value) === regexClass; 758 }; 759 760 761 /***/ }), 762 763 /***/ 3205: 764 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 765 766 var hasMap = typeof Map === 'function' && Map.prototype; 767 var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 768 var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 769 var mapForEach = hasMap && Map.prototype.forEach; 770 var hasSet = typeof Set === 'function' && Set.prototype; 771 var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 772 var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 773 var setForEach = hasSet && Set.prototype.forEach; 774 var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 775 var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 776 var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 777 var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 778 var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 779 var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 780 var booleanValueOf = Boolean.prototype.valueOf; 781 var objectToString = Object.prototype.toString; 782 var functionToString = Function.prototype.toString; 783 var $match = String.prototype.match; 784 var $slice = String.prototype.slice; 785 var $replace = String.prototype.replace; 786 var $toUpperCase = String.prototype.toUpperCase; 787 var $toLowerCase = String.prototype.toLowerCase; 788 var $test = RegExp.prototype.test; 789 var $concat = Array.prototype.concat; 790 var $join = Array.prototype.join; 791 var $arrSlice = Array.prototype.slice; 792 var $floor = Math.floor; 793 var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 794 var gOPS = Object.getOwnPropertySymbols; 795 var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 796 var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 797 // ie, `has-tostringtag/shams 798 var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') 799 ? Symbol.toStringTag 800 : null; 801 var isEnumerable = Object.prototype.propertyIsEnumerable; 802 803 var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 804 [].__proto__ === Array.prototype // eslint-disable-line no-proto 805 ? function (O) { 806 return O.__proto__; // eslint-disable-line no-proto 807 } 808 : null 809 ); 810 811 function addNumericSeparator(num, str) { 812 if ( 813 num === Infinity 814 || num === -Infinity 815 || num !== num 816 || (num && num > -1000 && num < 1000) 817 || $test.call(/e/, str) 818 ) { 819 return str; 820 } 821 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 822 if (typeof num === 'number') { 823 var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) 824 if (int !== num) { 825 var intStr = String(int); 826 var dec = $slice.call(str, intStr.length + 1); 827 return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); 828 } 829 } 830 return $replace.call(str, sepRegex, '$&_'); 831 } 832 833 var inspectCustom = (__webpack_require__(4080).custom); 834 var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; 835 836 module.exports = function inspect_(obj, options, depth, seen) { 837 var opts = options || {}; 838 839 if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { 840 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 841 } 842 if ( 843 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 844 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 845 : opts.maxStringLength !== null 846 ) 847 ) { 848 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 849 } 850 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 851 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 852 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 853 } 854 855 if ( 856 has(opts, 'indent') 857 && opts.indent !== null 858 && opts.indent !== '\t' 859 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 860 ) { 861 throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); 862 } 863 if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { 864 throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); 865 } 866 var numericSeparator = opts.numericSeparator; 867 868 if (typeof obj === 'undefined') { 869 return 'undefined'; 870 } 871 if (obj === null) { 872 return 'null'; 873 } 874 if (typeof obj === 'boolean') { 875 return obj ? 'true' : 'false'; 876 } 877 878 if (typeof obj === 'string') { 879 return inspectString(obj, opts); 880 } 881 if (typeof obj === 'number') { 882 if (obj === 0) { 883 return Infinity / obj > 0 ? '0' : '-0'; 884 } 885 var str = String(obj); 886 return numericSeparator ? addNumericSeparator(obj, str) : str; 887 } 888 if (typeof obj === 'bigint') { 889 var bigIntStr = String(obj) + 'n'; 890 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 891 } 892 893 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 894 if (typeof depth === 'undefined') { depth = 0; } 895 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 896 return isArray(obj) ? '[Array]' : '[Object]'; 897 } 898 899 var indent = getIndent(opts, depth); 900 901 if (typeof seen === 'undefined') { 902 seen = []; 903 } else if (indexOf(seen, obj) >= 0) { 904 return '[Circular]'; 905 } 906 907 function inspect(value, from, noIndent) { 908 if (from) { 909 seen = $arrSlice.call(seen); 910 seen.push(from); 911 } 912 if (noIndent) { 913 var newOpts = { 914 depth: opts.depth 915 }; 916 if (has(opts, 'quoteStyle')) { 917 newOpts.quoteStyle = opts.quoteStyle; 918 } 919 return inspect_(value, newOpts, depth + 1, seen); 920 } 921 return inspect_(value, opts, depth + 1, seen); 922 } 923 924 if (typeof obj === 'function') { 925 var name = nameOf(obj); 926 var keys = arrObjKeys(obj, inspect); 927 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); 928 } 929 if (isSymbol(obj)) { 930 var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 931 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 932 } 933 if (isElement(obj)) { 934 var s = '<' + $toLowerCase.call(String(obj.nodeName)); 935 var attrs = obj.attributes || []; 936 for (var i = 0; i < attrs.length; i++) { 937 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 938 } 939 s += '>'; 940 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 941 s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; 942 return s; 943 } 944 if (isArray(obj)) { 945 if (obj.length === 0) { return '[]'; } 946 var xs = arrObjKeys(obj, inspect); 947 if (indent && !singleLineValues(xs)) { 948 return '[' + indentedJoin(xs, indent) + ']'; 949 } 950 return '[ ' + $join.call(xs, ', ') + ' ]'; 951 } 952 if (isError(obj)) { 953 var parts = arrObjKeys(obj, inspect); 954 if ('cause' in obj && !isEnumerable.call(obj, 'cause')) { 955 return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; 956 } 957 if (parts.length === 0) { return '[' + String(obj) + ']'; } 958 return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; 959 } 960 if (typeof obj === 'object' && customInspect) { 961 if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { 962 return obj[inspectSymbol](); 963 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 964 return obj.inspect(); 965 } 966 } 967 if (isMap(obj)) { 968 var mapParts = []; 969 mapForEach.call(obj, function (value, key) { 970 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 971 }); 972 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 973 } 974 if (isSet(obj)) { 975 var setParts = []; 976 setForEach.call(obj, function (value) { 977 setParts.push(inspect(value, obj)); 978 }); 979 return collectionOf('Set', setSize.call(obj), setParts, indent); 980 } 981 if (isWeakMap(obj)) { 982 return weakCollectionOf('WeakMap'); 983 } 984 if (isWeakSet(obj)) { 985 return weakCollectionOf('WeakSet'); 986 } 987 if (isWeakRef(obj)) { 988 return weakCollectionOf('WeakRef'); 989 } 990 if (isNumber(obj)) { 991 return markBoxed(inspect(Number(obj))); 992 } 993 if (isBigInt(obj)) { 994 return markBoxed(inspect(bigIntValueOf.call(obj))); 995 } 996 if (isBoolean(obj)) { 997 return markBoxed(booleanValueOf.call(obj)); 998 } 999 if (isString(obj)) { 1000 return markBoxed(inspect(String(obj))); 1001 } 1002 if (!isDate(obj) && !isRegExp(obj)) { 1003 var ys = arrObjKeys(obj, inspect); 1004 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 1005 var protoTag = obj instanceof Object ? '' : 'null prototype'; 1006 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; 1007 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 1008 var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); 1009 if (ys.length === 0) { return tag + '{}'; } 1010 if (indent) { 1011 return tag + '{' + indentedJoin(ys, indent) + '}'; 1012 } 1013 return tag + '{ ' + $join.call(ys, ', ') + ' }'; 1014 } 1015 return String(obj); 1016 }; 1017 1018 function wrapQuotes(s, defaultStyle, opts) { 1019 var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; 1020 return quoteChar + s + quoteChar; 1021 } 1022 1023 function quote(s) { 1024 return $replace.call(String(s), /"/g, '"'); 1025 } 1026 1027 function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1028 function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1029 function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1030 function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1031 function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1032 function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1033 function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } 1034 1035 // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 1036 function isSymbol(obj) { 1037 if (hasShammedSymbols) { 1038 return obj && typeof obj === 'object' && obj instanceof Symbol; 1039 } 1040 if (typeof obj === 'symbol') { 1041 return true; 1042 } 1043 if (!obj || typeof obj !== 'object' || !symToString) { 1044 return false; 1045 } 1046 try { 1047 symToString.call(obj); 1048 return true; 1049 } catch (e) {} 1050 return false; 1051 } 1052 1053 function isBigInt(obj) { 1054 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 1055 return false; 1056 } 1057 try { 1058 bigIntValueOf.call(obj); 1059 return true; 1060 } catch (e) {} 1061 return false; 1062 } 1063 1064 var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 1065 function has(obj, key) { 1066 return hasOwn.call(obj, key); 1067 } 1068 1069 function toStr(obj) { 1070 return objectToString.call(obj); 1071 } 1072 1073 function nameOf(f) { 1074 if (f.name) { return f.name; } 1075 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 1076 if (m) { return m[1]; } 1077 return null; 1078 } 1079 1080 function indexOf(xs, x) { 1081 if (xs.indexOf) { return xs.indexOf(x); } 1082 for (var i = 0, l = xs.length; i < l; i++) { 1083 if (xs[i] === x) { return i; } 1084 } 1085 return -1; 1086 } 1087 1088 function isMap(x) { 1089 if (!mapSize || !x || typeof x !== 'object') { 1090 return false; 1091 } 1092 try { 1093 mapSize.call(x); 1094 try { 1095 setSize.call(x); 1096 } catch (s) { 1097 return true; 1098 } 1099 return x instanceof Map; // core-js workaround, pre-v2.5.0 1100 } catch (e) {} 1101 return false; 1102 } 1103 1104 function isWeakMap(x) { 1105 if (!weakMapHas || !x || typeof x !== 'object') { 1106 return false; 1107 } 1108 try { 1109 weakMapHas.call(x, weakMapHas); 1110 try { 1111 weakSetHas.call(x, weakSetHas); 1112 } catch (s) { 1113 return true; 1114 } 1115 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 1116 } catch (e) {} 1117 return false; 1118 } 1119 1120 function isWeakRef(x) { 1121 if (!weakRefDeref || !x || typeof x !== 'object') { 1122 return false; 1123 } 1124 try { 1125 weakRefDeref.call(x); 1126 return true; 1127 } catch (e) {} 1128 return false; 1129 } 1130 1131 function isSet(x) { 1132 if (!setSize || !x || typeof x !== 'object') { 1133 return false; 1134 } 1135 try { 1136 setSize.call(x); 1137 try { 1138 mapSize.call(x); 1139 } catch (m) { 1140 return true; 1141 } 1142 return x instanceof Set; // core-js workaround, pre-v2.5.0 1143 } catch (e) {} 1144 return false; 1145 } 1146 1147 function isWeakSet(x) { 1148 if (!weakSetHas || !x || typeof x !== 'object') { 1149 return false; 1150 } 1151 try { 1152 weakSetHas.call(x, weakSetHas); 1153 try { 1154 weakMapHas.call(x, weakMapHas); 1155 } catch (s) { 1156 return true; 1157 } 1158 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 1159 } catch (e) {} 1160 return false; 1161 } 1162 1163 function isElement(x) { 1164 if (!x || typeof x !== 'object') { return false; } 1165 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 1166 return true; 1167 } 1168 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 1169 } 1170 1171 function inspectString(str, opts) { 1172 if (str.length > opts.maxStringLength) { 1173 var remaining = str.length - opts.maxStringLength; 1174 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 1175 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 1176 } 1177 // eslint-disable-next-line no-control-regex 1178 var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); 1179 return wrapQuotes(s, 'single', opts); 1180 } 1181 1182 function lowbyte(c) { 1183 var n = c.charCodeAt(0); 1184 var x = { 1185 8: 'b', 1186 9: 't', 1187 10: 'n', 1188 12: 'f', 1189 13: 'r' 1190 }[n]; 1191 if (x) { return '\\' + x; } 1192 return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); 1193 } 1194 1195 function markBoxed(str) { 1196 return 'Object(' + str + ')'; 1197 } 1198 1199 function weakCollectionOf(type) { 1200 return type + ' { ? }'; 1201 } 1202 1203 function collectionOf(type, size, entries, indent) { 1204 var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); 1205 return type + ' (' + size + ') {' + joinedEntries + '}'; 1206 } 1207 1208 function singleLineValues(xs) { 1209 for (var i = 0; i < xs.length; i++) { 1210 if (indexOf(xs[i], '\n') >= 0) { 1211 return false; 1212 } 1213 } 1214 return true; 1215 } 1216 1217 function getIndent(opts, depth) { 1218 var baseIndent; 1219 if (opts.indent === '\t') { 1220 baseIndent = '\t'; 1221 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 1222 baseIndent = $join.call(Array(opts.indent + 1), ' '); 1223 } else { 1224 return null; 1225 } 1226 return { 1227 base: baseIndent, 1228 prev: $join.call(Array(depth + 1), baseIndent) 1229 }; 1230 } 1231 1232 function indentedJoin(xs, indent) { 1233 if (xs.length === 0) { return ''; } 1234 var lineJoiner = '\n' + indent.prev + indent.base; 1235 return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; 1236 } 1237 1238 function arrObjKeys(obj, inspect) { 1239 var isArr = isArray(obj); 1240 var xs = []; 1241 if (isArr) { 1242 xs.length = obj.length; 1243 for (var i = 0; i < obj.length; i++) { 1244 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 1245 } 1246 } 1247 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 1248 var symMap; 1249 if (hasShammedSymbols) { 1250 symMap = {}; 1251 for (var k = 0; k < syms.length; k++) { 1252 symMap['$' + syms[k]] = syms[k]; 1253 } 1254 } 1255 1256 for (var key in obj) { // eslint-disable-line no-restricted-syntax 1257 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 1258 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 1259 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 1260 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 1261 continue; // eslint-disable-line no-restricted-syntax, no-continue 1262 } else if ($test.call(/[^\w$]/, key)) { 1263 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 1264 } else { 1265 xs.push(key + ': ' + inspect(obj[key], obj)); 1266 } 1267 } 1268 if (typeof gOPS === 'function') { 1269 for (var j = 0; j < syms.length; j++) { 1270 if (isEnumerable.call(obj, syms[j])) { 1271 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 1272 } 1273 } 1274 } 1275 return xs; 1276 } 1277 1278 1279 /***/ }), 1280 1281 /***/ 616: 1282 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1283 1284 "use strict"; 1285 1286 1287 var implementation = __webpack_require__(4485); 1288 1289 module.exports = function getPolyfill() { 1290 return Array.prototype.flat || implementation; 1291 }; 1292 1293 1294 /***/ }), 1295 1296 /***/ 2059: 1297 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1298 1299 "use strict"; 1300 1301 1302 var define = __webpack_require__(9170); 1303 var shimUnscopables = __webpack_require__(2505); 1304 1305 var getPolyfill = __webpack_require__(616); 1306 1307 module.exports = function shimFlat() { 1308 var polyfill = getPolyfill(); 1309 1310 define( 1311 Array.prototype, 1312 { flat: polyfill }, 1313 { flat: function () { return Array.prototype.flat !== polyfill; } } 1314 ); 1315 1316 shimUnscopables('flat'); 1317 1318 return polyfill; 1319 }; 1320 1321 1322 /***/ }), 1323 1324 /***/ 7615: 1325 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1326 1327 "use strict"; 1328 1329 1330 var GetIntrinsic = __webpack_require__(1801); 1331 1332 var callBind = __webpack_require__(2550); 1333 1334 var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 1335 1336 module.exports = function callBoundIntrinsic(name, allowMissing) { 1337 var intrinsic = GetIntrinsic(name, !!allowMissing); 1338 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 1339 return callBind(intrinsic); 1340 } 1341 return intrinsic; 1342 }; 1343 1344 1345 /***/ }), 1346 1347 /***/ 2550: 1348 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1349 1350 "use strict"; 1351 1352 1353 var bind = __webpack_require__(1930); 1354 var GetIntrinsic = __webpack_require__(1801); 1355 1356 var $apply = GetIntrinsic('%Function.prototype.apply%'); 1357 var $call = GetIntrinsic('%Function.prototype.call%'); 1358 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 1359 1360 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 1361 1362 if ($defineProperty) { 1363 try { 1364 $defineProperty({}, 'a', { value: 1 }); 1365 } catch (e) { 1366 // IE 8 has a broken defineProperty 1367 $defineProperty = null; 1368 } 1369 } 1370 1371 module.exports = function callBind() { 1372 return $reflectApply(bind, $call, arguments); 1373 }; 1374 1375 var applyBind = function applyBind() { 1376 return $reflectApply(bind, $apply, arguments); 1377 }; 1378 1379 if ($defineProperty) { 1380 $defineProperty(module.exports, 'apply', { value: applyBind }); 1381 } else { 1382 module.exports.apply = applyBind; 1383 } 1384 1385 1386 /***/ }), 1387 1388 /***/ 4403: 1389 /***/ (function(module, exports) { 1390 1391 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1392 Copyright (c) 2018 Jed Watson. 1393 Licensed under the MIT License (MIT), see 1394 http://jedwatson.github.io/classnames 1395 */ 1396 /* global define */ 1397 1398 (function () { 1399 'use strict'; 1400 1401 var hasOwn = {}.hasOwnProperty; 1402 1403 function classNames() { 1404 var classes = []; 1405 1406 for (var i = 0; i < arguments.length; i++) { 1407 var arg = arguments[i]; 1408 if (!arg) continue; 1409 1410 var argType = typeof arg; 1411 1412 if (argType === 'string' || argType === 'number') { 1413 classes.push(arg); 1414 } else if (Array.isArray(arg)) { 1415 if (arg.length) { 1416 var inner = classNames.apply(null, arg); 1417 if (inner) { 1418 classes.push(inner); 1419 } 1420 } 1421 } else if (argType === 'object') { 1422 if (arg.toString === Object.prototype.toString) { 1423 for (var key in arg) { 1424 if (hasOwn.call(arg, key) && arg[key]) { 1425 classes.push(key); 1426 } 1427 } 1428 } else { 1429 classes.push(arg.toString()); 1430 } 1431 } 1432 } 1433 1434 return classes.join(' '); 1435 } 1436 1437 if ( true && module.exports) { 1438 classNames.default = classNames; 1439 module.exports = classNames; 1440 } else if (true) { 1441 // register as 'classnames', consistent with npm package name 1442 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 1443 return classNames; 1444 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 1445 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1446 } else {} 1447 }()); 1448 1449 1450 /***/ }), 1451 1452 /***/ 8495: 1453 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 1454 1455 "use strict"; 1456 __webpack_require__.r(__webpack_exports__); 1457 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1458 /* harmony export */ "addEventListener": function() { return /* binding */ addEventListener; } 1459 /* harmony export */ }); 1460 var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); 1461 1462 // Adapted from Modernizr 1463 // https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37 1464 function testPassiveEventListeners() { 1465 if (!CAN_USE_DOM) { 1466 return false; 1467 } 1468 1469 if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) { 1470 return false; 1471 } 1472 1473 var supportsPassiveOption = false; 1474 try { 1475 var opts = Object.defineProperty({}, 'passive', { 1476 // eslint-disable-next-line getter-return 1477 get: function () { 1478 function get() { 1479 supportsPassiveOption = true; 1480 } 1481 1482 return get; 1483 }() 1484 }); 1485 var noop = function noop() {}; 1486 window.addEventListener('testPassiveEventSupport', noop, opts); 1487 window.removeEventListener('testPassiveEventSupport', noop, opts); 1488 } catch (e) { 1489 // do nothing 1490 } 1491 1492 return supportsPassiveOption; 1493 } 1494 1495 var memoized = void 0; 1496 1497 function canUsePassiveEventListeners() { 1498 if (memoized === undefined) { 1499 memoized = testPassiveEventListeners(); 1500 } 1501 return memoized; 1502 } 1503 1504 function normalizeEventOptions(eventOptions) { 1505 if (!eventOptions) { 1506 return undefined; 1507 } 1508 1509 if (!canUsePassiveEventListeners()) { 1510 // If the browser does not support the passive option, then it is expecting 1511 // a boolean for the options argument to specify whether it should use 1512 // capture or not. In more modern browsers, this is passed via the `capture` 1513 // option, so let's just hoist that value up. 1514 return !!eventOptions.capture; 1515 } 1516 1517 return eventOptions; 1518 } 1519 1520 /* eslint-disable no-bitwise */ 1521 1522 /** 1523 * Generate a unique key for any set of event options 1524 */ 1525 function eventOptionsKey(normalizedEventOptions) { 1526 if (!normalizedEventOptions) { 1527 return 0; 1528 } 1529 1530 // If the browser does not support passive event listeners, the normalized 1531 // event options will be a boolean. 1532 if (normalizedEventOptions === true) { 1533 return 100; 1534 } 1535 1536 // At this point, the browser supports passive event listeners, so we expect 1537 // the event options to be an object with possible properties of capture, 1538 // passive, and once. 1539 // 1540 // We want to consistently return the same value, regardless of the order of 1541 // these properties, so let's use binary maths to assign each property to a 1542 // bit, and then add those together (with an offset to account for the 1543 // booleans at the beginning of this function). 1544 var capture = normalizedEventOptions.capture << 0; 1545 var passive = normalizedEventOptions.passive << 1; 1546 var once = normalizedEventOptions.once << 2; 1547 return capture + passive + once; 1548 } 1549 1550 function ensureCanMutateNextEventHandlers(eventHandlers) { 1551 if (eventHandlers.handlers === eventHandlers.nextHandlers) { 1552 // eslint-disable-next-line no-param-reassign 1553 eventHandlers.nextHandlers = eventHandlers.handlers.slice(); 1554 } 1555 } 1556 1557 function TargetEventHandlers(target) { 1558 this.target = target; 1559 this.events = {}; 1560 } 1561 1562 TargetEventHandlers.prototype.getEventHandlers = function () { 1563 function getEventHandlers(eventName, options) { 1564 var key = String(eventName) + ' ' + String(eventOptionsKey(options)); 1565 1566 if (!this.events[key]) { 1567 this.events[key] = { 1568 handlers: [], 1569 handleEvent: undefined 1570 }; 1571 this.events[key].nextHandlers = this.events[key].handlers; 1572 } 1573 1574 return this.events[key]; 1575 } 1576 1577 return getEventHandlers; 1578 }(); 1579 1580 TargetEventHandlers.prototype.handleEvent = function () { 1581 function handleEvent(eventName, options, event) { 1582 var eventHandlers = this.getEventHandlers(eventName, options); 1583 eventHandlers.handlers = eventHandlers.nextHandlers; 1584 eventHandlers.handlers.forEach(function (handler) { 1585 if (handler) { 1586 // We need to check for presence here because a handler function may 1587 // cause later handlers to get removed. This can happen if you for 1588 // instance have a waypoint that unmounts another waypoint as part of an 1589 // onEnter/onLeave handler. 1590 handler(event); 1591 } 1592 }); 1593 } 1594 1595 return handleEvent; 1596 }(); 1597 1598 TargetEventHandlers.prototype.add = function () { 1599 function add(eventName, listener, options) { 1600 var _this = this; 1601 1602 // options has already been normalized at this point. 1603 var eventHandlers = this.getEventHandlers(eventName, options); 1604 1605 ensureCanMutateNextEventHandlers(eventHandlers); 1606 1607 if (eventHandlers.nextHandlers.length === 0) { 1608 eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options); 1609 1610 this.target.addEventListener(eventName, eventHandlers.handleEvent, options); 1611 } 1612 1613 eventHandlers.nextHandlers.push(listener); 1614 1615 var isSubscribed = true; 1616 var unsubscribe = function () { 1617 function unsubscribe() { 1618 if (!isSubscribed) { 1619 return; 1620 } 1621 1622 isSubscribed = false; 1623 1624 ensureCanMutateNextEventHandlers(eventHandlers); 1625 var index = eventHandlers.nextHandlers.indexOf(listener); 1626 eventHandlers.nextHandlers.splice(index, 1); 1627 1628 if (eventHandlers.nextHandlers.length === 0) { 1629 // All event handlers have been removed, so we want to remove the event 1630 // listener from the target node. 1631 1632 if (_this.target) { 1633 // There can be a race condition where the target may no longer exist 1634 // when this function is called, e.g. when a React component is 1635 // unmounting. Guarding against this prevents the following error: 1636 // 1637 // Cannot read property 'removeEventListener' of undefined 1638 _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options); 1639 } 1640 1641 eventHandlers.handleEvent = undefined; 1642 } 1643 } 1644 1645 return unsubscribe; 1646 }(); 1647 return unsubscribe; 1648 } 1649 1650 return add; 1651 }(); 1652 1653 var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__'; 1654 1655 // eslint-disable-next-line import/prefer-default-export 1656 function addEventListener(target, eventName, listener, options) { 1657 if (!target[EVENT_HANDLERS_KEY]) { 1658 // eslint-disable-next-line no-param-reassign 1659 target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target); 1660 } 1661 var normalizedEventOptions = normalizeEventOptions(options); 1662 return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions); 1663 } 1664 1665 1666 1667 1668 /***/ }), 1669 1670 /***/ 9170: 1671 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1672 1673 "use strict"; 1674 1675 1676 var keys = __webpack_require__(806); 1677 var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; 1678 1679 var toStr = Object.prototype.toString; 1680 var concat = Array.prototype.concat; 1681 var origDefineProperty = Object.defineProperty; 1682 1683 var isFunction = function (fn) { 1684 return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; 1685 }; 1686 1687 var arePropertyDescriptorsSupported = function () { 1688 var obj = {}; 1689 try { 1690 origDefineProperty(obj, 'x', { enumerable: false, value: obj }); 1691 // eslint-disable-next-line no-unused-vars, no-restricted-syntax 1692 for (var _ in obj) { // jscs:ignore disallowUnusedVariables 1693 return false; 1694 } 1695 return obj.x === obj; 1696 } catch (e) { /* this is IE 8. */ 1697 return false; 1698 } 1699 }; 1700 var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); 1701 1702 var defineProperty = function (object, name, value, predicate) { 1703 if (name in object && (!isFunction(predicate) || !predicate())) { 1704 return; 1705 } 1706 if (supportsDescriptors) { 1707 origDefineProperty(object, name, { 1708 configurable: true, 1709 enumerable: false, 1710 value: value, 1711 writable: true 1712 }); 1713 } else { 1714 object[name] = value; 1715 } 1716 }; 1717 1718 var defineProperties = function (object, map) { 1719 var predicates = arguments.length > 2 ? arguments[2] : {}; 1720 var props = keys(map); 1721 if (hasSymbols) { 1722 props = concat.call(props, Object.getOwnPropertySymbols(map)); 1723 } 1724 for (var i = 0; i < props.length; i += 1) { 1725 defineProperty(object, props[i], map[props[i]], predicates[props[i]]); 1726 } 1727 }; 1728 1729 defineProperties.supportsDescriptors = !!supportsDescriptors; 1730 1731 module.exports = defineProperties; 1732 1733 1734 /***/ }), 1735 1736 /***/ 8110: 1737 /***/ (function(module) { 1738 1739 "use strict"; 1740 1741 1742 module.exports = function contains(other) { 1743 if (arguments.length < 1) { 1744 throw new TypeError('1 argument is required'); 1745 } 1746 if (typeof other !== 'object') { 1747 throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node'); 1748 } 1749 1750 var node = other; 1751 do { 1752 if (this === node) { 1753 return true; 1754 } 1755 if (node) { 1756 node = node.parentNode; 1757 } 1758 } while (node); 1759 1760 return false; 1761 }; 1762 1763 1764 /***/ }), 1765 1766 /***/ 6789: 1767 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1768 1769 "use strict"; 1770 1771 1772 var define = __webpack_require__(9170); 1773 1774 var implementation = __webpack_require__(8110); 1775 var getPolyfill = __webpack_require__(8267); 1776 var polyfill = getPolyfill(); 1777 var shim = __webpack_require__(714); 1778 1779 var boundContains = function contains(node, other) { 1780 return polyfill.apply(node, [other]); 1781 }; 1782 1783 define(boundContains, { 1784 getPolyfill: getPolyfill, 1785 implementation: implementation, 1786 shim: shim 1787 }); 1788 1789 module.exports = boundContains; 1790 1791 1792 /***/ }), 1793 1794 /***/ 8267: 1795 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1796 1797 "use strict"; 1798 1799 1800 var implementation = __webpack_require__(8110); 1801 1802 module.exports = function getPolyfill() { 1803 if (typeof document !== 'undefined') { 1804 if (document.contains) { 1805 return document.contains; 1806 } 1807 if (document.body && document.body.contains) { 1808 try { 1809 if (typeof document.body.contains.call(document, '') === 'boolean') { 1810 return document.body.contains; 1811 } 1812 } catch (e) { /**/ } 1813 } 1814 } 1815 return implementation; 1816 }; 1817 1818 1819 /***/ }), 1820 1821 /***/ 714: 1822 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1823 1824 "use strict"; 1825 1826 1827 var define = __webpack_require__(9170); 1828 var getPolyfill = __webpack_require__(8267); 1829 1830 module.exports = function shimContains() { 1831 var polyfill = getPolyfill(); 1832 if (typeof document !== 'undefined') { 1833 define( 1834 document, 1835 { contains: polyfill }, 1836 { contains: function () { return document.contains !== polyfill; } } 1837 ); 1838 if (typeof Element !== 'undefined') { 1839 define( 1840 Element.prototype, 1841 { contains: polyfill }, 1842 { contains: function () { return Element.prototype.contains !== polyfill; } } 1843 ); 1844 } 1845 } 1846 return polyfill; 1847 }; 1848 1849 1850 /***/ }), 1851 1852 /***/ 1345: 1853 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1854 1855 "use strict"; 1856 1857 1858 var util = __webpack_require__(5022); 1859 1860 function scrollIntoView(elem, container, config) { 1861 config = config || {}; 1862 // document 归一化到 window 1863 if (container.nodeType === 9) { 1864 container = util.getWindow(container); 1865 } 1866 1867 var allowHorizontalScroll = config.allowHorizontalScroll; 1868 var onlyScrollIfNeeded = config.onlyScrollIfNeeded; 1869 var alignWithTop = config.alignWithTop; 1870 var alignWithLeft = config.alignWithLeft; 1871 var offsetTop = config.offsetTop || 0; 1872 var offsetLeft = config.offsetLeft || 0; 1873 var offsetBottom = config.offsetBottom || 0; 1874 var offsetRight = config.offsetRight || 0; 1875 1876 allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; 1877 1878 var isWin = util.isWindow(container); 1879 var elemOffset = util.offset(elem); 1880 var eh = util.outerHeight(elem); 1881 var ew = util.outerWidth(elem); 1882 var containerOffset = undefined; 1883 var ch = undefined; 1884 var cw = undefined; 1885 var containerScroll = undefined; 1886 var diffTop = undefined; 1887 var diffBottom = undefined; 1888 var win = undefined; 1889 var winScroll = undefined; 1890 var ww = undefined; 1891 var wh = undefined; 1892 1893 if (isWin) { 1894 win = container; 1895 wh = util.height(win); 1896 ww = util.width(win); 1897 winScroll = { 1898 left: util.scrollLeft(win), 1899 top: util.scrollTop(win) 1900 }; 1901 // elem 相对 container 可视视窗的距离 1902 diffTop = { 1903 left: elemOffset.left - winScroll.left - offsetLeft, 1904 top: elemOffset.top - winScroll.top - offsetTop 1905 }; 1906 diffBottom = { 1907 left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, 1908 top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom 1909 }; 1910 containerScroll = winScroll; 1911 } else { 1912 containerOffset = util.offset(container); 1913 ch = container.clientHeight; 1914 cw = container.clientWidth; 1915 containerScroll = { 1916 left: container.scrollLeft, 1917 top: container.scrollTop 1918 }; 1919 // elem 相对 container 可视视窗的距离 1920 // 注意边框, offset 是边框到根节点 1921 diffTop = { 1922 left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, 1923 top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop 1924 }; 1925 diffBottom = { 1926 left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, 1927 top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom 1928 }; 1929 } 1930 1931 if (diffTop.top < 0 || diffBottom.top > 0) { 1932 // 强制向上 1933 if (alignWithTop === true) { 1934 util.scrollTop(container, containerScroll.top + diffTop.top); 1935 } else if (alignWithTop === false) { 1936 util.scrollTop(container, containerScroll.top + diffBottom.top); 1937 } else { 1938 // 自动调整 1939 if (diffTop.top < 0) { 1940 util.scrollTop(container, containerScroll.top + diffTop.top); 1941 } else { 1942 util.scrollTop(container, containerScroll.top + diffBottom.top); 1943 } 1944 } 1945 } else { 1946 if (!onlyScrollIfNeeded) { 1947 alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; 1948 if (alignWithTop) { 1949 util.scrollTop(container, containerScroll.top + diffTop.top); 1950 } else { 1951 util.scrollTop(container, containerScroll.top + diffBottom.top); 1952 } 1953 } 1954 } 1955 1956 if (allowHorizontalScroll) { 1957 if (diffTop.left < 0 || diffBottom.left > 0) { 1958 // 强制向上 1959 if (alignWithLeft === true) { 1960 util.scrollLeft(container, containerScroll.left + diffTop.left); 1961 } else if (alignWithLeft === false) { 1962 util.scrollLeft(container, containerScroll.left + diffBottom.left); 1963 } else { 1964 // 自动调整 1965 if (diffTop.left < 0) { 1966 util.scrollLeft(container, containerScroll.left + diffTop.left); 1967 } else { 1968 util.scrollLeft(container, containerScroll.left + diffBottom.left); 1969 } 1970 } 1971 } else { 1972 if (!onlyScrollIfNeeded) { 1973 alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; 1974 if (alignWithLeft) { 1975 util.scrollLeft(container, containerScroll.left + diffTop.left); 1976 } else { 1977 util.scrollLeft(container, containerScroll.left + diffBottom.left); 1978 } 1979 } 1980 } 1981 } 1982 } 1983 1984 module.exports = scrollIntoView; 1985 1986 /***/ }), 1987 1988 /***/ 5425: 1989 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1990 1991 "use strict"; 1992 1993 1994 module.exports = __webpack_require__(1345); 1995 1996 /***/ }), 1997 1998 /***/ 5022: 1999 /***/ (function(module) { 2000 2001 "use strict"; 2002 2003 2004 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 2005 2006 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; 2007 2008 var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; 2009 2010 function getClientPosition(elem) { 2011 var box = undefined; 2012 var x = undefined; 2013 var y = undefined; 2014 var doc = elem.ownerDocument; 2015 var body = doc.body; 2016 var docElem = doc && doc.documentElement; 2017 // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 2018 box = elem.getBoundingClientRect(); 2019 2020 // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop 2021 // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 2022 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin 2023 2024 x = box.left; 2025 y = box.top; 2026 2027 // In IE, most of the time, 2 extra pixels are added to the top and left 2028 // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and 2029 // IE6 standards mode, this border can be overridden by setting the 2030 // document element's border to zero -- thus, we cannot rely on the 2031 // offset always being 2 pixels. 2032 2033 // In quirks mode, the offset can be determined by querying the body's 2034 // clientLeft/clientTop, but in standards mode, it is found by querying 2035 // the document element's clientLeft/clientTop. Since we already called 2036 // getClientBoundingRect we have already forced a reflow, so it is not 2037 // too expensive just to query them all. 2038 2039 // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 2040 // 窗口边框标准是设 documentElement ,quirks 时设置 body 2041 // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 2042 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 2043 // 标准 ie 下 docElem.clientTop 就是 border-top 2044 // ie7 html 即窗口边框改变不了。永远为 2 2045 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 2046 2047 x -= docElem.clientLeft || body.clientLeft || 0; 2048 y -= docElem.clientTop || body.clientTop || 0; 2049 2050 return { 2051 left: x, 2052 top: y 2053 }; 2054 } 2055 2056 function getScroll(w, top) { 2057 var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; 2058 var method = 'scroll' + (top ? 'Top' : 'Left'); 2059 if (typeof ret !== 'number') { 2060 var d = w.document; 2061 // ie6,7,8 standard mode 2062 ret = d.documentElement[method]; 2063 if (typeof ret !== 'number') { 2064 // quirks mode 2065 ret = d.body[method]; 2066 } 2067 } 2068 return ret; 2069 } 2070 2071 function getScrollLeft(w) { 2072 return getScroll(w); 2073 } 2074 2075 function getScrollTop(w) { 2076 return getScroll(w, true); 2077 } 2078 2079 function getOffset(el) { 2080 var pos = getClientPosition(el); 2081 var doc = el.ownerDocument; 2082 var w = doc.defaultView || doc.parentWindow; 2083 pos.left += getScrollLeft(w); 2084 pos.top += getScrollTop(w); 2085 return pos; 2086 } 2087 function _getComputedStyle(elem, name, computedStyle_) { 2088 var val = ''; 2089 var d = elem.ownerDocument; 2090 var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null); 2091 2092 // https://github.com/kissyteam/kissy/issues/61 2093 if (computedStyle) { 2094 val = computedStyle.getPropertyValue(name) || computedStyle[name]; 2095 } 2096 2097 return val; 2098 } 2099 2100 var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); 2101 var RE_POS = /^(top|right|bottom|left)$/; 2102 var CURRENT_STYLE = 'currentStyle'; 2103 var RUNTIME_STYLE = 'runtimeStyle'; 2104 var LEFT = 'left'; 2105 var PX = 'px'; 2106 2107 function _getComputedStyleIE(elem, name) { 2108 // currentStyle maybe null 2109 // http://msdn.microsoft.com/en-us/library/ms535231.aspx 2110 var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; 2111 2112 // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 2113 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 2114 // 在 ie 下不对,需要直接用 offset 方式 2115 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 2116 2117 // From the awesome hack by Dean Edwards 2118 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 2119 // If we're not dealing with a regular pixel number 2120 // but a number that has a weird ending, we need to convert it to pixels 2121 // exclude left right for relativity 2122 if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { 2123 // Remember the original values 2124 var style = elem.style; 2125 var left = style[LEFT]; 2126 var rsLeft = elem[RUNTIME_STYLE][LEFT]; 2127 2128 // prevent flashing of content 2129 elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; 2130 2131 // Put in the new values to get a computed value out 2132 style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; 2133 ret = style.pixelLeft + PX; 2134 2135 // Revert the changed values 2136 style[LEFT] = left; 2137 2138 elem[RUNTIME_STYLE][LEFT] = rsLeft; 2139 } 2140 return ret === '' ? 'auto' : ret; 2141 } 2142 2143 var getComputedStyleX = undefined; 2144 if (typeof window !== 'undefined') { 2145 getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; 2146 } 2147 2148 function each(arr, fn) { 2149 for (var i = 0; i < arr.length; i++) { 2150 fn(arr[i]); 2151 } 2152 } 2153 2154 function isBorderBoxFn(elem) { 2155 return getComputedStyleX(elem, 'boxSizing') === 'border-box'; 2156 } 2157 2158 var BOX_MODELS = ['margin', 'border', 'padding']; 2159 var CONTENT_INDEX = -1; 2160 var PADDING_INDEX = 2; 2161 var BORDER_INDEX = 1; 2162 var MARGIN_INDEX = 0; 2163 2164 function swap(elem, options, callback) { 2165 var old = {}; 2166 var style = elem.style; 2167 var name = undefined; 2168 2169 // Remember the old values, and insert the new ones 2170 for (name in options) { 2171 if (options.hasOwnProperty(name)) { 2172 old[name] = style[name]; 2173 style[name] = options[name]; 2174 } 2175 } 2176 2177 callback.call(elem); 2178 2179 // Revert the old values 2180 for (name in options) { 2181 if (options.hasOwnProperty(name)) { 2182 style[name] = old[name]; 2183 } 2184 } 2185 } 2186 2187 function getPBMWidth(elem, props, which) { 2188 var value = 0; 2189 var prop = undefined; 2190 var j = undefined; 2191 var i = undefined; 2192 for (j = 0; j < props.length; j++) { 2193 prop = props[j]; 2194 if (prop) { 2195 for (i = 0; i < which.length; i++) { 2196 var cssProp = undefined; 2197 if (prop === 'border') { 2198 cssProp = prop + which[i] + 'Width'; 2199 } else { 2200 cssProp = prop + which[i]; 2201 } 2202 value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; 2203 } 2204 } 2205 } 2206 return value; 2207 } 2208 2209 /** 2210 * A crude way of determining if an object is a window 2211 * @member util 2212 */ 2213 function isWindow(obj) { 2214 // must use == for ie8 2215 /* eslint eqeqeq:0 */ 2216 return obj != null && obj == obj.window; 2217 } 2218 2219 var domUtils = {}; 2220 2221 each(['Width', 'Height'], function (name) { 2222 domUtils['doc' + name] = function (refWin) { 2223 var d = refWin.document; 2224 return Math.max( 2225 // firefox chrome documentElement.scrollHeight< body.scrollHeight 2226 // ie standard mode : documentElement.scrollHeight> body.scrollHeight 2227 d.documentElement['scroll' + name], 2228 // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? 2229 d.body['scroll' + name], domUtils['viewport' + name](d)); 2230 }; 2231 2232 domUtils['viewport' + name] = function (win) { 2233 // pc browser includes scrollbar in window.innerWidth 2234 var prop = 'client' + name; 2235 var doc = win.document; 2236 var body = doc.body; 2237 var documentElement = doc.documentElement; 2238 var documentElementProp = documentElement[prop]; 2239 // 标准模式取 documentElement 2240 // backcompat 取 body 2241 return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; 2242 }; 2243 }); 2244 2245 /* 2246 得到元素的大小信息 2247 @param elem 2248 @param name 2249 @param {String} [extra] 'padding' : (css width) + padding 2250 'border' : (css width) + padding + border 2251 'margin' : (css width) + padding + border + margin 2252 */ 2253 function getWH(elem, name, extra) { 2254 if (isWindow(elem)) { 2255 return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); 2256 } else if (elem.nodeType === 9) { 2257 return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); 2258 } 2259 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 2260 var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; 2261 var computedStyle = getComputedStyleX(elem); 2262 var isBorderBox = isBorderBoxFn(elem, computedStyle); 2263 var cssBoxValue = 0; 2264 if (borderBoxValue == null || borderBoxValue <= 0) { 2265 borderBoxValue = undefined; 2266 // Fall back to computed then un computed css if necessary 2267 cssBoxValue = getComputedStyleX(elem, name); 2268 if (cssBoxValue == null || Number(cssBoxValue) < 0) { 2269 cssBoxValue = elem.style[name] || 0; 2270 } 2271 // Normalize '', auto, and prepare for extra 2272 cssBoxValue = parseFloat(cssBoxValue) || 0; 2273 } 2274 if (extra === undefined) { 2275 extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; 2276 } 2277 var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; 2278 var val = borderBoxValue || cssBoxValue; 2279 if (extra === CONTENT_INDEX) { 2280 if (borderBoxValueOrIsBorderBox) { 2281 return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); 2282 } 2283 return cssBoxValue; 2284 } 2285 if (borderBoxValueOrIsBorderBox) { 2286 var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle); 2287 return val + (extra === BORDER_INDEX ? 0 : padding); 2288 } 2289 return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); 2290 } 2291 2292 var cssShow = { 2293 position: 'absolute', 2294 visibility: 'hidden', 2295 display: 'block' 2296 }; 2297 2298 // fix #119 : https://github.com/kissyteam/kissy/issues/119 2299 function getWHIgnoreDisplay(elem) { 2300 var val = undefined; 2301 var args = arguments; 2302 // in case elem is window 2303 // elem.offsetWidth === undefined 2304 if (elem.offsetWidth !== 0) { 2305 val = getWH.apply(undefined, args); 2306 } else { 2307 swap(elem, cssShow, function () { 2308 val = getWH.apply(undefined, args); 2309 }); 2310 } 2311 return val; 2312 } 2313 2314 function css(el, name, v) { 2315 var value = v; 2316 if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { 2317 for (var i in name) { 2318 if (name.hasOwnProperty(i)) { 2319 css(el, i, name[i]); 2320 } 2321 } 2322 return undefined; 2323 } 2324 if (typeof value !== 'undefined') { 2325 if (typeof value === 'number') { 2326 value += 'px'; 2327 } 2328 el.style[name] = value; 2329 return undefined; 2330 } 2331 return getComputedStyleX(el, name); 2332 } 2333 2334 each(['width', 'height'], function (name) { 2335 var first = name.charAt(0).toUpperCase() + name.slice(1); 2336 domUtils['outer' + first] = function (el, includeMargin) { 2337 return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); 2338 }; 2339 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; 2340 2341 domUtils[name] = function (elem, val) { 2342 if (val !== undefined) { 2343 if (elem) { 2344 var computedStyle = getComputedStyleX(elem); 2345 var isBorderBox = isBorderBoxFn(elem); 2346 if (isBorderBox) { 2347 val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); 2348 } 2349 return css(elem, name, val); 2350 } 2351 return undefined; 2352 } 2353 return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); 2354 }; 2355 }); 2356 2357 // 设置 elem 相对 elem.ownerDocument 的坐标 2358 function setOffset(elem, offset) { 2359 // set position first, in-case top/left are set even on static elem 2360 if (css(elem, 'position') === 'static') { 2361 elem.style.position = 'relative'; 2362 } 2363 2364 var old = getOffset(elem); 2365 var ret = {}; 2366 var current = undefined; 2367 var key = undefined; 2368 2369 for (key in offset) { 2370 if (offset.hasOwnProperty(key)) { 2371 current = parseFloat(css(elem, key)) || 0; 2372 ret[key] = current + offset[key] - old[key]; 2373 } 2374 } 2375 css(elem, ret); 2376 } 2377 2378 module.exports = _extends({ 2379 getWindow: function getWindow(node) { 2380 var doc = node.ownerDocument || node; 2381 return doc.defaultView || doc.parentWindow; 2382 }, 2383 offset: function offset(el, value) { 2384 if (typeof value !== 'undefined') { 2385 setOffset(el, value); 2386 } else { 2387 return getOffset(el); 2388 } 2389 }, 2390 2391 isWindow: isWindow, 2392 each: each, 2393 css: css, 2394 clone: function clone(obj) { 2395 var ret = {}; 2396 for (var i in obj) { 2397 if (obj.hasOwnProperty(i)) { 2398 ret[i] = obj[i]; 2399 } 2400 } 2401 var overflow = obj.overflow; 2402 if (overflow) { 2403 for (var i in obj) { 2404 if (obj.hasOwnProperty(i)) { 2405 ret.overflow[i] = obj.overflow[i]; 2406 } 2407 } 2408 } 2409 return ret; 2410 }, 2411 scrollLeft: function scrollLeft(w, v) { 2412 if (isWindow(w)) { 2413 if (v === undefined) { 2414 return getScrollLeft(w); 2415 } 2416 window.scrollTo(v, getScrollTop(w)); 2417 } else { 2418 if (v === undefined) { 2419 return w.scrollLeft; 2420 } 2421 w.scrollLeft = v; 2422 } 2423 }, 2424 scrollTop: function scrollTop(w, v) { 2425 if (isWindow(w)) { 2426 if (v === undefined) { 2427 return getScrollTop(w); 2428 } 2429 window.scrollTo(getScrollLeft(w), v); 2430 } else { 2431 if (v === undefined) { 2432 return w.scrollTop; 2433 } 2434 w.scrollTop = v; 2435 } 2436 }, 2437 2438 viewportWidth: 0, 2439 viewportHeight: 0 2440 }, domUtils); 2441 2442 /***/ }), 2443 2444 /***/ 9214: 2445 /***/ (function(__unused_webpack_module, exports) { 2446 2447 "use strict"; 2448 var __webpack_unused_export__; 2449 /** @license React v17.0.2 2450 * react-is.production.min.js 2451 * 2452 * Copyright (c) Facebook, Inc. and its affiliates. 2453 * 2454 * This source code is licensed under the MIT license found in the 2455 * LICENSE file in the root directory of this source tree. 2456 */ 2457 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; 2458 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")} 2459 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; 2460 __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}; 2461 __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}; 2462 __webpack_unused_export__=y; 2463 2464 2465 /***/ }), 2466 2467 /***/ 2797: 2468 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2469 2470 "use strict"; 2471 2472 2473 if (true) { 2474 /* unused reexport */ __webpack_require__(9214); 2475 } else {} 2476 2477 2478 /***/ }), 2479 2480 /***/ 2505: 2481 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2482 2483 "use strict"; 2484 2485 2486 var has = __webpack_require__(9284); 2487 2488 var hasUnscopables = typeof Symbol === 'function' && typeof Symbol.unscopables === 'symbol'; 2489 2490 var map = hasUnscopables && Array.prototype[Symbol.unscopables]; 2491 2492 var $TypeError = TypeError; 2493 2494 module.exports = function shimUnscopables(method) { 2495 if (typeof method !== 'string' || !method) { 2496 throw new $TypeError('method must be a non-empty string'); 2497 } 2498 if (!has(Array.prototype, method)) { 2499 throw new $TypeError('method must be on Array.prototype'); 2500 } 2501 if (hasUnscopables) { 2502 map[method] = true; 2503 } 2504 }; 2505 2506 2507 /***/ }), 2508 2509 /***/ 5249: 2510 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2511 2512 "use strict"; 2513 2514 2515 var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; 2516 2517 var isPrimitive = __webpack_require__(3777); 2518 var isCallable = __webpack_require__(5443); 2519 var isDate = __webpack_require__(8659); 2520 var isSymbol = __webpack_require__(3082); 2521 2522 var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { 2523 if (typeof O === 'undefined' || O === null) { 2524 throw new TypeError('Cannot call method on ' + O); 2525 } 2526 if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { 2527 throw new TypeError('hint must be "string" or "number"'); 2528 } 2529 var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; 2530 var method, result, i; 2531 for (i = 0; i < methodNames.length; ++i) { 2532 method = O[methodNames[i]]; 2533 if (isCallable(method)) { 2534 result = method.call(O); 2535 if (isPrimitive(result)) { 2536 return result; 2537 } 2538 } 2539 } 2540 throw new TypeError('No default value'); 2541 }; 2542 2543 var GetMethod = function GetMethod(O, P) { 2544 var func = O[P]; 2545 if (func !== null && typeof func !== 'undefined') { 2546 if (!isCallable(func)) { 2547 throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); 2548 } 2549 return func; 2550 } 2551 return void 0; 2552 }; 2553 2554 // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive 2555 module.exports = function ToPrimitive(input) { 2556 if (isPrimitive(input)) { 2557 return input; 2558 } 2559 var hint = 'default'; 2560 if (arguments.length > 1) { 2561 if (arguments[1] === String) { 2562 hint = 'string'; 2563 } else if (arguments[1] === Number) { 2564 hint = 'number'; 2565 } 2566 } 2567 2568 var exoticToPrim; 2569 if (hasSymbols) { 2570 if (Symbol.toPrimitive) { 2571 exoticToPrim = GetMethod(input, Symbol.toPrimitive); 2572 } else if (isSymbol(input)) { 2573 exoticToPrim = Symbol.prototype.valueOf; 2574 } 2575 } 2576 if (typeof exoticToPrim !== 'undefined') { 2577 var result = exoticToPrim.call(input, hint); 2578 if (isPrimitive(result)) { 2579 return result; 2580 } 2581 throw new TypeError('unable to convert exotic object to primitive'); 2582 } 2583 if (hint === 'default' && (isDate(input) || isSymbol(input))) { 2584 hint = 'string'; 2585 } 2586 return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); 2587 }; 2588 2589 2590 /***/ }), 2591 2592 /***/ 3777: 2593 /***/ (function(module) { 2594 2595 "use strict"; 2596 2597 2598 module.exports = function isPrimitive(value) { 2599 return value === null || (typeof value !== 'function' && typeof value !== 'object'); 2600 }; 2601 2602 2603 /***/ }), 2604 2605 /***/ 9930: 2606 /***/ (function(module) { 2607 2608 "use strict"; 2609 2610 2611 /* eslint no-invalid-this: 1 */ 2612 2613 var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 2614 var slice = Array.prototype.slice; 2615 var toStr = Object.prototype.toString; 2616 var funcType = '[object Function]'; 2617 2618 module.exports = function bind(that) { 2619 var target = this; 2620 if (typeof target !== 'function' || toStr.call(target) !== funcType) { 2621 throw new TypeError(ERROR_MESSAGE + target); 2622 } 2623 var args = slice.call(arguments, 1); 2624 2625 var bound; 2626 var binder = function () { 2627 if (this instanceof bound) { 2628 var result = target.apply( 2629 this, 2630 args.concat(slice.call(arguments)) 2631 ); 2632 if (Object(result) === result) { 2633 return result; 2634 } 2635 return this; 2636 } else { 2637 return target.apply( 2638 that, 2639 args.concat(slice.call(arguments)) 2640 ); 2641 } 2642 }; 2643 2644 var boundLength = Math.max(0, target.length - args.length); 2645 var boundArgs = []; 2646 for (var i = 0; i < boundLength; i++) { 2647 boundArgs.push('$' + i); 2648 } 2649 2650 bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); 2651 2652 if (target.prototype) { 2653 var Empty = function Empty() {}; 2654 Empty.prototype = target.prototype; 2655 bound.prototype = new Empty(); 2656 Empty.prototype = null; 2657 } 2658 2659 return bound; 2660 }; 2661 2662 2663 /***/ }), 2664 2665 /***/ 1930: 2666 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2667 2668 "use strict"; 2669 2670 2671 var implementation = __webpack_require__(9930); 2672 2673 module.exports = Function.prototype.bind || implementation; 2674 2675 2676 /***/ }), 2677 2678 /***/ 1801: 2679 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2680 2681 "use strict"; 2682 2683 2684 /* globals 2685 AggregateError, 2686 Atomics, 2687 FinalizationRegistry, 2688 SharedArrayBuffer, 2689 WeakRef, 2690 */ 2691 2692 var undefined; 2693 2694 var $SyntaxError = SyntaxError; 2695 var $Function = Function; 2696 var $TypeError = TypeError; 2697 2698 // eslint-disable-next-line consistent-return 2699 var getEvalledConstructor = function (expressionSyntax) { 2700 try { 2701 // eslint-disable-next-line no-new-func 2702 return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 2703 } catch (e) {} 2704 }; 2705 2706 var $gOPD = Object.getOwnPropertyDescriptor; 2707 if ($gOPD) { 2708 try { 2709 $gOPD({}, ''); 2710 } catch (e) { 2711 $gOPD = null; // this is IE 8, which has a broken gOPD 2712 } 2713 } 2714 2715 var throwTypeError = function () { 2716 throw new $TypeError(); 2717 }; 2718 var ThrowTypeError = $gOPD 2719 ? (function () { 2720 try { 2721 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 2722 arguments.callee; // IE 8 does not throw here 2723 return throwTypeError; 2724 } catch (calleeThrows) { 2725 try { 2726 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 2727 return $gOPD(arguments, 'callee').get; 2728 } catch (gOPDthrows) { 2729 return throwTypeError; 2730 } 2731 } 2732 }()) 2733 : throwTypeError; 2734 2735 var hasSymbols = __webpack_require__(9905)(); 2736 2737 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 2738 2739 var asyncGenFunction = getEvalledConstructor('async function* () {}'); 2740 var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; 2741 var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; 2742 2743 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 2744 2745 var INTRINSICS = { 2746 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 2747 '%Array%': Array, 2748 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 2749 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 2750 '%AsyncFromSyncIteratorPrototype%': undefined, 2751 '%AsyncFunction%': getEvalledConstructor('async function () {}'), 2752 '%AsyncGenerator%': asyncGenFunctionPrototype, 2753 '%AsyncGeneratorFunction%': asyncGenFunction, 2754 '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, 2755 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 2756 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 2757 '%Boolean%': Boolean, 2758 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 2759 '%Date%': Date, 2760 '%decodeURI%': decodeURI, 2761 '%decodeURIComponent%': decodeURIComponent, 2762 '%encodeURI%': encodeURI, 2763 '%encodeURIComponent%': encodeURIComponent, 2764 '%Error%': Error, 2765 '%eval%': eval, // eslint-disable-line no-eval 2766 '%EvalError%': EvalError, 2767 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 2768 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 2769 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 2770 '%Function%': $Function, 2771 '%GeneratorFunction%': getEvalledConstructor('function* () {}'), 2772 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 2773 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 2774 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 2775 '%isFinite%': isFinite, 2776 '%isNaN%': isNaN, 2777 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 2778 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 2779 '%Map%': typeof Map === 'undefined' ? undefined : Map, 2780 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 2781 '%Math%': Math, 2782 '%Number%': Number, 2783 '%Object%': Object, 2784 '%parseFloat%': parseFloat, 2785 '%parseInt%': parseInt, 2786 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 2787 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 2788 '%RangeError%': RangeError, 2789 '%ReferenceError%': ReferenceError, 2790 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 2791 '%RegExp%': RegExp, 2792 '%Set%': typeof Set === 'undefined' ? undefined : Set, 2793 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 2794 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 2795 '%String%': String, 2796 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 2797 '%Symbol%': hasSymbols ? Symbol : undefined, 2798 '%SyntaxError%': $SyntaxError, 2799 '%ThrowTypeError%': ThrowTypeError, 2800 '%TypedArray%': TypedArray, 2801 '%TypeError%': $TypeError, 2802 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 2803 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 2804 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 2805 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 2806 '%URIError%': URIError, 2807 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 2808 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 2809 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 2810 }; 2811 2812 var LEGACY_ALIASES = { 2813 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 2814 '%ArrayPrototype%': ['Array', 'prototype'], 2815 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 2816 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 2817 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 2818 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 2819 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 2820 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 2821 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 2822 '%BooleanPrototype%': ['Boolean', 'prototype'], 2823 '%DataViewPrototype%': ['DataView', 'prototype'], 2824 '%DatePrototype%': ['Date', 'prototype'], 2825 '%ErrorPrototype%': ['Error', 'prototype'], 2826 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 2827 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 2828 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 2829 '%FunctionPrototype%': ['Function', 'prototype'], 2830 '%Generator%': ['GeneratorFunction', 'prototype'], 2831 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 2832 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 2833 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 2834 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 2835 '%JSONParse%': ['JSON', 'parse'], 2836 '%JSONStringify%': ['JSON', 'stringify'], 2837 '%MapPrototype%': ['Map', 'prototype'], 2838 '%NumberPrototype%': ['Number', 'prototype'], 2839 '%ObjectPrototype%': ['Object', 'prototype'], 2840 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 2841 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 2842 '%PromisePrototype%': ['Promise', 'prototype'], 2843 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 2844 '%Promise_all%': ['Promise', 'all'], 2845 '%Promise_reject%': ['Promise', 'reject'], 2846 '%Promise_resolve%': ['Promise', 'resolve'], 2847 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 2848 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 2849 '%RegExpPrototype%': ['RegExp', 'prototype'], 2850 '%SetPrototype%': ['Set', 'prototype'], 2851 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 2852 '%StringPrototype%': ['String', 'prototype'], 2853 '%SymbolPrototype%': ['Symbol', 'prototype'], 2854 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 2855 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 2856 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 2857 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 2858 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 2859 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 2860 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 2861 '%URIErrorPrototype%': ['URIError', 'prototype'], 2862 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 2863 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 2864 }; 2865 2866 var bind = __webpack_require__(1930); 2867 var hasOwn = __webpack_require__(9284); 2868 var $concat = bind.call(Function.call, Array.prototype.concat); 2869 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 2870 var $replace = bind.call(Function.call, String.prototype.replace); 2871 var $strSlice = bind.call(Function.call, String.prototype.slice); 2872 2873 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 2874 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 2875 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 2876 var stringToPath = function stringToPath(string) { 2877 var first = $strSlice(string, 0, 1); 2878 var last = $strSlice(string, -1); 2879 if (first === '%' && last !== '%') { 2880 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 2881 } else if (last === '%' && first !== '%') { 2882 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 2883 } 2884 var result = []; 2885 $replace(string, rePropName, function (match, number, quote, subString) { 2886 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 2887 }); 2888 return result; 2889 }; 2890 /* end adaptation */ 2891 2892 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 2893 var intrinsicName = name; 2894 var alias; 2895 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 2896 alias = LEGACY_ALIASES[intrinsicName]; 2897 intrinsicName = '%' + alias[0] + '%'; 2898 } 2899 2900 if (hasOwn(INTRINSICS, intrinsicName)) { 2901 var value = INTRINSICS[intrinsicName]; 2902 if (typeof value === 'undefined' && !allowMissing) { 2903 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 2904 } 2905 2906 return { 2907 alias: alias, 2908 name: intrinsicName, 2909 value: value 2910 }; 2911 } 2912 2913 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 2914 }; 2915 2916 module.exports = function GetIntrinsic(name, allowMissing) { 2917 if (typeof name !== 'string' || name.length === 0) { 2918 throw new $TypeError('intrinsic name must be a non-empty string'); 2919 } 2920 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 2921 throw new $TypeError('"allowMissing" argument must be a boolean'); 2922 } 2923 2924 var parts = stringToPath(name); 2925 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 2926 2927 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 2928 var intrinsicRealName = intrinsic.name; 2929 var value = intrinsic.value; 2930 var skipFurtherCaching = false; 2931 2932 var alias = intrinsic.alias; 2933 if (alias) { 2934 intrinsicBaseName = alias[0]; 2935 $spliceApply(parts, $concat([0, 1], alias)); 2936 } 2937 2938 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 2939 var part = parts[i]; 2940 var first = $strSlice(part, 0, 1); 2941 var last = $strSlice(part, -1); 2942 if ( 2943 ( 2944 (first === '"' || first === "'" || first === '`') 2945 || (last === '"' || last === "'" || last === '`') 2946 ) 2947 && first !== last 2948 ) { 2949 throw new $SyntaxError('property names with quotes must have matching quotes'); 2950 } 2951 if (part === 'constructor' || !isOwn) { 2952 skipFurtherCaching = true; 2953 } 2954 2955 intrinsicBaseName += '.' + part; 2956 intrinsicRealName = '%' + intrinsicBaseName + '%'; 2957 2958 if (hasOwn(INTRINSICS, intrinsicRealName)) { 2959 value = INTRINSICS[intrinsicRealName]; 2960 } else if (value != null) { 2961 if (!(part in value)) { 2962 if (!allowMissing) { 2963 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 2964 } 2965 return void undefined; 2966 } 2967 if ($gOPD && (i + 1) >= parts.length) { 2968 var desc = $gOPD(value, part); 2969 isOwn = !!desc; 2970 2971 // By convention, when a data property is converted to an accessor 2972 // property to emulate a data property that does not suffer from 2973 // the override mistake, that accessor's getter is marked with 2974 // an `originalValue` property. Here, when we detect this, we 2975 // uphold the illusion by pretending to see that original data 2976 // property, i.e., returning the value rather than the getter 2977 // itself. 2978 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 2979 value = desc.get; 2980 } else { 2981 value = value[part]; 2982 } 2983 } else { 2984 isOwn = hasOwn(value, part); 2985 value = value[part]; 2986 } 2987 2988 if (isOwn && !skipFurtherCaching) { 2989 INTRINSICS[intrinsicRealName] = value; 2990 } 2991 } 2992 } 2993 return value; 2994 }; 2995 2996 2997 /***/ }), 2998 2999 /***/ 5371: 3000 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3001 3002 "use strict"; 3003 3004 3005 var define = __webpack_require__(9170); 3006 var isSymbol = __webpack_require__(3082); 3007 3008 var globalKey = '__ global cache key __'; 3009 /* istanbul ignore else */ 3010 // eslint-disable-next-line no-restricted-properties 3011 if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') { 3012 // eslint-disable-next-line no-restricted-properties 3013 globalKey = Symbol['for'](globalKey); 3014 } 3015 3016 var trueThunk = function () { 3017 return true; 3018 }; 3019 3020 var ensureCache = function ensureCache() { 3021 if (!__webpack_require__.g[globalKey]) { 3022 var properties = {}; 3023 properties[globalKey] = {}; 3024 var predicates = {}; 3025 predicates[globalKey] = trueThunk; 3026 define(__webpack_require__.g, properties, predicates); 3027 } 3028 return __webpack_require__.g[globalKey]; 3029 }; 3030 3031 var cache = ensureCache(); 3032 3033 var isPrimitive = function isPrimitive(val) { 3034 return val === null || (typeof val !== 'object' && typeof val !== 'function'); 3035 }; 3036 3037 var getPrimitiveKey = function getPrimitiveKey(val) { 3038 if (isSymbol(val)) { 3039 return Symbol.prototype.valueOf.call(val); 3040 } 3041 return typeof val + ' | ' + String(val); 3042 }; 3043 3044 var requirePrimitiveKey = function requirePrimitiveKey(val) { 3045 if (!isPrimitive(val)) { 3046 throw new TypeError('key must not be an object'); 3047 } 3048 }; 3049 3050 var globalCache = { 3051 clear: function clear() { 3052 delete __webpack_require__.g[globalKey]; 3053 cache = ensureCache(); 3054 }, 3055 3056 'delete': function deleteKey(key) { 3057 requirePrimitiveKey(key); 3058 delete cache[getPrimitiveKey(key)]; 3059 return !globalCache.has(key); 3060 }, 3061 3062 get: function get(key) { 3063 requirePrimitiveKey(key); 3064 return cache[getPrimitiveKey(key)]; 3065 }, 3066 3067 has: function has(key) { 3068 requirePrimitiveKey(key); 3069 return getPrimitiveKey(key) in cache; 3070 }, 3071 3072 set: function set(key, value) { 3073 requirePrimitiveKey(key); 3074 var primitiveKey = getPrimitiveKey(key); 3075 var props = {}; 3076 props[primitiveKey] = value; 3077 var predicates = {}; 3078 predicates[primitiveKey] = trueThunk; 3079 define(cache, props, predicates); 3080 return globalCache.has(key); 3081 }, 3082 3083 setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) { 3084 if (globalCache.has(key)) { 3085 return globalCache.get(key); 3086 } 3087 var item = valueThunk(); 3088 globalCache.set(key, item); 3089 return item; 3090 } 3091 }; 3092 3093 module.exports = globalCache; 3094 3095 3096 /***/ }), 3097 3098 /***/ 7115: 3099 /***/ (function(__unused_webpack_module, exports) { 3100 3101 // Copyright (c) 2014 Rafael Caricio. All rights reserved. 3102 // Use of this source code is governed by a BSD-style license that can be 3103 // found in the LICENSE file. 3104 3105 var GradientParser = {}; 3106 3107 GradientParser.parse = (function() { 3108 3109 var tokens = { 3110 linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, 3111 repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, 3112 radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, 3113 repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, 3114 sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, 3115 extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, 3116 positionKeywords: /^(left|center|right|top|bottom)/i, 3117 pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, 3118 percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, 3119 emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, 3120 angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, 3121 startCall: /^\(/, 3122 endCall: /^\)/, 3123 comma: /^,/, 3124 hexColor: /^\#([0-9a-fA-F]+)/, 3125 literalColor: /^([a-zA-Z]+)/, 3126 rgbColor: /^rgb/i, 3127 rgbaColor: /^rgba/i, 3128 number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ 3129 }; 3130 3131 var input = ''; 3132 3133 function error(msg) { 3134 var err = new Error(input + ': ' + msg); 3135 err.source = input; 3136 throw err; 3137 } 3138 3139 function getAST() { 3140 var ast = matchListDefinitions(); 3141 3142 if (input.length > 0) { 3143 error('Invalid input not EOF'); 3144 } 3145 3146 return ast; 3147 } 3148 3149 function matchListDefinitions() { 3150 return matchListing(matchDefinition); 3151 } 3152 3153 function matchDefinition() { 3154 return matchGradient( 3155 'linear-gradient', 3156 tokens.linearGradient, 3157 matchLinearOrientation) || 3158 3159 matchGradient( 3160 'repeating-linear-gradient', 3161 tokens.repeatingLinearGradient, 3162 matchLinearOrientation) || 3163 3164 matchGradient( 3165 'radial-gradient', 3166 tokens.radialGradient, 3167 matchListRadialOrientations) || 3168 3169 matchGradient( 3170 'repeating-radial-gradient', 3171 tokens.repeatingRadialGradient, 3172 matchListRadialOrientations); 3173 } 3174 3175 function matchGradient(gradientType, pattern, orientationMatcher) { 3176 return matchCall(pattern, function(captures) { 3177 3178 var orientation = orientationMatcher(); 3179 if (orientation) { 3180 if (!scan(tokens.comma)) { 3181 error('Missing comma before color stops'); 3182 } 3183 } 3184 3185 return { 3186 type: gradientType, 3187 orientation: orientation, 3188 colorStops: matchListing(matchColorStop) 3189 }; 3190 }); 3191 } 3192 3193 function matchCall(pattern, callback) { 3194 var captures = scan(pattern); 3195 3196 if (captures) { 3197 if (!scan(tokens.startCall)) { 3198 error('Missing ('); 3199 } 3200 3201 result = callback(captures); 3202 3203 if (!scan(tokens.endCall)) { 3204 error('Missing )'); 3205 } 3206 3207 return result; 3208 } 3209 } 3210 3211 function matchLinearOrientation() { 3212 return matchSideOrCorner() || 3213 matchAngle(); 3214 } 3215 3216 function matchSideOrCorner() { 3217 return match('directional', tokens.sideOrCorner, 1); 3218 } 3219 3220 function matchAngle() { 3221 return match('angular', tokens.angleValue, 1); 3222 } 3223 3224 function matchListRadialOrientations() { 3225 var radialOrientations, 3226 radialOrientation = matchRadialOrientation(), 3227 lookaheadCache; 3228 3229 if (radialOrientation) { 3230 radialOrientations = []; 3231 radialOrientations.push(radialOrientation); 3232 3233 lookaheadCache = input; 3234 if (scan(tokens.comma)) { 3235 radialOrientation = matchRadialOrientation(); 3236 if (radialOrientation) { 3237 radialOrientations.push(radialOrientation); 3238 } else { 3239 input = lookaheadCache; 3240 } 3241 } 3242 } 3243 3244 return radialOrientations; 3245 } 3246 3247 function matchRadialOrientation() { 3248 var radialType = matchCircle() || 3249 matchEllipse(); 3250 3251 if (radialType) { 3252 radialType.at = matchAtPosition(); 3253 } else { 3254 var defaultPosition = matchPositioning(); 3255 if (defaultPosition) { 3256 radialType = { 3257 type: 'default-radial', 3258 at: defaultPosition 3259 }; 3260 } 3261 } 3262 3263 return radialType; 3264 } 3265 3266 function matchCircle() { 3267 var circle = match('shape', /^(circle)/i, 0); 3268 3269 if (circle) { 3270 circle.style = matchLength() || matchExtentKeyword(); 3271 } 3272 3273 return circle; 3274 } 3275 3276 function matchEllipse() { 3277 var ellipse = match('shape', /^(ellipse)/i, 0); 3278 3279 if (ellipse) { 3280 ellipse.style = matchDistance() || matchExtentKeyword(); 3281 } 3282 3283 return ellipse; 3284 } 3285 3286 function matchExtentKeyword() { 3287 return match('extent-keyword', tokens.extentKeywords, 1); 3288 } 3289 3290 function matchAtPosition() { 3291 if (match('position', /^at/, 0)) { 3292 var positioning = matchPositioning(); 3293 3294 if (!positioning) { 3295 error('Missing positioning value'); 3296 } 3297 3298 return positioning; 3299 } 3300 } 3301 3302 function matchPositioning() { 3303 var location = matchCoordinates(); 3304 3305 if (location.x || location.y) { 3306 return { 3307 type: 'position', 3308 value: location 3309 }; 3310 } 3311 } 3312 3313 function matchCoordinates() { 3314 return { 3315 x: matchDistance(), 3316 y: matchDistance() 3317 }; 3318 } 3319 3320 function matchListing(matcher) { 3321 var captures = matcher(), 3322 result = []; 3323 3324 if (captures) { 3325 result.push(captures); 3326 while (scan(tokens.comma)) { 3327 captures = matcher(); 3328 if (captures) { 3329 result.push(captures); 3330 } else { 3331 error('One extra comma'); 3332 } 3333 } 3334 } 3335 3336 return result; 3337 } 3338 3339 function matchColorStop() { 3340 var color = matchColor(); 3341 3342 if (!color) { 3343 error('Expected color definition'); 3344 } 3345 3346 color.length = matchDistance(); 3347 return color; 3348 } 3349 3350 function matchColor() { 3351 return matchHexColor() || 3352 matchRGBAColor() || 3353 matchRGBColor() || 3354 matchLiteralColor(); 3355 } 3356 3357 function matchLiteralColor() { 3358 return match('literal', tokens.literalColor, 0); 3359 } 3360 3361 function matchHexColor() { 3362 return match('hex', tokens.hexColor, 1); 3363 } 3364 3365 function matchRGBColor() { 3366 return matchCall(tokens.rgbColor, function() { 3367 return { 3368 type: 'rgb', 3369 value: matchListing(matchNumber) 3370 }; 3371 }); 3372 } 3373 3374 function matchRGBAColor() { 3375 return matchCall(tokens.rgbaColor, function() { 3376 return { 3377 type: 'rgba', 3378 value: matchListing(matchNumber) 3379 }; 3380 }); 3381 } 3382 3383 function matchNumber() { 3384 return scan(tokens.number)[1]; 3385 } 3386 3387 function matchDistance() { 3388 return match('%', tokens.percentageValue, 1) || 3389 matchPositionKeyword() || 3390 matchLength(); 3391 } 3392 3393 function matchPositionKeyword() { 3394 return match('position-keyword', tokens.positionKeywords, 1); 3395 } 3396 3397 function matchLength() { 3398 return match('px', tokens.pixelValue, 1) || 3399 match('em', tokens.emValue, 1); 3400 } 3401 3402 function match(type, pattern, captureIndex) { 3403 var captures = scan(pattern); 3404 if (captures) { 3405 return { 3406 type: type, 3407 value: captures[captureIndex] 3408 }; 3409 } 3410 } 3411 3412 function scan(regexp) { 3413 var captures, 3414 blankCaptures; 3415 3416 blankCaptures = /^[\n\r\t\s]+/.exec(input); 3417 if (blankCaptures) { 3418 consume(blankCaptures[0].length); 3419 } 3420 3421 captures = regexp.exec(input); 3422 if (captures) { 3423 consume(captures[0].length); 3424 } 3425 3426 return captures; 3427 } 3428 3429 function consume(size) { 3430 input = input.substr(size); 3431 } 3432 3433 return function(code) { 3434 input = code.toString(); 3435 return getAST(); 3436 }; 3437 })(); 3438 3439 exports.parse = (GradientParser || {}).parse; 3440 3441 3442 /***/ }), 3443 3444 /***/ 9905: 3445 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3446 3447 "use strict"; 3448 3449 3450 var origSymbol = __webpack_require__.g.Symbol; 3451 var hasSymbolSham = __webpack_require__(5682); 3452 3453 module.exports = function hasNativeSymbols() { 3454 if (typeof origSymbol !== 'function') { return false; } 3455 if (typeof Symbol !== 'function') { return false; } 3456 if (typeof origSymbol('foo') !== 'symbol') { return false; } 3457 if (typeof Symbol('bar') !== 'symbol') { return false; } 3458 3459 return hasSymbolSham(); 3460 }; 3461 3462 3463 /***/ }), 3464 3465 /***/ 5682: 3466 /***/ (function(module) { 3467 3468 "use strict"; 3469 3470 3471 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 3472 module.exports = function hasSymbols() { 3473 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 3474 if (typeof Symbol.iterator === 'symbol') { return true; } 3475 3476 var obj = {}; 3477 var sym = Symbol('test'); 3478 var symObj = Object(sym); 3479 if (typeof sym === 'string') { return false; } 3480 3481 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 3482 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 3483 3484 // temp disabled per https://github.com/ljharb/object.assign/issues/17 3485 // if (sym instanceof Symbol) { return false; } 3486 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 3487 // if (!(symObj instanceof Symbol)) { return false; } 3488 3489 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 3490 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 3491 3492 var symVal = 42; 3493 obj[sym] = symVal; 3494 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax 3495 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 3496 3497 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 3498 3499 var syms = Object.getOwnPropertySymbols(obj); 3500 if (syms.length !== 1 || syms[0] !== sym) { return false; } 3501 3502 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 3503 3504 if (typeof Object.getOwnPropertyDescriptor === 'function') { 3505 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 3506 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 3507 } 3508 3509 return true; 3510 }; 3511 3512 3513 /***/ }), 3514 3515 /***/ 81: 3516 /***/ (function(module) { 3517 3518 "use strict"; 3519 3520 3521 /* eslint complexity: [2, 18], max-statements: [2, 33] */ 3522 module.exports = function hasSymbols() { 3523 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 3524 if (typeof Symbol.iterator === 'symbol') { return true; } 3525 3526 var obj = {}; 3527 var sym = Symbol('test'); 3528 var symObj = Object(sym); 3529 if (typeof sym === 'string') { return false; } 3530 3531 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 3532 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 3533 3534 // temp disabled per https://github.com/ljharb/object.assign/issues/17 3535 // if (sym instanceof Symbol) { return false; } 3536 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 3537 // if (!(symObj instanceof Symbol)) { return false; } 3538 3539 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 3540 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 3541 3542 var symVal = 42; 3543 obj[sym] = symVal; 3544 for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 3545 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 3546 3547 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 3548 3549 var syms = Object.getOwnPropertySymbols(obj); 3550 if (syms.length !== 1 || syms[0] !== sym) { return false; } 3551 3552 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 3553 3554 if (typeof Object.getOwnPropertyDescriptor === 'function') { 3555 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 3556 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 3557 } 3558 3559 return true; 3560 }; 3561 3562 3563 /***/ }), 3564 3565 /***/ 4111: 3566 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3567 3568 "use strict"; 3569 3570 3571 var hasSymbols = __webpack_require__(81); 3572 3573 module.exports = function hasToStringTagShams() { 3574 return hasSymbols() && !!Symbol.toStringTag; 3575 }; 3576 3577 3578 /***/ }), 3579 3580 /***/ 9284: 3581 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3582 3583 "use strict"; 3584 3585 3586 var bind = __webpack_require__(1930); 3587 3588 module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); 3589 3590 3591 /***/ }), 3592 3593 /***/ 3138: 3594 /***/ (function(module) { 3595 3596 module.exports = 3597 /******/ (function(modules) { // webpackBootstrap 3598 /******/ // The module cache 3599 /******/ var installedModules = {}; 3600 /******/ 3601 /******/ // The require function 3602 /******/ function __nested_webpack_require_187__(moduleId) { 3603 /******/ 3604 /******/ // Check if module is in cache 3605 /******/ if(installedModules[moduleId]) 3606 /******/ return installedModules[moduleId].exports; 3607 /******/ 3608 /******/ // Create a new module (and put it into the cache) 3609 /******/ var module = installedModules[moduleId] = { 3610 /******/ exports: {}, 3611 /******/ id: moduleId, 3612 /******/ loaded: false 3613 /******/ }; 3614 /******/ 3615 /******/ // Execute the module function 3616 /******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__); 3617 /******/ 3618 /******/ // Flag the module as loaded 3619 /******/ module.loaded = true; 3620 /******/ 3621 /******/ // Return the exports of the module 3622 /******/ return module.exports; 3623 /******/ } 3624 /******/ 3625 /******/ 3626 /******/ // expose the modules object (__webpack_modules__) 3627 /******/ __nested_webpack_require_187__.m = modules; 3628 /******/ 3629 /******/ // expose the module cache 3630 /******/ __nested_webpack_require_187__.c = installedModules; 3631 /******/ 3632 /******/ // __webpack_public_path__ 3633 /******/ __nested_webpack_require_187__.p = ""; 3634 /******/ 3635 /******/ // Load entry module and return exports 3636 /******/ return __nested_webpack_require_187__(0); 3637 /******/ }) 3638 /************************************************************************/ 3639 /******/ ([ 3640 /* 0 */ 3641 /***/ (function(module, exports, __nested_webpack_require_1468__) { 3642 3643 module.exports = __nested_webpack_require_1468__(1); 3644 3645 3646 /***/ }), 3647 /* 1 */ 3648 /***/ (function(module, exports, __nested_webpack_require_1587__) { 3649 3650 'use strict'; 3651 3652 Object.defineProperty(exports, "__esModule", { 3653 value: true 3654 }); 3655 3656 var _utils = __nested_webpack_require_1587__(2); 3657 3658 Object.defineProperty(exports, 'combineChunks', { 3659 enumerable: true, 3660 get: function get() { 3661 return _utils.combineChunks; 3662 } 3663 }); 3664 Object.defineProperty(exports, 'fillInChunks', { 3665 enumerable: true, 3666 get: function get() { 3667 return _utils.fillInChunks; 3668 } 3669 }); 3670 Object.defineProperty(exports, 'findAll', { 3671 enumerable: true, 3672 get: function get() { 3673 return _utils.findAll; 3674 } 3675 }); 3676 Object.defineProperty(exports, 'findChunks', { 3677 enumerable: true, 3678 get: function get() { 3679 return _utils.findChunks; 3680 } 3681 }); 3682 3683 /***/ }), 3684 /* 2 */ 3685 /***/ (function(module, exports) { 3686 3687 'use strict'; 3688 3689 Object.defineProperty(exports, "__esModule", { 3690 value: true 3691 }); 3692 3693 3694 /** 3695 * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. 3696 * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) 3697 */ 3698 var findAll = exports.findAll = function findAll(_ref) { 3699 var autoEscape = _ref.autoEscape, 3700 _ref$caseSensitive = _ref.caseSensitive, 3701 caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive, 3702 _ref$findChunks = _ref.findChunks, 3703 findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks, 3704 sanitize = _ref.sanitize, 3705 searchWords = _ref.searchWords, 3706 textToHighlight = _ref.textToHighlight; 3707 return fillInChunks({ 3708 chunksToHighlight: combineChunks({ 3709 chunks: findChunks({ 3710 autoEscape: autoEscape, 3711 caseSensitive: caseSensitive, 3712 sanitize: sanitize, 3713 searchWords: searchWords, 3714 textToHighlight: textToHighlight 3715 }) 3716 }), 3717 totalLength: textToHighlight ? textToHighlight.length : 0 3718 }); 3719 }; 3720 3721 /** 3722 * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. 3723 * @return {start:number, end:number}[] 3724 */ 3725 3726 3727 var combineChunks = exports.combineChunks = function combineChunks(_ref2) { 3728 var chunks = _ref2.chunks; 3729 3730 chunks = chunks.sort(function (first, second) { 3731 return first.start - second.start; 3732 }).reduce(function (processedChunks, nextChunk) { 3733 // First chunk just goes straight in the array... 3734 if (processedChunks.length === 0) { 3735 return [nextChunk]; 3736 } else { 3737 // ... subsequent chunks get checked to see if they overlap... 3738 var prevChunk = processedChunks.pop(); 3739 if (nextChunk.start <= prevChunk.end) { 3740 // It may be the case that prevChunk completely surrounds nextChunk, so take the 3741 // largest of the end indeces. 3742 var endIndex = Math.max(prevChunk.end, nextChunk.end); 3743 processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); 3744 } else { 3745 processedChunks.push(prevChunk, nextChunk); 3746 } 3747 return processedChunks; 3748 } 3749 }, []); 3750 3751 return chunks; 3752 }; 3753 3754 /** 3755 * Examine text for any matches. 3756 * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). 3757 * @return {start:number, end:number}[] 3758 */ 3759 var defaultFindChunks = function defaultFindChunks(_ref3) { 3760 var autoEscape = _ref3.autoEscape, 3761 caseSensitive = _ref3.caseSensitive, 3762 _ref3$sanitize = _ref3.sanitize, 3763 sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize, 3764 searchWords = _ref3.searchWords, 3765 textToHighlight = _ref3.textToHighlight; 3766 3767 textToHighlight = sanitize(textToHighlight); 3768 3769 return searchWords.filter(function (searchWord) { 3770 return searchWord; 3771 }) // Remove empty words 3772 .reduce(function (chunks, searchWord) { 3773 searchWord = sanitize(searchWord); 3774 3775 if (autoEscape) { 3776 searchWord = escapeRegExpFn(searchWord); 3777 } 3778 3779 var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); 3780 3781 var match = void 0; 3782 while (match = regex.exec(textToHighlight)) { 3783 var _start = match.index; 3784 var _end = regex.lastIndex; 3785 // We do not return zero-length matches 3786 if (_end > _start) { 3787 chunks.push({ highlight: false, start: _start, end: _end }); 3788 } 3789 3790 // Prevent browsers like Firefox from getting stuck in an infinite loop 3791 // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ 3792 if (match.index === regex.lastIndex) { 3793 regex.lastIndex++; 3794 } 3795 } 3796 3797 return chunks; 3798 }, []); 3799 }; 3800 // Allow the findChunks to be overridden in findAll, 3801 // but for backwards compatibility we export as the old name 3802 exports.findChunks = defaultFindChunks; 3803 3804 /** 3805 * Given a set of chunks to highlight, create an additional set of chunks 3806 * to represent the bits of text between the highlighted text. 3807 * @param chunksToHighlight {start:number, end:number}[] 3808 * @param totalLength number 3809 * @return {start:number, end:number, highlight:boolean}[] 3810 */ 3811 3812 var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) { 3813 var chunksToHighlight = _ref4.chunksToHighlight, 3814 totalLength = _ref4.totalLength; 3815 3816 var allChunks = []; 3817 var append = function append(start, end, highlight) { 3818 if (end - start > 0) { 3819 allChunks.push({ 3820 start: start, 3821 end: end, 3822 highlight: highlight 3823 }); 3824 } 3825 }; 3826 3827 if (chunksToHighlight.length === 0) { 3828 append(0, totalLength, false); 3829 } else { 3830 var lastIndex = 0; 3831 chunksToHighlight.forEach(function (chunk) { 3832 append(lastIndex, chunk.start, false); 3833 append(chunk.start, chunk.end, true); 3834 lastIndex = chunk.end; 3835 }); 3836 append(lastIndex, totalLength, false); 3837 } 3838 return allChunks; 3839 }; 3840 3841 function defaultSanitize(string) { 3842 return string; 3843 } 3844 3845 function escapeRegExpFn(string) { 3846 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); 3847 } 3848 3849 /***/ }) 3850 /******/ ]); 3851 3852 3853 /***/ }), 3854 3855 /***/ 1281: 3856 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3857 3858 "use strict"; 3859 3860 3861 var reactIs = __webpack_require__(338); 3862 3863 /** 3864 * Copyright 2015, Yahoo! Inc. 3865 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 3866 */ 3867 var REACT_STATICS = { 3868 childContextTypes: true, 3869 contextType: true, 3870 contextTypes: true, 3871 defaultProps: true, 3872 displayName: true, 3873 getDefaultProps: true, 3874 getDerivedStateFromError: true, 3875 getDerivedStateFromProps: true, 3876 mixins: true, 3877 propTypes: true, 3878 type: true 3879 }; 3880 var KNOWN_STATICS = { 3881 name: true, 3882 length: true, 3883 prototype: true, 3884 caller: true, 3885 callee: true, 3886 arguments: true, 3887 arity: true 3888 }; 3889 var FORWARD_REF_STATICS = { 3890 '$$typeof': true, 3891 render: true, 3892 defaultProps: true, 3893 displayName: true, 3894 propTypes: true 3895 }; 3896 var MEMO_STATICS = { 3897 '$$typeof': true, 3898 compare: true, 3899 defaultProps: true, 3900 displayName: true, 3901 propTypes: true, 3902 type: true 3903 }; 3904 var TYPE_STATICS = {}; 3905 TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; 3906 TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; 3907 3908 function getStatics(component) { 3909 // React v16.11 and below 3910 if (reactIs.isMemo(component)) { 3911 return MEMO_STATICS; 3912 } // React v16.12 and above 3913 3914 3915 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; 3916 } 3917 3918 var defineProperty = Object.defineProperty; 3919 var getOwnPropertyNames = Object.getOwnPropertyNames; 3920 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 3921 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 3922 var getPrototypeOf = Object.getPrototypeOf; 3923 var objectPrototype = Object.prototype; 3924 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { 3925 if (typeof sourceComponent !== 'string') { 3926 // don't hoist over string (html) components 3927 if (objectPrototype) { 3928 var inheritedComponent = getPrototypeOf(sourceComponent); 3929 3930 if (inheritedComponent && inheritedComponent !== objectPrototype) { 3931 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 3932 } 3933 } 3934 3935 var keys = getOwnPropertyNames(sourceComponent); 3936 3937 if (getOwnPropertySymbols) { 3938 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 3939 } 3940 3941 var targetStatics = getStatics(targetComponent); 3942 var sourceStatics = getStatics(sourceComponent); 3943 3944 for (var i = 0; i < keys.length; ++i) { 3945 var key = keys[i]; 3946 3947 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 3948 var descriptor = getOwnPropertyDescriptor(sourceComponent, key); 3949 3950 try { 3951 // Avoid failures from read-only properties 3952 defineProperty(targetComponent, key, descriptor); 3953 } catch (e) {} 3954 } 3955 } 3956 } 3957 3958 return targetComponent; 3959 } 3960 3961 module.exports = hoistNonReactStatics; 3962 3963 3964 /***/ }), 3965 3966 /***/ 5443: 3967 /***/ (function(module) { 3968 3969 "use strict"; 3970 3971 3972 var fnToStr = Function.prototype.toString; 3973 var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; 3974 var badArrayLike; 3975 var isCallableMarker; 3976 if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { 3977 try { 3978 badArrayLike = Object.defineProperty({}, 'length', { 3979 get: function () { 3980 throw isCallableMarker; 3981 } 3982 }); 3983 isCallableMarker = {}; 3984 // eslint-disable-next-line no-throw-literal 3985 reflectApply(function () { throw 42; }, null, badArrayLike); 3986 } catch (_) { 3987 if (_ !== isCallableMarker) { 3988 reflectApply = null; 3989 } 3990 } 3991 } else { 3992 reflectApply = null; 3993 } 3994 3995 var constructorRegex = /^\s*class\b/; 3996 var isES6ClassFn = function isES6ClassFunction(value) { 3997 try { 3998 var fnStr = fnToStr.call(value); 3999 return constructorRegex.test(fnStr); 4000 } catch (e) { 4001 return false; // not a function 4002 } 4003 }; 4004 4005 var tryFunctionObject = function tryFunctionToStr(value) { 4006 try { 4007 if (isES6ClassFn(value)) { return false; } 4008 fnToStr.call(value); 4009 return true; 4010 } catch (e) { 4011 return false; 4012 } 4013 }; 4014 var toStr = Object.prototype.toString; 4015 var fnClass = '[object Function]'; 4016 var genClass = '[object GeneratorFunction]'; 4017 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; 4018 4019 module.exports = reflectApply 4020 ? function isCallable(value) { 4021 if (!value) { return false; } 4022 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 4023 if (typeof value === 'function' && !value.prototype) { return true; } 4024 try { 4025 reflectApply(value, null, badArrayLike); 4026 } catch (e) { 4027 if (e !== isCallableMarker) { return false; } 4028 } 4029 return !isES6ClassFn(value); 4030 } 4031 : function isCallable(value) { 4032 if (!value) { return false; } 4033 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 4034 if (typeof value === 'function' && !value.prototype) { return true; } 4035 if (hasToStringTag) { return tryFunctionObject(value); } 4036 if (isES6ClassFn(value)) { return false; } 4037 var strClass = toStr.call(value); 4038 return strClass === fnClass || strClass === genClass; 4039 }; 4040 4041 4042 /***/ }), 4043 4044 /***/ 8659: 4045 /***/ (function(module) { 4046 4047 "use strict"; 4048 4049 4050 var getDay = Date.prototype.getDay; 4051 var tryDateObject = function tryDateGetDayCall(value) { 4052 try { 4053 getDay.call(value); 4054 return true; 4055 } catch (e) { 4056 return false; 4057 } 4058 }; 4059 4060 var toStr = Object.prototype.toString; 4061 var dateClass = '[object Date]'; 4062 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; 4063 4064 module.exports = function isDateObject(value) { 4065 if (typeof value !== 'object' || value === null) { 4066 return false; 4067 } 4068 return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; 4069 }; 4070 4071 4072 /***/ }), 4073 4074 /***/ 3082: 4075 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4076 4077 "use strict"; 4078 4079 4080 var toStr = Object.prototype.toString; 4081 var hasSymbols = __webpack_require__(9905)(); 4082 4083 if (hasSymbols) { 4084 var symToStr = Symbol.prototype.toString; 4085 var symStringRegex = /^Symbol\(.*\)$/; 4086 var isSymbolObject = function isRealSymbolObject(value) { 4087 if (typeof value.valueOf() !== 'symbol') { 4088 return false; 4089 } 4090 return symStringRegex.test(symToStr.call(value)); 4091 }; 4092 4093 module.exports = function isSymbol(value) { 4094 if (typeof value === 'symbol') { 4095 return true; 4096 } 4097 if (toStr.call(value) !== '[object Symbol]') { 4098 return false; 4099 } 4100 try { 4101 return isSymbolObject(value); 4102 } catch (e) { 4103 return false; 4104 } 4105 }; 4106 } else { 4107 4108 module.exports = function isSymbol(value) { 4109 // this environment does not support Symbols. 4110 return false && 0; 4111 }; 4112 } 4113 4114 4115 /***/ }), 4116 4117 /***/ 5834: 4118 /***/ (function(module, exports) { 4119 4120 Object.defineProperty(exports, "__esModule", ({ 4121 value: true 4122 })); 4123 exports["default"] = isTouchDevice; 4124 function isTouchDevice() { 4125 return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)); 4126 } 4127 module.exports = exports['default']; 4128 4129 /***/ }), 4130 4131 /***/ 4937: 4132 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4133 4134 var root = __webpack_require__(158); 4135 4136 /** Built-in value references. */ 4137 var Symbol = root.Symbol; 4138 4139 module.exports = Symbol; 4140 4141 4142 /***/ }), 4143 4144 /***/ 194: 4145 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4146 4147 var Symbol = __webpack_require__(4937), 4148 getRawTag = __webpack_require__(5401), 4149 objectToString = __webpack_require__(2445); 4150 4151 /** `Object#toString` result references. */ 4152 var nullTag = '[object Null]', 4153 undefinedTag = '[object Undefined]'; 4154 4155 /** Built-in value references. */ 4156 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 4157 4158 /** 4159 * The base implementation of `getTag` without fallbacks for buggy environments. 4160 * 4161 * @private 4162 * @param {*} value The value to query. 4163 * @returns {string} Returns the `toStringTag`. 4164 */ 4165 function baseGetTag(value) { 4166 if (value == null) { 4167 return value === undefined ? undefinedTag : nullTag; 4168 } 4169 return (symToStringTag && symToStringTag in Object(value)) 4170 ? getRawTag(value) 4171 : objectToString(value); 4172 } 4173 4174 module.exports = baseGetTag; 4175 4176 4177 /***/ }), 4178 4179 /***/ 2383: 4180 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4181 4182 var trimmedEndIndex = __webpack_require__(8725); 4183 4184 /** Used to match leading whitespace. */ 4185 var reTrimStart = /^\s+/; 4186 4187 /** 4188 * The base implementation of `_.trim`. 4189 * 4190 * @private 4191 * @param {string} string The string to trim. 4192 * @returns {string} Returns the trimmed string. 4193 */ 4194 function baseTrim(string) { 4195 return string 4196 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 4197 : string; 4198 } 4199 4200 module.exports = baseTrim; 4201 4202 4203 /***/ }), 4204 4205 /***/ 4528: 4206 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4207 4208 /** Detect free variable `global` from Node.js. */ 4209 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 4210 4211 module.exports = freeGlobal; 4212 4213 4214 /***/ }), 4215 4216 /***/ 5401: 4217 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4218 4219 var Symbol = __webpack_require__(4937); 4220 4221 /** Used for built-in method references. */ 4222 var objectProto = Object.prototype; 4223 4224 /** Used to check objects for own properties. */ 4225 var hasOwnProperty = objectProto.hasOwnProperty; 4226 4227 /** 4228 * Used to resolve the 4229 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 4230 * of values. 4231 */ 4232 var nativeObjectToString = objectProto.toString; 4233 4234 /** Built-in value references. */ 4235 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 4236 4237 /** 4238 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 4239 * 4240 * @private 4241 * @param {*} value The value to query. 4242 * @returns {string} Returns the raw `toStringTag`. 4243 */ 4244 function getRawTag(value) { 4245 var isOwn = hasOwnProperty.call(value, symToStringTag), 4246 tag = value[symToStringTag]; 4247 4248 try { 4249 value[symToStringTag] = undefined; 4250 var unmasked = true; 4251 } catch (e) {} 4252 4253 var result = nativeObjectToString.call(value); 4254 if (unmasked) { 4255 if (isOwn) { 4256 value[symToStringTag] = tag; 4257 } else { 4258 delete value[symToStringTag]; 4259 } 4260 } 4261 return result; 4262 } 4263 4264 module.exports = getRawTag; 4265 4266 4267 /***/ }), 4268 4269 /***/ 2445: 4270 /***/ (function(module) { 4271 4272 /** Used for built-in method references. */ 4273 var objectProto = Object.prototype; 4274 4275 /** 4276 * Used to resolve the 4277 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 4278 * of values. 4279 */ 4280 var nativeObjectToString = objectProto.toString; 4281 4282 /** 4283 * Converts `value` to a string using `Object.prototype.toString`. 4284 * 4285 * @private 4286 * @param {*} value The value to convert. 4287 * @returns {string} Returns the converted string. 4288 */ 4289 function objectToString(value) { 4290 return nativeObjectToString.call(value); 4291 } 4292 4293 module.exports = objectToString; 4294 4295 4296 /***/ }), 4297 4298 /***/ 158: 4299 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4300 4301 var freeGlobal = __webpack_require__(4528); 4302 4303 /** Detect free variable `self`. */ 4304 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 4305 4306 /** Used as a reference to the global object. */ 4307 var root = freeGlobal || freeSelf || Function('return this')(); 4308 4309 module.exports = root; 4310 4311 4312 /***/ }), 4313 4314 /***/ 8725: 4315 /***/ (function(module) { 4316 4317 /** Used to match a single whitespace character. */ 4318 var reWhitespace = /\s/; 4319 4320 /** 4321 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 4322 * character of `string`. 4323 * 4324 * @private 4325 * @param {string} string The string to inspect. 4326 * @returns {number} Returns the index of the last non-whitespace character. 4327 */ 4328 function trimmedEndIndex(string) { 4329 var index = string.length; 4330 4331 while (index-- && reWhitespace.test(string.charAt(index))) {} 4332 return index; 4333 } 4334 4335 module.exports = trimmedEndIndex; 4336 4337 4338 /***/ }), 4339 4340 /***/ 6897: 4341 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4342 4343 var isObject = __webpack_require__(3619), 4344 now = __webpack_require__(8253), 4345 toNumber = __webpack_require__(5053); 4346 4347 /** Error message constants. */ 4348 var FUNC_ERROR_TEXT = 'Expected a function'; 4349 4350 /* Built-in method references for those with the same name as other `lodash` methods. */ 4351 var nativeMax = Math.max, 4352 nativeMin = Math.min; 4353 4354 /** 4355 * Creates a debounced function that delays invoking `func` until after `wait` 4356 * milliseconds have elapsed since the last time the debounced function was 4357 * invoked. The debounced function comes with a `cancel` method to cancel 4358 * delayed `func` invocations and a `flush` method to immediately invoke them. 4359 * Provide `options` to indicate whether `func` should be invoked on the 4360 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 4361 * with the last arguments provided to the debounced function. Subsequent 4362 * calls to the debounced function return the result of the last `func` 4363 * invocation. 4364 * 4365 * **Note:** If `leading` and `trailing` options are `true`, `func` is 4366 * invoked on the trailing edge of the timeout only if the debounced function 4367 * is invoked more than once during the `wait` timeout. 4368 * 4369 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 4370 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 4371 * 4372 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 4373 * for details over the differences between `_.debounce` and `_.throttle`. 4374 * 4375 * @static 4376 * @memberOf _ 4377 * @since 0.1.0 4378 * @category Function 4379 * @param {Function} func The function to debounce. 4380 * @param {number} [wait=0] The number of milliseconds to delay. 4381 * @param {Object} [options={}] The options object. 4382 * @param {boolean} [options.leading=false] 4383 * Specify invoking on the leading edge of the timeout. 4384 * @param {number} [options.maxWait] 4385 * The maximum time `func` is allowed to be delayed before it's invoked. 4386 * @param {boolean} [options.trailing=true] 4387 * Specify invoking on the trailing edge of the timeout. 4388 * @returns {Function} Returns the new debounced function. 4389 * @example 4390 * 4391 * // Avoid costly calculations while the window size is in flux. 4392 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 4393 * 4394 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 4395 * jQuery(element).on('click', _.debounce(sendMail, 300, { 4396 * 'leading': true, 4397 * 'trailing': false 4398 * })); 4399 * 4400 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 4401 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 4402 * var source = new EventSource('/stream'); 4403 * jQuery(source).on('message', debounced); 4404 * 4405 * // Cancel the trailing debounced invocation. 4406 * jQuery(window).on('popstate', debounced.cancel); 4407 */ 4408 function debounce(func, wait, options) { 4409 var lastArgs, 4410 lastThis, 4411 maxWait, 4412 result, 4413 timerId, 4414 lastCallTime, 4415 lastInvokeTime = 0, 4416 leading = false, 4417 maxing = false, 4418 trailing = true; 4419 4420 if (typeof func != 'function') { 4421 throw new TypeError(FUNC_ERROR_TEXT); 4422 } 4423 wait = toNumber(wait) || 0; 4424 if (isObject(options)) { 4425 leading = !!options.leading; 4426 maxing = 'maxWait' in options; 4427 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 4428 trailing = 'trailing' in options ? !!options.trailing : trailing; 4429 } 4430 4431 function invokeFunc(time) { 4432 var args = lastArgs, 4433 thisArg = lastThis; 4434 4435 lastArgs = lastThis = undefined; 4436 lastInvokeTime = time; 4437 result = func.apply(thisArg, args); 4438 return result; 4439 } 4440 4441 function leadingEdge(time) { 4442 // Reset any `maxWait` timer. 4443 lastInvokeTime = time; 4444 // Start the timer for the trailing edge. 4445 timerId = setTimeout(timerExpired, wait); 4446 // Invoke the leading edge. 4447 return leading ? invokeFunc(time) : result; 4448 } 4449 4450 function remainingWait(time) { 4451 var timeSinceLastCall = time - lastCallTime, 4452 timeSinceLastInvoke = time - lastInvokeTime, 4453 timeWaiting = wait - timeSinceLastCall; 4454 4455 return maxing 4456 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 4457 : timeWaiting; 4458 } 4459 4460 function shouldInvoke(time) { 4461 var timeSinceLastCall = time - lastCallTime, 4462 timeSinceLastInvoke = time - lastInvokeTime; 4463 4464 // Either this is the first call, activity has stopped and we're at the 4465 // trailing edge, the system time has gone backwards and we're treating 4466 // it as the trailing edge, or we've hit the `maxWait` limit. 4467 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 4468 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 4469 } 4470 4471 function timerExpired() { 4472 var time = now(); 4473 if (shouldInvoke(time)) { 4474 return trailingEdge(time); 4475 } 4476 // Restart the timer. 4477 timerId = setTimeout(timerExpired, remainingWait(time)); 4478 } 4479 4480 function trailingEdge(time) { 4481 timerId = undefined; 4482 4483 // Only invoke if we have `lastArgs` which means `func` has been 4484 // debounced at least once. 4485 if (trailing && lastArgs) { 4486 return invokeFunc(time); 4487 } 4488 lastArgs = lastThis = undefined; 4489 return result; 4490 } 4491 4492 function cancel() { 4493 if (timerId !== undefined) { 4494 clearTimeout(timerId); 4495 } 4496 lastInvokeTime = 0; 4497 lastArgs = lastCallTime = lastThis = timerId = undefined; 4498 } 4499 4500 function flush() { 4501 return timerId === undefined ? result : trailingEdge(now()); 4502 } 4503 4504 function debounced() { 4505 var time = now(), 4506 isInvoking = shouldInvoke(time); 4507 4508 lastArgs = arguments; 4509 lastThis = this; 4510 lastCallTime = time; 4511 4512 if (isInvoking) { 4513 if (timerId === undefined) { 4514 return leadingEdge(lastCallTime); 4515 } 4516 if (maxing) { 4517 // Handle invocations in a tight loop. 4518 clearTimeout(timerId); 4519 timerId = setTimeout(timerExpired, wait); 4520 return invokeFunc(lastCallTime); 4521 } 4522 } 4523 if (timerId === undefined) { 4524 timerId = setTimeout(timerExpired, wait); 4525 } 4526 return result; 4527 } 4528 debounced.cancel = cancel; 4529 debounced.flush = flush; 4530 return debounced; 4531 } 4532 4533 module.exports = debounce; 4534 4535 4536 /***/ }), 4537 4538 /***/ 3619: 4539 /***/ (function(module) { 4540 4541 /** 4542 * Checks if `value` is the 4543 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 4544 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 4545 * 4546 * @static 4547 * @memberOf _ 4548 * @since 0.1.0 4549 * @category Lang 4550 * @param {*} value The value to check. 4551 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 4552 * @example 4553 * 4554 * _.isObject({}); 4555 * // => true 4556 * 4557 * _.isObject([1, 2, 3]); 4558 * // => true 4559 * 4560 * _.isObject(_.noop); 4561 * // => true 4562 * 4563 * _.isObject(null); 4564 * // => false 4565 */ 4566 function isObject(value) { 4567 var type = typeof value; 4568 return value != null && (type == 'object' || type == 'function'); 4569 } 4570 4571 module.exports = isObject; 4572 4573 4574 /***/ }), 4575 4576 /***/ 1653: 4577 /***/ (function(module) { 4578 4579 /** 4580 * Checks if `value` is object-like. A value is object-like if it's not `null` 4581 * and has a `typeof` result of "object". 4582 * 4583 * @static 4584 * @memberOf _ 4585 * @since 4.0.0 4586 * @category Lang 4587 * @param {*} value The value to check. 4588 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 4589 * @example 4590 * 4591 * _.isObjectLike({}); 4592 * // => true 4593 * 4594 * _.isObjectLike([1, 2, 3]); 4595 * // => true 4596 * 4597 * _.isObjectLike(_.noop); 4598 * // => false 4599 * 4600 * _.isObjectLike(null); 4601 * // => false 4602 */ 4603 function isObjectLike(value) { 4604 return value != null && typeof value == 'object'; 4605 } 4606 4607 module.exports = isObjectLike; 4608 4609 4610 /***/ }), 4611 4612 /***/ 1878: 4613 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4614 4615 var baseGetTag = __webpack_require__(194), 4616 isObjectLike = __webpack_require__(1653); 4617 4618 /** `Object#toString` result references. */ 4619 var symbolTag = '[object Symbol]'; 4620 4621 /** 4622 * Checks if `value` is classified as a `Symbol` primitive or object. 4623 * 4624 * @static 4625 * @memberOf _ 4626 * @since 4.0.0 4627 * @category Lang 4628 * @param {*} value The value to check. 4629 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 4630 * @example 4631 * 4632 * _.isSymbol(Symbol.iterator); 4633 * // => true 4634 * 4635 * _.isSymbol('abc'); 4636 * // => false 4637 */ 4638 function isSymbol(value) { 4639 return typeof value == 'symbol' || 4640 (isObjectLike(value) && baseGetTag(value) == symbolTag); 4641 } 4642 4643 module.exports = isSymbol; 4644 4645 4646 /***/ }), 4647 4648 /***/ 8253: 4649 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4650 4651 var root = __webpack_require__(158); 4652 4653 /** 4654 * Gets the timestamp of the number of milliseconds that have elapsed since 4655 * the Unix epoch (1 January 1970 00:00:00 UTC). 4656 * 4657 * @static 4658 * @memberOf _ 4659 * @since 2.4.0 4660 * @category Date 4661 * @returns {number} Returns the timestamp. 4662 * @example 4663 * 4664 * _.defer(function(stamp) { 4665 * console.log(_.now() - stamp); 4666 * }, _.now()); 4667 * // => Logs the number of milliseconds it took for the deferred invocation. 4668 */ 4669 var now = function() { 4670 return root.Date.now(); 4671 }; 4672 4673 module.exports = now; 4674 4675 4676 /***/ }), 4677 4678 /***/ 8172: 4679 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4680 4681 var debounce = __webpack_require__(6897), 4682 isObject = __webpack_require__(3619); 4683 4684 /** Error message constants. */ 4685 var FUNC_ERROR_TEXT = 'Expected a function'; 4686 4687 /** 4688 * Creates a throttled function that only invokes `func` at most once per 4689 * every `wait` milliseconds. The throttled function comes with a `cancel` 4690 * method to cancel delayed `func` invocations and a `flush` method to 4691 * immediately invoke them. Provide `options` to indicate whether `func` 4692 * should be invoked on the leading and/or trailing edge of the `wait` 4693 * timeout. The `func` is invoked with the last arguments provided to the 4694 * throttled function. Subsequent calls to the throttled function return the 4695 * result of the last `func` invocation. 4696 * 4697 * **Note:** If `leading` and `trailing` options are `true`, `func` is 4698 * invoked on the trailing edge of the timeout only if the throttled function 4699 * is invoked more than once during the `wait` timeout. 4700 * 4701 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 4702 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 4703 * 4704 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 4705 * for details over the differences between `_.throttle` and `_.debounce`. 4706 * 4707 * @static 4708 * @memberOf _ 4709 * @since 0.1.0 4710 * @category Function 4711 * @param {Function} func The function to throttle. 4712 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 4713 * @param {Object} [options={}] The options object. 4714 * @param {boolean} [options.leading=true] 4715 * Specify invoking on the leading edge of the timeout. 4716 * @param {boolean} [options.trailing=true] 4717 * Specify invoking on the trailing edge of the timeout. 4718 * @returns {Function} Returns the new throttled function. 4719 * @example 4720 * 4721 * // Avoid excessively updating the position while scrolling. 4722 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 4723 * 4724 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 4725 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 4726 * jQuery(element).on('click', throttled); 4727 * 4728 * // Cancel the trailing throttled invocation. 4729 * jQuery(window).on('popstate', throttled.cancel); 4730 */ 4731 function throttle(func, wait, options) { 4732 var leading = true, 4733 trailing = true; 4734 4735 if (typeof func != 'function') { 4736 throw new TypeError(FUNC_ERROR_TEXT); 4737 } 4738 if (isObject(options)) { 4739 leading = 'leading' in options ? !!options.leading : leading; 4740 trailing = 'trailing' in options ? !!options.trailing : trailing; 4741 } 4742 return debounce(func, wait, { 4743 'leading': leading, 4744 'maxWait': wait, 4745 'trailing': trailing 4746 }); 4747 } 4748 4749 module.exports = throttle; 4750 4751 4752 /***/ }), 4753 4754 /***/ 5053: 4755 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4756 4757 var baseTrim = __webpack_require__(2383), 4758 isObject = __webpack_require__(3619), 4759 isSymbol = __webpack_require__(1878); 4760 4761 /** Used as references for various `Number` constants. */ 4762 var NAN = 0 / 0; 4763 4764 /** Used to detect bad signed hexadecimal string values. */ 4765 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 4766 4767 /** Used to detect binary string values. */ 4768 var reIsBinary = /^0b[01]+$/i; 4769 4770 /** Used to detect octal string values. */ 4771 var reIsOctal = /^0o[0-7]+$/i; 4772 4773 /** Built-in method references without a dependency on `root`. */ 4774 var freeParseInt = parseInt; 4775 4776 /** 4777 * Converts `value` to a number. 4778 * 4779 * @static 4780 * @memberOf _ 4781 * @since 4.0.0 4782 * @category Lang 4783 * @param {*} value The value to process. 4784 * @returns {number} Returns the number. 4785 * @example 4786 * 4787 * _.toNumber(3.2); 4788 * // => 3.2 4789 * 4790 * _.toNumber(Number.MIN_VALUE); 4791 * // => 5e-324 4792 * 4793 * _.toNumber(Infinity); 4794 * // => Infinity 4795 * 4796 * _.toNumber('3.2'); 4797 * // => 3.2 4798 */ 4799 function toNumber(value) { 4800 if (typeof value == 'number') { 4801 return value; 4802 } 4803 if (isSymbol(value)) { 4804 return NAN; 4805 } 4806 if (isObject(value)) { 4807 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 4808 value = isObject(other) ? (other + '') : other; 4809 } 4810 if (typeof value != 'string') { 4811 return value === 0 ? value : +value; 4812 } 4813 value = baseTrim(value); 4814 var isBinary = reIsBinary.test(value); 4815 return (isBinary || reIsOctal.test(value)) 4816 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 4817 : (reIsBadHex.test(value) ? NAN : +value); 4818 } 4819 4820 module.exports = toNumber; 4821 4822 4823 /***/ }), 4824 4825 /***/ 9756: 4826 /***/ (function(module) { 4827 4828 /** 4829 * Memize options object. 4830 * 4831 * @typedef MemizeOptions 4832 * 4833 * @property {number} [maxSize] Maximum size of the cache. 4834 */ 4835 4836 /** 4837 * Internal cache entry. 4838 * 4839 * @typedef MemizeCacheNode 4840 * 4841 * @property {?MemizeCacheNode|undefined} [prev] Previous node. 4842 * @property {?MemizeCacheNode|undefined} [next] Next node. 4843 * @property {Array<*>} args Function arguments for cache 4844 * entry. 4845 * @property {*} val Function result. 4846 */ 4847 4848 /** 4849 * Properties of the enhanced function for controlling cache. 4850 * 4851 * @typedef MemizeMemoizedFunction 4852 * 4853 * @property {()=>void} clear Clear the cache. 4854 */ 4855 4856 /** 4857 * Accepts a function to be memoized, and returns a new memoized function, with 4858 * optional options. 4859 * 4860 * @template {Function} F 4861 * 4862 * @param {F} fn Function to memoize. 4863 * @param {MemizeOptions} [options] Options object. 4864 * 4865 * @return {F & MemizeMemoizedFunction} Memoized function. 4866 */ 4867 function memize( fn, options ) { 4868 var size = 0; 4869 4870 /** @type {?MemizeCacheNode|undefined} */ 4871 var head; 4872 4873 /** @type {?MemizeCacheNode|undefined} */ 4874 var tail; 4875 4876 options = options || {}; 4877 4878 function memoized( /* ...args */ ) { 4879 var node = head, 4880 len = arguments.length, 4881 args, i; 4882 4883 searchCache: while ( node ) { 4884 // Perform a shallow equality test to confirm that whether the node 4885 // under test is a candidate for the arguments passed. Two arrays 4886 // are shallowly equal if their length matches and each entry is 4887 // strictly equal between the two sets. Avoid abstracting to a 4888 // function which could incur an arguments leaking deoptimization. 4889 4890 // Check whether node arguments match arguments length 4891 if ( node.args.length !== arguments.length ) { 4892 node = node.next; 4893 continue; 4894 } 4895 4896 // Check whether node arguments match arguments values 4897 for ( i = 0; i < len; i++ ) { 4898 if ( node.args[ i ] !== arguments[ i ] ) { 4899 node = node.next; 4900 continue searchCache; 4901 } 4902 } 4903 4904 // At this point we can assume we've found a match 4905 4906 // Surface matched node to head if not already 4907 if ( node !== head ) { 4908 // As tail, shift to previous. Must only shift if not also 4909 // head, since if both head and tail, there is no previous. 4910 if ( node === tail ) { 4911 tail = node.prev; 4912 } 4913 4914 // Adjust siblings to point to each other. If node was tail, 4915 // this also handles new tail's empty `next` assignment. 4916 /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; 4917 if ( node.next ) { 4918 node.next.prev = node.prev; 4919 } 4920 4921 node.next = head; 4922 node.prev = null; 4923 /** @type {MemizeCacheNode} */ ( head ).prev = node; 4924 head = node; 4925 } 4926 4927 // Return immediately 4928 return node.val; 4929 } 4930 4931 // No cached value found. Continue to insertion phase: 4932 4933 // Create a copy of arguments (avoid leaking deoptimization) 4934 args = new Array( len ); 4935 for ( i = 0; i < len; i++ ) { 4936 args[ i ] = arguments[ i ]; 4937 } 4938 4939 node = { 4940 args: args, 4941 4942 // Generate the result from original function 4943 val: fn.apply( null, args ), 4944 }; 4945 4946 // Don't need to check whether node is already head, since it would 4947 // have been returned above already if it was 4948 4949 // Shift existing head down list 4950 if ( head ) { 4951 head.prev = node; 4952 node.next = head; 4953 } else { 4954 // If no head, follows that there's no tail (at initial or reset) 4955 tail = node; 4956 } 4957 4958 // Trim tail if we're reached max size and are pending cache insertion 4959 if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { 4960 tail = /** @type {MemizeCacheNode} */ ( tail ).prev; 4961 /** @type {MemizeCacheNode} */ ( tail ).next = null; 4962 } else { 4963 size++; 4964 } 4965 4966 head = node; 4967 4968 return node.val; 4969 } 4970 4971 memoized.clear = function() { 4972 head = null; 4973 tail = null; 4974 size = 0; 4975 }; 4976 4977 if ( false ) {} 4978 4979 // Ignore reason: There's not a clear solution to create an intersection of 4980 // the function with additional properties, where the goal is to retain the 4981 // function signature of the incoming argument and add control properties 4982 // on the return value. 4983 4984 // @ts-ignore 4985 return memoized; 4986 } 4987 4988 module.exports = memize; 4989 4990 4991 /***/ }), 4992 4993 /***/ 8383: 4994 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4995 4996 "use strict"; 4997 4998 4999 var keysShim; 5000 if (!Object.keys) { 5001 // modified from https://github.com/es-shims/es5-shim 5002 var has = Object.prototype.hasOwnProperty; 5003 var toStr = Object.prototype.toString; 5004 var isArgs = __webpack_require__(4418); // eslint-disable-line global-require 5005 var isEnumerable = Object.prototype.propertyIsEnumerable; 5006 var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); 5007 var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); 5008 var dontEnums = [ 5009 'toString', 5010 'toLocaleString', 5011 'valueOf', 5012 'hasOwnProperty', 5013 'isPrototypeOf', 5014 'propertyIsEnumerable', 5015 'constructor' 5016 ]; 5017 var equalsConstructorPrototype = function (o) { 5018 var ctor = o.constructor; 5019 return ctor && ctor.prototype === o; 5020 }; 5021 var excludedKeys = { 5022 $applicationCache: true, 5023 $console: true, 5024 $external: true, 5025 $frame: true, 5026 $frameElement: true, 5027 $frames: true, 5028 $innerHeight: true, 5029 $innerWidth: true, 5030 $onmozfullscreenchange: true, 5031 $onmozfullscreenerror: true, 5032 $outerHeight: true, 5033 $outerWidth: true, 5034 $pageXOffset: true, 5035 $pageYOffset: true, 5036 $parent: true, 5037 $scrollLeft: true, 5038 $scrollTop: true, 5039 $scrollX: true, 5040 $scrollY: true, 5041 $self: true, 5042 $webkitIndexedDB: true, 5043 $webkitStorageInfo: true, 5044 $window: true 5045 }; 5046 var hasAutomationEqualityBug = (function () { 5047 /* global window */ 5048 if (typeof window === 'undefined') { return false; } 5049 for (var k in window) { 5050 try { 5051 if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { 5052 try { 5053 equalsConstructorPrototype(window[k]); 5054 } catch (e) { 5055 return true; 5056 } 5057 } 5058 } catch (e) { 5059 return true; 5060 } 5061 } 5062 return false; 5063 }()); 5064 var equalsConstructorPrototypeIfNotBuggy = function (o) { 5065 /* global window */ 5066 if (typeof window === 'undefined' || !hasAutomationEqualityBug) { 5067 return equalsConstructorPrototype(o); 5068 } 5069 try { 5070 return equalsConstructorPrototype(o); 5071 } catch (e) { 5072 return false; 5073 } 5074 }; 5075 5076 keysShim = function keys(object) { 5077 var isObject = object !== null && typeof object === 'object'; 5078 var isFunction = toStr.call(object) === '[object Function]'; 5079 var isArguments = isArgs(object); 5080 var isString = isObject && toStr.call(object) === '[object String]'; 5081 var theKeys = []; 5082 5083 if (!isObject && !isFunction && !isArguments) { 5084 throw new TypeError('Object.keys called on a non-object'); 5085 } 5086 5087 var skipProto = hasProtoEnumBug && isFunction; 5088 if (isString && object.length > 0 && !has.call(object, 0)) { 5089 for (var i = 0; i < object.length; ++i) { 5090 theKeys.push(String(i)); 5091 } 5092 } 5093 5094 if (isArguments && object.length > 0) { 5095 for (var j = 0; j < object.length; ++j) { 5096 theKeys.push(String(j)); 5097 } 5098 } else { 5099 for (var name in object) { 5100 if (!(skipProto && name === 'prototype') && has.call(object, name)) { 5101 theKeys.push(String(name)); 5102 } 5103 } 5104 } 5105 5106 if (hasDontEnumBug) { 5107 var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); 5108 5109 for (var k = 0; k < dontEnums.length; ++k) { 5110 if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { 5111 theKeys.push(dontEnums[k]); 5112 } 5113 } 5114 } 5115 return theKeys; 5116 }; 5117 } 5118 module.exports = keysShim; 5119 5120 5121 /***/ }), 5122 5123 /***/ 806: 5124 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5125 5126 "use strict"; 5127 5128 5129 var slice = Array.prototype.slice; 5130 var isArgs = __webpack_require__(4418); 5131 5132 var origKeys = Object.keys; 5133 var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(8383); 5134 5135 var originalKeys = Object.keys; 5136 5137 keysShim.shim = function shimObjectKeys() { 5138 if (Object.keys) { 5139 var keysWorksWithArguments = (function () { 5140 // Safari 5.0 bug 5141 var args = Object.keys(arguments); 5142 return args && args.length === arguments.length; 5143 }(1, 2)); 5144 if (!keysWorksWithArguments) { 5145 Object.keys = function keys(object) { // eslint-disable-line func-name-matching 5146 if (isArgs(object)) { 5147 return originalKeys(slice.call(object)); 5148 } 5149 return originalKeys(object); 5150 }; 5151 } 5152 } else { 5153 Object.keys = keysShim; 5154 } 5155 return Object.keys || keysShim; 5156 }; 5157 5158 module.exports = keysShim; 5159 5160 5161 /***/ }), 5162 5163 /***/ 4418: 5164 /***/ (function(module) { 5165 5166 "use strict"; 5167 5168 5169 var toStr = Object.prototype.toString; 5170 5171 module.exports = function isArguments(value) { 5172 var str = toStr.call(value); 5173 var isArgs = str === '[object Arguments]'; 5174 if (!isArgs) { 5175 isArgs = str !== '[object Array]' && 5176 value !== null && 5177 typeof value === 'object' && 5178 typeof value.length === 'number' && 5179 value.length >= 0 && 5180 toStr.call(value.callee) === '[object Function]'; 5181 } 5182 return isArgs; 5183 }; 5184 5185 5186 /***/ }), 5187 5188 /***/ 2148: 5189 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5190 5191 "use strict"; 5192 5193 5194 // modified from https://github.com/es-shims/es6-shim 5195 var keys = __webpack_require__(806); 5196 var canBeObject = function (obj) { 5197 return typeof obj !== 'undefined' && obj !== null; 5198 }; 5199 var hasSymbols = __webpack_require__(5682)(); 5200 var callBound = __webpack_require__(7615); 5201 var toObject = Object; 5202 var $push = callBound('Array.prototype.push'); 5203 var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 5204 var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; 5205 5206 // eslint-disable-next-line no-unused-vars 5207 module.exports = function assign(target, source1) { 5208 if (!canBeObject(target)) { throw new TypeError('target must be an object'); } 5209 var objTarget = toObject(target); 5210 var s, source, i, props, syms, value, key; 5211 for (s = 1; s < arguments.length; ++s) { 5212 source = toObject(arguments[s]); 5213 props = keys(source); 5214 var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); 5215 if (getSymbols) { 5216 syms = getSymbols(source); 5217 for (i = 0; i < syms.length; ++i) { 5218 key = syms[i]; 5219 if ($propIsEnumerable(source, key)) { 5220 $push(props, key); 5221 } 5222 } 5223 } 5224 for (i = 0; i < props.length; ++i) { 5225 key = props[i]; 5226 value = source[key]; 5227 if ($propIsEnumerable(source, key)) { 5228 objTarget[key] = value; 5229 } 5230 } 5231 } 5232 return objTarget; 5233 }; 5234 5235 5236 /***/ }), 5237 5238 /***/ 4011: 5239 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5240 5241 "use strict"; 5242 5243 5244 var defineProperties = __webpack_require__(9170); 5245 var callBind = __webpack_require__(2550); 5246 5247 var implementation = __webpack_require__(2148); 5248 var getPolyfill = __webpack_require__(293); 5249 var shim = __webpack_require__(2666); 5250 5251 var polyfill = callBind.apply(getPolyfill()); 5252 // eslint-disable-next-line no-unused-vars 5253 var bound = function assign(target, source1) { 5254 return polyfill(Object, arguments); 5255 }; 5256 5257 defineProperties(bound, { 5258 getPolyfill: getPolyfill, 5259 implementation: implementation, 5260 shim: shim 5261 }); 5262 5263 module.exports = bound; 5264 5265 5266 /***/ }), 5267 5268 /***/ 293: 5269 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5270 5271 "use strict"; 5272 5273 5274 var implementation = __webpack_require__(2148); 5275 5276 var lacksProperEnumerationOrder = function () { 5277 if (!Object.assign) { 5278 return false; 5279 } 5280 /* 5281 * v8, specifically in node 4.x, has a bug with incorrect property enumeration order 5282 * note: this does not detect the bug unless there's 20 characters 5283 */ 5284 var str = 'abcdefghijklmnopqrst'; 5285 var letters = str.split(''); 5286 var map = {}; 5287 for (var i = 0; i < letters.length; ++i) { 5288 map[letters[i]] = letters[i]; 5289 } 5290 var obj = Object.assign({}, map); 5291 var actual = ''; 5292 for (var k in obj) { 5293 actual += k; 5294 } 5295 return str !== actual; 5296 }; 5297 5298 var assignHasPendingExceptions = function () { 5299 if (!Object.assign || !Object.preventExtensions) { 5300 return false; 5301 } 5302 /* 5303 * Firefox 37 still has "pending exception" logic in its Object.assign implementation, 5304 * which is 72% slower than our shim, and Firefox 40's native implementation. 5305 */ 5306 var thrower = Object.preventExtensions({ 1: 2 }); 5307 try { 5308 Object.assign(thrower, 'xy'); 5309 } catch (e) { 5310 return thrower[1] === 'y'; 5311 } 5312 return false; 5313 }; 5314 5315 module.exports = function getPolyfill() { 5316 if (!Object.assign) { 5317 return implementation; 5318 } 5319 if (lacksProperEnumerationOrder()) { 5320 return implementation; 5321 } 5322 if (assignHasPendingExceptions()) { 5323 return implementation; 5324 } 5325 return Object.assign; 5326 }; 5327 5328 5329 /***/ }), 5330 5331 /***/ 2666: 5332 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5333 5334 "use strict"; 5335 5336 5337 var define = __webpack_require__(9170); 5338 var getPolyfill = __webpack_require__(293); 5339 5340 module.exports = function shimAssign() { 5341 var polyfill = getPolyfill(); 5342 define( 5343 Object, 5344 { assign: polyfill }, 5345 { assign: function () { return Object.assign !== polyfill; } } 5346 ); 5347 return polyfill; 5348 }; 5349 5350 5351 /***/ }), 5352 5353 /***/ 1631: 5354 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5355 5356 "use strict"; 5357 5358 5359 var has = __webpack_require__(9284); 5360 var RequireObjectCoercible = __webpack_require__(604); 5361 var callBound = __webpack_require__(7615); 5362 5363 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 5364 5365 module.exports = function values(O) { 5366 var obj = RequireObjectCoercible(O); 5367 var vals = []; 5368 for (var key in obj) { 5369 if (has(obj, key) && $isEnumerable(obj, key)) { 5370 vals.push(obj[key]); 5371 } 5372 } 5373 return vals; 5374 }; 5375 5376 5377 /***/ }), 5378 5379 /***/ 5861: 5380 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5381 5382 "use strict"; 5383 5384 5385 var define = __webpack_require__(9170); 5386 var callBind = __webpack_require__(2550); 5387 5388 var implementation = __webpack_require__(1631); 5389 var getPolyfill = __webpack_require__(779); 5390 var shim = __webpack_require__(7256); 5391 5392 var polyfill = callBind(getPolyfill(), Object); 5393 5394 define(polyfill, { 5395 getPolyfill: getPolyfill, 5396 implementation: implementation, 5397 shim: shim 5398 }); 5399 5400 module.exports = polyfill; 5401 5402 5403 /***/ }), 5404 5405 /***/ 604: 5406 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5407 5408 "use strict"; 5409 5410 5411 module.exports = __webpack_require__(2559); 5412 5413 5414 /***/ }), 5415 5416 /***/ 2559: 5417 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5418 5419 "use strict"; 5420 5421 5422 var GetIntrinsic = __webpack_require__(6732); 5423 5424 var $TypeError = GetIntrinsic('%TypeError%'); 5425 5426 // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 5427 5428 module.exports = function CheckObjectCoercible(value, optMessage) { 5429 if (value == null) { 5430 throw new $TypeError(optMessage || ('Cannot call method on ' + value)); 5431 } 5432 return value; 5433 }; 5434 5435 5436 /***/ }), 5437 5438 /***/ 6732: 5439 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5440 5441 "use strict"; 5442 5443 5444 /* globals 5445 AggregateError, 5446 Atomics, 5447 FinalizationRegistry, 5448 SharedArrayBuffer, 5449 WeakRef, 5450 */ 5451 5452 var undefined; 5453 5454 var $SyntaxError = SyntaxError; 5455 var $Function = Function; 5456 var $TypeError = TypeError; 5457 5458 // eslint-disable-next-line consistent-return 5459 var getEvalledConstructor = function (expressionSyntax) { 5460 try { 5461 // eslint-disable-next-line no-new-func 5462 return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 5463 } catch (e) {} 5464 }; 5465 5466 var $gOPD = Object.getOwnPropertyDescriptor; 5467 if ($gOPD) { 5468 try { 5469 $gOPD({}, ''); 5470 } catch (e) { 5471 $gOPD = null; // this is IE 8, which has a broken gOPD 5472 } 5473 } 5474 5475 var throwTypeError = function () { throw new $TypeError(); }; 5476 var ThrowTypeError = $gOPD 5477 ? (function () { 5478 try { 5479 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 5480 arguments.callee; // IE 8 does not throw here 5481 return throwTypeError; 5482 } catch (calleeThrows) { 5483 try { 5484 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 5485 return $gOPD(arguments, 'callee').get; 5486 } catch (gOPDthrows) { 5487 return throwTypeError; 5488 } 5489 } 5490 }()) 5491 : throwTypeError; 5492 5493 var hasSymbols = __webpack_require__(9905)(); 5494 5495 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 5496 5497 var asyncGenFunction = getEvalledConstructor('async function* () {}'); 5498 var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; 5499 var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; 5500 5501 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 5502 5503 var INTRINSICS = { 5504 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 5505 '%Array%': Array, 5506 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 5507 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 5508 '%AsyncFromSyncIteratorPrototype%': undefined, 5509 '%AsyncFunction%': getEvalledConstructor('async function () {}'), 5510 '%AsyncGenerator%': asyncGenFunctionPrototype, 5511 '%AsyncGeneratorFunction%': asyncGenFunction, 5512 '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, 5513 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 5514 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 5515 '%Boolean%': Boolean, 5516 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 5517 '%Date%': Date, 5518 '%decodeURI%': decodeURI, 5519 '%decodeURIComponent%': decodeURIComponent, 5520 '%encodeURI%': encodeURI, 5521 '%encodeURIComponent%': encodeURIComponent, 5522 '%Error%': Error, 5523 '%eval%': eval, // eslint-disable-line no-eval 5524 '%EvalError%': EvalError, 5525 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 5526 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 5527 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 5528 '%Function%': $Function, 5529 '%GeneratorFunction%': getEvalledConstructor('function* () {}'), 5530 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 5531 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 5532 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 5533 '%isFinite%': isFinite, 5534 '%isNaN%': isNaN, 5535 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 5536 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 5537 '%Map%': typeof Map === 'undefined' ? undefined : Map, 5538 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 5539 '%Math%': Math, 5540 '%Number%': Number, 5541 '%Object%': Object, 5542 '%parseFloat%': parseFloat, 5543 '%parseInt%': parseInt, 5544 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 5545 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 5546 '%RangeError%': RangeError, 5547 '%ReferenceError%': ReferenceError, 5548 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 5549 '%RegExp%': RegExp, 5550 '%Set%': typeof Set === 'undefined' ? undefined : Set, 5551 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 5552 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 5553 '%String%': String, 5554 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 5555 '%Symbol%': hasSymbols ? Symbol : undefined, 5556 '%SyntaxError%': $SyntaxError, 5557 '%ThrowTypeError%': ThrowTypeError, 5558 '%TypedArray%': TypedArray, 5559 '%TypeError%': $TypeError, 5560 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 5561 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 5562 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 5563 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 5564 '%URIError%': URIError, 5565 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 5566 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 5567 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 5568 }; 5569 5570 var LEGACY_ALIASES = { 5571 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 5572 '%ArrayPrototype%': ['Array', 'prototype'], 5573 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 5574 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 5575 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 5576 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 5577 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 5578 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 5579 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 5580 '%BooleanPrototype%': ['Boolean', 'prototype'], 5581 '%DataViewPrototype%': ['DataView', 'prototype'], 5582 '%DatePrototype%': ['Date', 'prototype'], 5583 '%ErrorPrototype%': ['Error', 'prototype'], 5584 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 5585 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 5586 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 5587 '%FunctionPrototype%': ['Function', 'prototype'], 5588 '%Generator%': ['GeneratorFunction', 'prototype'], 5589 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 5590 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 5591 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 5592 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 5593 '%JSONParse%': ['JSON', 'parse'], 5594 '%JSONStringify%': ['JSON', 'stringify'], 5595 '%MapPrototype%': ['Map', 'prototype'], 5596 '%NumberPrototype%': ['Number', 'prototype'], 5597 '%ObjectPrototype%': ['Object', 'prototype'], 5598 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 5599 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 5600 '%PromisePrototype%': ['Promise', 'prototype'], 5601 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 5602 '%Promise_all%': ['Promise', 'all'], 5603 '%Promise_reject%': ['Promise', 'reject'], 5604 '%Promise_resolve%': ['Promise', 'resolve'], 5605 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 5606 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 5607 '%RegExpPrototype%': ['RegExp', 'prototype'], 5608 '%SetPrototype%': ['Set', 'prototype'], 5609 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 5610 '%StringPrototype%': ['String', 'prototype'], 5611 '%SymbolPrototype%': ['Symbol', 'prototype'], 5612 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 5613 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 5614 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 5615 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 5616 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 5617 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 5618 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 5619 '%URIErrorPrototype%': ['URIError', 'prototype'], 5620 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 5621 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 5622 }; 5623 5624 var bind = __webpack_require__(1930); 5625 var hasOwn = __webpack_require__(9284); 5626 var $concat = bind.call(Function.call, Array.prototype.concat); 5627 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 5628 var $replace = bind.call(Function.call, String.prototype.replace); 5629 5630 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 5631 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 5632 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 5633 var stringToPath = function stringToPath(string) { 5634 var result = []; 5635 $replace(string, rePropName, function (match, number, quote, subString) { 5636 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 5637 }); 5638 return result; 5639 }; 5640 /* end adaptation */ 5641 5642 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 5643 var intrinsicName = name; 5644 var alias; 5645 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 5646 alias = LEGACY_ALIASES[intrinsicName]; 5647 intrinsicName = '%' + alias[0] + '%'; 5648 } 5649 5650 if (hasOwn(INTRINSICS, intrinsicName)) { 5651 var value = INTRINSICS[intrinsicName]; 5652 if (typeof value === 'undefined' && !allowMissing) { 5653 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 5654 } 5655 5656 return { 5657 alias: alias, 5658 name: intrinsicName, 5659 value: value 5660 }; 5661 } 5662 5663 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 5664 }; 5665 5666 module.exports = function GetIntrinsic(name, allowMissing) { 5667 if (typeof name !== 'string' || name.length === 0) { 5668 throw new $TypeError('intrinsic name must be a non-empty string'); 5669 } 5670 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 5671 throw new $TypeError('"allowMissing" argument must be a boolean'); 5672 } 5673 5674 var parts = stringToPath(name); 5675 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 5676 5677 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 5678 var intrinsicRealName = intrinsic.name; 5679 var value = intrinsic.value; 5680 var skipFurtherCaching = false; 5681 5682 var alias = intrinsic.alias; 5683 if (alias) { 5684 intrinsicBaseName = alias[0]; 5685 $spliceApply(parts, $concat([0, 1], alias)); 5686 } 5687 5688 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 5689 var part = parts[i]; 5690 if (part === 'constructor' || !isOwn) { 5691 skipFurtherCaching = true; 5692 } 5693 5694 intrinsicBaseName += '.' + part; 5695 intrinsicRealName = '%' + intrinsicBaseName + '%'; 5696 5697 if (hasOwn(INTRINSICS, intrinsicRealName)) { 5698 value = INTRINSICS[intrinsicRealName]; 5699 } else if (value != null) { 5700 if ($gOPD && (i + 1) >= parts.length) { 5701 var desc = $gOPD(value, part); 5702 isOwn = !!desc; 5703 5704 if (!allowMissing && !(part in value)) { 5705 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 5706 } 5707 // By convention, when a data property is converted to an accessor 5708 // property to emulate a data property that does not suffer from 5709 // the override mistake, that accessor's getter is marked with 5710 // an `originalValue` property. Here, when we detect this, we 5711 // uphold the illusion by pretending to see that original data 5712 // property, i.e., returning the value rather than the getter 5713 // itself. 5714 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 5715 value = desc.get; 5716 } else { 5717 value = value[part]; 5718 } 5719 } else { 5720 isOwn = hasOwn(value, part); 5721 value = value[part]; 5722 } 5723 5724 if (isOwn && !skipFurtherCaching) { 5725 INTRINSICS[intrinsicRealName] = value; 5726 } 5727 } 5728 } 5729 return value; 5730 }; 5731 5732 5733 /***/ }), 5734 5735 /***/ 779: 5736 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5737 5738 "use strict"; 5739 5740 5741 var implementation = __webpack_require__(1631); 5742 5743 module.exports = function getPolyfill() { 5744 return typeof Object.values === 'function' ? Object.values : implementation; 5745 }; 5746 5747 5748 /***/ }), 5749 5750 /***/ 7256: 5751 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5752 5753 "use strict"; 5754 5755 5756 var getPolyfill = __webpack_require__(779); 5757 var define = __webpack_require__(9170); 5758 5759 module.exports = function shimValues() { 5760 var polyfill = getPolyfill(); 5761 define(Object, { values: polyfill }, { 5762 values: function testValues() { 5763 return Object.values !== polyfill; 5764 } 5765 }); 5766 return polyfill; 5767 }; 5768 5769 5770 /***/ }), 5771 5772 /***/ 5372: 5773 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5774 5775 "use strict"; 5776 /** 5777 * Copyright (c) 2013-present, Facebook, Inc. 5778 * 5779 * This source code is licensed under the MIT license found in the 5780 * LICENSE file in the root directory of this source tree. 5781 */ 5782 5783 5784 5785 var ReactPropTypesSecret = __webpack_require__(9567); 5786 5787 function emptyFunction() {} 5788 function emptyFunctionWithReset() {} 5789 emptyFunctionWithReset.resetWarningCache = emptyFunction; 5790 5791 module.exports = function() { 5792 function shim(props, propName, componentName, location, propFullName, secret) { 5793 if (secret === ReactPropTypesSecret) { 5794 // It is still safe when called from React. 5795 return; 5796 } 5797 var err = new Error( 5798 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 5799 'Use PropTypes.checkPropTypes() to call them. ' + 5800 'Read more at http://fb.me/use-check-prop-types' 5801 ); 5802 err.name = 'Invariant Violation'; 5803 throw err; 5804 }; 5805 shim.isRequired = shim; 5806 function getShim() { 5807 return shim; 5808 }; 5809 // Important! 5810 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. 5811 var ReactPropTypes = { 5812 array: shim, 5813 bigint: shim, 5814 bool: shim, 5815 func: shim, 5816 number: shim, 5817 object: shim, 5818 string: shim, 5819 symbol: shim, 5820 5821 any: shim, 5822 arrayOf: getShim, 5823 element: shim, 5824 elementType: shim, 5825 instanceOf: getShim, 5826 node: shim, 5827 objectOf: getShim, 5828 oneOf: getShim, 5829 oneOfType: getShim, 5830 shape: getShim, 5831 exact: getShim, 5832 5833 checkPropTypes: emptyFunctionWithReset, 5834 resetWarningCache: emptyFunction 5835 }; 5836 5837 ReactPropTypes.PropTypes = ReactPropTypes; 5838 5839 return ReactPropTypes; 5840 }; 5841 5842 5843 /***/ }), 5844 5845 /***/ 2652: 5846 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5847 5848 /** 5849 * Copyright (c) 2013-present, Facebook, Inc. 5850 * 5851 * This source code is licensed under the MIT license found in the 5852 * LICENSE file in the root directory of this source tree. 5853 */ 5854 5855 if (false) { var throwOnDirectAccess, ReactIs; } else { 5856 // By explicitly using `prop-types` you are opting into new production behavior. 5857 // http://fb.me/prop-types-in-prod 5858 module.exports = __webpack_require__(5372)(); 5859 } 5860 5861 5862 /***/ }), 5863 5864 /***/ 9567: 5865 /***/ (function(module) { 5866 5867 "use strict"; 5868 /** 5869 * Copyright (c) 2013-present, Facebook, Inc. 5870 * 5871 * This source code is licensed under the MIT license found in the 5872 * LICENSE file in the root directory of this source tree. 5873 */ 5874 5875 5876 5877 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 5878 5879 module.exports = ReactPropTypesSecret; 5880 5881 5882 /***/ }), 5883 5884 /***/ 2541: 5885 /***/ (function(module) { 5886 5887 "use strict"; 5888 /** 5889 * Copyright (c) 2013-present, Facebook, Inc. 5890 * 5891 * This source code is licensed under the MIT license found in the 5892 * LICENSE file in the root directory of this source tree. 5893 * 5894 * @providesModule shallowCompare 5895 */ 5896 5897 5898 5899 var hasOwnProperty = Object.prototype.hasOwnProperty; 5900 5901 /** 5902 * inlined Object.is polyfill to avoid requiring consumers ship their own 5903 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is 5904 */ 5905 function is(x, y) { 5906 // SameValue algorithm 5907 if (x === y) { 5908 // Steps 1-5, 7-10 5909 // Steps 6.b-6.e: +0 != -0 5910 // Added the nonzero y check to make Flow happy, but it is redundant 5911 return x !== 0 || y !== 0 || 1 / x === 1 / y; 5912 } else { 5913 // Step 6.a: NaN == NaN 5914 return x !== x && y !== y; 5915 } 5916 } 5917 5918 /** 5919 * Performs equality by iterating through keys on an object and returning false 5920 * when any key has values which are not strictly equal between the arguments. 5921 * Returns true when the values of all keys are strictly equal. 5922 */ 5923 function shallowEqual(objA, objB) { 5924 if (is(objA, objB)) { 5925 return true; 5926 } 5927 5928 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { 5929 return false; 5930 } 5931 5932 var keysA = Object.keys(objA); 5933 var keysB = Object.keys(objB); 5934 5935 if (keysA.length !== keysB.length) { 5936 return false; 5937 } 5938 5939 // Test for A's keys different from B. 5940 for (var i = 0; i < keysA.length; i++) { 5941 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { 5942 return false; 5943 } 5944 } 5945 5946 return true; 5947 } 5948 5949 /** 5950 * Does a shallow comparison for props and state. 5951 * See ReactComponentWithPureRenderMixin 5952 * See also https://facebook.github.io/react/docs/shallow-compare.html 5953 */ 5954 function shallowCompare(instance, nextProps, nextState) { 5955 return ( 5956 !shallowEqual(instance.props, nextProps) || 5957 !shallowEqual(instance.state, nextState) 5958 ); 5959 } 5960 5961 module.exports = shallowCompare; 5962 5963 5964 /***/ }), 5965 5966 /***/ 4185: 5967 /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 5968 5969 // eslint-disable-next-line import/no-unresolved 5970 __webpack_require__(17); 5971 5972 5973 /***/ }), 5974 5975 /***/ 7617: 5976 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 5977 5978 "use strict"; 5979 5980 5981 Object.defineProperty(exports, "__esModule", ({ 5982 value: true 5983 })); 5984 exports.PureCalendarDay = undefined; 5985 5986 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 5987 5988 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 5989 5990 var _object = __webpack_require__(4011); 5991 5992 var _object2 = _interopRequireDefault(_object); 5993 5994 var _react = __webpack_require__(9196); 5995 5996 var _react2 = _interopRequireDefault(_react); 5997 5998 var _propTypes = __webpack_require__(2652); 5999 6000 var _propTypes2 = _interopRequireDefault(_propTypes); 6001 6002 var _reactAddonsShallowCompare = __webpack_require__(2541); 6003 6004 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 6005 6006 var _reactMomentProptypes = __webpack_require__(6150); 6007 6008 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 6009 6010 var _airbnbPropTypes = __webpack_require__(4882); 6011 6012 var _reactWithStyles = __webpack_require__(3576); 6013 6014 var _moment = __webpack_require__(6292); 6015 6016 var _moment2 = _interopRequireDefault(_moment); 6017 6018 var _defaultPhrases = __webpack_require__(6030); 6019 6020 var _getPhrasePropTypes = __webpack_require__(2893); 6021 6022 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 6023 6024 var _getCalendarDaySettings = __webpack_require__(7475); 6025 6026 var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings); 6027 6028 var _ModifiersShape = __webpack_require__(6747); 6029 6030 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 6031 6032 var _constants = __webpack_require__(257); 6033 6034 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6035 6036 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6037 6038 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6039 6040 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 6041 6042 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 6043 day: _reactMomentProptypes2['default'].momentObj, 6044 daySize: _airbnbPropTypes.nonNegativeInteger, 6045 isOutsideDay: _propTypes2['default'].bool, 6046 modifiers: _ModifiersShape2['default'], 6047 isFocused: _propTypes2['default'].bool, 6048 tabIndex: _propTypes2['default'].oneOf([0, -1]), 6049 onDayClick: _propTypes2['default'].func, 6050 onDayMouseEnter: _propTypes2['default'].func, 6051 onDayMouseLeave: _propTypes2['default'].func, 6052 renderDayContents: _propTypes2['default'].func, 6053 ariaLabelFormat: _propTypes2['default'].string, 6054 6055 // internationalization 6056 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)) 6057 })); 6058 6059 var defaultProps = { 6060 day: (0, _moment2['default'])(), 6061 daySize: _constants.DAY_SIZE, 6062 isOutsideDay: false, 6063 modifiers: new Set(), 6064 isFocused: false, 6065 tabIndex: -1, 6066 onDayClick: function () { 6067 function onDayClick() {} 6068 6069 return onDayClick; 6070 }(), 6071 onDayMouseEnter: function () { 6072 function onDayMouseEnter() {} 6073 6074 return onDayMouseEnter; 6075 }(), 6076 onDayMouseLeave: function () { 6077 function onDayMouseLeave() {} 6078 6079 return onDayMouseLeave; 6080 }(), 6081 6082 renderDayContents: null, 6083 ariaLabelFormat: 'dddd, LL', 6084 6085 // internationalization 6086 phrases: _defaultPhrases.CalendarDayPhrases 6087 }; 6088 6089 var CalendarDay = function (_React$Component) { 6090 _inherits(CalendarDay, _React$Component); 6091 6092 function CalendarDay() { 6093 var _ref; 6094 6095 _classCallCheck(this, CalendarDay); 6096 6097 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 6098 args[_key] = arguments[_key]; 6099 } 6100 6101 var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args))); 6102 6103 _this.setButtonRef = _this.setButtonRef.bind(_this); 6104 return _this; 6105 } 6106 6107 _createClass(CalendarDay, [{ 6108 key: 'shouldComponentUpdate', 6109 value: function () { 6110 function shouldComponentUpdate(nextProps, nextState) { 6111 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 6112 } 6113 6114 return shouldComponentUpdate; 6115 }() 6116 }, { 6117 key: 'componentDidUpdate', 6118 value: function () { 6119 function componentDidUpdate(prevProps) { 6120 var _props = this.props, 6121 isFocused = _props.isFocused, 6122 tabIndex = _props.tabIndex; 6123 6124 if (tabIndex === 0) { 6125 if (isFocused || tabIndex !== prevProps.tabIndex) { 6126 this.buttonRef.focus(); 6127 } 6128 } 6129 } 6130 6131 return componentDidUpdate; 6132 }() 6133 }, { 6134 key: 'onDayClick', 6135 value: function () { 6136 function onDayClick(day, e) { 6137 var onDayClick = this.props.onDayClick; 6138 6139 onDayClick(day, e); 6140 } 6141 6142 return onDayClick; 6143 }() 6144 }, { 6145 key: 'onDayMouseEnter', 6146 value: function () { 6147 function onDayMouseEnter(day, e) { 6148 var onDayMouseEnter = this.props.onDayMouseEnter; 6149 6150 onDayMouseEnter(day, e); 6151 } 6152 6153 return onDayMouseEnter; 6154 }() 6155 }, { 6156 key: 'onDayMouseLeave', 6157 value: function () { 6158 function onDayMouseLeave(day, e) { 6159 var onDayMouseLeave = this.props.onDayMouseLeave; 6160 6161 onDayMouseLeave(day, e); 6162 } 6163 6164 return onDayMouseLeave; 6165 }() 6166 }, { 6167 key: 'onKeyDown', 6168 value: function () { 6169 function onKeyDown(day, e) { 6170 var onDayClick = this.props.onDayClick; 6171 var key = e.key; 6172 6173 if (key === 'Enter' || key === ' ') { 6174 onDayClick(day, e); 6175 } 6176 } 6177 6178 return onKeyDown; 6179 }() 6180 }, { 6181 key: 'setButtonRef', 6182 value: function () { 6183 function setButtonRef(ref) { 6184 this.buttonRef = ref; 6185 } 6186 6187 return setButtonRef; 6188 }() 6189 }, { 6190 key: 'render', 6191 value: function () { 6192 function render() { 6193 var _this2 = this; 6194 6195 var _props2 = this.props, 6196 day = _props2.day, 6197 ariaLabelFormat = _props2.ariaLabelFormat, 6198 daySize = _props2.daySize, 6199 isOutsideDay = _props2.isOutsideDay, 6200 modifiers = _props2.modifiers, 6201 renderDayContents = _props2.renderDayContents, 6202 tabIndex = _props2.tabIndex, 6203 styles = _props2.styles, 6204 phrases = _props2.phrases; 6205 6206 6207 if (!day) return _react2['default'].createElement('td', null); 6208 6209 var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases), 6210 daySizeStyles = _getCalendarDaySettin.daySizeStyles, 6211 useDefaultCursor = _getCalendarDaySettin.useDefaultCursor, 6212 selected = _getCalendarDaySettin.selected, 6213 hoveredSpan = _getCalendarDaySettin.hoveredSpan, 6214 isOutsideRange = _getCalendarDaySettin.isOutsideRange, 6215 ariaLabel = _getCalendarDaySettin.ariaLabel; 6216 6217 return _react2['default'].createElement( 6218 'td', 6219 _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), { 6220 role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role 6221 , ref: this.setButtonRef, 6222 'aria-label': ariaLabel, 6223 onMouseEnter: function () { 6224 function onMouseEnter(e) { 6225 _this2.onDayMouseEnter(day, e); 6226 } 6227 6228 return onMouseEnter; 6229 }(), 6230 onMouseLeave: function () { 6231 function onMouseLeave(e) { 6232 _this2.onDayMouseLeave(day, e); 6233 } 6234 6235 return onMouseLeave; 6236 }(), 6237 onMouseUp: function () { 6238 function onMouseUp(e) { 6239 e.currentTarget.blur(); 6240 } 6241 6242 return onMouseUp; 6243 }(), 6244 onClick: function () { 6245 function onClick(e) { 6246 _this2.onDayClick(day, e); 6247 } 6248 6249 return onClick; 6250 }(), 6251 onKeyDown: function () { 6252 function onKeyDown(e) { 6253 _this2.onKeyDown(day, e); 6254 } 6255 6256 return onKeyDown; 6257 }(), 6258 tabIndex: tabIndex 6259 }), 6260 renderDayContents ? renderDayContents(day, modifiers) : day.format('D') 6261 ); 6262 } 6263 6264 return render; 6265 }() 6266 }]); 6267 6268 return CalendarDay; 6269 }(_react2['default'].Component); 6270 6271 CalendarDay.propTypes = propTypes; 6272 CalendarDay.defaultProps = defaultProps; 6273 6274 exports.PureCalendarDay = CalendarDay; 6275 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) { 6276 var _ref2$reactDates = _ref2.reactDates, 6277 color = _ref2$reactDates.color, 6278 font = _ref2$reactDates.font; 6279 return { 6280 CalendarDay: { 6281 boxSizing: 'border-box', 6282 cursor: 'pointer', 6283 fontSize: font.size, 6284 textAlign: 'center', 6285 6286 ':active': { 6287 outline: 0 6288 } 6289 }, 6290 6291 CalendarDay__defaultCursor: { 6292 cursor: 'default' 6293 }, 6294 6295 CalendarDay__default: { 6296 border: '1px solid ' + String(color.core.borderLight), 6297 color: color.text, 6298 background: color.background, 6299 6300 ':hover': { 6301 background: color.core.borderLight, 6302 border: '1px double ' + String(color.core.borderLight), 6303 color: 'inherit' 6304 } 6305 }, 6306 6307 CalendarDay__hovered_offset: { 6308 background: color.core.borderBright, 6309 border: '1px double ' + String(color.core.borderLight), 6310 color: 'inherit' 6311 }, 6312 6313 CalendarDay__outside: { 6314 border: 0, 6315 background: color.outside.backgroundColor, 6316 color: color.outside.color, 6317 6318 ':hover': { 6319 border: 0 6320 } 6321 }, 6322 6323 CalendarDay__blocked_minimum_nights: { 6324 background: color.minimumNights.backgroundColor, 6325 border: '1px solid ' + String(color.minimumNights.borderColor), 6326 color: color.minimumNights.color, 6327 6328 ':hover': { 6329 background: color.minimumNights.backgroundColor_hover, 6330 color: color.minimumNights.color_active 6331 }, 6332 6333 ':active': { 6334 background: color.minimumNights.backgroundColor_active, 6335 color: color.minimumNights.color_active 6336 } 6337 }, 6338 6339 CalendarDay__highlighted_calendar: { 6340 background: color.highlighted.backgroundColor, 6341 color: color.highlighted.color, 6342 6343 ':hover': { 6344 background: color.highlighted.backgroundColor_hover, 6345 color: color.highlighted.color_active 6346 }, 6347 6348 ':active': { 6349 background: color.highlighted.backgroundColor_active, 6350 color: color.highlighted.color_active 6351 } 6352 }, 6353 6354 CalendarDay__selected_span: { 6355 background: color.selectedSpan.backgroundColor, 6356 border: '1px solid ' + String(color.selectedSpan.borderColor), 6357 color: color.selectedSpan.color, 6358 6359 ':hover': { 6360 background: color.selectedSpan.backgroundColor_hover, 6361 border: '1px solid ' + String(color.selectedSpan.borderColor), 6362 color: color.selectedSpan.color_active 6363 }, 6364 6365 ':active': { 6366 background: color.selectedSpan.backgroundColor_active, 6367 border: '1px solid ' + String(color.selectedSpan.borderColor), 6368 color: color.selectedSpan.color_active 6369 } 6370 }, 6371 6372 CalendarDay__last_in_range: { 6373 borderRight: color.core.primary 6374 }, 6375 6376 CalendarDay__selected: { 6377 background: color.selected.backgroundColor, 6378 border: '1px solid ' + String(color.selected.borderColor), 6379 color: color.selected.color, 6380 6381 ':hover': { 6382 background: color.selected.backgroundColor_hover, 6383 border: '1px solid ' + String(color.selected.borderColor), 6384 color: color.selected.color_active 6385 }, 6386 6387 ':active': { 6388 background: color.selected.backgroundColor_active, 6389 border: '1px solid ' + String(color.selected.borderColor), 6390 color: color.selected.color_active 6391 } 6392 }, 6393 6394 CalendarDay__hovered_span: { 6395 background: color.hoveredSpan.backgroundColor, 6396 border: '1px solid ' + String(color.hoveredSpan.borderColor), 6397 color: color.hoveredSpan.color, 6398 6399 ':hover': { 6400 background: color.hoveredSpan.backgroundColor_hover, 6401 border: '1px solid ' + String(color.hoveredSpan.borderColor), 6402 color: color.hoveredSpan.color_active 6403 }, 6404 6405 ':active': { 6406 background: color.hoveredSpan.backgroundColor_active, 6407 border: '1px solid ' + String(color.hoveredSpan.borderColor), 6408 color: color.hoveredSpan.color_active 6409 } 6410 }, 6411 6412 CalendarDay__blocked_calendar: { 6413 background: color.blocked_calendar.backgroundColor, 6414 border: '1px solid ' + String(color.blocked_calendar.borderColor), 6415 color: color.blocked_calendar.color, 6416 6417 ':hover': { 6418 background: color.blocked_calendar.backgroundColor_hover, 6419 border: '1px solid ' + String(color.blocked_calendar.borderColor), 6420 color: color.blocked_calendar.color_active 6421 }, 6422 6423 ':active': { 6424 background: color.blocked_calendar.backgroundColor_active, 6425 border: '1px solid ' + String(color.blocked_calendar.borderColor), 6426 color: color.blocked_calendar.color_active 6427 } 6428 }, 6429 6430 CalendarDay__blocked_out_of_range: { 6431 background: color.blocked_out_of_range.backgroundColor, 6432 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 6433 color: color.blocked_out_of_range.color, 6434 6435 ':hover': { 6436 background: color.blocked_out_of_range.backgroundColor_hover, 6437 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 6438 color: color.blocked_out_of_range.color_active 6439 }, 6440 6441 ':active': { 6442 background: color.blocked_out_of_range.backgroundColor_active, 6443 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 6444 color: color.blocked_out_of_range.color_active 6445 } 6446 }, 6447 6448 CalendarDay__selected_start: {}, 6449 CalendarDay__selected_end: {}, 6450 CalendarDay__today: {}, 6451 CalendarDay__firstDayOfWeek: {}, 6452 CalendarDay__lastDayOfWeek: {} 6453 }; 6454 })(CalendarDay); 6455 6456 /***/ }), 6457 6458 /***/ 5986: 6459 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 6460 6461 "use strict"; 6462 6463 6464 Object.defineProperty(exports, "__esModule", ({ 6465 value: true 6466 })); 6467 6468 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 6469 6470 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 6471 6472 var _object = __webpack_require__(4011); 6473 6474 var _object2 = _interopRequireDefault(_object); 6475 6476 var _react = __webpack_require__(9196); 6477 6478 var _react2 = _interopRequireDefault(_react); 6479 6480 var _propTypes = __webpack_require__(2652); 6481 6482 var _propTypes2 = _interopRequireDefault(_propTypes); 6483 6484 var _reactAddonsShallowCompare = __webpack_require__(2541); 6485 6486 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 6487 6488 var _reactMomentProptypes = __webpack_require__(6150); 6489 6490 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 6491 6492 var _airbnbPropTypes = __webpack_require__(4882); 6493 6494 var _reactWithStyles = __webpack_require__(3576); 6495 6496 var _moment = __webpack_require__(6292); 6497 6498 var _moment2 = _interopRequireDefault(_moment); 6499 6500 var _defaultPhrases = __webpack_require__(6030); 6501 6502 var _getPhrasePropTypes = __webpack_require__(2893); 6503 6504 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 6505 6506 var _CalendarWeek = __webpack_require__(4604); 6507 6508 var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek); 6509 6510 var _CalendarDay = __webpack_require__(7617); 6511 6512 var _CalendarDay2 = _interopRequireDefault(_CalendarDay); 6513 6514 var _calculateDimension = __webpack_require__(8607); 6515 6516 var _calculateDimension2 = _interopRequireDefault(_calculateDimension); 6517 6518 var _getCalendarMonthWeeks = __webpack_require__(5644); 6519 6520 var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks); 6521 6522 var _isSameDay = __webpack_require__(3923); 6523 6524 var _isSameDay2 = _interopRequireDefault(_isSameDay); 6525 6526 var _toISODateString = __webpack_require__(7310); 6527 6528 var _toISODateString2 = _interopRequireDefault(_toISODateString); 6529 6530 var _ModifiersShape = __webpack_require__(6747); 6531 6532 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 6533 6534 var _ScrollableOrientationShape = __webpack_require__(6553); 6535 6536 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 6537 6538 var _DayOfWeekShape = __webpack_require__(243); 6539 6540 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 6541 6542 var _constants = __webpack_require__(257); 6543 6544 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6545 6546 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6547 6548 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6549 6550 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-array-index-key: 0 */ 6551 6552 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 6553 month: _reactMomentProptypes2['default'].momentObj, 6554 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 6555 isVisible: _propTypes2['default'].bool, 6556 enableOutsideDays: _propTypes2['default'].bool, 6557 modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']), 6558 orientation: _ScrollableOrientationShape2['default'], 6559 daySize: _airbnbPropTypes.nonNegativeInteger, 6560 onDayClick: _propTypes2['default'].func, 6561 onDayMouseEnter: _propTypes2['default'].func, 6562 onDayMouseLeave: _propTypes2['default'].func, 6563 onMonthSelect: _propTypes2['default'].func, 6564 onYearSelect: _propTypes2['default'].func, 6565 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 6566 renderCalendarDay: _propTypes2['default'].func, 6567 renderDayContents: _propTypes2['default'].func, 6568 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 6569 firstDayOfWeek: _DayOfWeekShape2['default'], 6570 setMonthTitleHeight: _propTypes2['default'].func, 6571 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 6572 6573 focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day 6574 isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day 6575 6576 // i18n 6577 monthFormat: _propTypes2['default'].string, 6578 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)), 6579 dayAriaLabelFormat: _propTypes2['default'].string 6580 })); 6581 6582 var defaultProps = { 6583 month: (0, _moment2['default'])(), 6584 horizontalMonthPadding: 13, 6585 isVisible: true, 6586 enableOutsideDays: false, 6587 modifiers: {}, 6588 orientation: _constants.HORIZONTAL_ORIENTATION, 6589 daySize: _constants.DAY_SIZE, 6590 onDayClick: function () { 6591 function onDayClick() {} 6592 6593 return onDayClick; 6594 }(), 6595 onDayMouseEnter: function () { 6596 function onDayMouseEnter() {} 6597 6598 return onDayMouseEnter; 6599 }(), 6600 onDayMouseLeave: function () { 6601 function onDayMouseLeave() {} 6602 6603 return onDayMouseLeave; 6604 }(), 6605 onMonthSelect: function () { 6606 function onMonthSelect() {} 6607 6608 return onMonthSelect; 6609 }(), 6610 onYearSelect: function () { 6611 function onYearSelect() {} 6612 6613 return onYearSelect; 6614 }(), 6615 6616 renderMonthText: null, 6617 renderCalendarDay: function () { 6618 function renderCalendarDay(props) { 6619 return _react2['default'].createElement(_CalendarDay2['default'], props); 6620 } 6621 6622 return renderCalendarDay; 6623 }(), 6624 renderDayContents: null, 6625 renderMonthElement: null, 6626 firstDayOfWeek: null, 6627 setMonthTitleHeight: null, 6628 6629 focusedDate: null, 6630 isFocused: false, 6631 6632 // i18n 6633 monthFormat: 'MMMM YYYY', // english locale 6634 phrases: _defaultPhrases.CalendarDayPhrases, 6635 dayAriaLabelFormat: undefined, 6636 verticalBorderSpacing: undefined 6637 }; 6638 6639 var CalendarMonth = function (_React$Component) { 6640 _inherits(CalendarMonth, _React$Component); 6641 6642 function CalendarMonth(props) { 6643 _classCallCheck(this, CalendarMonth); 6644 6645 var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props)); 6646 6647 _this.state = { 6648 weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek) 6649 }; 6650 6651 _this.setCaptionRef = _this.setCaptionRef.bind(_this); 6652 _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this); 6653 return _this; 6654 } 6655 6656 _createClass(CalendarMonth, [{ 6657 key: 'componentDidMount', 6658 value: function () { 6659 function componentDidMount() { 6660 this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0); 6661 } 6662 6663 return componentDidMount; 6664 }() 6665 }, { 6666 key: 'componentWillReceiveProps', 6667 value: function () { 6668 function componentWillReceiveProps(nextProps) { 6669 var month = nextProps.month, 6670 enableOutsideDays = nextProps.enableOutsideDays, 6671 firstDayOfWeek = nextProps.firstDayOfWeek; 6672 var _props = this.props, 6673 prevMonth = _props.month, 6674 prevEnableOutsideDays = _props.enableOutsideDays, 6675 prevFirstDayOfWeek = _props.firstDayOfWeek; 6676 6677 if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) { 6678 this.setState({ 6679 weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek) 6680 }); 6681 } 6682 } 6683 6684 return componentWillReceiveProps; 6685 }() 6686 }, { 6687 key: 'shouldComponentUpdate', 6688 value: function () { 6689 function shouldComponentUpdate(nextProps, nextState) { 6690 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 6691 } 6692 6693 return shouldComponentUpdate; 6694 }() 6695 }, { 6696 key: 'componentWillUnmount', 6697 value: function () { 6698 function componentWillUnmount() { 6699 if (this.setMonthTitleHeightTimeout) { 6700 clearTimeout(this.setMonthTitleHeightTimeout); 6701 } 6702 } 6703 6704 return componentWillUnmount; 6705 }() 6706 }, { 6707 key: 'setMonthTitleHeight', 6708 value: function () { 6709 function setMonthTitleHeight() { 6710 var setMonthTitleHeight = this.props.setMonthTitleHeight; 6711 6712 if (setMonthTitleHeight) { 6713 var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true); 6714 setMonthTitleHeight(captionHeight); 6715 } 6716 } 6717 6718 return setMonthTitleHeight; 6719 }() 6720 }, { 6721 key: 'setCaptionRef', 6722 value: function () { 6723 function setCaptionRef(ref) { 6724 this.captionRef = ref; 6725 } 6726 6727 return setCaptionRef; 6728 }() 6729 }, { 6730 key: 'render', 6731 value: function () { 6732 function render() { 6733 var _props2 = this.props, 6734 dayAriaLabelFormat = _props2.dayAriaLabelFormat, 6735 daySize = _props2.daySize, 6736 focusedDate = _props2.focusedDate, 6737 horizontalMonthPadding = _props2.horizontalMonthPadding, 6738 isFocused = _props2.isFocused, 6739 isVisible = _props2.isVisible, 6740 modifiers = _props2.modifiers, 6741 month = _props2.month, 6742 monthFormat = _props2.monthFormat, 6743 onDayClick = _props2.onDayClick, 6744 onDayMouseEnter = _props2.onDayMouseEnter, 6745 onDayMouseLeave = _props2.onDayMouseLeave, 6746 onMonthSelect = _props2.onMonthSelect, 6747 onYearSelect = _props2.onYearSelect, 6748 orientation = _props2.orientation, 6749 phrases = _props2.phrases, 6750 renderCalendarDay = _props2.renderCalendarDay, 6751 renderDayContents = _props2.renderDayContents, 6752 renderMonthElement = _props2.renderMonthElement, 6753 renderMonthText = _props2.renderMonthText, 6754 styles = _props2.styles, 6755 verticalBorderSpacing = _props2.verticalBorderSpacing; 6756 var weeks = this.state.weeks; 6757 6758 var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat); 6759 6760 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 6761 6762 return _react2['default'].createElement( 6763 'div', 6764 _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), { 6765 'data-visible': isVisible 6766 }), 6767 _react2['default'].createElement( 6768 'div', 6769 _extends({ 6770 ref: this.setCaptionRef 6771 }, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)), 6772 renderMonthElement ? renderMonthElement({ month: month, onMonthSelect: onMonthSelect, onYearSelect: onYearSelect }) : _react2['default'].createElement( 6773 'strong', 6774 null, 6775 monthTitle 6776 ) 6777 ), 6778 _react2['default'].createElement( 6779 'table', 6780 _extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && { borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px' }), { 6781 role: 'presentation' 6782 }), 6783 _react2['default'].createElement( 6784 'tbody', 6785 null, 6786 weeks.map(function (week, i) { 6787 return _react2['default'].createElement( 6788 _CalendarWeek2['default'], 6789 { key: i }, 6790 week.map(function (day, dayOfWeek) { 6791 return renderCalendarDay({ 6792 key: dayOfWeek, 6793 day: day, 6794 daySize: daySize, 6795 isOutsideDay: !day || day.month() !== month.month(), 6796 tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1, 6797 isFocused: isFocused, 6798 onDayMouseEnter: onDayMouseEnter, 6799 onDayMouseLeave: onDayMouseLeave, 6800 onDayClick: onDayClick, 6801 renderDayContents: renderDayContents, 6802 phrases: phrases, 6803 modifiers: modifiers[(0, _toISODateString2['default'])(day)], 6804 ariaLabelFormat: dayAriaLabelFormat 6805 }); 6806 }) 6807 ); 6808 }) 6809 ) 6810 ) 6811 ); 6812 } 6813 6814 return render; 6815 }() 6816 }]); 6817 6818 return CalendarMonth; 6819 }(_react2['default'].Component); 6820 6821 CalendarMonth.propTypes = propTypes; 6822 CalendarMonth.defaultProps = defaultProps; 6823 6824 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref) { 6825 var _ref$reactDates = _ref.reactDates, 6826 color = _ref$reactDates.color, 6827 font = _ref$reactDates.font, 6828 spacing = _ref$reactDates.spacing; 6829 return { 6830 CalendarMonth: { 6831 background: color.background, 6832 textAlign: 'center', 6833 verticalAlign: 'top', 6834 userSelect: 'none' 6835 }, 6836 6837 CalendarMonth_table: { 6838 borderCollapse: 'collapse', 6839 borderSpacing: 0 6840 }, 6841 6842 CalendarMonth_verticalSpacing: { 6843 borderCollapse: 'separate' 6844 }, 6845 6846 CalendarMonth_caption: { 6847 color: color.text, 6848 fontSize: font.captionSize, 6849 textAlign: 'center', 6850 paddingTop: spacing.captionPaddingTop, 6851 paddingBottom: spacing.captionPaddingBottom, 6852 captionSide: 'initial' 6853 }, 6854 6855 CalendarMonth_caption__verticalScrollable: { 6856 paddingTop: 12, 6857 paddingBottom: 7 6858 } 6859 }; 6860 })(CalendarMonth); 6861 6862 /***/ }), 6863 6864 /***/ 7938: 6865 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 6866 6867 "use strict"; 6868 6869 6870 Object.defineProperty(exports, "__esModule", ({ 6871 value: true 6872 })); 6873 6874 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 6875 6876 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 6877 6878 var _object = __webpack_require__(4011); 6879 6880 var _object2 = _interopRequireDefault(_object); 6881 6882 var _react = __webpack_require__(9196); 6883 6884 var _react2 = _interopRequireDefault(_react); 6885 6886 var _propTypes = __webpack_require__(2652); 6887 6888 var _propTypes2 = _interopRequireDefault(_propTypes); 6889 6890 var _reactAddonsShallowCompare = __webpack_require__(2541); 6891 6892 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 6893 6894 var _reactMomentProptypes = __webpack_require__(6150); 6895 6896 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 6897 6898 var _airbnbPropTypes = __webpack_require__(4882); 6899 6900 var _reactWithStyles = __webpack_require__(3576); 6901 6902 var _moment = __webpack_require__(6292); 6903 6904 var _moment2 = _interopRequireDefault(_moment); 6905 6906 var _consolidatedEvents = __webpack_require__(8495); 6907 6908 var _defaultPhrases = __webpack_require__(6030); 6909 6910 var _getPhrasePropTypes = __webpack_require__(2893); 6911 6912 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 6913 6914 var _CalendarMonth = __webpack_require__(5986); 6915 6916 var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth); 6917 6918 var _isTransitionEndSupported = __webpack_require__(7978); 6919 6920 var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported); 6921 6922 var _getTransformStyles = __webpack_require__(8304); 6923 6924 var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles); 6925 6926 var _getCalendarMonthWidth = __webpack_require__(8964); 6927 6928 var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth); 6929 6930 var _toISOMonthString = __webpack_require__(2705); 6931 6932 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 6933 6934 var _isPrevMonth = __webpack_require__(3858); 6935 6936 var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth); 6937 6938 var _isNextMonth = __webpack_require__(1310); 6939 6940 var _isNextMonth2 = _interopRequireDefault(_isNextMonth); 6941 6942 var _ModifiersShape = __webpack_require__(6747); 6943 6944 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 6945 6946 var _ScrollableOrientationShape = __webpack_require__(6553); 6947 6948 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 6949 6950 var _DayOfWeekShape = __webpack_require__(243); 6951 6952 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 6953 6954 var _constants = __webpack_require__(257); 6955 6956 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6957 6958 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6959 6960 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6961 6962 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 6963 6964 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 6965 enableOutsideDays: _propTypes2['default'].bool, 6966 firstVisibleMonthIndex: _propTypes2['default'].number, 6967 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 6968 initialMonth: _reactMomentProptypes2['default'].momentObj, 6969 isAnimating: _propTypes2['default'].bool, 6970 numberOfMonths: _propTypes2['default'].number, 6971 modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])), 6972 orientation: _ScrollableOrientationShape2['default'], 6973 onDayClick: _propTypes2['default'].func, 6974 onDayMouseEnter: _propTypes2['default'].func, 6975 onDayMouseLeave: _propTypes2['default'].func, 6976 onMonthTransitionEnd: _propTypes2['default'].func, 6977 onMonthChange: _propTypes2['default'].func, 6978 onYearChange: _propTypes2['default'].func, 6979 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 6980 renderCalendarDay: _propTypes2['default'].func, 6981 renderDayContents: _propTypes2['default'].func, 6982 translationValue: _propTypes2['default'].number, 6983 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 6984 daySize: _airbnbPropTypes.nonNegativeInteger, 6985 focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day 6986 isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day 6987 firstDayOfWeek: _DayOfWeekShape2['default'], 6988 setMonthTitleHeight: _propTypes2['default'].func, 6989 isRTL: _propTypes2['default'].bool, 6990 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 6991 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 6992 6993 // i18n 6994 monthFormat: _propTypes2['default'].string, 6995 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)), 6996 dayAriaLabelFormat: _propTypes2['default'].string 6997 })); 6998 6999 var defaultProps = { 7000 enableOutsideDays: false, 7001 firstVisibleMonthIndex: 0, 7002 horizontalMonthPadding: 13, 7003 initialMonth: (0, _moment2['default'])(), 7004 isAnimating: false, 7005 numberOfMonths: 1, 7006 modifiers: {}, 7007 orientation: _constants.HORIZONTAL_ORIENTATION, 7008 onDayClick: function () { 7009 function onDayClick() {} 7010 7011 return onDayClick; 7012 }(), 7013 onDayMouseEnter: function () { 7014 function onDayMouseEnter() {} 7015 7016 return onDayMouseEnter; 7017 }(), 7018 onDayMouseLeave: function () { 7019 function onDayMouseLeave() {} 7020 7021 return onDayMouseLeave; 7022 }(), 7023 onMonthChange: function () { 7024 function onMonthChange() {} 7025 7026 return onMonthChange; 7027 }(), 7028 onYearChange: function () { 7029 function onYearChange() {} 7030 7031 return onYearChange; 7032 }(), 7033 onMonthTransitionEnd: function () { 7034 function onMonthTransitionEnd() {} 7035 7036 return onMonthTransitionEnd; 7037 }(), 7038 7039 renderMonthText: null, 7040 renderCalendarDay: undefined, 7041 renderDayContents: null, 7042 translationValue: null, 7043 renderMonthElement: null, 7044 daySize: _constants.DAY_SIZE, 7045 focusedDate: null, 7046 isFocused: false, 7047 firstDayOfWeek: null, 7048 setMonthTitleHeight: null, 7049 isRTL: false, 7050 transitionDuration: 200, 7051 verticalBorderSpacing: undefined, 7052 7053 // i18n 7054 monthFormat: 'MMMM YYYY', // english locale 7055 phrases: _defaultPhrases.CalendarDayPhrases, 7056 dayAriaLabelFormat: undefined 7057 }; 7058 7059 function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) { 7060 var month = initialMonth.clone(); 7061 if (!withoutTransitionMonths) month = month.subtract(1, 'month'); 7062 7063 var months = []; 7064 for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) { 7065 months.push(month); 7066 month = month.clone().add(1, 'month'); 7067 } 7068 7069 return months; 7070 } 7071 7072 var CalendarMonthGrid = function (_React$Component) { 7073 _inherits(CalendarMonthGrid, _React$Component); 7074 7075 function CalendarMonthGrid(props) { 7076 _classCallCheck(this, CalendarMonthGrid); 7077 7078 var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props)); 7079 7080 var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE; 7081 _this.state = { 7082 months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths) 7083 }; 7084 7085 _this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])(); 7086 _this.onTransitionEnd = _this.onTransitionEnd.bind(_this); 7087 _this.setContainerRef = _this.setContainerRef.bind(_this); 7088 7089 _this.locale = _moment2['default'].locale(); 7090 _this.onMonthSelect = _this.onMonthSelect.bind(_this); 7091 _this.onYearSelect = _this.onYearSelect.bind(_this); 7092 return _this; 7093 } 7094 7095 _createClass(CalendarMonthGrid, [{ 7096 key: 'componentDidMount', 7097 value: function () { 7098 function componentDidMount() { 7099 this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd); 7100 } 7101 7102 return componentDidMount; 7103 }() 7104 }, { 7105 key: 'componentWillReceiveProps', 7106 value: function () { 7107 function componentWillReceiveProps(nextProps) { 7108 var _this2 = this; 7109 7110 var initialMonth = nextProps.initialMonth, 7111 numberOfMonths = nextProps.numberOfMonths, 7112 orientation = nextProps.orientation; 7113 var months = this.state.months; 7114 var _props = this.props, 7115 prevInitialMonth = _props.initialMonth, 7116 prevNumberOfMonths = _props.numberOfMonths; 7117 7118 var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month'); 7119 var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths; 7120 var newMonths = months; 7121 7122 if (hasMonthChanged && !hasNumberOfMonthsChanged) { 7123 if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) { 7124 newMonths = months.slice(1); 7125 newMonths.push(months[months.length - 1].clone().add(1, 'month')); 7126 } else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) { 7127 newMonths = months.slice(0, months.length - 1); 7128 newMonths.unshift(months[0].clone().subtract(1, 'month')); 7129 } else { 7130 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 7131 newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths); 7132 } 7133 } 7134 7135 if (hasNumberOfMonthsChanged) { 7136 var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 7137 newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths); 7138 } 7139 7140 var momentLocale = _moment2['default'].locale(); 7141 if (this.locale !== momentLocale) { 7142 this.locale = momentLocale; 7143 newMonths = newMonths.map(function (m) { 7144 return m.locale(_this2.locale); 7145 }); 7146 } 7147 7148 this.setState({ 7149 months: newMonths 7150 }); 7151 } 7152 7153 return componentWillReceiveProps; 7154 }() 7155 }, { 7156 key: 'shouldComponentUpdate', 7157 value: function () { 7158 function shouldComponentUpdate(nextProps, nextState) { 7159 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 7160 } 7161 7162 return shouldComponentUpdate; 7163 }() 7164 }, { 7165 key: 'componentDidUpdate', 7166 value: function () { 7167 function componentDidUpdate() { 7168 var _props2 = this.props, 7169 isAnimating = _props2.isAnimating, 7170 transitionDuration = _props2.transitionDuration, 7171 onMonthTransitionEnd = _props2.onMonthTransitionEnd; 7172 7173 // For IE9, immediately call onMonthTransitionEnd instead of 7174 // waiting for the animation to complete. Similarly, if transitionDuration 7175 // is set to 0, also immediately invoke the onMonthTransitionEnd callback 7176 7177 if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) { 7178 onMonthTransitionEnd(); 7179 } 7180 } 7181 7182 return componentDidUpdate; 7183 }() 7184 }, { 7185 key: 'componentWillUnmount', 7186 value: function () { 7187 function componentWillUnmount() { 7188 if (this.removeEventListener) this.removeEventListener(); 7189 } 7190 7191 return componentWillUnmount; 7192 }() 7193 }, { 7194 key: 'onTransitionEnd', 7195 value: function () { 7196 function onTransitionEnd() { 7197 var onMonthTransitionEnd = this.props.onMonthTransitionEnd; 7198 7199 onMonthTransitionEnd(); 7200 } 7201 7202 return onTransitionEnd; 7203 }() 7204 }, { 7205 key: 'onMonthSelect', 7206 value: function () { 7207 function onMonthSelect(currentMonth, newMonthVal) { 7208 var newMonth = currentMonth.clone(); 7209 var _props3 = this.props, 7210 onMonthChange = _props3.onMonthChange, 7211 orientation = _props3.orientation; 7212 var months = this.state.months; 7213 7214 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 7215 var initialMonthSubtraction = months.indexOf(currentMonth); 7216 if (!withoutTransitionMonths) { 7217 initialMonthSubtraction -= 1; 7218 } 7219 newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months'); 7220 onMonthChange(newMonth); 7221 } 7222 7223 return onMonthSelect; 7224 }() 7225 }, { 7226 key: 'onYearSelect', 7227 value: function () { 7228 function onYearSelect(currentMonth, newYearVal) { 7229 var newMonth = currentMonth.clone(); 7230 var _props4 = this.props, 7231 onYearChange = _props4.onYearChange, 7232 orientation = _props4.orientation; 7233 var months = this.state.months; 7234 7235 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 7236 var initialMonthSubtraction = months.indexOf(currentMonth); 7237 if (!withoutTransitionMonths) { 7238 initialMonthSubtraction -= 1; 7239 } 7240 newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months'); 7241 onYearChange(newMonth); 7242 } 7243 7244 return onYearSelect; 7245 }() 7246 }, { 7247 key: 'setContainerRef', 7248 value: function () { 7249 function setContainerRef(ref) { 7250 this.container = ref; 7251 } 7252 7253 return setContainerRef; 7254 }() 7255 }, { 7256 key: 'render', 7257 value: function () { 7258 function render() { 7259 var _this3 = this; 7260 7261 var _props5 = this.props, 7262 enableOutsideDays = _props5.enableOutsideDays, 7263 firstVisibleMonthIndex = _props5.firstVisibleMonthIndex, 7264 horizontalMonthPadding = _props5.horizontalMonthPadding, 7265 isAnimating = _props5.isAnimating, 7266 modifiers = _props5.modifiers, 7267 numberOfMonths = _props5.numberOfMonths, 7268 monthFormat = _props5.monthFormat, 7269 orientation = _props5.orientation, 7270 translationValue = _props5.translationValue, 7271 daySize = _props5.daySize, 7272 onDayMouseEnter = _props5.onDayMouseEnter, 7273 onDayMouseLeave = _props5.onDayMouseLeave, 7274 onDayClick = _props5.onDayClick, 7275 renderMonthText = _props5.renderMonthText, 7276 renderCalendarDay = _props5.renderCalendarDay, 7277 renderDayContents = _props5.renderDayContents, 7278 renderMonthElement = _props5.renderMonthElement, 7279 onMonthTransitionEnd = _props5.onMonthTransitionEnd, 7280 firstDayOfWeek = _props5.firstDayOfWeek, 7281 focusedDate = _props5.focusedDate, 7282 isFocused = _props5.isFocused, 7283 isRTL = _props5.isRTL, 7284 styles = _props5.styles, 7285 phrases = _props5.phrases, 7286 dayAriaLabelFormat = _props5.dayAriaLabelFormat, 7287 transitionDuration = _props5.transitionDuration, 7288 verticalBorderSpacing = _props5.verticalBorderSpacing, 7289 setMonthTitleHeight = _props5.setMonthTitleHeight; 7290 var months = this.state.months; 7291 7292 var isVertical = orientation === _constants.VERTICAL_ORIENTATION; 7293 var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 7294 var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION; 7295 7296 var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding); 7297 7298 var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth; 7299 7300 var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX'; 7301 var transformValue = transformType + '(' + String(translationValue) + 'px)'; 7302 7303 return _react2['default'].createElement( 7304 'div', 7305 _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && { 7306 transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out' 7307 }, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), { 7308 width: width 7309 })), { 7310 ref: this.setContainerRef, 7311 onTransitionEnd: onMonthTransitionEnd 7312 }), 7313 months.map(function (month, i) { 7314 var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths; 7315 var hideForAnimation = i === 0 && !isVisible; 7316 var showForAnimation = i === 0 && isAnimating && isVisible; 7317 var monthString = (0, _toISOMonthString2['default'])(month); 7318 return _react2['default'].createElement( 7319 'div', 7320 _extends({ 7321 key: monthString 7322 }, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && { 7323 position: 'absolute', 7324 left: -calendarMonthWidth 7325 }, showForAnimation && !isVertical && isRTL && { 7326 position: 'absolute', 7327 right: 0 7328 }, showForAnimation && isVertical && { 7329 position: 'absolute', 7330 top: -translationValue 7331 }, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)), 7332 _react2['default'].createElement(_CalendarMonth2['default'], { 7333 month: month, 7334 isVisible: isVisible, 7335 enableOutsideDays: enableOutsideDays, 7336 modifiers: modifiers[monthString], 7337 monthFormat: monthFormat, 7338 orientation: orientation, 7339 onDayMouseEnter: onDayMouseEnter, 7340 onDayMouseLeave: onDayMouseLeave, 7341 onDayClick: onDayClick, 7342 onMonthSelect: _this3.onMonthSelect, 7343 onYearSelect: _this3.onYearSelect, 7344 renderMonthText: renderMonthText, 7345 renderCalendarDay: renderCalendarDay, 7346 renderDayContents: renderDayContents, 7347 renderMonthElement: renderMonthElement, 7348 firstDayOfWeek: firstDayOfWeek, 7349 daySize: daySize, 7350 focusedDate: isVisible ? focusedDate : null, 7351 isFocused: isFocused, 7352 phrases: phrases, 7353 setMonthTitleHeight: setMonthTitleHeight, 7354 dayAriaLabelFormat: dayAriaLabelFormat, 7355 verticalBorderSpacing: verticalBorderSpacing, 7356 horizontalMonthPadding: horizontalMonthPadding 7357 }) 7358 ); 7359 }) 7360 ); 7361 } 7362 7363 return render; 7364 }() 7365 }]); 7366 7367 return CalendarMonthGrid; 7368 }(_react2['default'].Component); 7369 7370 CalendarMonthGrid.propTypes = propTypes; 7371 CalendarMonthGrid.defaultProps = defaultProps; 7372 7373 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref) { 7374 var _ref$reactDates = _ref.reactDates, 7375 color = _ref$reactDates.color, 7376 noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable, 7377 spacing = _ref$reactDates.spacing, 7378 zIndex = _ref$reactDates.zIndex; 7379 return { 7380 CalendarMonthGrid: { 7381 background: color.background, 7382 textAlign: 'left', 7383 zIndex: zIndex 7384 }, 7385 7386 CalendarMonthGrid__animating: { 7387 zIndex: zIndex + 1 7388 }, 7389 7390 CalendarMonthGrid__horizontal: { 7391 position: 'absolute', 7392 left: spacing.dayPickerHorizontalPadding 7393 }, 7394 7395 CalendarMonthGrid__vertical: { 7396 margin: '0 auto' 7397 }, 7398 7399 CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({ 7400 margin: '0 auto', 7401 overflowY: 'scroll' 7402 }, noScrollBarOnVerticalScrollable && { 7403 '-webkitOverflowScrolling': 'touch', 7404 '::-webkit-scrollbar': { 7405 '-webkit-appearance': 'none', 7406 display: 'none' 7407 } 7408 }), 7409 7410 CalendarMonthGrid_month__horizontal: { 7411 display: 'inline-block', 7412 verticalAlign: 'top', 7413 minHeight: '100%' 7414 }, 7415 7416 CalendarMonthGrid_month__hideForAnimation: { 7417 position: 'absolute', 7418 zIndex: zIndex - 1, 7419 opacity: 0, 7420 pointerEvents: 'none' 7421 }, 7422 7423 CalendarMonthGrid_month__hidden: { 7424 visibility: 'hidden' 7425 } 7426 }; 7427 })(CalendarMonthGrid); 7428 7429 /***/ }), 7430 7431 /***/ 4604: 7432 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 7433 7434 "use strict"; 7435 7436 7437 Object.defineProperty(exports, "__esModule", ({ 7438 value: true 7439 })); 7440 exports["default"] = CalendarWeek; 7441 7442 var _react = __webpack_require__(9196); 7443 7444 var _react2 = _interopRequireDefault(_react); 7445 7446 var _airbnbPropTypes = __webpack_require__(4882); 7447 7448 var _CalendarDay = __webpack_require__(7617); 7449 7450 var _CalendarDay2 = _interopRequireDefault(_CalendarDay); 7451 7452 var _CustomizableCalendarDay = __webpack_require__(6698); 7453 7454 var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay); 7455 7456 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7457 7458 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 7459 children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired 7460 }); 7461 7462 function CalendarWeek(_ref) { 7463 var children = _ref.children; 7464 7465 return _react2['default'].createElement( 7466 'tr', 7467 null, 7468 children 7469 ); 7470 } 7471 7472 CalendarWeek.propTypes = propTypes; 7473 7474 /***/ }), 7475 7476 /***/ 9588: 7477 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 7478 7479 "use strict"; 7480 7481 7482 Object.defineProperty(exports, "__esModule", ({ 7483 value: true 7484 })); 7485 7486 var _react = __webpack_require__(9196); 7487 7488 var _react2 = _interopRequireDefault(_react); 7489 7490 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7491 7492 var ChevronDown = function () { 7493 function ChevronDown(props) { 7494 return _react2['default'].createElement( 7495 'svg', 7496 props, 7497 _react2['default'].createElement('path', { 7498 d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z' 7499 }) 7500 ); 7501 } 7502 7503 return ChevronDown; 7504 }(); 7505 7506 ChevronDown.defaultProps = { 7507 viewBox: '0 0 1000 1000' 7508 }; 7509 exports["default"] = ChevronDown; 7510 7511 /***/ }), 7512 7513 /***/ 1809: 7514 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 7515 7516 "use strict"; 7517 7518 7519 Object.defineProperty(exports, "__esModule", ({ 7520 value: true 7521 })); 7522 7523 var _react = __webpack_require__(9196); 7524 7525 var _react2 = _interopRequireDefault(_react); 7526 7527 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7528 7529 var ChevronUp = function () { 7530 function ChevronUp(props) { 7531 return _react2['default'].createElement( 7532 'svg', 7533 props, 7534 _react2['default'].createElement('path', { 7535 d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z' 7536 }) 7537 ); 7538 } 7539 7540 return ChevronUp; 7541 }(); 7542 7543 ChevronUp.defaultProps = { 7544 viewBox: '0 0 1000 1000' 7545 }; 7546 exports["default"] = ChevronUp; 7547 7548 /***/ }), 7549 7550 /***/ 6973: 7551 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 7552 7553 "use strict"; 7554 7555 7556 Object.defineProperty(exports, "__esModule", ({ 7557 value: true 7558 })); 7559 7560 var _react = __webpack_require__(9196); 7561 7562 var _react2 = _interopRequireDefault(_react); 7563 7564 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7565 7566 var CloseButton = function () { 7567 function CloseButton(props) { 7568 return _react2['default'].createElement( 7569 'svg', 7570 props, 7571 _react2['default'].createElement('path', { 7572 fillRule: 'evenodd', 7573 d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z' 7574 }) 7575 ); 7576 } 7577 7578 return CloseButton; 7579 }(); 7580 7581 CloseButton.defaultProps = { 7582 viewBox: '0 0 12 12' 7583 }; 7584 exports["default"] = CloseButton; 7585 7586 /***/ }), 7587 7588 /***/ 6698: 7589 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 7590 7591 "use strict"; 7592 7593 7594 Object.defineProperty(exports, "__esModule", ({ 7595 value: true 7596 })); 7597 exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = undefined; 7598 7599 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 7600 7601 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 7602 7603 var _object = __webpack_require__(4011); 7604 7605 var _object2 = _interopRequireDefault(_object); 7606 7607 var _react = __webpack_require__(9196); 7608 7609 var _react2 = _interopRequireDefault(_react); 7610 7611 var _propTypes = __webpack_require__(2652); 7612 7613 var _propTypes2 = _interopRequireDefault(_propTypes); 7614 7615 var _reactAddonsShallowCompare = __webpack_require__(2541); 7616 7617 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 7618 7619 var _reactMomentProptypes = __webpack_require__(6150); 7620 7621 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 7622 7623 var _airbnbPropTypes = __webpack_require__(4882); 7624 7625 var _reactWithStyles = __webpack_require__(3576); 7626 7627 var _moment = __webpack_require__(6292); 7628 7629 var _moment2 = _interopRequireDefault(_moment); 7630 7631 var _defaultPhrases = __webpack_require__(6030); 7632 7633 var _getPhrasePropTypes = __webpack_require__(2893); 7634 7635 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 7636 7637 var _getCalendarDaySettings = __webpack_require__(7475); 7638 7639 var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings); 7640 7641 var _constants = __webpack_require__(257); 7642 7643 var _DefaultTheme = __webpack_require__(8158); 7644 7645 var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme); 7646 7647 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 7648 7649 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7650 7651 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 7652 7653 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 7654 7655 var color = _DefaultTheme2['default'].reactDates.color; 7656 7657 7658 function getStyles(stylesObj, isHovered) { 7659 if (!stylesObj) return null; 7660 7661 var hover = stylesObj.hover; 7662 7663 if (isHovered && hover) { 7664 return hover; 7665 } 7666 7667 return stylesObj; 7668 } 7669 7670 var DayStyleShape = _propTypes2['default'].shape({ 7671 background: _propTypes2['default'].string, 7672 border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]), 7673 color: _propTypes2['default'].string, 7674 7675 hover: _propTypes2['default'].shape({ 7676 background: _propTypes2['default'].string, 7677 border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]), 7678 color: _propTypes2['default'].string 7679 }) 7680 }); 7681 7682 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 7683 day: _reactMomentProptypes2['default'].momentObj, 7684 daySize: _airbnbPropTypes.nonNegativeInteger, 7685 isOutsideDay: _propTypes2['default'].bool, 7686 modifiers: _propTypes2['default'].instanceOf(Set), 7687 isFocused: _propTypes2['default'].bool, 7688 tabIndex: _propTypes2['default'].oneOf([0, -1]), 7689 onDayClick: _propTypes2['default'].func, 7690 onDayMouseEnter: _propTypes2['default'].func, 7691 onDayMouseLeave: _propTypes2['default'].func, 7692 renderDayContents: _propTypes2['default'].func, 7693 ariaLabelFormat: _propTypes2['default'].string, 7694 7695 // style overrides 7696 defaultStyles: DayStyleShape, 7697 outsideStyles: DayStyleShape, 7698 todayStyles: DayStyleShape, 7699 firstDayOfWeekStyles: DayStyleShape, 7700 lastDayOfWeekStyles: DayStyleShape, 7701 highlightedCalendarStyles: DayStyleShape, 7702 blockedMinNightsStyles: DayStyleShape, 7703 blockedCalendarStyles: DayStyleShape, 7704 blockedOutOfRangeStyles: DayStyleShape, 7705 hoveredSpanStyles: DayStyleShape, 7706 selectedSpanStyles: DayStyleShape, 7707 lastInRangeStyles: DayStyleShape, 7708 selectedStyles: DayStyleShape, 7709 selectedStartStyles: DayStyleShape, 7710 selectedEndStyles: DayStyleShape, 7711 afterHoveredStartStyles: DayStyleShape, 7712 7713 // internationalization 7714 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)) 7715 })); 7716 7717 var defaultStyles = exports.defaultStyles = { 7718 border: '1px solid ' + String(color.core.borderLight), 7719 color: color.text, 7720 background: color.background, 7721 7722 hover: { 7723 background: color.core.borderLight, 7724 border: '1px double ' + String(color.core.borderLight), 7725 color: 'inherit' 7726 } 7727 }; 7728 7729 var outsideStyles = exports.outsideStyles = { 7730 background: color.outside.backgroundColor, 7731 border: 0, 7732 color: color.outside.color 7733 }; 7734 7735 var highlightedCalendarStyles = exports.highlightedCalendarStyles = { 7736 background: color.highlighted.backgroundColor, 7737 color: color.highlighted.color, 7738 7739 hover: { 7740 background: color.highlighted.backgroundColor_hover, 7741 color: color.highlighted.color_active 7742 } 7743 }; 7744 7745 var blockedMinNightsStyles = exports.blockedMinNightsStyles = { 7746 background: color.minimumNights.backgroundColor, 7747 border: '1px solid ' + String(color.minimumNights.borderColor), 7748 color: color.minimumNights.color, 7749 7750 hover: { 7751 background: color.minimumNights.backgroundColor_hover, 7752 color: color.minimumNights.color_active 7753 } 7754 }; 7755 7756 var blockedCalendarStyles = exports.blockedCalendarStyles = { 7757 background: color.blocked_calendar.backgroundColor, 7758 border: '1px solid ' + String(color.blocked_calendar.borderColor), 7759 color: color.blocked_calendar.color, 7760 7761 hover: { 7762 background: color.blocked_calendar.backgroundColor_hover, 7763 border: '1px solid ' + String(color.blocked_calendar.borderColor), 7764 color: color.blocked_calendar.color_active 7765 } 7766 }; 7767 7768 var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = { 7769 background: color.blocked_out_of_range.backgroundColor, 7770 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 7771 color: color.blocked_out_of_range.color, 7772 7773 hover: { 7774 background: color.blocked_out_of_range.backgroundColor_hover, 7775 border: '1px solid ' + String(color.blocked_out_of_range.borderColor), 7776 color: color.blocked_out_of_range.color_active 7777 } 7778 }; 7779 7780 var hoveredSpanStyles = exports.hoveredSpanStyles = { 7781 background: color.hoveredSpan.backgroundColor, 7782 border: '1px solid ' + String(color.hoveredSpan.borderColor), 7783 color: color.hoveredSpan.color, 7784 7785 hover: { 7786 background: color.hoveredSpan.backgroundColor_hover, 7787 border: '1px solid ' + String(color.hoveredSpan.borderColor), 7788 color: color.hoveredSpan.color_active 7789 } 7790 }; 7791 7792 var selectedSpanStyles = exports.selectedSpanStyles = { 7793 background: color.selectedSpan.backgroundColor, 7794 border: '1px solid ' + String(color.selectedSpan.borderColor), 7795 color: color.selectedSpan.color, 7796 7797 hover: { 7798 background: color.selectedSpan.backgroundColor_hover, 7799 border: '1px solid ' + String(color.selectedSpan.borderColor), 7800 color: color.selectedSpan.color_active 7801 } 7802 }; 7803 7804 var lastInRangeStyles = exports.lastInRangeStyles = { 7805 borderRight: color.core.primary 7806 }; 7807 7808 var selectedStyles = exports.selectedStyles = { 7809 background: color.selected.backgroundColor, 7810 border: '1px solid ' + String(color.selected.borderColor), 7811 color: color.selected.color, 7812 7813 hover: { 7814 background: color.selected.backgroundColor_hover, 7815 border: '1px solid ' + String(color.selected.borderColor), 7816 color: color.selected.color_active 7817 } 7818 }; 7819 7820 var defaultProps = { 7821 day: (0, _moment2['default'])(), 7822 daySize: _constants.DAY_SIZE, 7823 isOutsideDay: false, 7824 modifiers: new Set(), 7825 isFocused: false, 7826 tabIndex: -1, 7827 onDayClick: function () { 7828 function onDayClick() {} 7829 7830 return onDayClick; 7831 }(), 7832 onDayMouseEnter: function () { 7833 function onDayMouseEnter() {} 7834 7835 return onDayMouseEnter; 7836 }(), 7837 onDayMouseLeave: function () { 7838 function onDayMouseLeave() {} 7839 7840 return onDayMouseLeave; 7841 }(), 7842 7843 renderDayContents: null, 7844 ariaLabelFormat: 'dddd, LL', 7845 7846 // style defaults 7847 defaultStyles: defaultStyles, 7848 outsideStyles: outsideStyles, 7849 todayStyles: {}, 7850 highlightedCalendarStyles: highlightedCalendarStyles, 7851 blockedMinNightsStyles: blockedMinNightsStyles, 7852 blockedCalendarStyles: blockedCalendarStyles, 7853 blockedOutOfRangeStyles: blockedOutOfRangeStyles, 7854 hoveredSpanStyles: hoveredSpanStyles, 7855 selectedSpanStyles: selectedSpanStyles, 7856 lastInRangeStyles: lastInRangeStyles, 7857 selectedStyles: selectedStyles, 7858 selectedStartStyles: {}, 7859 selectedEndStyles: {}, 7860 afterHoveredStartStyles: {}, 7861 firstDayOfWeekStyles: {}, 7862 lastDayOfWeekStyles: {}, 7863 7864 // internationalization 7865 phrases: _defaultPhrases.CalendarDayPhrases 7866 }; 7867 7868 var CustomizableCalendarDay = function (_React$Component) { 7869 _inherits(CustomizableCalendarDay, _React$Component); 7870 7871 function CustomizableCalendarDay() { 7872 var _ref; 7873 7874 _classCallCheck(this, CustomizableCalendarDay); 7875 7876 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 7877 args[_key] = arguments[_key]; 7878 } 7879 7880 var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args))); 7881 7882 _this.state = { 7883 isHovered: false 7884 }; 7885 7886 _this.setButtonRef = _this.setButtonRef.bind(_this); 7887 return _this; 7888 } 7889 7890 _createClass(CustomizableCalendarDay, [{ 7891 key: 'shouldComponentUpdate', 7892 value: function () { 7893 function shouldComponentUpdate(nextProps, nextState) { 7894 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 7895 } 7896 7897 return shouldComponentUpdate; 7898 }() 7899 }, { 7900 key: 'componentDidUpdate', 7901 value: function () { 7902 function componentDidUpdate(prevProps) { 7903 var _props = this.props, 7904 isFocused = _props.isFocused, 7905 tabIndex = _props.tabIndex; 7906 7907 if (tabIndex === 0) { 7908 if (isFocused || tabIndex !== prevProps.tabIndex) { 7909 this.buttonRef.focus(); 7910 } 7911 } 7912 } 7913 7914 return componentDidUpdate; 7915 }() 7916 }, { 7917 key: 'onDayClick', 7918 value: function () { 7919 function onDayClick(day, e) { 7920 var onDayClick = this.props.onDayClick; 7921 7922 onDayClick(day, e); 7923 } 7924 7925 return onDayClick; 7926 }() 7927 }, { 7928 key: 'onDayMouseEnter', 7929 value: function () { 7930 function onDayMouseEnter(day, e) { 7931 var onDayMouseEnter = this.props.onDayMouseEnter; 7932 7933 this.setState({ isHovered: true }); 7934 onDayMouseEnter(day, e); 7935 } 7936 7937 return onDayMouseEnter; 7938 }() 7939 }, { 7940 key: 'onDayMouseLeave', 7941 value: function () { 7942 function onDayMouseLeave(day, e) { 7943 var onDayMouseLeave = this.props.onDayMouseLeave; 7944 7945 this.setState({ isHovered: false }); 7946 onDayMouseLeave(day, e); 7947 } 7948 7949 return onDayMouseLeave; 7950 }() 7951 }, { 7952 key: 'onKeyDown', 7953 value: function () { 7954 function onKeyDown(day, e) { 7955 var onDayClick = this.props.onDayClick; 7956 var key = e.key; 7957 7958 if (key === 'Enter' || key === ' ') { 7959 onDayClick(day, e); 7960 } 7961 } 7962 7963 return onKeyDown; 7964 }() 7965 }, { 7966 key: 'setButtonRef', 7967 value: function () { 7968 function setButtonRef(ref) { 7969 this.buttonRef = ref; 7970 } 7971 7972 return setButtonRef; 7973 }() 7974 }, { 7975 key: 'render', 7976 value: function () { 7977 function render() { 7978 var _this2 = this; 7979 7980 var _props2 = this.props, 7981 day = _props2.day, 7982 ariaLabelFormat = _props2.ariaLabelFormat, 7983 daySize = _props2.daySize, 7984 isOutsideDay = _props2.isOutsideDay, 7985 modifiers = _props2.modifiers, 7986 tabIndex = _props2.tabIndex, 7987 renderDayContents = _props2.renderDayContents, 7988 styles = _props2.styles, 7989 phrases = _props2.phrases, 7990 defaultStylesWithHover = _props2.defaultStyles, 7991 outsideStylesWithHover = _props2.outsideStyles, 7992 todayStylesWithHover = _props2.todayStyles, 7993 firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles, 7994 lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles, 7995 highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles, 7996 blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles, 7997 blockedCalendarStylesWithHover = _props2.blockedCalendarStyles, 7998 blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles, 7999 hoveredSpanStylesWithHover = _props2.hoveredSpanStyles, 8000 selectedSpanStylesWithHover = _props2.selectedSpanStyles, 8001 lastInRangeStylesWithHover = _props2.lastInRangeStyles, 8002 selectedStylesWithHover = _props2.selectedStyles, 8003 selectedStartStylesWithHover = _props2.selectedStartStyles, 8004 selectedEndStylesWithHover = _props2.selectedEndStyles, 8005 afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles; 8006 var isHovered = this.state.isHovered; 8007 8008 8009 if (!day) return _react2['default'].createElement('td', null); 8010 8011 var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases), 8012 daySizeStyles = _getCalendarDaySettin.daySizeStyles, 8013 useDefaultCursor = _getCalendarDaySettin.useDefaultCursor, 8014 selected = _getCalendarDaySettin.selected, 8015 hoveredSpan = _getCalendarDaySettin.hoveredSpan, 8016 isOutsideRange = _getCalendarDaySettin.isOutsideRange, 8017 ariaLabel = _getCalendarDaySettin.ariaLabel; 8018 8019 return _react2['default'].createElement( 8020 'td', 8021 _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), { 8022 role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role 8023 , ref: this.setButtonRef, 8024 'aria-label': ariaLabel, 8025 onMouseEnter: function () { 8026 function onMouseEnter(e) { 8027 _this2.onDayMouseEnter(day, e); 8028 } 8029 8030 return onMouseEnter; 8031 }(), 8032 onMouseLeave: function () { 8033 function onMouseLeave(e) { 8034 _this2.onDayMouseLeave(day, e); 8035 } 8036 8037 return onMouseLeave; 8038 }(), 8039 onMouseUp: function () { 8040 function onMouseUp(e) { 8041 e.currentTarget.blur(); 8042 } 8043 8044 return onMouseUp; 8045 }(), 8046 onClick: function () { 8047 function onClick(e) { 8048 _this2.onDayClick(day, e); 8049 } 8050 8051 return onClick; 8052 }(), 8053 onKeyDown: function () { 8054 function onKeyDown(e) { 8055 _this2.onKeyDown(day, e); 8056 } 8057 8058 return onKeyDown; 8059 }(), 8060 tabIndex: tabIndex 8061 }), 8062 renderDayContents ? renderDayContents(day, modifiers) : day.format('D') 8063 ); 8064 } 8065 8066 return render; 8067 }() 8068 }]); 8069 8070 return CustomizableCalendarDay; 8071 }(_react2['default'].Component); 8072 8073 CustomizableCalendarDay.propTypes = propTypes; 8074 CustomizableCalendarDay.defaultProps = defaultProps; 8075 8076 exports.PureCustomizableCalendarDay = CustomizableCalendarDay; 8077 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) { 8078 var font = _ref2.reactDates.font; 8079 return { 8080 CalendarDay: { 8081 boxSizing: 'border-box', 8082 cursor: 'pointer', 8083 fontSize: font.size, 8084 textAlign: 'center', 8085 8086 ':active': { 8087 outline: 0 8088 } 8089 }, 8090 8091 CalendarDay__defaultCursor: { 8092 cursor: 'default' 8093 } 8094 }; 8095 })(CustomizableCalendarDay); 8096 8097 /***/ }), 8098 8099 /***/ 8665: 8100 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 8101 8102 "use strict"; 8103 8104 8105 Object.defineProperty(exports, "__esModule", ({ 8106 value: true 8107 })); 8108 exports.PureDayPicker = exports.defaultProps = undefined; 8109 8110 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 8111 8112 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 8113 8114 var _object = __webpack_require__(4011); 8115 8116 var _object2 = _interopRequireDefault(_object); 8117 8118 var _react = __webpack_require__(9196); 8119 8120 var _react2 = _interopRequireDefault(_react); 8121 8122 var _propTypes = __webpack_require__(2652); 8123 8124 var _propTypes2 = _interopRequireDefault(_propTypes); 8125 8126 var _reactAddonsShallowCompare = __webpack_require__(2541); 8127 8128 var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); 8129 8130 var _airbnbPropTypes = __webpack_require__(4882); 8131 8132 var _reactWithStyles = __webpack_require__(3576); 8133 8134 var _moment = __webpack_require__(6292); 8135 8136 var _moment2 = _interopRequireDefault(_moment); 8137 8138 var _throttle = __webpack_require__(8172); 8139 8140 var _throttle2 = _interopRequireDefault(_throttle); 8141 8142 var _isTouchDevice = __webpack_require__(5834); 8143 8144 var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice); 8145 8146 var _reactOutsideClickHandler = __webpack_require__(6606); 8147 8148 var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler); 8149 8150 var _defaultPhrases = __webpack_require__(6030); 8151 8152 var _getPhrasePropTypes = __webpack_require__(2893); 8153 8154 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 8155 8156 var _CalendarMonthGrid = __webpack_require__(7938); 8157 8158 var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid); 8159 8160 var _DayPickerNavigation = __webpack_require__(3895); 8161 8162 var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation); 8163 8164 var _DayPickerKeyboardShortcuts = __webpack_require__(600); 8165 8166 var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts); 8167 8168 var _getNumberOfCalendarMonthWeeks = __webpack_require__(4112); 8169 8170 var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks); 8171 8172 var _getCalendarMonthWidth = __webpack_require__(8964); 8173 8174 var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth); 8175 8176 var _calculateDimension = __webpack_require__(8607); 8177 8178 var _calculateDimension2 = _interopRequireDefault(_calculateDimension); 8179 8180 var _getActiveElement = __webpack_require__(5814); 8181 8182 var _getActiveElement2 = _interopRequireDefault(_getActiveElement); 8183 8184 var _isDayVisible = __webpack_require__(5713); 8185 8186 var _isDayVisible2 = _interopRequireDefault(_isDayVisible); 8187 8188 var _ModifiersShape = __webpack_require__(6747); 8189 8190 var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); 8191 8192 var _ScrollableOrientationShape = __webpack_require__(6553); 8193 8194 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 8195 8196 var _DayOfWeekShape = __webpack_require__(243); 8197 8198 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 8199 8200 var _CalendarInfoPositionShape = __webpack_require__(8182); 8201 8202 var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape); 8203 8204 var _constants = __webpack_require__(257); 8205 8206 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8207 8208 function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 8209 8210 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8211 8212 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 8213 8214 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 8215 8216 var MONTH_PADDING = 23; 8217 var PREV_TRANSITION = 'prev'; 8218 var NEXT_TRANSITION = 'next'; 8219 var MONTH_SELECTION_TRANSITION = 'month_selection'; 8220 var YEAR_SELECTION_TRANSITION = 'year_selection'; 8221 8222 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 8223 8224 // calendar presentation props 8225 enableOutsideDays: _propTypes2['default'].bool, 8226 numberOfMonths: _propTypes2['default'].number, 8227 orientation: _ScrollableOrientationShape2['default'], 8228 withPortal: _propTypes2['default'].bool, 8229 onOutsideClick: _propTypes2['default'].func, 8230 hidden: _propTypes2['default'].bool, 8231 initialVisibleMonth: _propTypes2['default'].func, 8232 firstDayOfWeek: _DayOfWeekShape2['default'], 8233 renderCalendarInfo: _propTypes2['default'].func, 8234 calendarInfoPosition: _CalendarInfoPositionShape2['default'], 8235 hideKeyboardShortcutsPanel: _propTypes2['default'].bool, 8236 daySize: _airbnbPropTypes.nonNegativeInteger, 8237 isRTL: _propTypes2['default'].bool, 8238 verticalHeight: _airbnbPropTypes.nonNegativeInteger, 8239 noBorder: _propTypes2['default'].bool, 8240 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 8241 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 8242 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 8243 8244 // navigation props 8245 navPrev: _propTypes2['default'].node, 8246 navNext: _propTypes2['default'].node, 8247 noNavButtons: _propTypes2['default'].bool, 8248 onPrevMonthClick: _propTypes2['default'].func, 8249 onNextMonthClick: _propTypes2['default'].func, 8250 onMonthChange: _propTypes2['default'].func, 8251 onYearChange: _propTypes2['default'].func, 8252 onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only 8253 8254 // month props 8255 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 8256 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 8257 8258 // day props 8259 modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])), 8260 renderCalendarDay: _propTypes2['default'].func, 8261 renderDayContents: _propTypes2['default'].func, 8262 onDayClick: _propTypes2['default'].func, 8263 onDayMouseEnter: _propTypes2['default'].func, 8264 onDayMouseLeave: _propTypes2['default'].func, 8265 8266 // accessibility props 8267 isFocused: _propTypes2['default'].bool, 8268 getFirstFocusableDay: _propTypes2['default'].func, 8269 onBlur: _propTypes2['default'].func, 8270 showKeyboardShortcuts: _propTypes2['default'].bool, 8271 8272 // internationalization 8273 monthFormat: _propTypes2['default'].string, 8274 weekDayFormat: _propTypes2['default'].string, 8275 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)), 8276 dayAriaLabelFormat: _propTypes2['default'].string 8277 })); 8278 8279 var defaultProps = exports.defaultProps = { 8280 // calendar presentation props 8281 enableOutsideDays: false, 8282 numberOfMonths: 2, 8283 orientation: _constants.HORIZONTAL_ORIENTATION, 8284 withPortal: false, 8285 onOutsideClick: function () { 8286 function onOutsideClick() {} 8287 8288 return onOutsideClick; 8289 }(), 8290 8291 hidden: false, 8292 initialVisibleMonth: function () { 8293 function initialVisibleMonth() { 8294 return (0, _moment2['default'])(); 8295 } 8296 8297 return initialVisibleMonth; 8298 }(), 8299 firstDayOfWeek: null, 8300 renderCalendarInfo: null, 8301 calendarInfoPosition: _constants.INFO_POSITION_BOTTOM, 8302 hideKeyboardShortcutsPanel: false, 8303 daySize: _constants.DAY_SIZE, 8304 isRTL: false, 8305 verticalHeight: null, 8306 noBorder: false, 8307 transitionDuration: undefined, 8308 verticalBorderSpacing: undefined, 8309 horizontalMonthPadding: 13, 8310 8311 // navigation props 8312 navPrev: null, 8313 navNext: null, 8314 noNavButtons: false, 8315 onPrevMonthClick: function () { 8316 function onPrevMonthClick() {} 8317 8318 return onPrevMonthClick; 8319 }(), 8320 onNextMonthClick: function () { 8321 function onNextMonthClick() {} 8322 8323 return onNextMonthClick; 8324 }(), 8325 onMonthChange: function () { 8326 function onMonthChange() {} 8327 8328 return onMonthChange; 8329 }(), 8330 onYearChange: function () { 8331 function onYearChange() {} 8332 8333 return onYearChange; 8334 }(), 8335 onMultiplyScrollableMonths: function () { 8336 function onMultiplyScrollableMonths() {} 8337 8338 return onMultiplyScrollableMonths; 8339 }(), 8340 8341 8342 // month props 8343 renderMonthText: null, 8344 renderMonthElement: null, 8345 8346 // day props 8347 modifiers: {}, 8348 renderCalendarDay: undefined, 8349 renderDayContents: null, 8350 onDayClick: function () { 8351 function onDayClick() {} 8352 8353 return onDayClick; 8354 }(), 8355 onDayMouseEnter: function () { 8356 function onDayMouseEnter() {} 8357 8358 return onDayMouseEnter; 8359 }(), 8360 onDayMouseLeave: function () { 8361 function onDayMouseLeave() {} 8362 8363 return onDayMouseLeave; 8364 }(), 8365 8366 8367 // accessibility props 8368 isFocused: false, 8369 getFirstFocusableDay: null, 8370 onBlur: function () { 8371 function onBlur() {} 8372 8373 return onBlur; 8374 }(), 8375 8376 showKeyboardShortcuts: false, 8377 8378 // internationalization 8379 monthFormat: 'MMMM YYYY', 8380 weekDayFormat: 'dd', 8381 phrases: _defaultPhrases.DayPickerPhrases, 8382 dayAriaLabelFormat: undefined 8383 }; 8384 8385 var DayPicker = function (_React$Component) { 8386 _inherits(DayPicker, _React$Component); 8387 8388 function DayPicker(props) { 8389 _classCallCheck(this, DayPicker); 8390 8391 var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props)); 8392 8393 var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth(); 8394 8395 var focusedDate = currentMonth.clone().startOf('month'); 8396 if (props.getFirstFocusableDay) { 8397 focusedDate = props.getFirstFocusableDay(currentMonth); 8398 } 8399 8400 var horizontalMonthPadding = props.horizontalMonthPadding; 8401 8402 8403 var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0; 8404 8405 _this.hasSetInitialVisibleMonth = !props.hidden; 8406 _this.state = { 8407 currentMonth: currentMonth, 8408 monthTransition: null, 8409 translationValue: translationValue, 8410 scrollableMonthMultiple: 1, 8411 calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding), 8412 focusedDate: !props.hidden || props.isFocused ? focusedDate : null, 8413 nextFocusedDate: null, 8414 showKeyboardShortcuts: props.showKeyboardShortcuts, 8415 onKeyboardShortcutsPanelClose: function () { 8416 function onKeyboardShortcutsPanelClose() {} 8417 8418 return onKeyboardShortcutsPanelClose; 8419 }(), 8420 8421 isTouchDevice: (0, _isTouchDevice2['default'])(), 8422 withMouseInteractions: true, 8423 calendarInfoWidth: 0, 8424 monthTitleHeight: null, 8425 hasSetHeight: false 8426 }; 8427 8428 _this.setCalendarMonthWeeks(currentMonth); 8429 8430 _this.calendarMonthGridHeight = 0; 8431 _this.setCalendarInfoWidthTimeout = null; 8432 8433 _this.onKeyDown = _this.onKeyDown.bind(_this); 8434 _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false }); 8435 _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this); 8436 _this.onNextMonthClick = _this.onNextMonthClick.bind(_this); 8437 _this.onMonthChange = _this.onMonthChange.bind(_this); 8438 _this.onYearChange = _this.onYearChange.bind(_this); 8439 8440 _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this); 8441 _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this); 8442 8443 _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this); 8444 _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this); 8445 8446 _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this); 8447 _this.setContainerRef = _this.setContainerRef.bind(_this); 8448 _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this); 8449 _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this); 8450 return _this; 8451 } 8452 8453 _createClass(DayPicker, [{ 8454 key: 'componentDidMount', 8455 value: function () { 8456 function componentDidMount() { 8457 var currentMonth = this.state.currentMonth; 8458 8459 if (this.calendarInfo) { 8460 this.setState({ 8461 isTouchDevice: (0, _isTouchDevice2['default'])(), 8462 calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true) 8463 }); 8464 } else { 8465 this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() }); 8466 } 8467 8468 this.setCalendarMonthWeeks(currentMonth); 8469 } 8470 8471 return componentDidMount; 8472 }() 8473 }, { 8474 key: 'componentWillReceiveProps', 8475 value: function () { 8476 function componentWillReceiveProps(nextProps) { 8477 var hidden = nextProps.hidden, 8478 isFocused = nextProps.isFocused, 8479 showKeyboardShortcuts = nextProps.showKeyboardShortcuts, 8480 onBlur = nextProps.onBlur, 8481 renderMonthText = nextProps.renderMonthText, 8482 horizontalMonthPadding = nextProps.horizontalMonthPadding; 8483 var currentMonth = this.state.currentMonth; 8484 8485 8486 if (!hidden) { 8487 if (!this.hasSetInitialVisibleMonth) { 8488 this.hasSetInitialVisibleMonth = true; 8489 this.setState({ 8490 currentMonth: nextProps.initialVisibleMonth() 8491 }); 8492 } 8493 } 8494 8495 var _props = this.props, 8496 daySize = _props.daySize, 8497 prevIsFocused = _props.isFocused, 8498 prevRenderMonthText = _props.renderMonthText; 8499 8500 8501 if (nextProps.daySize !== daySize) { 8502 this.setState({ 8503 calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding) 8504 }); 8505 } 8506 8507 if (isFocused !== prevIsFocused) { 8508 if (isFocused) { 8509 var focusedDate = this.getFocusedDay(currentMonth); 8510 8511 var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose; 8512 8513 if (nextProps.showKeyboardShortcuts) { 8514 // the ? shortcut came from the input and we should return input there once it is close 8515 onKeyboardShortcutsPanelClose = onBlur; 8516 } 8517 8518 this.setState({ 8519 showKeyboardShortcuts: showKeyboardShortcuts, 8520 onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose, 8521 focusedDate: focusedDate, 8522 withMouseInteractions: false 8523 }); 8524 } else { 8525 this.setState({ focusedDate: null }); 8526 } 8527 } 8528 8529 if (renderMonthText !== prevRenderMonthText) { 8530 this.setState({ 8531 monthTitleHeight: null 8532 }); 8533 } 8534 } 8535 8536 return componentWillReceiveProps; 8537 }() 8538 }, { 8539 key: 'shouldComponentUpdate', 8540 value: function () { 8541 function shouldComponentUpdate(nextProps, nextState) { 8542 return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); 8543 } 8544 8545 return shouldComponentUpdate; 8546 }() 8547 }, { 8548 key: 'componentWillUpdate', 8549 value: function () { 8550 function componentWillUpdate() { 8551 var _this2 = this; 8552 8553 var transitionDuration = this.props.transitionDuration; 8554 8555 // Calculating the dimensions trigger a DOM repaint which 8556 // breaks the CSS transition. 8557 // The setTimeout will wait until the transition ends. 8558 8559 if (this.calendarInfo) { 8560 this.setCalendarInfoWidthTimeout = setTimeout(function () { 8561 var calendarInfoWidth = _this2.state.calendarInfoWidth; 8562 8563 var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true); 8564 if (calendarInfoWidth !== calendarInfoPanelWidth) { 8565 _this2.setState({ 8566 calendarInfoWidth: calendarInfoPanelWidth 8567 }); 8568 } 8569 }, transitionDuration); 8570 } 8571 } 8572 8573 return componentWillUpdate; 8574 }() 8575 }, { 8576 key: 'componentDidUpdate', 8577 value: function () { 8578 function componentDidUpdate(prevProps) { 8579 var _props2 = this.props, 8580 orientation = _props2.orientation, 8581 daySize = _props2.daySize, 8582 isFocused = _props2.isFocused, 8583 numberOfMonths = _props2.numberOfMonths; 8584 var _state = this.state, 8585 focusedDate = _state.focusedDate, 8586 monthTitleHeight = _state.monthTitleHeight; 8587 8588 8589 if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) { 8590 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1); 8591 var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 8592 var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1; 8593 this.adjustDayPickerHeight(newMonthHeight); 8594 } 8595 8596 if (!prevProps.isFocused && isFocused && !focusedDate) { 8597 this.container.focus(); 8598 } 8599 } 8600 8601 return componentDidUpdate; 8602 }() 8603 }, { 8604 key: 'componentWillUnmount', 8605 value: function () { 8606 function componentWillUnmount() { 8607 clearTimeout(this.setCalendarInfoWidthTimeout); 8608 } 8609 8610 return componentWillUnmount; 8611 }() 8612 }, { 8613 key: 'onKeyDown', 8614 value: function () { 8615 function onKeyDown(e) { 8616 e.stopPropagation(); 8617 if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) { 8618 this.throttledKeyDown(e); 8619 } 8620 } 8621 8622 return onKeyDown; 8623 }() 8624 }, { 8625 key: 'onFinalKeyDown', 8626 value: function () { 8627 function onFinalKeyDown(e) { 8628 this.setState({ withMouseInteractions: false }); 8629 8630 var _props3 = this.props, 8631 onBlur = _props3.onBlur, 8632 isRTL = _props3.isRTL; 8633 var _state2 = this.state, 8634 focusedDate = _state2.focusedDate, 8635 showKeyboardShortcuts = _state2.showKeyboardShortcuts; 8636 8637 if (!focusedDate) return; 8638 8639 var newFocusedDate = focusedDate.clone(); 8640 8641 var didTransitionMonth = false; 8642 8643 // focus might be anywhere when the keyboard shortcuts panel is opened so we want to 8644 // return it to wherever it was before when the panel was opened 8645 var activeElement = (0, _getActiveElement2['default'])(); 8646 var onKeyboardShortcutsPanelClose = function () { 8647 function onKeyboardShortcutsPanelClose() { 8648 if (activeElement) activeElement.focus(); 8649 } 8650 8651 return onKeyboardShortcutsPanelClose; 8652 }(); 8653 8654 switch (e.key) { 8655 case 'ArrowUp': 8656 e.preventDefault(); 8657 newFocusedDate.subtract(1, 'week'); 8658 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 8659 break; 8660 case 'ArrowLeft': 8661 e.preventDefault(); 8662 if (isRTL) { 8663 newFocusedDate.add(1, 'day'); 8664 } else { 8665 newFocusedDate.subtract(1, 'day'); 8666 } 8667 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 8668 break; 8669 case 'Home': 8670 e.preventDefault(); 8671 newFocusedDate.startOf('week'); 8672 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 8673 break; 8674 case 'PageUp': 8675 e.preventDefault(); 8676 newFocusedDate.subtract(1, 'month'); 8677 didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate); 8678 break; 8679 8680 case 'ArrowDown': 8681 e.preventDefault(); 8682 newFocusedDate.add(1, 'week'); 8683 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 8684 break; 8685 case 'ArrowRight': 8686 e.preventDefault(); 8687 if (isRTL) { 8688 newFocusedDate.subtract(1, 'day'); 8689 } else { 8690 newFocusedDate.add(1, 'day'); 8691 } 8692 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 8693 break; 8694 case 'End': 8695 e.preventDefault(); 8696 newFocusedDate.endOf('week'); 8697 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 8698 break; 8699 case 'PageDown': 8700 e.preventDefault(); 8701 newFocusedDate.add(1, 'month'); 8702 didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate); 8703 break; 8704 8705 case '?': 8706 this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose); 8707 break; 8708 8709 case 'Escape': 8710 if (showKeyboardShortcuts) { 8711 this.closeKeyboardShortcutsPanel(); 8712 } else { 8713 onBlur(); 8714 } 8715 break; 8716 8717 default: 8718 break; 8719 } 8720 8721 // If there was a month transition, do not update the focused date until the transition has 8722 // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If 8723 // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition 8724 if (!didTransitionMonth) { 8725 this.setState({ 8726 focusedDate: newFocusedDate 8727 }); 8728 } 8729 } 8730 8731 return onFinalKeyDown; 8732 }() 8733 }, { 8734 key: 'onPrevMonthClick', 8735 value: function () { 8736 function onPrevMonthClick(nextFocusedDate, e) { 8737 var _props4 = this.props, 8738 daySize = _props4.daySize, 8739 isRTL = _props4.isRTL, 8740 numberOfMonths = _props4.numberOfMonths; 8741 var _state3 = this.state, 8742 calendarMonthWidth = _state3.calendarMonthWidth, 8743 monthTitleHeight = _state3.monthTitleHeight; 8744 8745 8746 if (e) e.preventDefault(); 8747 8748 var translationValue = void 0; 8749 if (this.isVertical()) { 8750 var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1); 8751 translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1; 8752 } else if (this.isHorizontal()) { 8753 translationValue = calendarMonthWidth; 8754 if (isRTL) { 8755 translationValue = -2 * calendarMonthWidth; 8756 } 8757 8758 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths); 8759 var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 8760 var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1; 8761 this.adjustDayPickerHeight(newMonthHeight); 8762 } 8763 8764 this.setState({ 8765 monthTransition: PREV_TRANSITION, 8766 translationValue: translationValue, 8767 focusedDate: null, 8768 nextFocusedDate: nextFocusedDate 8769 }); 8770 } 8771 8772 return onPrevMonthClick; 8773 }() 8774 }, { 8775 key: 'onMonthChange', 8776 value: function () { 8777 function onMonthChange(currentMonth) { 8778 this.setCalendarMonthWeeks(currentMonth); 8779 this.calculateAndSetDayPickerHeight(); 8780 8781 // Translation value is a hack to force an invisible transition that 8782 // properly rerenders the CalendarMonthGrid 8783 this.setState({ 8784 monthTransition: MONTH_SELECTION_TRANSITION, 8785 translationValue: 0.00001, 8786 focusedDate: null, 8787 nextFocusedDate: currentMonth, 8788 currentMonth: currentMonth 8789 }); 8790 } 8791 8792 return onMonthChange; 8793 }() 8794 }, { 8795 key: 'onYearChange', 8796 value: function () { 8797 function onYearChange(currentMonth) { 8798 this.setCalendarMonthWeeks(currentMonth); 8799 this.calculateAndSetDayPickerHeight(); 8800 8801 // Translation value is a hack to force an invisible transition that 8802 // properly rerenders the CalendarMonthGrid 8803 this.setState({ 8804 monthTransition: YEAR_SELECTION_TRANSITION, 8805 translationValue: 0.0001, 8806 focusedDate: null, 8807 nextFocusedDate: currentMonth, 8808 currentMonth: currentMonth 8809 }); 8810 } 8811 8812 return onYearChange; 8813 }() 8814 }, { 8815 key: 'onNextMonthClick', 8816 value: function () { 8817 function onNextMonthClick(nextFocusedDate, e) { 8818 var _props5 = this.props, 8819 isRTL = _props5.isRTL, 8820 numberOfMonths = _props5.numberOfMonths, 8821 daySize = _props5.daySize; 8822 var _state4 = this.state, 8823 calendarMonthWidth = _state4.calendarMonthWidth, 8824 monthTitleHeight = _state4.monthTitleHeight; 8825 8826 8827 if (e) e.preventDefault(); 8828 8829 var translationValue = void 0; 8830 8831 if (this.isVertical()) { 8832 var firstVisibleMonthWeeks = this.calendarMonthWeeks[1]; 8833 var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1); 8834 translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1); 8835 } 8836 8837 if (this.isHorizontal()) { 8838 translationValue = -calendarMonthWidth; 8839 if (isRTL) { 8840 translationValue = 0; 8841 } 8842 8843 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2); 8844 var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 8845 var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1; 8846 this.adjustDayPickerHeight(newMonthHeight); 8847 } 8848 8849 this.setState({ 8850 monthTransition: NEXT_TRANSITION, 8851 translationValue: translationValue, 8852 focusedDate: null, 8853 nextFocusedDate: nextFocusedDate 8854 }); 8855 } 8856 8857 return onNextMonthClick; 8858 }() 8859 }, { 8860 key: 'getFirstDayOfWeek', 8861 value: function () { 8862 function getFirstDayOfWeek() { 8863 var firstDayOfWeek = this.props.firstDayOfWeek; 8864 8865 if (firstDayOfWeek == null) { 8866 return _moment2['default'].localeData().firstDayOfWeek(); 8867 } 8868 8869 return firstDayOfWeek; 8870 } 8871 8872 return getFirstDayOfWeek; 8873 }() 8874 }, { 8875 key: 'getFirstVisibleIndex', 8876 value: function () { 8877 function getFirstVisibleIndex() { 8878 var orientation = this.props.orientation; 8879 var monthTransition = this.state.monthTransition; 8880 8881 8882 if (orientation === _constants.VERTICAL_SCROLLABLE) return 0; 8883 8884 var firstVisibleMonthIndex = 1; 8885 if (monthTransition === PREV_TRANSITION) { 8886 firstVisibleMonthIndex -= 1; 8887 } else if (monthTransition === NEXT_TRANSITION) { 8888 firstVisibleMonthIndex += 1; 8889 } 8890 8891 return firstVisibleMonthIndex; 8892 } 8893 8894 return getFirstVisibleIndex; 8895 }() 8896 }, { 8897 key: 'getFocusedDay', 8898 value: function () { 8899 function getFocusedDay(newMonth) { 8900 var _props6 = this.props, 8901 getFirstFocusableDay = _props6.getFirstFocusableDay, 8902 numberOfMonths = _props6.numberOfMonths; 8903 8904 8905 var focusedDate = void 0; 8906 if (getFirstFocusableDay) { 8907 focusedDate = getFirstFocusableDay(newMonth); 8908 } 8909 8910 if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) { 8911 focusedDate = newMonth.clone().startOf('month'); 8912 } 8913 8914 return focusedDate; 8915 } 8916 8917 return getFocusedDay; 8918 }() 8919 }, { 8920 key: 'setMonthTitleHeight', 8921 value: function () { 8922 function setMonthTitleHeight(monthTitleHeight) { 8923 var _this3 = this; 8924 8925 this.setState({ 8926 monthTitleHeight: monthTitleHeight 8927 }, function () { 8928 _this3.calculateAndSetDayPickerHeight(); 8929 }); 8930 } 8931 8932 return setMonthTitleHeight; 8933 }() 8934 }, { 8935 key: 'setCalendarMonthWeeks', 8936 value: function () { 8937 function setCalendarMonthWeeks(currentMonth) { 8938 var numberOfMonths = this.props.numberOfMonths; 8939 8940 8941 this.calendarMonthWeeks = []; 8942 var month = currentMonth.clone().subtract(1, 'months'); 8943 var firstDayOfWeek = this.getFirstDayOfWeek(); 8944 for (var i = 0; i < numberOfMonths + 2; i += 1) { 8945 var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek); 8946 this.calendarMonthWeeks.push(numberOfWeeks); 8947 month = month.add(1, 'months'); 8948 } 8949 } 8950 8951 return setCalendarMonthWeeks; 8952 }() 8953 }, { 8954 key: 'setContainerRef', 8955 value: function () { 8956 function setContainerRef(ref) { 8957 this.container = ref; 8958 } 8959 8960 return setContainerRef; 8961 }() 8962 }, { 8963 key: 'setCalendarInfoRef', 8964 value: function () { 8965 function setCalendarInfoRef(ref) { 8966 this.calendarInfo = ref; 8967 } 8968 8969 return setCalendarInfoRef; 8970 }() 8971 }, { 8972 key: 'setTransitionContainerRef', 8973 value: function () { 8974 function setTransitionContainerRef(ref) { 8975 this.transitionContainer = ref; 8976 } 8977 8978 return setTransitionContainerRef; 8979 }() 8980 }, { 8981 key: 'maybeTransitionNextMonth', 8982 value: function () { 8983 function maybeTransitionNextMonth(newFocusedDate) { 8984 var numberOfMonths = this.props.numberOfMonths; 8985 var _state5 = this.state, 8986 currentMonth = _state5.currentMonth, 8987 focusedDate = _state5.focusedDate; 8988 8989 8990 var newFocusedDateMonth = newFocusedDate.month(); 8991 var focusedDateMonth = focusedDate.month(); 8992 var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths); 8993 if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) { 8994 this.onNextMonthClick(newFocusedDate); 8995 return true; 8996 } 8997 8998 return false; 8999 } 9000 9001 return maybeTransitionNextMonth; 9002 }() 9003 }, { 9004 key: 'maybeTransitionPrevMonth', 9005 value: function () { 9006 function maybeTransitionPrevMonth(newFocusedDate) { 9007 var numberOfMonths = this.props.numberOfMonths; 9008 var _state6 = this.state, 9009 currentMonth = _state6.currentMonth, 9010 focusedDate = _state6.focusedDate; 9011 9012 9013 var newFocusedDateMonth = newFocusedDate.month(); 9014 var focusedDateMonth = focusedDate.month(); 9015 var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths); 9016 if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) { 9017 this.onPrevMonthClick(newFocusedDate); 9018 return true; 9019 } 9020 9021 return false; 9022 } 9023 9024 return maybeTransitionPrevMonth; 9025 }() 9026 }, { 9027 key: 'multiplyScrollableMonths', 9028 value: function () { 9029 function multiplyScrollableMonths(e) { 9030 var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths; 9031 9032 if (e) e.preventDefault(); 9033 9034 if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e); 9035 9036 this.setState(function (_ref) { 9037 var scrollableMonthMultiple = _ref.scrollableMonthMultiple; 9038 return { 9039 scrollableMonthMultiple: scrollableMonthMultiple + 1 9040 }; 9041 }); 9042 } 9043 9044 return multiplyScrollableMonths; 9045 }() 9046 }, { 9047 key: 'isHorizontal', 9048 value: function () { 9049 function isHorizontal() { 9050 var orientation = this.props.orientation; 9051 9052 return orientation === _constants.HORIZONTAL_ORIENTATION; 9053 } 9054 9055 return isHorizontal; 9056 }() 9057 }, { 9058 key: 'isVertical', 9059 value: function () { 9060 function isVertical() { 9061 var orientation = this.props.orientation; 9062 9063 return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE; 9064 } 9065 9066 return isVertical; 9067 }() 9068 }, { 9069 key: 'updateStateAfterMonthTransition', 9070 value: function () { 9071 function updateStateAfterMonthTransition() { 9072 var _this4 = this; 9073 9074 var _props7 = this.props, 9075 onPrevMonthClick = _props7.onPrevMonthClick, 9076 onNextMonthClick = _props7.onNextMonthClick, 9077 numberOfMonths = _props7.numberOfMonths, 9078 onMonthChange = _props7.onMonthChange, 9079 onYearChange = _props7.onYearChange, 9080 isRTL = _props7.isRTL; 9081 var _state7 = this.state, 9082 currentMonth = _state7.currentMonth, 9083 monthTransition = _state7.monthTransition, 9084 focusedDate = _state7.focusedDate, 9085 nextFocusedDate = _state7.nextFocusedDate, 9086 withMouseInteractions = _state7.withMouseInteractions, 9087 calendarMonthWidth = _state7.calendarMonthWidth; 9088 9089 9090 if (!monthTransition) return; 9091 9092 var newMonth = currentMonth.clone(); 9093 var firstDayOfWeek = this.getFirstDayOfWeek(); 9094 if (monthTransition === PREV_TRANSITION) { 9095 newMonth.subtract(1, 'month'); 9096 if (onPrevMonthClick) onPrevMonthClick(newMonth); 9097 var newInvisibleMonth = newMonth.clone().subtract(1, 'month'); 9098 var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek); 9099 this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1))); 9100 } else if (monthTransition === NEXT_TRANSITION) { 9101 newMonth.add(1, 'month'); 9102 if (onNextMonthClick) onNextMonthClick(newMonth); 9103 var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month'); 9104 var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek); 9105 this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]); 9106 } else if (monthTransition === MONTH_SELECTION_TRANSITION) { 9107 if (onMonthChange) onMonthChange(newMonth); 9108 } else if (monthTransition === YEAR_SELECTION_TRANSITION) { 9109 if (onYearChange) onYearChange(newMonth); 9110 } 9111 9112 var newFocusedDate = null; 9113 if (nextFocusedDate) { 9114 newFocusedDate = nextFocusedDate; 9115 } else if (!focusedDate && !withMouseInteractions) { 9116 newFocusedDate = this.getFocusedDay(newMonth); 9117 } 9118 9119 this.setState({ 9120 currentMonth: newMonth, 9121 monthTransition: null, 9122 translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0, 9123 nextFocusedDate: null, 9124 focusedDate: newFocusedDate 9125 }, function () { 9126 // we don't want to focus on the relevant calendar day after a month transition 9127 // if the user is navigating around using a mouse 9128 if (withMouseInteractions) { 9129 var activeElement = (0, _getActiveElement2['default'])(); 9130 if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) { 9131 activeElement.blur(); 9132 } 9133 } 9134 }); 9135 } 9136 9137 return updateStateAfterMonthTransition; 9138 }() 9139 }, { 9140 key: 'adjustDayPickerHeight', 9141 value: function () { 9142 function adjustDayPickerHeight(newMonthHeight) { 9143 var _this5 = this; 9144 9145 var monthHeight = newMonthHeight + MONTH_PADDING; 9146 if (monthHeight !== this.calendarMonthGridHeight) { 9147 this.transitionContainer.style.height = String(monthHeight) + 'px'; 9148 if (!this.calendarMonthGridHeight) { 9149 setTimeout(function () { 9150 _this5.setState({ hasSetHeight: true }); 9151 }, 0); 9152 } 9153 this.calendarMonthGridHeight = monthHeight; 9154 } 9155 } 9156 9157 return adjustDayPickerHeight; 9158 }() 9159 }, { 9160 key: 'calculateAndSetDayPickerHeight', 9161 value: function () { 9162 function calculateAndSetDayPickerHeight() { 9163 var _props8 = this.props, 9164 daySize = _props8.daySize, 9165 numberOfMonths = _props8.numberOfMonths; 9166 var monthTitleHeight = this.state.monthTitleHeight; 9167 9168 9169 var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1); 9170 var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1); 9171 var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1; 9172 9173 if (this.isHorizontal()) { 9174 this.adjustDayPickerHeight(newMonthHeight); 9175 } 9176 } 9177 9178 return calculateAndSetDayPickerHeight; 9179 }() 9180 }, { 9181 key: 'openKeyboardShortcutsPanel', 9182 value: function () { 9183 function openKeyboardShortcutsPanel(onCloseCallBack) { 9184 this.setState({ 9185 showKeyboardShortcuts: true, 9186 onKeyboardShortcutsPanelClose: onCloseCallBack 9187 }); 9188 } 9189 9190 return openKeyboardShortcutsPanel; 9191 }() 9192 }, { 9193 key: 'closeKeyboardShortcutsPanel', 9194 value: function () { 9195 function closeKeyboardShortcutsPanel() { 9196 var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose; 9197 9198 9199 if (onKeyboardShortcutsPanelClose) { 9200 onKeyboardShortcutsPanelClose(); 9201 } 9202 9203 this.setState({ 9204 onKeyboardShortcutsPanelClose: null, 9205 showKeyboardShortcuts: false 9206 }); 9207 } 9208 9209 return closeKeyboardShortcutsPanel; 9210 }() 9211 }, { 9212 key: 'renderNavigation', 9213 value: function () { 9214 function renderNavigation() { 9215 var _this6 = this; 9216 9217 var _props9 = this.props, 9218 navPrev = _props9.navPrev, 9219 navNext = _props9.navNext, 9220 noNavButtons = _props9.noNavButtons, 9221 orientation = _props9.orientation, 9222 phrases = _props9.phrases, 9223 isRTL = _props9.isRTL; 9224 9225 9226 if (noNavButtons) { 9227 return null; 9228 } 9229 9230 var onNextMonthClick = void 0; 9231 if (orientation === _constants.VERTICAL_SCROLLABLE) { 9232 onNextMonthClick = this.multiplyScrollableMonths; 9233 } else { 9234 onNextMonthClick = function () { 9235 function onNextMonthClick(e) { 9236 _this6.onNextMonthClick(null, e); 9237 } 9238 9239 return onNextMonthClick; 9240 }(); 9241 } 9242 9243 return _react2['default'].createElement(_DayPickerNavigation2['default'], { 9244 onPrevMonthClick: function () { 9245 function onPrevMonthClick(e) { 9246 _this6.onPrevMonthClick(null, e); 9247 } 9248 9249 return onPrevMonthClick; 9250 }(), 9251 onNextMonthClick: onNextMonthClick, 9252 navPrev: navPrev, 9253 navNext: navNext, 9254 orientation: orientation, 9255 phrases: phrases, 9256 isRTL: isRTL 9257 }); 9258 } 9259 9260 return renderNavigation; 9261 }() 9262 }, { 9263 key: 'renderWeekHeader', 9264 value: function () { 9265 function renderWeekHeader(index) { 9266 var _props10 = this.props, 9267 daySize = _props10.daySize, 9268 horizontalMonthPadding = _props10.horizontalMonthPadding, 9269 orientation = _props10.orientation, 9270 weekDayFormat = _props10.weekDayFormat, 9271 styles = _props10.styles; 9272 var calendarMonthWidth = this.state.calendarMonthWidth; 9273 9274 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 9275 var horizontalStyle = { 9276 left: index * calendarMonthWidth 9277 }; 9278 var verticalStyle = { 9279 marginLeft: -calendarMonthWidth / 2 9280 }; 9281 9282 var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation 9283 if (this.isHorizontal()) { 9284 weekHeaderStyle = horizontalStyle; 9285 } else if (this.isVertical() && !verticalScrollable) { 9286 weekHeaderStyle = verticalStyle; 9287 } 9288 9289 var firstDayOfWeek = this.getFirstDayOfWeek(); 9290 9291 var header = []; 9292 for (var i = 0; i < 7; i += 1) { 9293 header.push(_react2['default'].createElement( 9294 'li', 9295 _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })), 9296 _react2['default'].createElement( 9297 'small', 9298 null, 9299 (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat) 9300 ) 9301 )); 9302 } 9303 9304 return _react2['default'].createElement( 9305 'div', 9306 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), { 9307 key: 'week-' + String(index) 9308 }), 9309 _react2['default'].createElement( 9310 'ul', 9311 (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul), 9312 header 9313 ) 9314 ); 9315 } 9316 9317 return renderWeekHeader; 9318 }() 9319 }, { 9320 key: 'render', 9321 value: function () { 9322 function render() { 9323 var _this7 = this; 9324 9325 var _state8 = this.state, 9326 calendarMonthWidth = _state8.calendarMonthWidth, 9327 currentMonth = _state8.currentMonth, 9328 monthTransition = _state8.monthTransition, 9329 translationValue = _state8.translationValue, 9330 scrollableMonthMultiple = _state8.scrollableMonthMultiple, 9331 focusedDate = _state8.focusedDate, 9332 showKeyboardShortcuts = _state8.showKeyboardShortcuts, 9333 isTouch = _state8.isTouchDevice, 9334 hasSetHeight = _state8.hasSetHeight, 9335 calendarInfoWidth = _state8.calendarInfoWidth, 9336 monthTitleHeight = _state8.monthTitleHeight; 9337 var _props11 = this.props, 9338 enableOutsideDays = _props11.enableOutsideDays, 9339 numberOfMonths = _props11.numberOfMonths, 9340 orientation = _props11.orientation, 9341 modifiers = _props11.modifiers, 9342 withPortal = _props11.withPortal, 9343 onDayClick = _props11.onDayClick, 9344 onDayMouseEnter = _props11.onDayMouseEnter, 9345 onDayMouseLeave = _props11.onDayMouseLeave, 9346 firstDayOfWeek = _props11.firstDayOfWeek, 9347 renderMonthText = _props11.renderMonthText, 9348 renderCalendarDay = _props11.renderCalendarDay, 9349 renderDayContents = _props11.renderDayContents, 9350 renderCalendarInfo = _props11.renderCalendarInfo, 9351 renderMonthElement = _props11.renderMonthElement, 9352 calendarInfoPosition = _props11.calendarInfoPosition, 9353 hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel, 9354 onOutsideClick = _props11.onOutsideClick, 9355 monthFormat = _props11.monthFormat, 9356 daySize = _props11.daySize, 9357 isFocused = _props11.isFocused, 9358 isRTL = _props11.isRTL, 9359 styles = _props11.styles, 9360 theme = _props11.theme, 9361 phrases = _props11.phrases, 9362 verticalHeight = _props11.verticalHeight, 9363 dayAriaLabelFormat = _props11.dayAriaLabelFormat, 9364 noBorder = _props11.noBorder, 9365 transitionDuration = _props11.transitionDuration, 9366 verticalBorderSpacing = _props11.verticalBorderSpacing, 9367 horizontalMonthPadding = _props11.horizontalMonthPadding; 9368 var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding; 9369 9370 9371 var isHorizontal = this.isHorizontal(); 9372 9373 var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths; 9374 var weekHeaders = []; 9375 for (var i = 0; i < numOfWeekHeaders; i += 1) { 9376 weekHeaders.push(this.renderWeekHeader(i)); 9377 } 9378 9379 var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 9380 var height = void 0; 9381 if (isHorizontal) { 9382 height = this.calendarMonthGridHeight; 9383 } else if (this.isVertical() && !verticalScrollable && !withPortal) { 9384 // If the user doesn't set a desired height, 9385 // we default back to this kind of made-up value that generally looks good 9386 height = verticalHeight || 1.75 * calendarMonthWidth; 9387 } 9388 9389 var isCalendarMonthGridAnimating = monthTransition !== null; 9390 9391 var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused; 9392 9393 var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT; 9394 if (this.isVertical()) { 9395 keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT; 9396 } 9397 9398 var shouldAnimateHeight = isHorizontal && hasSetHeight; 9399 9400 var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP; 9401 var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM; 9402 var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE; 9403 var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER; 9404 var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter; 9405 9406 var calendarInfo = renderCalendarInfo && _react2['default'].createElement( 9407 'div', 9408 _extends({ 9409 ref: this.setCalendarInfoRef 9410 }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)), 9411 renderCalendarInfo() 9412 ); 9413 9414 var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0; 9415 9416 var firstVisibleMonthIndex = this.getFirstVisibleIndex(); 9417 var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding; 9418 // Adding `1px` because of whitespace between 2 inline-block 9419 var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1; 9420 9421 var transitionContainerStyle = { 9422 width: isHorizontal && wrapperHorizontalWidth, 9423 height: height 9424 }; 9425 9426 var dayPickerWrapperStyle = { 9427 width: isHorizontal && wrapperHorizontalWidth 9428 }; 9429 9430 var dayPickerStyle = { 9431 width: isHorizontal && fullHorizontalWidth, 9432 9433 // These values are to center the datepicker (approximately) on the page 9434 marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null, 9435 marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null 9436 }; 9437 9438 return _react2['default'].createElement( 9439 'div', 9440 _extends({ 9441 role: 'application', 9442 'aria-label': phrases.calendarLabel 9443 }, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)), 9444 _react2['default'].createElement( 9445 _reactOutsideClickHandler2['default'], 9446 { onOutsideClick: onOutsideClick }, 9447 (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo, 9448 _react2['default'].createElement( 9449 'div', 9450 (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal), 9451 _react2['default'].createElement( 9452 'div', 9453 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), { 9454 'aria-hidden': 'true', 9455 role: 'presentation' 9456 }), 9457 weekHeaders 9458 ), 9459 _react2['default'].createElement( 9460 'div', 9461 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), { 9462 ref: this.setContainerRef, 9463 onClick: function () { 9464 function onClick(e) { 9465 e.stopPropagation(); 9466 } 9467 9468 return onClick; 9469 }(), 9470 onKeyDown: this.onKeyDown, 9471 onMouseUp: function () { 9472 function onMouseUp() { 9473 _this7.setState({ withMouseInteractions: true }); 9474 } 9475 9476 return onMouseUp; 9477 }(), 9478 role: 'region', 9479 tabIndex: -1 9480 }), 9481 !verticalScrollable && this.renderNavigation(), 9482 _react2['default'].createElement( 9483 'div', 9484 _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), { 9485 ref: this.setTransitionContainerRef 9486 }), 9487 _react2['default'].createElement(_CalendarMonthGrid2['default'], { 9488 setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined, 9489 translationValue: translationValue, 9490 enableOutsideDays: enableOutsideDays, 9491 firstVisibleMonthIndex: firstVisibleMonthIndex, 9492 initialMonth: currentMonth, 9493 isAnimating: isCalendarMonthGridAnimating, 9494 modifiers: modifiers, 9495 orientation: orientation, 9496 numberOfMonths: numberOfMonths * scrollableMonthMultiple, 9497 onDayClick: onDayClick, 9498 onDayMouseEnter: onDayMouseEnter, 9499 onDayMouseLeave: onDayMouseLeave, 9500 onMonthChange: this.onMonthChange, 9501 onYearChange: this.onYearChange, 9502 renderMonthText: renderMonthText, 9503 renderCalendarDay: renderCalendarDay, 9504 renderDayContents: renderDayContents, 9505 renderMonthElement: renderMonthElement, 9506 onMonthTransitionEnd: this.updateStateAfterMonthTransition, 9507 monthFormat: monthFormat, 9508 daySize: daySize, 9509 firstDayOfWeek: firstDayOfWeek, 9510 isFocused: shouldFocusDate, 9511 focusedDate: focusedDate, 9512 phrases: phrases, 9513 isRTL: isRTL, 9514 dayAriaLabelFormat: dayAriaLabelFormat, 9515 transitionDuration: transitionDuration, 9516 verticalBorderSpacing: verticalBorderSpacing, 9517 horizontalMonthPadding: horizontalMonthPadding 9518 }), 9519 verticalScrollable && this.renderNavigation() 9520 ), 9521 !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], { 9522 block: this.isVertical() && !withPortal, 9523 buttonLocation: keyboardShortcutButtonLocation, 9524 showKeyboardShortcutsPanel: showKeyboardShortcuts, 9525 openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel, 9526 closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel, 9527 phrases: phrases 9528 }) 9529 ) 9530 ), 9531 (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo 9532 ) 9533 ); 9534 } 9535 9536 return render; 9537 }() 9538 }]); 9539 9540 return DayPicker; 9541 }(_react2['default'].Component); 9542 9543 DayPicker.propTypes = propTypes; 9544 DayPicker.defaultProps = defaultProps; 9545 9546 exports.PureDayPicker = DayPicker; 9547 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) { 9548 var _ref2$reactDates = _ref2.reactDates, 9549 color = _ref2$reactDates.color, 9550 font = _ref2$reactDates.font, 9551 noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable, 9552 spacing = _ref2$reactDates.spacing, 9553 zIndex = _ref2$reactDates.zIndex; 9554 return { 9555 DayPicker: { 9556 background: color.background, 9557 position: 'relative', 9558 textAlign: 'left' 9559 }, 9560 9561 DayPicker__horizontal: { 9562 background: color.background 9563 }, 9564 9565 DayPicker__verticalScrollable: { 9566 height: '100%' 9567 }, 9568 9569 DayPicker__hidden: { 9570 visibility: 'hidden' 9571 }, 9572 9573 DayPicker__withBorder: { 9574 boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)', 9575 borderRadius: 3 9576 }, 9577 9578 DayPicker_portal__horizontal: { 9579 boxShadow: 'none', 9580 position: 'absolute', 9581 left: '50%', 9582 top: '50%' 9583 }, 9584 9585 DayPicker_portal__vertical: { 9586 position: 'initial' 9587 }, 9588 9589 DayPicker_focusRegion: { 9590 outline: 'none' 9591 }, 9592 9593 DayPicker_calendarInfo__horizontal: { 9594 display: 'inline-block', 9595 verticalAlign: 'top' 9596 }, 9597 9598 DayPicker_wrapper__horizontal: { 9599 display: 'inline-block', 9600 verticalAlign: 'top' 9601 }, 9602 9603 DayPicker_weekHeaders: { 9604 position: 'relative' 9605 }, 9606 9607 DayPicker_weekHeaders__horizontal: { 9608 marginLeft: spacing.dayPickerHorizontalPadding 9609 }, 9610 9611 DayPicker_weekHeader: { 9612 color: color.placeholderText, 9613 position: 'absolute', 9614 top: 62, 9615 zIndex: zIndex + 2, 9616 textAlign: 'left' 9617 }, 9618 9619 DayPicker_weekHeader__vertical: { 9620 left: '50%' 9621 }, 9622 9623 DayPicker_weekHeader__verticalScrollable: { 9624 top: 0, 9625 display: 'table-row', 9626 borderBottom: '1px solid ' + String(color.core.border), 9627 background: color.background, 9628 marginLeft: 0, 9629 left: 0, 9630 width: '100%', 9631 textAlign: 'center' 9632 }, 9633 9634 DayPicker_weekHeader_ul: { 9635 listStyle: 'none', 9636 margin: '1px 0', 9637 paddingLeft: 0, 9638 paddingRight: 0, 9639 fontSize: font.size 9640 }, 9641 9642 DayPicker_weekHeader_li: { 9643 display: 'inline-block', 9644 textAlign: 'center' 9645 }, 9646 9647 DayPicker_transitionContainer: { 9648 position: 'relative', 9649 overflow: 'hidden', 9650 borderRadius: 3 9651 }, 9652 9653 DayPicker_transitionContainer__horizontal: { 9654 transition: 'height 0.2s ease-in-out' 9655 }, 9656 9657 DayPicker_transitionContainer__vertical: { 9658 width: '100%' 9659 }, 9660 9661 DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({ 9662 paddingTop: 20, 9663 height: '100%', 9664 position: 'absolute', 9665 top: 0, 9666 bottom: 0, 9667 right: 0, 9668 left: 0, 9669 overflowY: 'scroll' 9670 }, noScrollBarOnVerticalScrollable && { 9671 '-webkitOverflowScrolling': 'touch', 9672 '::-webkit-scrollbar': { 9673 '-webkit-appearance': 'none', 9674 display: 'none' 9675 } 9676 }) 9677 }; 9678 })(DayPicker); 9679 9680 /***/ }), 9681 9682 /***/ 600: 9683 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 9684 9685 "use strict"; 9686 9687 9688 Object.defineProperty(exports, "__esModule", ({ 9689 value: true 9690 })); 9691 exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined; 9692 9693 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 9694 9695 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 9696 9697 var _object = __webpack_require__(4011); 9698 9699 var _object2 = _interopRequireDefault(_object); 9700 9701 var _react = __webpack_require__(9196); 9702 9703 var _react2 = _interopRequireDefault(_react); 9704 9705 var _propTypes = __webpack_require__(2652); 9706 9707 var _propTypes2 = _interopRequireDefault(_propTypes); 9708 9709 var _airbnbPropTypes = __webpack_require__(4882); 9710 9711 var _reactWithStyles = __webpack_require__(3576); 9712 9713 var _defaultPhrases = __webpack_require__(6030); 9714 9715 var _getPhrasePropTypes = __webpack_require__(2893); 9716 9717 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 9718 9719 var _KeyboardShortcutRow = __webpack_require__(5820); 9720 9721 var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow); 9722 9723 var _CloseButton = __webpack_require__(6973); 9724 9725 var _CloseButton2 = _interopRequireDefault(_CloseButton); 9726 9727 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9728 9729 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9730 9731 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 9732 9733 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 9734 9735 var TOP_LEFT = exports.TOP_LEFT = 'top-left'; 9736 var TOP_RIGHT = exports.TOP_RIGHT = 'top-right'; 9737 var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right'; 9738 9739 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 9740 block: _propTypes2['default'].bool, 9741 buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]), 9742 showKeyboardShortcutsPanel: _propTypes2['default'].bool, 9743 openKeyboardShortcutsPanel: _propTypes2['default'].func, 9744 closeKeyboardShortcutsPanel: _propTypes2['default'].func, 9745 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases)) 9746 })); 9747 9748 var defaultProps = { 9749 block: false, 9750 buttonLocation: BOTTOM_RIGHT, 9751 showKeyboardShortcutsPanel: false, 9752 openKeyboardShortcutsPanel: function () { 9753 function openKeyboardShortcutsPanel() {} 9754 9755 return openKeyboardShortcutsPanel; 9756 }(), 9757 closeKeyboardShortcutsPanel: function () { 9758 function closeKeyboardShortcutsPanel() {} 9759 9760 return closeKeyboardShortcutsPanel; 9761 }(), 9762 9763 phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases 9764 }; 9765 9766 function getKeyboardShortcuts(phrases) { 9767 return [{ 9768 unicode: '↵', 9769 label: phrases.enterKey, 9770 action: phrases.selectFocusedDate 9771 }, { 9772 unicode: '←/→', 9773 label: phrases.leftArrowRightArrow, 9774 action: phrases.moveFocusByOneDay 9775 }, { 9776 unicode: '↑/↓', 9777 label: phrases.upArrowDownArrow, 9778 action: phrases.moveFocusByOneWeek 9779 }, { 9780 unicode: 'PgUp/PgDn', 9781 label: phrases.pageUpPageDown, 9782 action: phrases.moveFocusByOneMonth 9783 }, { 9784 unicode: 'Home/End', 9785 label: phrases.homeEnd, 9786 action: phrases.moveFocustoStartAndEndOfWeek 9787 }, { 9788 unicode: 'Esc', 9789 label: phrases.escape, 9790 action: phrases.returnFocusToInput 9791 }, { 9792 unicode: '?', 9793 label: phrases.questionMark, 9794 action: phrases.openThisPanel 9795 }]; 9796 } 9797 9798 var DayPickerKeyboardShortcuts = function (_React$Component) { 9799 _inherits(DayPickerKeyboardShortcuts, _React$Component); 9800 9801 function DayPickerKeyboardShortcuts() { 9802 var _ref; 9803 9804 _classCallCheck(this, DayPickerKeyboardShortcuts); 9805 9806 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 9807 args[_key] = arguments[_key]; 9808 } 9809 9810 var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args))); 9811 9812 var phrases = _this.props.phrases; 9813 9814 _this.keyboardShortcuts = getKeyboardShortcuts(phrases); 9815 9816 _this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this); 9817 _this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this); 9818 _this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this); 9819 _this.handleFocus = _this.handleFocus.bind(_this); 9820 _this.onKeyDown = _this.onKeyDown.bind(_this); 9821 return _this; 9822 } 9823 9824 _createClass(DayPickerKeyboardShortcuts, [{ 9825 key: 'componentWillReceiveProps', 9826 value: function () { 9827 function componentWillReceiveProps(nextProps) { 9828 var phrases = this.props.phrases; 9829 9830 if (nextProps.phrases !== phrases) { 9831 this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases); 9832 } 9833 } 9834 9835 return componentWillReceiveProps; 9836 }() 9837 }, { 9838 key: 'componentDidUpdate', 9839 value: function () { 9840 function componentDidUpdate() { 9841 this.handleFocus(); 9842 } 9843 9844 return componentDidUpdate; 9845 }() 9846 }, { 9847 key: 'onKeyDown', 9848 value: function () { 9849 function onKeyDown(e) { 9850 e.stopPropagation(); 9851 9852 var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel; 9853 // Because the close button is the only focusable element inside of the panel, this 9854 // amounts to a very basic focus trap. The user can exit the panel by "pressing" the 9855 // close button or hitting escape 9856 9857 switch (e.key) { 9858 case 'Enter': 9859 case ' ': 9860 case 'Spacebar': // for older browsers 9861 case 'Escape': 9862 closeKeyboardShortcutsPanel(); 9863 break; 9864 9865 // do nothing - this allows the up and down arrows continue their 9866 // default behavior of scrolling the content of the Keyboard Shortcuts Panel 9867 // which is needed when only a single month is shown for instance. 9868 case 'ArrowUp': 9869 case 'ArrowDown': 9870 break; 9871 9872 // completely block the rest of the keys that have functionality outside of this panel 9873 case 'Tab': 9874 case 'Home': 9875 case 'End': 9876 case 'PageUp': 9877 case 'PageDown': 9878 case 'ArrowLeft': 9879 case 'ArrowRight': 9880 e.preventDefault(); 9881 break; 9882 9883 default: 9884 break; 9885 } 9886 } 9887 9888 return onKeyDown; 9889 }() 9890 }, { 9891 key: 'onShowKeyboardShortcutsButtonClick', 9892 value: function () { 9893 function onShowKeyboardShortcutsButtonClick() { 9894 var _this2 = this; 9895 9896 var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel; 9897 9898 // we want to return focus to this button after closing the keyboard shortcuts panel 9899 9900 openKeyboardShortcutsPanel(function () { 9901 _this2.showKeyboardShortcutsButton.focus(); 9902 }); 9903 } 9904 9905 return onShowKeyboardShortcutsButtonClick; 9906 }() 9907 }, { 9908 key: 'setShowKeyboardShortcutsButtonRef', 9909 value: function () { 9910 function setShowKeyboardShortcutsButtonRef(ref) { 9911 this.showKeyboardShortcutsButton = ref; 9912 } 9913 9914 return setShowKeyboardShortcutsButtonRef; 9915 }() 9916 }, { 9917 key: 'setHideKeyboardShortcutsButtonRef', 9918 value: function () { 9919 function setHideKeyboardShortcutsButtonRef(ref) { 9920 this.hideKeyboardShortcutsButton = ref; 9921 } 9922 9923 return setHideKeyboardShortcutsButtonRef; 9924 }() 9925 }, { 9926 key: 'handleFocus', 9927 value: function () { 9928 function handleFocus() { 9929 if (this.hideKeyboardShortcutsButton) { 9930 // automatically move focus into the dialog by moving 9931 // to the only interactive element, the hide button 9932 this.hideKeyboardShortcutsButton.focus(); 9933 } 9934 } 9935 9936 return handleFocus; 9937 }() 9938 }, { 9939 key: 'render', 9940 value: function () { 9941 function render() { 9942 var _this3 = this; 9943 9944 var _props = this.props, 9945 block = _props.block, 9946 buttonLocation = _props.buttonLocation, 9947 showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel, 9948 closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel, 9949 styles = _props.styles, 9950 phrases = _props.phrases; 9951 9952 9953 var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel; 9954 9955 var bottomRight = buttonLocation === BOTTOM_RIGHT; 9956 var topRight = buttonLocation === TOP_RIGHT; 9957 var topLeft = buttonLocation === TOP_LEFT; 9958 9959 return _react2['default'].createElement( 9960 'div', 9961 null, 9962 _react2['default'].createElement( 9963 'button', 9964 _extends({ 9965 ref: this.setShowKeyboardShortcutsButtonRef 9966 }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), { 9967 type: 'button', 9968 'aria-label': toggleButtonText, 9969 onClick: this.onShowKeyboardShortcutsButtonClick, 9970 onKeyDown: function () { 9971 function onKeyDown(e) { 9972 if (e.key === 'Enter') { 9973 e.preventDefault(); 9974 } else if (e.key === 'Space') { 9975 _this3.onShowKeyboardShortcutsButtonClick(e); 9976 } 9977 } 9978 9979 return onKeyDown; 9980 }(), 9981 onMouseUp: function () { 9982 function onMouseUp(e) { 9983 e.currentTarget.blur(); 9984 } 9985 9986 return onMouseUp; 9987 }() 9988 }), 9989 _react2['default'].createElement( 9990 'span', 9991 (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft), 9992 '?' 9993 ) 9994 ), 9995 showKeyboardShortcutsPanel && _react2['default'].createElement( 9996 'div', 9997 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), { 9998 role: 'dialog', 9999 'aria-labelledby': 'DayPickerKeyboardShortcuts_title', 10000 'aria-describedby': 'DayPickerKeyboardShortcuts_description' 10001 }), 10002 _react2['default'].createElement( 10003 'div', 10004 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), { 10005 id: 'DayPickerKeyboardShortcuts_title' 10006 }), 10007 phrases.keyboardShortcuts 10008 ), 10009 _react2['default'].createElement( 10010 'button', 10011 _extends({ 10012 ref: this.setHideKeyboardShortcutsButtonRef 10013 }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), { 10014 type: 'button', 10015 tabIndex: '0', 10016 'aria-label': phrases.hideKeyboardShortcutsPanel, 10017 onClick: closeKeyboardShortcutsPanel, 10018 onKeyDown: this.onKeyDown 10019 }), 10020 _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg)) 10021 ), 10022 _react2['default'].createElement( 10023 'ul', 10024 _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), { 10025 id: 'DayPickerKeyboardShortcuts_description' 10026 }), 10027 this.keyboardShortcuts.map(function (_ref2) { 10028 var unicode = _ref2.unicode, 10029 label = _ref2.label, 10030 action = _ref2.action; 10031 return _react2['default'].createElement(_KeyboardShortcutRow2['default'], { 10032 key: label, 10033 unicode: unicode, 10034 label: label, 10035 action: action, 10036 block: block 10037 }); 10038 }) 10039 ) 10040 ) 10041 ); 10042 } 10043 10044 return render; 10045 }() 10046 }]); 10047 10048 return DayPickerKeyboardShortcuts; 10049 }(_react2['default'].Component); 10050 10051 DayPickerKeyboardShortcuts.propTypes = propTypes; 10052 DayPickerKeyboardShortcuts.defaultProps = defaultProps; 10053 10054 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref3) { 10055 var _ref3$reactDates = _ref3.reactDates, 10056 color = _ref3$reactDates.color, 10057 font = _ref3$reactDates.font, 10058 zIndex = _ref3$reactDates.zIndex; 10059 return { 10060 DayPickerKeyboardShortcuts_buttonReset: { 10061 background: 'none', 10062 border: 0, 10063 borderRadius: 0, 10064 color: 'inherit', 10065 font: 'inherit', 10066 lineHeight: 'normal', 10067 overflow: 'visible', 10068 padding: 0, 10069 cursor: 'pointer', 10070 fontSize: font.size, 10071 10072 ':active': { 10073 outline: 'none' 10074 } 10075 }, 10076 10077 DayPickerKeyboardShortcuts_show: { 10078 width: 22, 10079 position: 'absolute', 10080 zIndex: zIndex + 2 10081 }, 10082 10083 DayPickerKeyboardShortcuts_show__bottomRight: { 10084 borderTop: '26px solid transparent', 10085 borderRight: '33px solid ' + String(color.core.primary), 10086 bottom: 0, 10087 right: 0, 10088 10089 ':hover': { 10090 borderRight: '33px solid ' + String(color.core.primary_dark) 10091 } 10092 }, 10093 10094 DayPickerKeyboardShortcuts_show__topRight: { 10095 borderBottom: '26px solid transparent', 10096 borderRight: '33px solid ' + String(color.core.primary), 10097 top: 0, 10098 right: 0, 10099 10100 ':hover': { 10101 borderRight: '33px solid ' + String(color.core.primary_dark) 10102 } 10103 }, 10104 10105 DayPickerKeyboardShortcuts_show__topLeft: { 10106 borderBottom: '26px solid transparent', 10107 borderLeft: '33px solid ' + String(color.core.primary), 10108 top: 0, 10109 left: 0, 10110 10111 ':hover': { 10112 borderLeft: '33px solid ' + String(color.core.primary_dark) 10113 } 10114 }, 10115 10116 DayPickerKeyboardShortcuts_showSpan: { 10117 color: color.core.white, 10118 position: 'absolute' 10119 }, 10120 10121 DayPickerKeyboardShortcuts_showSpan__bottomRight: { 10122 bottom: 0, 10123 right: -28 10124 }, 10125 10126 DayPickerKeyboardShortcuts_showSpan__topRight: { 10127 top: 1, 10128 right: -28 10129 }, 10130 10131 DayPickerKeyboardShortcuts_showSpan__topLeft: { 10132 top: 1, 10133 left: -28 10134 }, 10135 10136 DayPickerKeyboardShortcuts_panel: { 10137 overflow: 'auto', 10138 background: color.background, 10139 border: '1px solid ' + String(color.core.border), 10140 borderRadius: 2, 10141 position: 'absolute', 10142 top: 0, 10143 bottom: 0, 10144 right: 0, 10145 left: 0, 10146 zIndex: zIndex + 2, 10147 padding: 22, 10148 margin: 33 10149 }, 10150 10151 DayPickerKeyboardShortcuts_title: { 10152 fontSize: 16, 10153 fontWeight: 'bold', 10154 margin: 0 10155 }, 10156 10157 DayPickerKeyboardShortcuts_list: { 10158 listStyle: 'none', 10159 padding: 0, 10160 fontSize: font.size 10161 }, 10162 10163 DayPickerKeyboardShortcuts_close: { 10164 position: 'absolute', 10165 right: 22, 10166 top: 22, 10167 zIndex: zIndex + 2, 10168 10169 ':active': { 10170 outline: 'none' 10171 } 10172 }, 10173 10174 DayPickerKeyboardShortcuts_closeSvg: { 10175 height: 15, 10176 width: 15, 10177 fill: color.core.grayLighter, 10178 10179 ':hover': { 10180 fill: color.core.grayLight 10181 }, 10182 10183 ':focus': { 10184 fill: color.core.grayLight 10185 } 10186 } 10187 }; 10188 })(DayPickerKeyboardShortcuts); 10189 10190 /***/ }), 10191 10192 /***/ 3895: 10193 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 10194 10195 "use strict"; 10196 10197 10198 Object.defineProperty(exports, "__esModule", ({ 10199 value: true 10200 })); 10201 10202 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 10203 10204 var _object = __webpack_require__(4011); 10205 10206 var _object2 = _interopRequireDefault(_object); 10207 10208 var _react = __webpack_require__(9196); 10209 10210 var _react2 = _interopRequireDefault(_react); 10211 10212 var _propTypes = __webpack_require__(2652); 10213 10214 var _propTypes2 = _interopRequireDefault(_propTypes); 10215 10216 var _airbnbPropTypes = __webpack_require__(4882); 10217 10218 var _reactWithStyles = __webpack_require__(3576); 10219 10220 var _defaultPhrases = __webpack_require__(6030); 10221 10222 var _getPhrasePropTypes = __webpack_require__(2893); 10223 10224 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 10225 10226 var _LeftArrow = __webpack_require__(8); 10227 10228 var _LeftArrow2 = _interopRequireDefault(_LeftArrow); 10229 10230 var _RightArrow = __webpack_require__(4921); 10231 10232 var _RightArrow2 = _interopRequireDefault(_RightArrow); 10233 10234 var _ChevronUp = __webpack_require__(1809); 10235 10236 var _ChevronUp2 = _interopRequireDefault(_ChevronUp); 10237 10238 var _ChevronDown = __webpack_require__(9588); 10239 10240 var _ChevronDown2 = _interopRequireDefault(_ChevronDown); 10241 10242 var _ScrollableOrientationShape = __webpack_require__(6553); 10243 10244 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 10245 10246 var _constants = __webpack_require__(257); 10247 10248 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 10249 10250 function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 10251 10252 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 10253 navPrev: _propTypes2['default'].node, 10254 navNext: _propTypes2['default'].node, 10255 orientation: _ScrollableOrientationShape2['default'], 10256 10257 onPrevMonthClick: _propTypes2['default'].func, 10258 onNextMonthClick: _propTypes2['default'].func, 10259 10260 // internationalization 10261 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)), 10262 10263 isRTL: _propTypes2['default'].bool 10264 })); 10265 10266 var defaultProps = { 10267 navPrev: null, 10268 navNext: null, 10269 orientation: _constants.HORIZONTAL_ORIENTATION, 10270 10271 onPrevMonthClick: function () { 10272 function onPrevMonthClick() {} 10273 10274 return onPrevMonthClick; 10275 }(), 10276 onNextMonthClick: function () { 10277 function onNextMonthClick() {} 10278 10279 return onNextMonthClick; 10280 }(), 10281 10282 10283 // internationalization 10284 phrases: _defaultPhrases.DayPickerNavigationPhrases, 10285 isRTL: false 10286 }; 10287 10288 function DayPickerNavigation(_ref) { 10289 var navPrev = _ref.navPrev, 10290 navNext = _ref.navNext, 10291 onPrevMonthClick = _ref.onPrevMonthClick, 10292 onNextMonthClick = _ref.onNextMonthClick, 10293 orientation = _ref.orientation, 10294 phrases = _ref.phrases, 10295 isRTL = _ref.isRTL, 10296 styles = _ref.styles; 10297 10298 var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION; 10299 var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION; 10300 var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE; 10301 10302 var navPrevIcon = navPrev; 10303 var navNextIcon = navNext; 10304 var isDefaultNavPrev = false; 10305 var isDefaultNavNext = false; 10306 if (!navPrevIcon) { 10307 isDefaultNavPrev = true; 10308 var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default']; 10309 if (isRTL && !isVertical) { 10310 Icon = _RightArrow2['default']; 10311 } 10312 navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical)); 10313 } 10314 10315 if (!navNextIcon) { 10316 isDefaultNavNext = true; 10317 var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default']; 10318 if (isRTL && !isVertical) { 10319 _Icon = _LeftArrow2['default']; 10320 } 10321 navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical)); 10322 } 10323 10324 var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev; 10325 10326 return _react2['default'].createElement( 10327 'div', 10328 _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))), 10329 !isVerticalScrollable && _react2['default'].createElement( 10330 'div', 10331 _extends({ 10332 role: 'button', 10333 tabIndex: '0' 10334 }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), { 10335 'aria-label': phrases.jumpToPrevMonth, 10336 onClick: onPrevMonthClick, 10337 onKeyUp: function () { 10338 function onKeyUp(e) { 10339 var key = e.key; 10340 10341 if (key === 'Enter' || key === ' ') onPrevMonthClick(e); 10342 } 10343 10344 return onKeyUp; 10345 }(), 10346 onMouseUp: function () { 10347 function onMouseUp(e) { 10348 e.currentTarget.blur(); 10349 } 10350 10351 return onMouseUp; 10352 }() 10353 }), 10354 navPrevIcon 10355 ), 10356 _react2['default'].createElement( 10357 'div', 10358 _extends({ 10359 role: 'button', 10360 tabIndex: '0' 10361 }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), { 10362 'aria-label': phrases.jumpToNextMonth, 10363 onClick: onNextMonthClick, 10364 onKeyUp: function () { 10365 function onKeyUp(e) { 10366 var key = e.key; 10367 10368 if (key === 'Enter' || key === ' ') onNextMonthClick(e); 10369 } 10370 10371 return onKeyUp; 10372 }(), 10373 onMouseUp: function () { 10374 function onMouseUp(e) { 10375 e.currentTarget.blur(); 10376 } 10377 10378 return onMouseUp; 10379 }() 10380 }), 10381 navNextIcon 10382 ) 10383 ); 10384 } 10385 10386 DayPickerNavigation.propTypes = propTypes; 10387 DayPickerNavigation.defaultProps = defaultProps; 10388 10389 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) { 10390 var _ref2$reactDates = _ref2.reactDates, 10391 color = _ref2$reactDates.color, 10392 zIndex = _ref2$reactDates.zIndex; 10393 return { 10394 DayPickerNavigation: { 10395 position: 'relative', 10396 zIndex: zIndex + 2 10397 }, 10398 10399 DayPickerNavigation__horizontal: { 10400 height: 0 10401 }, 10402 10403 DayPickerNavigation__vertical: {}, 10404 DayPickerNavigation__verticalScrollable: {}, 10405 10406 DayPickerNavigation__verticalDefault: { 10407 position: 'absolute', 10408 width: '100%', 10409 height: 52, 10410 bottom: 0, 10411 left: 0 10412 }, 10413 10414 DayPickerNavigation__verticalScrollableDefault: { 10415 position: 'relative' 10416 }, 10417 10418 DayPickerNavigation_button: { 10419 cursor: 'pointer', 10420 userSelect: 'none', 10421 border: 0, 10422 padding: 0, 10423 margin: 0 10424 }, 10425 10426 DayPickerNavigation_button__default: { 10427 border: '1px solid ' + String(color.core.borderLight), 10428 backgroundColor: color.background, 10429 color: color.placeholderText, 10430 10431 ':focus': { 10432 border: '1px solid ' + String(color.core.borderMedium) 10433 }, 10434 10435 ':hover': { 10436 border: '1px solid ' + String(color.core.borderMedium) 10437 }, 10438 10439 ':active': { 10440 background: color.backgroundDark 10441 } 10442 }, 10443 10444 DayPickerNavigation_button__horizontal: {}, 10445 10446 DayPickerNavigation_button__horizontalDefault: { 10447 position: 'absolute', 10448 top: 18, 10449 lineHeight: 0.78, 10450 borderRadius: 3, 10451 padding: '6px 9px' 10452 }, 10453 10454 DayPickerNavigation_leftButton__horizontalDefault: { 10455 left: 22 10456 }, 10457 10458 DayPickerNavigation_rightButton__horizontalDefault: { 10459 right: 22 10460 }, 10461 10462 DayPickerNavigation_button__vertical: {}, 10463 10464 DayPickerNavigation_button__verticalDefault: { 10465 padding: 5, 10466 background: color.background, 10467 boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)', 10468 position: 'relative', 10469 display: 'inline-block', 10470 height: '100%', 10471 width: '50%' 10472 }, 10473 10474 DayPickerNavigation_prevButton__verticalDefault: {}, 10475 10476 DayPickerNavigation_nextButton__verticalDefault: { 10477 borderLeft: 0 10478 }, 10479 10480 DayPickerNavigation_nextButton__verticalScrollableDefault: { 10481 width: '100%' 10482 }, 10483 10484 DayPickerNavigation_svg__horizontal: { 10485 height: 19, 10486 width: 19, 10487 fill: color.core.grayLight, 10488 display: 'block' 10489 }, 10490 10491 DayPickerNavigation_svg__vertical: { 10492 height: 42, 10493 width: 42, 10494 fill: color.text, 10495 display: 'block' 10496 } 10497 }; 10498 })(DayPickerNavigation); 10499 10500 /***/ }), 10501 10502 /***/ 6302: 10503 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 10504 10505 "use strict"; 10506 var __webpack_unused_export__; 10507 10508 10509 __webpack_unused_export__ = ({ 10510 value: true 10511 }); 10512 10513 var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 10514 10515 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10516 10517 var _object = __webpack_require__(4011); 10518 10519 var _object2 = _interopRequireDefault(_object); 10520 10521 var _react = __webpack_require__(9196); 10522 10523 var _react2 = _interopRequireDefault(_react); 10524 10525 var _propTypes = __webpack_require__(2652); 10526 10527 var _propTypes2 = _interopRequireDefault(_propTypes); 10528 10529 var _reactMomentProptypes = __webpack_require__(6150); 10530 10531 var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); 10532 10533 var _airbnbPropTypes = __webpack_require__(4882); 10534 10535 var _moment = __webpack_require__(6292); 10536 10537 var _moment2 = _interopRequireDefault(_moment); 10538 10539 var _object3 = __webpack_require__(5861); 10540 10541 var _object4 = _interopRequireDefault(_object3); 10542 10543 var _isTouchDevice = __webpack_require__(5834); 10544 10545 var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice); 10546 10547 var _defaultPhrases = __webpack_require__(6030); 10548 10549 var _getPhrasePropTypes = __webpack_require__(2893); 10550 10551 var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); 10552 10553 var _isSameDay = __webpack_require__(3923); 10554 10555 var _isSameDay2 = _interopRequireDefault(_isSameDay); 10556 10557 var _isAfterDay = __webpack_require__(7365); 10558 10559 var _isAfterDay2 = _interopRequireDefault(_isAfterDay); 10560 10561 var _getVisibleDays = __webpack_require__(3268); 10562 10563 var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays); 10564 10565 var _isDayVisible = __webpack_require__(5713); 10566 10567 var _isDayVisible2 = _interopRequireDefault(_isDayVisible); 10568 10569 var _toISODateString = __webpack_require__(7310); 10570 10571 var _toISODateString2 = _interopRequireDefault(_toISODateString); 10572 10573 var _toISOMonthString = __webpack_require__(2705); 10574 10575 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 10576 10577 var _ScrollableOrientationShape = __webpack_require__(6553); 10578 10579 var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape); 10580 10581 var _DayOfWeekShape = __webpack_require__(243); 10582 10583 var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape); 10584 10585 var _CalendarInfoPositionShape = __webpack_require__(8182); 10586 10587 var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape); 10588 10589 var _constants = __webpack_require__(257); 10590 10591 var _DayPicker = __webpack_require__(8665); 10592 10593 var _DayPicker2 = _interopRequireDefault(_DayPicker); 10594 10595 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 10596 10597 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 10598 10599 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10600 10601 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 10602 10603 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10604 10605 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 10606 date: _reactMomentProptypes2['default'].momentObj, 10607 onDateChange: _propTypes2['default'].func, 10608 10609 focused: _propTypes2['default'].bool, 10610 onFocusChange: _propTypes2['default'].func, 10611 onClose: _propTypes2['default'].func, 10612 10613 keepOpenOnDateSelect: _propTypes2['default'].bool, 10614 isOutsideRange: _propTypes2['default'].func, 10615 isDayBlocked: _propTypes2['default'].func, 10616 isDayHighlighted: _propTypes2['default'].func, 10617 10618 // DayPicker props 10619 renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 10620 renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'), 10621 enableOutsideDays: _propTypes2['default'].bool, 10622 numberOfMonths: _propTypes2['default'].number, 10623 orientation: _ScrollableOrientationShape2['default'], 10624 withPortal: _propTypes2['default'].bool, 10625 initialVisibleMonth: _propTypes2['default'].func, 10626 firstDayOfWeek: _DayOfWeekShape2['default'], 10627 hideKeyboardShortcutsPanel: _propTypes2['default'].bool, 10628 daySize: _airbnbPropTypes.nonNegativeInteger, 10629 verticalHeight: _airbnbPropTypes.nonNegativeInteger, 10630 noBorder: _propTypes2['default'].bool, 10631 verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger, 10632 transitionDuration: _airbnbPropTypes.nonNegativeInteger, 10633 horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger, 10634 10635 navPrev: _propTypes2['default'].node, 10636 navNext: _propTypes2['default'].node, 10637 10638 onPrevMonthClick: _propTypes2['default'].func, 10639 onNextMonthClick: _propTypes2['default'].func, 10640 onOutsideClick: _propTypes2['default'].func, 10641 renderCalendarDay: _propTypes2['default'].func, 10642 renderDayContents: _propTypes2['default'].func, 10643 renderCalendarInfo: _propTypes2['default'].func, 10644 calendarInfoPosition: _CalendarInfoPositionShape2['default'], 10645 10646 // accessibility 10647 onBlur: _propTypes2['default'].func, 10648 isFocused: _propTypes2['default'].bool, 10649 showKeyboardShortcuts: _propTypes2['default'].bool, 10650 10651 // i18n 10652 monthFormat: _propTypes2['default'].string, 10653 weekDayFormat: _propTypes2['default'].string, 10654 phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)), 10655 dayAriaLabelFormat: _propTypes2['default'].string, 10656 10657 isRTL: _propTypes2['default'].bool 10658 }); 10659 10660 var defaultProps = { 10661 date: undefined, // TODO: use null 10662 onDateChange: function () { 10663 function onDateChange() {} 10664 10665 return onDateChange; 10666 }(), 10667 10668 10669 focused: false, 10670 onFocusChange: function () { 10671 function onFocusChange() {} 10672 10673 return onFocusChange; 10674 }(), 10675 onClose: function () { 10676 function onClose() {} 10677 10678 return onClose; 10679 }(), 10680 10681 10682 keepOpenOnDateSelect: false, 10683 isOutsideRange: function () { 10684 function isOutsideRange() {} 10685 10686 return isOutsideRange; 10687 }(), 10688 isDayBlocked: function () { 10689 function isDayBlocked() {} 10690 10691 return isDayBlocked; 10692 }(), 10693 isDayHighlighted: function () { 10694 function isDayHighlighted() {} 10695 10696 return isDayHighlighted; 10697 }(), 10698 10699 10700 // DayPicker props 10701 renderMonthText: null, 10702 enableOutsideDays: false, 10703 numberOfMonths: 1, 10704 orientation: _constants.HORIZONTAL_ORIENTATION, 10705 withPortal: false, 10706 hideKeyboardShortcutsPanel: false, 10707 initialVisibleMonth: null, 10708 firstDayOfWeek: null, 10709 daySize: _constants.DAY_SIZE, 10710 verticalHeight: null, 10711 noBorder: false, 10712 verticalBorderSpacing: undefined, 10713 transitionDuration: undefined, 10714 horizontalMonthPadding: 13, 10715 10716 navPrev: null, 10717 navNext: null, 10718 10719 onPrevMonthClick: function () { 10720 function onPrevMonthClick() {} 10721 10722 return onPrevMonthClick; 10723 }(), 10724 onNextMonthClick: function () { 10725 function onNextMonthClick() {} 10726 10727 return onNextMonthClick; 10728 }(), 10729 onOutsideClick: function () { 10730 function onOutsideClick() {} 10731 10732 return onOutsideClick; 10733 }(), 10734 10735 10736 renderCalendarDay: undefined, 10737 renderDayContents: null, 10738 renderCalendarInfo: null, 10739 renderMonthElement: null, 10740 calendarInfoPosition: _constants.INFO_POSITION_BOTTOM, 10741 10742 // accessibility 10743 onBlur: function () { 10744 function onBlur() {} 10745 10746 return onBlur; 10747 }(), 10748 10749 isFocused: false, 10750 showKeyboardShortcuts: false, 10751 10752 // i18n 10753 monthFormat: 'MMMM YYYY', 10754 weekDayFormat: 'dd', 10755 phrases: _defaultPhrases.DayPickerPhrases, 10756 dayAriaLabelFormat: undefined, 10757 10758 isRTL: false 10759 }; 10760 10761 var DayPickerSingleDateController = function (_React$Component) { 10762 _inherits(DayPickerSingleDateController, _React$Component); 10763 10764 function DayPickerSingleDateController(props) { 10765 _classCallCheck(this, DayPickerSingleDateController); 10766 10767 var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props)); 10768 10769 _this.isTouchDevice = false; 10770 _this.today = (0, _moment2['default'])(); 10771 10772 _this.modifiers = { 10773 today: function () { 10774 function today(day) { 10775 return _this.isToday(day); 10776 } 10777 10778 return today; 10779 }(), 10780 blocked: function () { 10781 function blocked(day) { 10782 return _this.isBlocked(day); 10783 } 10784 10785 return blocked; 10786 }(), 10787 'blocked-calendar': function () { 10788 function blockedCalendar(day) { 10789 return props.isDayBlocked(day); 10790 } 10791 10792 return blockedCalendar; 10793 }(), 10794 'blocked-out-of-range': function () { 10795 function blockedOutOfRange(day) { 10796 return props.isOutsideRange(day); 10797 } 10798 10799 return blockedOutOfRange; 10800 }(), 10801 'highlighted-calendar': function () { 10802 function highlightedCalendar(day) { 10803 return props.isDayHighlighted(day); 10804 } 10805 10806 return highlightedCalendar; 10807 }(), 10808 valid: function () { 10809 function valid(day) { 10810 return !_this.isBlocked(day); 10811 } 10812 10813 return valid; 10814 }(), 10815 hovered: function () { 10816 function hovered(day) { 10817 return _this.isHovered(day); 10818 } 10819 10820 return hovered; 10821 }(), 10822 selected: function () { 10823 function selected(day) { 10824 return _this.isSelected(day); 10825 } 10826 10827 return selected; 10828 }(), 10829 'first-day-of-week': function () { 10830 function firstDayOfWeek(day) { 10831 return _this.isFirstDayOfWeek(day); 10832 } 10833 10834 return firstDayOfWeek; 10835 }(), 10836 'last-day-of-week': function () { 10837 function lastDayOfWeek(day) { 10838 return _this.isLastDayOfWeek(day); 10839 } 10840 10841 return lastDayOfWeek; 10842 }() 10843 }; 10844 10845 var _this$getStateForNewM = _this.getStateForNewMonth(props), 10846 currentMonth = _this$getStateForNewM.currentMonth, 10847 visibleDays = _this$getStateForNewM.visibleDays; 10848 10849 _this.state = { 10850 hoverDate: null, 10851 currentMonth: currentMonth, 10852 visibleDays: visibleDays 10853 }; 10854 10855 _this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this); 10856 _this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this); 10857 _this.onDayClick = _this.onDayClick.bind(_this); 10858 10859 _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this); 10860 _this.onNextMonthClick = _this.onNextMonthClick.bind(_this); 10861 _this.onMonthChange = _this.onMonthChange.bind(_this); 10862 _this.onYearChange = _this.onYearChange.bind(_this); 10863 10864 _this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this); 10865 return _this; 10866 } 10867 10868 _createClass(DayPickerSingleDateController, [{ 10869 key: 'componentDidMount', 10870 value: function () { 10871 function componentDidMount() { 10872 this.isTouchDevice = (0, _isTouchDevice2['default'])(); 10873 } 10874 10875 return componentDidMount; 10876 }() 10877 }, { 10878 key: 'componentWillReceiveProps', 10879 value: function () { 10880 function componentWillReceiveProps(nextProps) { 10881 var _this2 = this; 10882 10883 var date = nextProps.date, 10884 focused = nextProps.focused, 10885 isOutsideRange = nextProps.isOutsideRange, 10886 isDayBlocked = nextProps.isDayBlocked, 10887 isDayHighlighted = nextProps.isDayHighlighted, 10888 initialVisibleMonth = nextProps.initialVisibleMonth, 10889 numberOfMonths = nextProps.numberOfMonths, 10890 enableOutsideDays = nextProps.enableOutsideDays; 10891 var _props = this.props, 10892 prevIsOutsideRange = _props.isOutsideRange, 10893 prevIsDayBlocked = _props.isDayBlocked, 10894 prevIsDayHighlighted = _props.isDayHighlighted, 10895 prevNumberOfMonths = _props.numberOfMonths, 10896 prevEnableOutsideDays = _props.enableOutsideDays, 10897 prevInitialVisibleMonth = _props.initialVisibleMonth, 10898 prevFocused = _props.focused, 10899 prevDate = _props.date; 10900 var visibleDays = this.state.visibleDays; 10901 10902 10903 var recomputeOutsideRange = false; 10904 var recomputeDayBlocked = false; 10905 var recomputeDayHighlighted = false; 10906 10907 if (isOutsideRange !== prevIsOutsideRange) { 10908 this.modifiers['blocked-out-of-range'] = function (day) { 10909 return isOutsideRange(day); 10910 }; 10911 recomputeOutsideRange = true; 10912 } 10913 10914 if (isDayBlocked !== prevIsDayBlocked) { 10915 this.modifiers['blocked-calendar'] = function (day) { 10916 return isDayBlocked(day); 10917 }; 10918 recomputeDayBlocked = true; 10919 } 10920 10921 if (isDayHighlighted !== prevIsDayHighlighted) { 10922 this.modifiers['highlighted-calendar'] = function (day) { 10923 return isDayHighlighted(day); 10924 }; 10925 recomputeDayHighlighted = true; 10926 } 10927 10928 var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted; 10929 10930 if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) { 10931 var newMonthState = this.getStateForNewMonth(nextProps); 10932 var currentMonth = newMonthState.currentMonth; 10933 visibleDays = newMonthState.visibleDays; 10934 10935 this.setState({ 10936 currentMonth: currentMonth, 10937 visibleDays: visibleDays 10938 }); 10939 } 10940 10941 var didDateChange = date !== prevDate; 10942 var didFocusChange = focused !== prevFocused; 10943 10944 var modifiers = {}; 10945 10946 if (didDateChange) { 10947 modifiers = this.deleteModifier(modifiers, prevDate, 'selected'); 10948 modifiers = this.addModifier(modifiers, date, 'selected'); 10949 } 10950 10951 if (didFocusChange || recomputePropModifiers) { 10952 (0, _object4['default'])(visibleDays).forEach(function (days) { 10953 Object.keys(days).forEach(function (day) { 10954 var momentObj = (0, _moment2['default'])(day); 10955 if (_this2.isBlocked(momentObj)) { 10956 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked'); 10957 } else { 10958 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked'); 10959 } 10960 10961 if (didFocusChange || recomputeOutsideRange) { 10962 if (isOutsideRange(momentObj)) { 10963 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range'); 10964 } else { 10965 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range'); 10966 } 10967 } 10968 10969 if (didFocusChange || recomputeDayBlocked) { 10970 if (isDayBlocked(momentObj)) { 10971 modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar'); 10972 } else { 10973 modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar'); 10974 } 10975 } 10976 10977 if (didFocusChange || recomputeDayHighlighted) { 10978 if (isDayHighlighted(momentObj)) { 10979 modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar'); 10980 } else { 10981 modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar'); 10982 } 10983 } 10984 }); 10985 }); 10986 } 10987 10988 var today = (0, _moment2['default'])(); 10989 if (!(0, _isSameDay2['default'])(this.today, today)) { 10990 modifiers = this.deleteModifier(modifiers, this.today, 'today'); 10991 modifiers = this.addModifier(modifiers, today, 'today'); 10992 this.today = today; 10993 } 10994 10995 if (Object.keys(modifiers).length > 0) { 10996 this.setState({ 10997 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 10998 }); 10999 } 11000 } 11001 11002 return componentWillReceiveProps; 11003 }() 11004 }, { 11005 key: 'componentWillUpdate', 11006 value: function () { 11007 function componentWillUpdate() { 11008 this.today = (0, _moment2['default'])(); 11009 } 11010 11011 return componentWillUpdate; 11012 }() 11013 }, { 11014 key: 'onDayClick', 11015 value: function () { 11016 function onDayClick(day, e) { 11017 if (e) e.preventDefault(); 11018 if (this.isBlocked(day)) return; 11019 var _props2 = this.props, 11020 onDateChange = _props2.onDateChange, 11021 keepOpenOnDateSelect = _props2.keepOpenOnDateSelect, 11022 onFocusChange = _props2.onFocusChange, 11023 onClose = _props2.onClose; 11024 11025 11026 onDateChange(day); 11027 if (!keepOpenOnDateSelect) { 11028 onFocusChange({ focused: false }); 11029 onClose({ date: day }); 11030 } 11031 } 11032 11033 return onDayClick; 11034 }() 11035 }, { 11036 key: 'onDayMouseEnter', 11037 value: function () { 11038 function onDayMouseEnter(day) { 11039 if (this.isTouchDevice) return; 11040 var _state = this.state, 11041 hoverDate = _state.hoverDate, 11042 visibleDays = _state.visibleDays; 11043 11044 11045 var modifiers = this.deleteModifier({}, hoverDate, 'hovered'); 11046 modifiers = this.addModifier(modifiers, day, 'hovered'); 11047 11048 this.setState({ 11049 hoverDate: day, 11050 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 11051 }); 11052 } 11053 11054 return onDayMouseEnter; 11055 }() 11056 }, { 11057 key: 'onDayMouseLeave', 11058 value: function () { 11059 function onDayMouseLeave() { 11060 var _state2 = this.state, 11061 hoverDate = _state2.hoverDate, 11062 visibleDays = _state2.visibleDays; 11063 11064 if (this.isTouchDevice || !hoverDate) return; 11065 11066 var modifiers = this.deleteModifier({}, hoverDate, 'hovered'); 11067 11068 this.setState({ 11069 hoverDate: null, 11070 visibleDays: (0, _object2['default'])({}, visibleDays, modifiers) 11071 }); 11072 } 11073 11074 return onDayMouseLeave; 11075 }() 11076 }, { 11077 key: 'onPrevMonthClick', 11078 value: function () { 11079 function onPrevMonthClick() { 11080 var _props3 = this.props, 11081 onPrevMonthClick = _props3.onPrevMonthClick, 11082 numberOfMonths = _props3.numberOfMonths, 11083 enableOutsideDays = _props3.enableOutsideDays; 11084 var _state3 = this.state, 11085 currentMonth = _state3.currentMonth, 11086 visibleDays = _state3.visibleDays; 11087 11088 11089 var newVisibleDays = {}; 11090 Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) { 11091 newVisibleDays[month] = visibleDays[month]; 11092 }); 11093 11094 var prevMonth = currentMonth.clone().subtract(1, 'month'); 11095 var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays); 11096 11097 this.setState({ 11098 currentMonth: prevMonth, 11099 visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays)) 11100 }, function () { 11101 onPrevMonthClick(prevMonth.clone()); 11102 }); 11103 } 11104 11105 return onPrevMonthClick; 11106 }() 11107 }, { 11108 key: 'onNextMonthClick', 11109 value: function () { 11110 function onNextMonthClick() { 11111 var _props4 = this.props, 11112 onNextMonthClick = _props4.onNextMonthClick, 11113 numberOfMonths = _props4.numberOfMonths, 11114 enableOutsideDays = _props4.enableOutsideDays; 11115 var _state4 = this.state, 11116 currentMonth = _state4.currentMonth, 11117 visibleDays = _state4.visibleDays; 11118 11119 11120 var newVisibleDays = {}; 11121 Object.keys(visibleDays).sort().slice(1).forEach(function (month) { 11122 newVisibleDays[month] = visibleDays[month]; 11123 }); 11124 11125 var nextMonth = currentMonth.clone().add(numberOfMonths, 'month'); 11126 var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays); 11127 11128 var newCurrentMonth = currentMonth.clone().add(1, 'month'); 11129 this.setState({ 11130 currentMonth: newCurrentMonth, 11131 visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays)) 11132 }, function () { 11133 onNextMonthClick(newCurrentMonth.clone()); 11134 }); 11135 } 11136 11137 return onNextMonthClick; 11138 }() 11139 }, { 11140 key: 'onMonthChange', 11141 value: function () { 11142 function onMonthChange(newMonth) { 11143 var _props5 = this.props, 11144 numberOfMonths = _props5.numberOfMonths, 11145 enableOutsideDays = _props5.enableOutsideDays, 11146 orientation = _props5.orientation; 11147 11148 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 11149 var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths); 11150 11151 this.setState({ 11152 currentMonth: newMonth.clone(), 11153 visibleDays: this.getModifiers(newVisibleDays) 11154 }); 11155 } 11156 11157 return onMonthChange; 11158 }() 11159 }, { 11160 key: 'onYearChange', 11161 value: function () { 11162 function onYearChange(newMonth) { 11163 var _props6 = this.props, 11164 numberOfMonths = _props6.numberOfMonths, 11165 enableOutsideDays = _props6.enableOutsideDays, 11166 orientation = _props6.orientation; 11167 11168 var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE; 11169 var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths); 11170 11171 this.setState({ 11172 currentMonth: newMonth.clone(), 11173 visibleDays: this.getModifiers(newVisibleDays) 11174 }); 11175 } 11176 11177 return onYearChange; 11178 }() 11179 }, { 11180 key: 'getFirstFocusableDay', 11181 value: function () { 11182 function getFirstFocusableDay(newMonth) { 11183 var _this3 = this; 11184 11185 var _props7 = this.props, 11186 date = _props7.date, 11187 numberOfMonths = _props7.numberOfMonths; 11188 11189 11190 var focusedDate = newMonth.clone().startOf('month'); 11191 if (date) { 11192 focusedDate = date.clone(); 11193 } 11194 11195 if (this.isBlocked(focusedDate)) { 11196 var days = []; 11197 var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month'); 11198 var currentDay = focusedDate.clone(); 11199 while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) { 11200 currentDay = currentDay.clone().add(1, 'day'); 11201 days.push(currentDay); 11202 } 11203 11204 var viableDays = days.filter(function (day) { 11205 return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate); 11206 }); 11207 if (viableDays.length > 0) { 11208 var _viableDays = _slicedToArray(viableDays, 1); 11209 11210 focusedDate = _viableDays[0]; 11211 } 11212 } 11213 11214 return focusedDate; 11215 } 11216 11217 return getFirstFocusableDay; 11218 }() 11219 }, { 11220 key: 'getModifiers', 11221 value: function () { 11222 function getModifiers(visibleDays) { 11223 var _this4 = this; 11224 11225 var modifiers = {}; 11226 Object.keys(visibleDays).forEach(function (month) { 11227 modifiers[month] = {}; 11228 visibleDays[month].forEach(function (day) { 11229 modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day); 11230 }); 11231 }); 11232 11233 return modifiers; 11234 } 11235 11236 return getModifiers; 11237 }() 11238 }, { 11239 key: 'getModifiersForDay', 11240 value: function () { 11241 function getModifiersForDay(day) { 11242 var _this5 = this; 11243 11244 return new Set(Object.keys(this.modifiers).filter(function (modifier) { 11245 return _this5.modifiers[modifier](day); 11246 })); 11247 } 11248 11249 return getModifiersForDay; 11250 }() 11251 }, { 11252 key: 'getStateForNewMonth', 11253 value: function () { 11254 function getStateForNewMonth(nextProps) { 11255 var _this6 = this; 11256 11257 var initialVisibleMonth = nextProps.initialVisibleMonth, 11258 date = nextProps.date, 11259 numberOfMonths = nextProps.numberOfMonths, 11260 enableOutsideDays = nextProps.enableOutsideDays; 11261 11262 var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () { 11263 return date; 11264 } : function () { 11265 return _this6.today; 11266 }); 11267 var currentMonth = initialVisibleMonthThunk(); 11268 var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays)); 11269 return { currentMonth: currentMonth, visibleDays: visibleDays }; 11270 } 11271 11272 return getStateForNewMonth; 11273 }() 11274 }, { 11275 key: 'addModifier', 11276 value: function () { 11277 function addModifier(updatedDays, day, modifier) { 11278 var _props8 = this.props, 11279 numberOfVisibleMonths = _props8.numberOfMonths, 11280 enableOutsideDays = _props8.enableOutsideDays, 11281 orientation = _props8.orientation; 11282 var _state5 = this.state, 11283 firstVisibleMonth = _state5.currentMonth, 11284 visibleDays = _state5.visibleDays; 11285 11286 11287 var currentMonth = firstVisibleMonth; 11288 var numberOfMonths = numberOfVisibleMonths; 11289 if (orientation === _constants.VERTICAL_SCROLLABLE) { 11290 numberOfMonths = Object.keys(visibleDays).length; 11291 } else { 11292 currentMonth = currentMonth.clone().subtract(1, 'month'); 11293 numberOfMonths += 2; 11294 } 11295 if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) { 11296 return updatedDays; 11297 } 11298 11299 var iso = (0, _toISODateString2['default'])(day); 11300 11301 var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays); 11302 if (enableOutsideDays) { 11303 var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) { 11304 return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1; 11305 }); 11306 11307 updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) { 11308 var month = updatedDays[monthIso] || visibleDays[monthIso]; 11309 var modifiers = new Set(month[iso]); 11310 modifiers.add(modifier); 11311 return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 11312 }, updatedDaysAfterAddition); 11313 } else { 11314 var monthIso = (0, _toISOMonthString2['default'])(day); 11315 var month = updatedDays[monthIso] || visibleDays[monthIso]; 11316 11317 var modifiers = new Set(month[iso]); 11318 modifiers.add(modifier); 11319 updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 11320 } 11321 11322 return updatedDaysAfterAddition; 11323 } 11324 11325 return addModifier; 11326 }() 11327 }, { 11328 key: 'deleteModifier', 11329 value: function () { 11330 function deleteModifier(updatedDays, day, modifier) { 11331 var _props9 = this.props, 11332 numberOfVisibleMonths = _props9.numberOfMonths, 11333 enableOutsideDays = _props9.enableOutsideDays, 11334 orientation = _props9.orientation; 11335 var _state6 = this.state, 11336 firstVisibleMonth = _state6.currentMonth, 11337 visibleDays = _state6.visibleDays; 11338 11339 11340 var currentMonth = firstVisibleMonth; 11341 var numberOfMonths = numberOfVisibleMonths; 11342 if (orientation === _constants.VERTICAL_SCROLLABLE) { 11343 numberOfMonths = Object.keys(visibleDays).length; 11344 } else { 11345 currentMonth = currentMonth.clone().subtract(1, 'month'); 11346 numberOfMonths += 2; 11347 } 11348 if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) { 11349 return updatedDays; 11350 } 11351 11352 var iso = (0, _toISODateString2['default'])(day); 11353 11354 var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays); 11355 if (enableOutsideDays) { 11356 var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) { 11357 return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1; 11358 }); 11359 11360 updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) { 11361 var month = updatedDays[monthIso] || visibleDays[monthIso]; 11362 var modifiers = new Set(month[iso]); 11363 modifiers['delete'](modifier); 11364 return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 11365 }, updatedDaysAfterDeletion); 11366 } else { 11367 var monthIso = (0, _toISOMonthString2['default'])(day); 11368 var month = updatedDays[monthIso] || visibleDays[monthIso]; 11369 11370 var modifiers = new Set(month[iso]); 11371 modifiers['delete'](modifier); 11372 updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers)))); 11373 } 11374 11375 return updatedDaysAfterDeletion; 11376 } 11377 11378 return deleteModifier; 11379 }() 11380 }, { 11381 key: 'isBlocked', 11382 value: function () { 11383 function isBlocked(day) { 11384 var _props10 = this.props, 11385 isDayBlocked = _props10.isDayBlocked, 11386 isOutsideRange = _props10.isOutsideRange; 11387 11388 return isDayBlocked(day) || isOutsideRange(day); 11389 } 11390 11391 return isBlocked; 11392 }() 11393 }, { 11394 key: 'isHovered', 11395 value: function () { 11396 function isHovered(day) { 11397 var _ref = this.state || {}, 11398 hoverDate = _ref.hoverDate; 11399 11400 return (0, _isSameDay2['default'])(day, hoverDate); 11401 } 11402 11403 return isHovered; 11404 }() 11405 }, { 11406 key: 'isSelected', 11407 value: function () { 11408 function isSelected(day) { 11409 var date = this.props.date; 11410 11411 return (0, _isSameDay2['default'])(day, date); 11412 } 11413 11414 return isSelected; 11415 }() 11416 }, { 11417 key: 'isToday', 11418 value: function () { 11419 function isToday(day) { 11420 return (0, _isSameDay2['default'])(day, this.today); 11421 } 11422 11423 return isToday; 11424 }() 11425 }, { 11426 key: 'isFirstDayOfWeek', 11427 value: function () { 11428 function isFirstDayOfWeek(day) { 11429 var firstDayOfWeek = this.props.firstDayOfWeek; 11430 11431 return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()); 11432 } 11433 11434 return isFirstDayOfWeek; 11435 }() 11436 }, { 11437 key: 'isLastDayOfWeek', 11438 value: function () { 11439 function isLastDayOfWeek(day) { 11440 var firstDayOfWeek = this.props.firstDayOfWeek; 11441 11442 return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7; 11443 } 11444 11445 return isLastDayOfWeek; 11446 }() 11447 }, { 11448 key: 'render', 11449 value: function () { 11450 function render() { 11451 var _props11 = this.props, 11452 numberOfMonths = _props11.numberOfMonths, 11453 orientation = _props11.orientation, 11454 monthFormat = _props11.monthFormat, 11455 renderMonthText = _props11.renderMonthText, 11456 navPrev = _props11.navPrev, 11457 navNext = _props11.navNext, 11458 onOutsideClick = _props11.onOutsideClick, 11459 withPortal = _props11.withPortal, 11460 focused = _props11.focused, 11461 enableOutsideDays = _props11.enableOutsideDays, 11462 hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel, 11463 daySize = _props11.daySize, 11464 firstDayOfWeek = _props11.firstDayOfWeek, 11465 renderCalendarDay = _props11.renderCalendarDay, 11466 renderDayContents = _props11.renderDayContents, 11467 renderCalendarInfo = _props11.renderCalendarInfo, 11468 renderMonthElement = _props11.renderMonthElement, 11469 calendarInfoPosition = _props11.calendarInfoPosition, 11470 isFocused = _props11.isFocused, 11471 isRTL = _props11.isRTL, 11472 phrases = _props11.phrases, 11473 dayAriaLabelFormat = _props11.dayAriaLabelFormat, 11474 onBlur = _props11.onBlur, 11475 showKeyboardShortcuts = _props11.showKeyboardShortcuts, 11476 weekDayFormat = _props11.weekDayFormat, 11477 verticalHeight = _props11.verticalHeight, 11478 noBorder = _props11.noBorder, 11479 transitionDuration = _props11.transitionDuration, 11480 verticalBorderSpacing = _props11.verticalBorderSpacing, 11481 horizontalMonthPadding = _props11.horizontalMonthPadding; 11482 var _state7 = this.state, 11483 currentMonth = _state7.currentMonth, 11484 visibleDays = _state7.visibleDays; 11485 11486 11487 return _react2['default'].createElement(_DayPicker2['default'], { 11488 orientation: orientation, 11489 enableOutsideDays: enableOutsideDays, 11490 modifiers: visibleDays, 11491 numberOfMonths: numberOfMonths, 11492 onDayClick: this.onDayClick, 11493 onDayMouseEnter: this.onDayMouseEnter, 11494 onDayMouseLeave: this.onDayMouseLeave, 11495 onPrevMonthClick: this.onPrevMonthClick, 11496 onNextMonthClick: this.onNextMonthClick, 11497 onMonthChange: this.onMonthChange, 11498 onYearChange: this.onYearChange, 11499 monthFormat: monthFormat, 11500 withPortal: withPortal, 11501 hidden: !focused, 11502 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11503 initialVisibleMonth: function () { 11504 function initialVisibleMonth() { 11505 return currentMonth; 11506 } 11507 11508 return initialVisibleMonth; 11509 }(), 11510 firstDayOfWeek: firstDayOfWeek, 11511 onOutsideClick: onOutsideClick, 11512 navPrev: navPrev, 11513 navNext: navNext, 11514 renderMonthText: renderMonthText, 11515 renderCalendarDay: renderCalendarDay, 11516 renderDayContents: renderDayContents, 11517 renderCalendarInfo: renderCalendarInfo, 11518 renderMonthElement: renderMonthElement, 11519 calendarInfoPosition: calendarInfoPosition, 11520 isFocused: isFocused, 11521 getFirstFocusableDay: this.getFirstFocusableDay, 11522 onBlur: onBlur, 11523 phrases: phrases, 11524 daySize: daySize, 11525 isRTL: isRTL, 11526 showKeyboardShortcuts: showKeyboardShortcuts, 11527 weekDayFormat: weekDayFormat, 11528 dayAriaLabelFormat: dayAriaLabelFormat, 11529 verticalHeight: verticalHeight, 11530 noBorder: noBorder, 11531 transitionDuration: transitionDuration, 11532 verticalBorderSpacing: verticalBorderSpacing, 11533 horizontalMonthPadding: horizontalMonthPadding 11534 }); 11535 } 11536 11537 return render; 11538 }() 11539 }]); 11540 11541 return DayPickerSingleDateController; 11542 }(_react2['default'].Component); 11543 11544 exports.Z = DayPickerSingleDateController; 11545 11546 11547 DayPickerSingleDateController.propTypes = propTypes; 11548 DayPickerSingleDateController.defaultProps = defaultProps; 11549 11550 /***/ }), 11551 11552 /***/ 5820: 11553 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 11554 11555 "use strict"; 11556 11557 11558 Object.defineProperty(exports, "__esModule", ({ 11559 value: true 11560 })); 11561 11562 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 11563 11564 var _object = __webpack_require__(4011); 11565 11566 var _object2 = _interopRequireDefault(_object); 11567 11568 var _react = __webpack_require__(9196); 11569 11570 var _react2 = _interopRequireDefault(_react); 11571 11572 var _propTypes = __webpack_require__(2652); 11573 11574 var _propTypes2 = _interopRequireDefault(_propTypes); 11575 11576 var _airbnbPropTypes = __webpack_require__(4882); 11577 11578 var _reactWithStyles = __webpack_require__(3576); 11579 11580 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 11581 11582 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { 11583 unicode: _propTypes2['default'].string.isRequired, 11584 label: _propTypes2['default'].string.isRequired, 11585 action: _propTypes2['default'].string.isRequired, 11586 block: _propTypes2['default'].bool 11587 })); 11588 11589 var defaultProps = { 11590 block: false 11591 }; 11592 11593 function KeyboardShortcutRow(_ref) { 11594 var unicode = _ref.unicode, 11595 label = _ref.label, 11596 action = _ref.action, 11597 block = _ref.block, 11598 styles = _ref.styles; 11599 11600 return _react2['default'].createElement( 11601 'li', 11602 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block), 11603 _react2['default'].createElement( 11604 'div', 11605 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block), 11606 _react2['default'].createElement( 11607 'span', 11608 _extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), { 11609 role: 'img', 11610 'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action 11611 }), 11612 unicode 11613 ) 11614 ), 11615 _react2['default'].createElement( 11616 'div', 11617 (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action), 11618 action 11619 ) 11620 ); 11621 } 11622 11623 KeyboardShortcutRow.propTypes = propTypes; 11624 KeyboardShortcutRow.defaultProps = defaultProps; 11625 11626 exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) { 11627 var color = _ref2.reactDates.color; 11628 return { 11629 KeyboardShortcutRow: { 11630 listStyle: 'none', 11631 margin: '6px 0' 11632 }, 11633 11634 KeyboardShortcutRow__block: { 11635 marginBottom: 16 11636 }, 11637 11638 KeyboardShortcutRow_keyContainer: { 11639 display: 'inline-block', 11640 whiteSpace: 'nowrap', 11641 textAlign: 'right', 11642 marginRight: 6 11643 }, 11644 11645 KeyboardShortcutRow_keyContainer__block: { 11646 textAlign: 'left', 11647 display: 'inline' 11648 }, 11649 11650 KeyboardShortcutRow_key: { 11651 fontFamily: 'monospace', 11652 fontSize: 12, 11653 textTransform: 'uppercase', 11654 background: color.core.grayLightest, 11655 padding: '2px 6px' 11656 }, 11657 11658 KeyboardShortcutRow_action: { 11659 display: 'inline', 11660 wordBreak: 'break-word', 11661 marginLeft: 8 11662 } 11663 }; 11664 })(KeyboardShortcutRow); 11665 11666 /***/ }), 11667 11668 /***/ 8: 11669 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 11670 11671 "use strict"; 11672 11673 11674 Object.defineProperty(exports, "__esModule", ({ 11675 value: true 11676 })); 11677 11678 var _react = __webpack_require__(9196); 11679 11680 var _react2 = _interopRequireDefault(_react); 11681 11682 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 11683 11684 var LeftArrow = function () { 11685 function LeftArrow(props) { 11686 return _react2['default'].createElement( 11687 'svg', 11688 props, 11689 _react2['default'].createElement('path', { 11690 d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z' 11691 }) 11692 ); 11693 } 11694 11695 return LeftArrow; 11696 }(); 11697 11698 LeftArrow.defaultProps = { 11699 viewBox: '0 0 1000 1000' 11700 }; 11701 exports["default"] = LeftArrow; 11702 11703 /***/ }), 11704 11705 /***/ 4921: 11706 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 11707 11708 "use strict"; 11709 11710 11711 Object.defineProperty(exports, "__esModule", ({ 11712 value: true 11713 })); 11714 11715 var _react = __webpack_require__(9196); 11716 11717 var _react2 = _interopRequireDefault(_react); 11718 11719 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 11720 11721 var RightArrow = function () { 11722 function RightArrow(props) { 11723 return _react2['default'].createElement( 11724 'svg', 11725 props, 11726 _react2['default'].createElement('path', { 11727 d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z' 11728 }) 11729 ); 11730 } 11731 11732 return RightArrow; 11733 }(); 11734 11735 RightArrow.defaultProps = { 11736 viewBox: '0 0 1000 1000' 11737 }; 11738 exports["default"] = RightArrow; 11739 11740 /***/ }), 11741 11742 /***/ 257: 11743 /***/ (function(__unused_webpack_module, exports) { 11744 11745 "use strict"; 11746 11747 11748 Object.defineProperty(exports, "__esModule", ({ 11749 value: true 11750 })); 11751 var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L'; 11752 var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD'; 11753 var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM'; 11754 11755 var START_DATE = exports.START_DATE = 'startDate'; 11756 var END_DATE = exports.END_DATE = 'endDate'; 11757 11758 var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal'; 11759 var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical'; 11760 var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable'; 11761 11762 var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before'; 11763 var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after'; 11764 11765 var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top'; 11766 var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom'; 11767 var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before'; 11768 var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after'; 11769 11770 var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left'; 11771 var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right'; 11772 11773 var OPEN_DOWN = exports.OPEN_DOWN = 'down'; 11774 var OPEN_UP = exports.OPEN_UP = 'up'; 11775 11776 var DAY_SIZE = exports.DAY_SIZE = 39; 11777 var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked'; 11778 var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6]; 11779 11780 var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20; 11781 var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10; 11782 var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22; 11783 11784 var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']); 11785 11786 /***/ }), 11787 11788 /***/ 6030: 11789 /***/ (function(__unused_webpack_module, exports) { 11790 11791 "use strict"; 11792 11793 11794 Object.defineProperty(exports, "__esModule", ({ 11795 value: true 11796 })); 11797 var calendarLabel = 'Calendar'; 11798 var closeDatePicker = 'Close'; 11799 var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.'; 11800 var clearDate = 'Clear Date'; 11801 var clearDates = 'Clear Dates'; 11802 var jumpToPrevMonth = 'Move backward to switch to the previous month.'; 11803 var jumpToNextMonth = 'Move forward to switch to the next month.'; 11804 var keyboardShortcuts = 'Keyboard Shortcuts'; 11805 var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.'; 11806 var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.'; 11807 var openThisPanel = 'Open this panel.'; 11808 var enterKey = 'Enter key'; 11809 var leftArrowRightArrow = 'Right and left arrow keys'; 11810 var upArrowDownArrow = 'up and down arrow keys'; 11811 var pageUpPageDown = 'page up and page down keys'; 11812 var homeEnd = 'Home and end keys'; 11813 var escape = 'Escape key'; 11814 var questionMark = 'Question mark'; 11815 var selectFocusedDate = 'Select the date in focus.'; 11816 var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.'; 11817 var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.'; 11818 var moveFocusByOneMonth = 'Switch months.'; 11819 var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.'; 11820 var returnFocusToInput = 'Return to the date input field.'; 11821 var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.'; 11822 11823 var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) { 11824 var date = _ref.date; 11825 return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.'; 11826 }; 11827 var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) { 11828 var date = _ref2.date; 11829 return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.'; 11830 }; 11831 var chooseAvailableDate = function chooseAvailableDate(_ref3) { 11832 var date = _ref3.date; 11833 return date; 11834 }; 11835 var dateIsUnavailable = function dateIsUnavailable(_ref4) { 11836 var date = _ref4.date; 11837 return 'Not available. ' + String(date); 11838 }; 11839 var dateIsSelected = function dateIsSelected(_ref5) { 11840 var date = _ref5.date; 11841 return 'Selected. ' + String(date); 11842 }; 11843 11844 exports["default"] = { 11845 calendarLabel: calendarLabel, 11846 closeDatePicker: closeDatePicker, 11847 focusStartDate: focusStartDate, 11848 clearDate: clearDate, 11849 clearDates: clearDates, 11850 jumpToPrevMonth: jumpToPrevMonth, 11851 jumpToNextMonth: jumpToNextMonth, 11852 keyboardShortcuts: keyboardShortcuts, 11853 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 11854 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11855 openThisPanel: openThisPanel, 11856 enterKey: enterKey, 11857 leftArrowRightArrow: leftArrowRightArrow, 11858 upArrowDownArrow: upArrowDownArrow, 11859 pageUpPageDown: pageUpPageDown, 11860 homeEnd: homeEnd, 11861 escape: escape, 11862 questionMark: questionMark, 11863 selectFocusedDate: selectFocusedDate, 11864 moveFocusByOneDay: moveFocusByOneDay, 11865 moveFocusByOneWeek: moveFocusByOneWeek, 11866 moveFocusByOneMonth: moveFocusByOneMonth, 11867 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 11868 returnFocusToInput: returnFocusToInput, 11869 keyboardNavigationInstructions: keyboardNavigationInstructions, 11870 11871 chooseAvailableStartDate: chooseAvailableStartDate, 11872 chooseAvailableEndDate: chooseAvailableEndDate, 11873 dateIsUnavailable: dateIsUnavailable, 11874 dateIsSelected: dateIsSelected 11875 }; 11876 var DateRangePickerPhrases = exports.DateRangePickerPhrases = { 11877 calendarLabel: calendarLabel, 11878 closeDatePicker: closeDatePicker, 11879 clearDates: clearDates, 11880 focusStartDate: focusStartDate, 11881 jumpToPrevMonth: jumpToPrevMonth, 11882 jumpToNextMonth: jumpToNextMonth, 11883 keyboardShortcuts: keyboardShortcuts, 11884 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 11885 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11886 openThisPanel: openThisPanel, 11887 enterKey: enterKey, 11888 leftArrowRightArrow: leftArrowRightArrow, 11889 upArrowDownArrow: upArrowDownArrow, 11890 pageUpPageDown: pageUpPageDown, 11891 homeEnd: homeEnd, 11892 escape: escape, 11893 questionMark: questionMark, 11894 selectFocusedDate: selectFocusedDate, 11895 moveFocusByOneDay: moveFocusByOneDay, 11896 moveFocusByOneWeek: moveFocusByOneWeek, 11897 moveFocusByOneMonth: moveFocusByOneMonth, 11898 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 11899 returnFocusToInput: returnFocusToInput, 11900 keyboardNavigationInstructions: keyboardNavigationInstructions, 11901 chooseAvailableStartDate: chooseAvailableStartDate, 11902 chooseAvailableEndDate: chooseAvailableEndDate, 11903 dateIsUnavailable: dateIsUnavailable, 11904 dateIsSelected: dateIsSelected 11905 }; 11906 11907 var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = { 11908 focusStartDate: focusStartDate, 11909 clearDates: clearDates, 11910 keyboardNavigationInstructions: keyboardNavigationInstructions 11911 }; 11912 11913 var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = { 11914 calendarLabel: calendarLabel, 11915 closeDatePicker: closeDatePicker, 11916 clearDate: clearDate, 11917 jumpToPrevMonth: jumpToPrevMonth, 11918 jumpToNextMonth: jumpToNextMonth, 11919 keyboardShortcuts: keyboardShortcuts, 11920 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 11921 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11922 openThisPanel: openThisPanel, 11923 enterKey: enterKey, 11924 leftArrowRightArrow: leftArrowRightArrow, 11925 upArrowDownArrow: upArrowDownArrow, 11926 pageUpPageDown: pageUpPageDown, 11927 homeEnd: homeEnd, 11928 escape: escape, 11929 questionMark: questionMark, 11930 selectFocusedDate: selectFocusedDate, 11931 moveFocusByOneDay: moveFocusByOneDay, 11932 moveFocusByOneWeek: moveFocusByOneWeek, 11933 moveFocusByOneMonth: moveFocusByOneMonth, 11934 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 11935 returnFocusToInput: returnFocusToInput, 11936 keyboardNavigationInstructions: keyboardNavigationInstructions, 11937 chooseAvailableDate: chooseAvailableDate, 11938 dateIsUnavailable: dateIsUnavailable, 11939 dateIsSelected: dateIsSelected 11940 }; 11941 11942 var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = { 11943 clearDate: clearDate, 11944 keyboardNavigationInstructions: keyboardNavigationInstructions 11945 }; 11946 11947 var DayPickerPhrases = exports.DayPickerPhrases = { 11948 calendarLabel: calendarLabel, 11949 jumpToPrevMonth: jumpToPrevMonth, 11950 jumpToNextMonth: jumpToNextMonth, 11951 keyboardShortcuts: keyboardShortcuts, 11952 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 11953 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11954 openThisPanel: openThisPanel, 11955 enterKey: enterKey, 11956 leftArrowRightArrow: leftArrowRightArrow, 11957 upArrowDownArrow: upArrowDownArrow, 11958 pageUpPageDown: pageUpPageDown, 11959 homeEnd: homeEnd, 11960 escape: escape, 11961 questionMark: questionMark, 11962 selectFocusedDate: selectFocusedDate, 11963 moveFocusByOneDay: moveFocusByOneDay, 11964 moveFocusByOneWeek: moveFocusByOneWeek, 11965 moveFocusByOneMonth: moveFocusByOneMonth, 11966 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 11967 returnFocusToInput: returnFocusToInput, 11968 chooseAvailableStartDate: chooseAvailableStartDate, 11969 chooseAvailableEndDate: chooseAvailableEndDate, 11970 chooseAvailableDate: chooseAvailableDate, 11971 dateIsUnavailable: dateIsUnavailable, 11972 dateIsSelected: dateIsSelected 11973 }; 11974 11975 var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = { 11976 keyboardShortcuts: keyboardShortcuts, 11977 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 11978 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 11979 openThisPanel: openThisPanel, 11980 enterKey: enterKey, 11981 leftArrowRightArrow: leftArrowRightArrow, 11982 upArrowDownArrow: upArrowDownArrow, 11983 pageUpPageDown: pageUpPageDown, 11984 homeEnd: homeEnd, 11985 escape: escape, 11986 questionMark: questionMark, 11987 selectFocusedDate: selectFocusedDate, 11988 moveFocusByOneDay: moveFocusByOneDay, 11989 moveFocusByOneWeek: moveFocusByOneWeek, 11990 moveFocusByOneMonth: moveFocusByOneMonth, 11991 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 11992 returnFocusToInput: returnFocusToInput 11993 }; 11994 11995 var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = { 11996 jumpToPrevMonth: jumpToPrevMonth, 11997 jumpToNextMonth: jumpToNextMonth 11998 }; 11999 12000 var CalendarDayPhrases = exports.CalendarDayPhrases = { 12001 chooseAvailableDate: chooseAvailableDate, 12002 dateIsUnavailable: dateIsUnavailable, 12003 dateIsSelected: dateIsSelected 12004 }; 12005 12006 /***/ }), 12007 12008 /***/ 17: 12009 /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 12010 12011 "use strict"; 12012 12013 12014 var _registerCSSInterfaceWithDefaultTheme = __webpack_require__(9305); 12015 12016 var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme); 12017 12018 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12019 12020 (0, _registerCSSInterfaceWithDefaultTheme2['default'])(); 12021 12022 /***/ }), 12023 12024 /***/ 8182: 12025 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12026 12027 "use strict"; 12028 12029 12030 Object.defineProperty(exports, "__esModule", ({ 12031 value: true 12032 })); 12033 12034 var _propTypes = __webpack_require__(2652); 12035 12036 var _propTypes2 = _interopRequireDefault(_propTypes); 12037 12038 var _constants = __webpack_require__(257); 12039 12040 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12041 12042 exports["default"] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]); 12043 12044 /***/ }), 12045 12046 /***/ 243: 12047 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12048 12049 "use strict"; 12050 12051 12052 Object.defineProperty(exports, "__esModule", ({ 12053 value: true 12054 })); 12055 12056 var _propTypes = __webpack_require__(2652); 12057 12058 var _propTypes2 = _interopRequireDefault(_propTypes); 12059 12060 var _constants = __webpack_require__(257); 12061 12062 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12063 12064 exports["default"] = _propTypes2['default'].oneOf(_constants.WEEKDAYS); 12065 12066 /***/ }), 12067 12068 /***/ 6747: 12069 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12070 12071 "use strict"; 12072 12073 12074 Object.defineProperty(exports, "__esModule", ({ 12075 value: true 12076 })); 12077 12078 var _propTypes = __webpack_require__(2652); 12079 12080 var _propTypes2 = _interopRequireDefault(_propTypes); 12081 12082 var _airbnbPropTypes = __webpack_require__(4882); 12083 12084 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12085 12086 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 12087 12088 function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 12089 12090 exports["default"] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () { 12091 function modifiers(props, propName) { 12092 for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 12093 rest[_key - 2] = arguments[_key]; 12094 } 12095 12096 var propValue = props[propName]; 12097 12098 var firstError = void 0; 12099 [].concat(_toConsumableArray(propValue)).some(function (v, i) { 12100 var _PropTypes$string; 12101 12102 var fakePropName = String(propName) + ': index ' + String(i); 12103 firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest)); 12104 return firstError != null; 12105 }); 12106 return firstError == null ? null : firstError; 12107 } 12108 12109 return modifiers; 12110 }()], 'Modifiers (Set of Strings)'); 12111 12112 /***/ }), 12113 12114 /***/ 6553: 12115 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12116 12117 "use strict"; 12118 12119 12120 Object.defineProperty(exports, "__esModule", ({ 12121 value: true 12122 })); 12123 12124 var _propTypes = __webpack_require__(2652); 12125 12126 var _propTypes2 = _interopRequireDefault(_propTypes); 12127 12128 var _constants = __webpack_require__(257); 12129 12130 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12131 12132 exports["default"] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]); 12133 12134 /***/ }), 12135 12136 /***/ 8158: 12137 /***/ (function(__unused_webpack_module, exports) { 12138 12139 "use strict"; 12140 12141 12142 Object.defineProperty(exports, "__esModule", ({ 12143 value: true 12144 })); 12145 var core = { 12146 white: '#fff', 12147 gray: '#484848', 12148 grayLight: '#82888a', 12149 grayLighter: '#cacccd', 12150 grayLightest: '#f2f2f2', 12151 12152 borderMedium: '#c4c4c4', 12153 border: '#dbdbdb', 12154 borderLight: '#e4e7e7', 12155 borderLighter: '#eceeee', 12156 borderBright: '#f4f5f5', 12157 12158 primary: '#00a699', 12159 primaryShade_1: '#33dacd', 12160 primaryShade_2: '#66e2da', 12161 primaryShade_3: '#80e8e0', 12162 primaryShade_4: '#b2f1ec', 12163 primary_dark: '#008489', 12164 12165 secondary: '#007a87', 12166 12167 yellow: '#ffe8bc', 12168 yellow_dark: '#ffce71' 12169 }; 12170 12171 exports["default"] = { 12172 reactDates: { 12173 zIndex: 0, 12174 border: { 12175 input: { 12176 border: 0, 12177 borderTop: 0, 12178 borderRight: 0, 12179 borderBottom: '2px solid transparent', 12180 borderLeft: 0, 12181 outlineFocused: 0, 12182 borderFocused: 0, 12183 borderTopFocused: 0, 12184 borderLeftFocused: 0, 12185 borderBottomFocused: '2px solid ' + String(core.primary_dark), 12186 borderRightFocused: 0, 12187 borderRadius: 0 12188 }, 12189 pickerInput: { 12190 borderWidth: 1, 12191 borderStyle: 'solid', 12192 borderRadius: 2 12193 } 12194 }, 12195 12196 color: { 12197 core: core, 12198 12199 disabled: core.grayLightest, 12200 12201 background: core.white, 12202 backgroundDark: '#f2f2f2', 12203 backgroundFocused: core.white, 12204 border: 'rgb(219, 219, 219)', 12205 text: core.gray, 12206 textDisabled: core.border, 12207 textFocused: '#007a87', 12208 placeholderText: '#757575', 12209 12210 outside: { 12211 backgroundColor: core.white, 12212 backgroundColor_active: core.white, 12213 backgroundColor_hover: core.white, 12214 color: core.gray, 12215 color_active: core.gray, 12216 color_hover: core.gray 12217 }, 12218 12219 highlighted: { 12220 backgroundColor: core.yellow, 12221 backgroundColor_active: core.yellow_dark, 12222 backgroundColor_hover: core.yellow_dark, 12223 color: core.gray, 12224 color_active: core.gray, 12225 color_hover: core.gray 12226 }, 12227 12228 minimumNights: { 12229 backgroundColor: core.white, 12230 backgroundColor_active: core.white, 12231 backgroundColor_hover: core.white, 12232 borderColor: core.borderLighter, 12233 color: core.grayLighter, 12234 color_active: core.grayLighter, 12235 color_hover: core.grayLighter 12236 }, 12237 12238 hoveredSpan: { 12239 backgroundColor: core.primaryShade_4, 12240 backgroundColor_active: core.primaryShade_3, 12241 backgroundColor_hover: core.primaryShade_4, 12242 borderColor: core.primaryShade_3, 12243 borderColor_active: core.primaryShade_3, 12244 borderColor_hover: core.primaryShade_3, 12245 color: core.secondary, 12246 color_active: core.secondary, 12247 color_hover: core.secondary 12248 }, 12249 12250 selectedSpan: { 12251 backgroundColor: core.primaryShade_2, 12252 backgroundColor_active: core.primaryShade_1, 12253 backgroundColor_hover: core.primaryShade_1, 12254 borderColor: core.primaryShade_1, 12255 borderColor_active: core.primary, 12256 borderColor_hover: core.primary, 12257 color: core.white, 12258 color_active: core.white, 12259 color_hover: core.white 12260 }, 12261 12262 selected: { 12263 backgroundColor: core.primary, 12264 backgroundColor_active: core.primary, 12265 backgroundColor_hover: core.primary, 12266 borderColor: core.primary, 12267 borderColor_active: core.primary, 12268 borderColor_hover: core.primary, 12269 color: core.white, 12270 color_active: core.white, 12271 color_hover: core.white 12272 }, 12273 12274 blocked_calendar: { 12275 backgroundColor: core.grayLighter, 12276 backgroundColor_active: core.grayLighter, 12277 backgroundColor_hover: core.grayLighter, 12278 borderColor: core.grayLighter, 12279 borderColor_active: core.grayLighter, 12280 borderColor_hover: core.grayLighter, 12281 color: core.grayLight, 12282 color_active: core.grayLight, 12283 color_hover: core.grayLight 12284 }, 12285 12286 blocked_out_of_range: { 12287 backgroundColor: core.white, 12288 backgroundColor_active: core.white, 12289 backgroundColor_hover: core.white, 12290 borderColor: core.borderLight, 12291 borderColor_active: core.borderLight, 12292 borderColor_hover: core.borderLight, 12293 color: core.grayLighter, 12294 color_active: core.grayLighter, 12295 color_hover: core.grayLighter 12296 } 12297 }, 12298 12299 spacing: { 12300 dayPickerHorizontalPadding: 9, 12301 captionPaddingTop: 22, 12302 captionPaddingBottom: 37, 12303 inputPadding: 0, 12304 displayTextPaddingVertical: undefined, 12305 displayTextPaddingTop: 11, 12306 displayTextPaddingBottom: 9, 12307 displayTextPaddingHorizontal: undefined, 12308 displayTextPaddingLeft: 11, 12309 displayTextPaddingRight: 11, 12310 displayTextPaddingVertical_small: undefined, 12311 displayTextPaddingTop_small: 7, 12312 displayTextPaddingBottom_small: 5, 12313 displayTextPaddingHorizontal_small: undefined, 12314 displayTextPaddingLeft_small: 7, 12315 displayTextPaddingRight_small: 7 12316 }, 12317 12318 sizing: { 12319 inputWidth: 130, 12320 inputWidth_small: 97, 12321 arrowWidth: 24 12322 }, 12323 12324 noScrollBarOnVerticalScrollable: false, 12325 12326 font: { 12327 size: 14, 12328 captionSize: 18, 12329 input: { 12330 size: 19, 12331 lineHeight: '24px', 12332 size_small: 15, 12333 lineHeight_small: '18px', 12334 letterSpacing_small: '0.2px', 12335 styleDisabled: 'italic' 12336 } 12337 } 12338 } 12339 }; 12340 12341 /***/ }), 12342 12343 /***/ 8607: 12344 /***/ (function(__unused_webpack_module, exports) { 12345 12346 "use strict"; 12347 12348 12349 Object.defineProperty(exports, "__esModule", ({ 12350 value: true 12351 })); 12352 exports["default"] = calculateDimension; 12353 function calculateDimension(el, axis) { 12354 var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 12355 var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 12356 12357 if (!el) { 12358 return 0; 12359 } 12360 12361 var axisStart = axis === 'width' ? 'Left' : 'Top'; 12362 var axisEnd = axis === 'width' ? 'Right' : 'Bottom'; 12363 12364 // Only read styles if we need to 12365 var style = !borderBox || withMargin ? window.getComputedStyle(el) : null; 12366 12367 // Offset includes border and padding 12368 var offsetWidth = el.offsetWidth, 12369 offsetHeight = el.offsetHeight; 12370 12371 var size = axis === 'width' ? offsetWidth : offsetHeight; 12372 12373 // Get the inner size 12374 if (!borderBox) { 12375 size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']); 12376 } 12377 12378 // Apply margin 12379 if (withMargin) { 12380 size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]); 12381 } 12382 12383 return size; 12384 } 12385 12386 /***/ }), 12387 12388 /***/ 5814: 12389 /***/ (function(__unused_webpack_module, exports) { 12390 12391 "use strict"; 12392 12393 12394 Object.defineProperty(exports, "__esModule", ({ 12395 value: true 12396 })); 12397 exports["default"] = getActiveElement; 12398 function getActiveElement() { 12399 return typeof document !== 'undefined' && document.activeElement; 12400 } 12401 12402 /***/ }), 12403 12404 /***/ 7475: 12405 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12406 12407 "use strict"; 12408 12409 12410 Object.defineProperty(exports, "__esModule", ({ 12411 value: true 12412 })); 12413 exports["default"] = getCalendarDaySettings; 12414 12415 var _getPhrase = __webpack_require__(7098); 12416 12417 var _getPhrase2 = _interopRequireDefault(_getPhrase); 12418 12419 var _constants = __webpack_require__(257); 12420 12421 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12422 12423 function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) { 12424 var chooseAvailableDate = phrases.chooseAvailableDate, 12425 dateIsUnavailable = phrases.dateIsUnavailable, 12426 dateIsSelected = phrases.dateIsSelected; 12427 12428 12429 var daySizeStyles = { 12430 width: daySize, 12431 height: daySize - 1 12432 }; 12433 12434 var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range'); 12435 12436 var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end'); 12437 12438 var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start')); 12439 12440 var isOutsideRange = modifiers.has('blocked-out-of-range'); 12441 12442 var formattedDate = { date: day.format(ariaLabelFormat) }; 12443 12444 var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate); 12445 if (modifiers.has(_constants.BLOCKED_MODIFIER)) { 12446 ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate); 12447 } else if (selected) { 12448 ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate); 12449 } 12450 12451 return { 12452 daySizeStyles: daySizeStyles, 12453 useDefaultCursor: useDefaultCursor, 12454 selected: selected, 12455 hoveredSpan: hoveredSpan, 12456 isOutsideRange: isOutsideRange, 12457 ariaLabel: ariaLabel 12458 }; 12459 } 12460 12461 /***/ }), 12462 12463 /***/ 5644: 12464 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12465 12466 "use strict"; 12467 12468 12469 Object.defineProperty(exports, "__esModule", ({ 12470 value: true 12471 })); 12472 exports["default"] = getCalendarMonthWeeks; 12473 12474 var _moment = __webpack_require__(6292); 12475 12476 var _moment2 = _interopRequireDefault(_moment); 12477 12478 var _constants = __webpack_require__(257); 12479 12480 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12481 12482 function getCalendarMonthWeeks(month, enableOutsideDays) { 12483 var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek(); 12484 12485 if (!_moment2['default'].isMoment(month) || !month.isValid()) { 12486 throw new TypeError('`month` must be a valid moment object'); 12487 } 12488 if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) { 12489 throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6'); 12490 } 12491 12492 // set utc offset to get correct dates in future (when timezone changes) 12493 var firstOfMonth = month.clone().startOf('month').hour(12); 12494 var lastOfMonth = month.clone().endOf('month').hour(12); 12495 12496 // calculate the exact first and last days to fill the entire matrix 12497 // (considering days outside month) 12498 var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7; 12499 var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7; 12500 var firstDay = firstOfMonth.clone().subtract(prevDays, 'day'); 12501 var lastDay = lastOfMonth.clone().add(nextDays, 'day'); 12502 12503 var totalDays = lastDay.diff(firstDay, 'days') + 1; 12504 12505 var currentDay = firstDay.clone(); 12506 var weeksInMonth = []; 12507 12508 for (var i = 0; i < totalDays; i += 1) { 12509 if (i % 7 === 0) { 12510 weeksInMonth.push([]); 12511 } 12512 12513 var day = null; 12514 if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) { 12515 day = currentDay.clone(); 12516 } 12517 12518 weeksInMonth[weeksInMonth.length - 1].push(day); 12519 12520 currentDay.add(1, 'day'); 12521 } 12522 12523 return weeksInMonth; 12524 } 12525 12526 /***/ }), 12527 12528 /***/ 8964: 12529 /***/ (function(__unused_webpack_module, exports) { 12530 12531 "use strict"; 12532 12533 12534 Object.defineProperty(exports, "__esModule", ({ 12535 value: true 12536 })); 12537 exports["default"] = getCalendarMonthWidth; 12538 function getCalendarMonthWidth(daySize, calendarMonthPadding) { 12539 return 7 * daySize + 2 * calendarMonthPadding + 1; 12540 } 12541 12542 /***/ }), 12543 12544 /***/ 4112: 12545 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12546 12547 "use strict"; 12548 12549 12550 Object.defineProperty(exports, "__esModule", ({ 12551 value: true 12552 })); 12553 exports["default"] = getNumberOfCalendarMonthWeeks; 12554 12555 var _moment = __webpack_require__(6292); 12556 12557 var _moment2 = _interopRequireDefault(_moment); 12558 12559 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12560 12561 function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) { 12562 var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek; 12563 return (weekDayDiff + 7) % 7; 12564 } 12565 12566 function getNumberOfCalendarMonthWeeks(month) { 12567 var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek(); 12568 12569 var firstDayOfMonth = month.clone().startOf('month'); 12570 var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek); 12571 return Math.ceil((numBlankDays + month.daysInMonth()) / 7); 12572 } 12573 12574 /***/ }), 12575 12576 /***/ 7098: 12577 /***/ (function(__unused_webpack_module, exports) { 12578 12579 "use strict"; 12580 12581 12582 Object.defineProperty(exports, "__esModule", ({ 12583 value: true 12584 })); 12585 exports["default"] = getPhrase; 12586 function getPhrase(phrase, args) { 12587 if (typeof phrase === 'string') return phrase; 12588 12589 if (typeof phrase === 'function') { 12590 return phrase(args); 12591 } 12592 12593 return ''; 12594 } 12595 12596 /***/ }), 12597 12598 /***/ 2893: 12599 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12600 12601 "use strict"; 12602 12603 12604 Object.defineProperty(exports, "__esModule", ({ 12605 value: true 12606 })); 12607 exports["default"] = getPhrasePropTypes; 12608 12609 var _object = __webpack_require__(4011); 12610 12611 var _object2 = _interopRequireDefault(_object); 12612 12613 var _propTypes = __webpack_require__(2652); 12614 12615 var _propTypes2 = _interopRequireDefault(_propTypes); 12616 12617 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12618 12619 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 12620 12621 function getPhrasePropTypes(defaultPhrases) { 12622 return Object.keys(defaultPhrases).reduce(function (phrases, key) { 12623 return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node]))); 12624 }, {}); 12625 } 12626 12627 /***/ }), 12628 12629 /***/ 8304: 12630 /***/ (function(__unused_webpack_module, exports) { 12631 12632 "use strict"; 12633 12634 12635 Object.defineProperty(exports, "__esModule", ({ 12636 value: true 12637 })); 12638 exports["default"] = getTransformStyles; 12639 function getTransformStyles(transformValue) { 12640 return { 12641 transform: transformValue, 12642 msTransform: transformValue, 12643 MozTransform: transformValue, 12644 WebkitTransform: transformValue 12645 }; 12646 } 12647 12648 /***/ }), 12649 12650 /***/ 3268: 12651 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12652 12653 "use strict"; 12654 12655 12656 Object.defineProperty(exports, "__esModule", ({ 12657 value: true 12658 })); 12659 exports["default"] = getVisibleDays; 12660 12661 var _moment = __webpack_require__(6292); 12662 12663 var _moment2 = _interopRequireDefault(_moment); 12664 12665 var _toISOMonthString = __webpack_require__(2705); 12666 12667 var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString); 12668 12669 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12670 12671 function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) { 12672 if (!_moment2['default'].isMoment(month)) return {}; 12673 12674 var visibleDaysByMonth = {}; 12675 var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month'); 12676 for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) { 12677 var visibleDays = []; 12678 12679 // set utc offset to get correct dates in future (when timezone changes) 12680 var baseDate = currentMonth.clone(); 12681 var firstOfMonth = baseDate.clone().startOf('month').hour(12); 12682 var lastOfMonth = baseDate.clone().endOf('month').hour(12); 12683 12684 var currentDay = firstOfMonth.clone(); 12685 12686 // days belonging to the previous month 12687 if (enableOutsideDays) { 12688 for (var j = 0; j < currentDay.weekday(); j += 1) { 12689 var prevDay = currentDay.clone().subtract(j + 1, 'day'); 12690 visibleDays.unshift(prevDay); 12691 } 12692 } 12693 12694 while (currentDay < lastOfMonth) { 12695 visibleDays.push(currentDay.clone()); 12696 currentDay.add(1, 'day'); 12697 } 12698 12699 if (enableOutsideDays) { 12700 // weekday() returns the index of the day of the week according to the locale 12701 // this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1 12702 if (currentDay.weekday() !== 0) { 12703 // days belonging to the next month 12704 for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) { 12705 var nextDay = currentDay.clone().add(count, 'day'); 12706 visibleDays.push(nextDay); 12707 } 12708 } 12709 } 12710 12711 visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays; 12712 currentMonth = currentMonth.clone().add(1, 'month'); 12713 } 12714 12715 return visibleDaysByMonth; 12716 } 12717 12718 /***/ }), 12719 12720 /***/ 7365: 12721 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12722 12723 "use strict"; 12724 12725 12726 Object.defineProperty(exports, "__esModule", ({ 12727 value: true 12728 })); 12729 exports["default"] = isAfterDay; 12730 12731 var _moment = __webpack_require__(6292); 12732 12733 var _moment2 = _interopRequireDefault(_moment); 12734 12735 var _isBeforeDay = __webpack_require__(862); 12736 12737 var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); 12738 12739 var _isSameDay = __webpack_require__(3923); 12740 12741 var _isSameDay2 = _interopRequireDefault(_isSameDay); 12742 12743 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12744 12745 function isAfterDay(a, b) { 12746 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12747 return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b); 12748 } 12749 12750 /***/ }), 12751 12752 /***/ 862: 12753 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12754 12755 "use strict"; 12756 12757 12758 Object.defineProperty(exports, "__esModule", ({ 12759 value: true 12760 })); 12761 exports["default"] = isBeforeDay; 12762 12763 var _moment = __webpack_require__(6292); 12764 12765 var _moment2 = _interopRequireDefault(_moment); 12766 12767 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12768 12769 function isBeforeDay(a, b) { 12770 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12771 12772 var aYear = a.year(); 12773 var aMonth = a.month(); 12774 12775 var bYear = b.year(); 12776 var bMonth = b.month(); 12777 12778 var isSameYear = aYear === bYear; 12779 var isSameMonth = aMonth === bMonth; 12780 12781 if (isSameYear && isSameMonth) return a.date() < b.date(); 12782 if (isSameYear) return aMonth < bMonth; 12783 return aYear < bYear; 12784 } 12785 12786 /***/ }), 12787 12788 /***/ 5713: 12789 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12790 12791 "use strict"; 12792 12793 12794 Object.defineProperty(exports, "__esModule", ({ 12795 value: true 12796 })); 12797 exports["default"] = isDayVisible; 12798 12799 var _isBeforeDay = __webpack_require__(862); 12800 12801 var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); 12802 12803 var _isAfterDay = __webpack_require__(7365); 12804 12805 var _isAfterDay2 = _interopRequireDefault(_isAfterDay); 12806 12807 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12808 12809 function isDayVisible(day, month, numberOfMonths, enableOutsideDays) { 12810 var firstDayOfFirstMonth = month.clone().startOf('month'); 12811 if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week'); 12812 if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false; 12813 12814 var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month'); 12815 if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week'); 12816 return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth); 12817 } 12818 12819 /***/ }), 12820 12821 /***/ 1310: 12822 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12823 12824 "use strict"; 12825 12826 12827 Object.defineProperty(exports, "__esModule", ({ 12828 value: true 12829 })); 12830 exports["default"] = isNextMonth; 12831 12832 var _moment = __webpack_require__(6292); 12833 12834 var _moment2 = _interopRequireDefault(_moment); 12835 12836 var _isSameMonth = __webpack_require__(4669); 12837 12838 var _isSameMonth2 = _interopRequireDefault(_isSameMonth); 12839 12840 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12841 12842 function isNextMonth(a, b) { 12843 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12844 return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b); 12845 } 12846 12847 /***/ }), 12848 12849 /***/ 3858: 12850 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12851 12852 "use strict"; 12853 12854 12855 Object.defineProperty(exports, "__esModule", ({ 12856 value: true 12857 })); 12858 exports["default"] = isPrevMonth; 12859 12860 var _moment = __webpack_require__(6292); 12861 12862 var _moment2 = _interopRequireDefault(_moment); 12863 12864 var _isSameMonth = __webpack_require__(4669); 12865 12866 var _isSameMonth2 = _interopRequireDefault(_isSameMonth); 12867 12868 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12869 12870 function isPrevMonth(a, b) { 12871 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12872 return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b); 12873 } 12874 12875 /***/ }), 12876 12877 /***/ 3923: 12878 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12879 12880 "use strict"; 12881 12882 12883 Object.defineProperty(exports, "__esModule", ({ 12884 value: true 12885 })); 12886 exports["default"] = isSameDay; 12887 12888 var _moment = __webpack_require__(6292); 12889 12890 var _moment2 = _interopRequireDefault(_moment); 12891 12892 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12893 12894 function isSameDay(a, b) { 12895 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12896 // Compare least significant, most likely to change units first 12897 // Moment's isSame clones moment inputs and is a tad slow 12898 return a.date() === b.date() && a.month() === b.month() && a.year() === b.year(); 12899 } 12900 12901 /***/ }), 12902 12903 /***/ 4669: 12904 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12905 12906 "use strict"; 12907 12908 12909 Object.defineProperty(exports, "__esModule", ({ 12910 value: true 12911 })); 12912 exports["default"] = isSameMonth; 12913 12914 var _moment = __webpack_require__(6292); 12915 12916 var _moment2 = _interopRequireDefault(_moment); 12917 12918 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12919 12920 function isSameMonth(a, b) { 12921 if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; 12922 // Compare least significant, most likely to change units first 12923 // Moment's isSame clones moment inputs and is a tad slow 12924 return a.month() === b.month() && a.year() === b.year(); 12925 } 12926 12927 /***/ }), 12928 12929 /***/ 7978: 12930 /***/ (function(__unused_webpack_module, exports) { 12931 12932 "use strict"; 12933 12934 12935 Object.defineProperty(exports, "__esModule", ({ 12936 value: true 12937 })); 12938 exports["default"] = isTransitionEndSupported; 12939 function isTransitionEndSupported() { 12940 return !!(typeof window !== 'undefined' && 'TransitionEvent' in window); 12941 } 12942 12943 /***/ }), 12944 12945 /***/ 9305: 12946 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12947 12948 "use strict"; 12949 12950 12951 Object.defineProperty(exports, "__esModule", ({ 12952 value: true 12953 })); 12954 exports["default"] = registerCSSInterfaceWithDefaultTheme; 12955 12956 var _reactWithStylesInterfaceCss = __webpack_require__(5553); 12957 12958 var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss); 12959 12960 var _registerInterfaceWithDefaultTheme = __webpack_require__(1980); 12961 12962 var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme); 12963 12964 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12965 12966 function registerCSSInterfaceWithDefaultTheme() { 12967 (0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']); 12968 } 12969 12970 /***/ }), 12971 12972 /***/ 1980: 12973 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 12974 12975 "use strict"; 12976 12977 12978 Object.defineProperty(exports, "__esModule", ({ 12979 value: true 12980 })); 12981 exports["default"] = registerInterfaceWithDefaultTheme; 12982 12983 var _ThemedStyleSheet = __webpack_require__(9349); 12984 12985 var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); 12986 12987 var _DefaultTheme = __webpack_require__(8158); 12988 12989 var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme); 12990 12991 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 12992 12993 function registerInterfaceWithDefaultTheme(reactWithStylesInterface) { 12994 _ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface); 12995 _ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']); 12996 } 12997 12998 /***/ }), 12999 13000 /***/ 7310: 13001 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13002 13003 "use strict"; 13004 13005 13006 Object.defineProperty(exports, "__esModule", ({ 13007 value: true 13008 })); 13009 exports["default"] = toISODateString; 13010 13011 var _moment = __webpack_require__(6292); 13012 13013 var _moment2 = _interopRequireDefault(_moment); 13014 13015 var _toMomentObject = __webpack_require__(2008); 13016 13017 var _toMomentObject2 = _interopRequireDefault(_toMomentObject); 13018 13019 var _constants = __webpack_require__(257); 13020 13021 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13022 13023 function toISODateString(date, currentFormat) { 13024 var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); 13025 if (!dateObj) return null; 13026 13027 return dateObj.format(_constants.ISO_FORMAT); 13028 } 13029 13030 /***/ }), 13031 13032 /***/ 2705: 13033 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13034 13035 "use strict"; 13036 13037 13038 Object.defineProperty(exports, "__esModule", ({ 13039 value: true 13040 })); 13041 exports["default"] = toISOMonthString; 13042 13043 var _moment = __webpack_require__(6292); 13044 13045 var _moment2 = _interopRequireDefault(_moment); 13046 13047 var _toMomentObject = __webpack_require__(2008); 13048 13049 var _toMomentObject2 = _interopRequireDefault(_toMomentObject); 13050 13051 var _constants = __webpack_require__(257); 13052 13053 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13054 13055 function toISOMonthString(date, currentFormat) { 13056 var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); 13057 if (!dateObj) return null; 13058 13059 return dateObj.format(_constants.ISO_MONTH_FORMAT); 13060 } 13061 13062 /***/ }), 13063 13064 /***/ 2008: 13065 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13066 13067 "use strict"; 13068 13069 13070 Object.defineProperty(exports, "__esModule", ({ 13071 value: true 13072 })); 13073 exports["default"] = toMomentObject; 13074 13075 var _moment = __webpack_require__(6292); 13076 13077 var _moment2 = _interopRequireDefault(_moment); 13078 13079 var _constants = __webpack_require__(257); 13080 13081 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13082 13083 function toMomentObject(dateString, customFormat) { 13084 var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT]; 13085 13086 var date = (0, _moment2['default'])(dateString, dateFormats, true); 13087 return date.isValid() ? date.hour(12) : null; 13088 } 13089 13090 /***/ }), 13091 13092 /***/ 4821: 13093 /***/ (function(__unused_webpack_module, exports) { 13094 13095 "use strict"; 13096 /** @license React v16.13.1 13097 * react-is.production.min.js 13098 * 13099 * Copyright (c) Facebook, Inc. and its affiliates. 13100 * 13101 * This source code is licensed under the MIT license found in the 13102 * LICENSE file in the root directory of this source tree. 13103 */ 13104 13105 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? 13106 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; 13107 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; 13108 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}; 13109 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}; 13110 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; 13111 13112 13113 /***/ }), 13114 13115 /***/ 338: 13116 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13117 13118 "use strict"; 13119 13120 13121 if (true) { 13122 module.exports = __webpack_require__(4821); 13123 } else {} 13124 13125 13126 /***/ }), 13127 13128 /***/ 9217: 13129 /***/ (function(module) { 13130 13131 var messages = { 13132 invalidPredicate: '`predicate` must be a function', 13133 invalidPropValidator: '`propValidator` must be a function', 13134 requiredCore: 'is marked as required', 13135 invalidTypeCore: 'Invalid input type', 13136 predicateFailureCore: 'Failed to succeed with predicate', 13137 anonymousMessage: '<<anonymous>>', 13138 baseInvalidMessage: 'Invalid ', 13139 }; 13140 13141 function constructPropValidatorVariations(propValidator) { 13142 if (typeof propValidator !== 'function') { 13143 throw new Error(messages.invalidPropValidator); 13144 } 13145 13146 var requiredPropValidator = propValidator.bind(null, false, null); 13147 requiredPropValidator.isRequired = propValidator.bind(null, true, null); 13148 13149 requiredPropValidator.withPredicate = function predicateApplication(predicate) { 13150 if (typeof predicate !== 'function') { 13151 throw new Error(messages.invalidPredicate); 13152 } 13153 var basePropValidator = propValidator.bind(null, false, predicate); 13154 basePropValidator.isRequired = propValidator.bind(null, true, predicate); 13155 return basePropValidator; 13156 }; 13157 13158 return requiredPropValidator; 13159 } 13160 13161 function createInvalidRequiredErrorMessage(propName, componentName, value) { 13162 return new Error( 13163 'The prop `' + propName + '` ' + messages.requiredCore + 13164 ' in `' + componentName + '`, but its value is `' + value + '`.' 13165 ); 13166 } 13167 13168 var independentGuardianValue = -1; 13169 13170 function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) { 13171 var isPropValueUndefined = typeof propValue === 'undefined'; 13172 var isPropValueNull = propValue === null; 13173 13174 if (isRequired) { 13175 if (isPropValueUndefined) { 13176 return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined'); 13177 } else if (isPropValueNull) { 13178 return createInvalidRequiredErrorMessage(propFullName, componentName, 'null'); 13179 } 13180 } 13181 13182 if (isPropValueUndefined || isPropValueNull) { 13183 return null; 13184 } 13185 13186 return independentGuardianValue; 13187 } 13188 13189 function createMomentChecker(type, typeValidator, validator, momentType) { 13190 13191 function propValidator( 13192 isRequired, // Bound parameter to indicate with the propType is required 13193 predicate, // Bound parameter to allow user to add dynamic validation 13194 props, 13195 propName, 13196 componentName, 13197 location, 13198 propFullName 13199 ) { 13200 var propValue = props[ propName ]; 13201 var propType = typeof propValue; 13202 13203 componentName = componentName || messages.anonymousMessage; 13204 propFullName = propFullName || propName; 13205 13206 var preValidationRequireCheckValue = preValidationRequireCheck( 13207 isRequired, componentName, propFullName, propValue 13208 ); 13209 13210 if (preValidationRequireCheckValue !== independentGuardianValue) { 13211 return preValidationRequireCheckValue; 13212 } 13213 13214 if (typeValidator && !typeValidator(propValue)) { 13215 return new Error( 13216 messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' + 13217 'supplied to `' + componentName + '`, expected `' + type + '`.' 13218 ); 13219 } 13220 13221 if (!validator(propValue)) { 13222 return new Error( 13223 messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 13224 'supplied to `' + componentName + '`, expected `' + momentType + '`.' 13225 ); 13226 } 13227 13228 if (predicate && !predicate(propValue)) { 13229 var predicateName = predicate.name || messages.anonymousMessage; 13230 return new Error( 13231 messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 13232 'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' + 13233 predicateName + '`.' 13234 ); 13235 } 13236 13237 return null; 13238 13239 } 13240 13241 return constructPropValidatorVariations(propValidator); 13242 13243 } 13244 13245 module.exports = { 13246 constructPropValidatorVariations: constructPropValidatorVariations, 13247 createMomentChecker: createMomentChecker, 13248 messages: messages, 13249 }; 13250 13251 13252 /***/ }), 13253 13254 /***/ 6150: 13255 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13256 13257 var moment = __webpack_require__(6292); 13258 var momentValidationWrapper = __webpack_require__(3416); 13259 var core = __webpack_require__(9217); 13260 13261 module.exports = { 13262 13263 momentObj : core.createMomentChecker( 13264 'object', 13265 function(obj) { 13266 return typeof obj === 'object'; 13267 }, 13268 function isValid(value) { 13269 return momentValidationWrapper.isValidMoment(value); 13270 }, 13271 'Moment' 13272 ), 13273 13274 momentString : core.createMomentChecker( 13275 'string', 13276 function(str) { 13277 return typeof str === 'string'; 13278 }, 13279 function isValid(value) { 13280 return momentValidationWrapper.isValidMoment(moment(value)); 13281 }, 13282 'Moment' 13283 ), 13284 13285 momentDurationObj : core.createMomentChecker( 13286 'object', 13287 function(obj) { 13288 return typeof obj === 'object'; 13289 }, 13290 function isValid(value) { 13291 return moment.isDuration(value); 13292 }, 13293 'Duration' 13294 ), 13295 13296 }; 13297 13298 13299 /***/ }), 13300 13301 /***/ 3416: 13302 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13303 13304 var moment = __webpack_require__(6292); 13305 13306 function isValidMoment(testMoment) { 13307 if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) { 13308 return false; 13309 } 13310 13311 /* istanbul ignore else */ 13312 if (typeof testMoment.isValid === 'function') { 13313 // moment 1.7.0+ 13314 return testMoment.isValid(); 13315 } 13316 13317 /* istanbul ignore next */ 13318 return !isNaN(testMoment); 13319 } 13320 13321 module.exports = { 13322 isValidMoment : isValidMoment, 13323 }; 13324 13325 13326 /***/ }), 13327 13328 /***/ 2239: 13329 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13330 13331 "use strict"; 13332 13333 13334 Object.defineProperty(exports, "__esModule", ({ 13335 value: true 13336 })); 13337 13338 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 13339 13340 var _react = __webpack_require__(9196); 13341 13342 var _react2 = _interopRequireDefault(_react); 13343 13344 var _propTypes = __webpack_require__(2652); 13345 13346 var _propTypes2 = _interopRequireDefault(_propTypes); 13347 13348 var _airbnbPropTypes = __webpack_require__(4882); 13349 13350 var _consolidatedEvents = __webpack_require__(8495); 13351 13352 var _object = __webpack_require__(5861); 13353 13354 var _object2 = _interopRequireDefault(_object); 13355 13356 var _document = __webpack_require__(6789); 13357 13358 var _document2 = _interopRequireDefault(_document); 13359 13360 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13361 13362 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 13363 13364 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 13365 13366 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 13367 13368 var DISPLAY = { 13369 BLOCK: 'block', 13370 FLEX: 'flex', 13371 INLINE: 'inline', 13372 INLINE_BLOCK: 'inline-block', 13373 CONTENTS: 'contents' 13374 }; 13375 13376 var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({ 13377 children: _propTypes2['default'].node.isRequired, 13378 onOutsideClick: _propTypes2['default'].func.isRequired, 13379 disabled: _propTypes2['default'].bool, 13380 useCapture: _propTypes2['default'].bool, 13381 display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY)) 13382 }); 13383 13384 var defaultProps = { 13385 disabled: false, 13386 13387 // `useCapture` is set to true by default so that a `stopPropagation` in the 13388 // children will not prevent all outside click handlers from firing - maja 13389 useCapture: true, 13390 display: DISPLAY.BLOCK 13391 }; 13392 13393 var OutsideClickHandler = function (_React$Component) { 13394 _inherits(OutsideClickHandler, _React$Component); 13395 13396 function OutsideClickHandler() { 13397 var _ref; 13398 13399 _classCallCheck(this, OutsideClickHandler); 13400 13401 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 13402 args[_key] = arguments[_key]; 13403 } 13404 13405 var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args))); 13406 13407 _this.onMouseDown = _this.onMouseDown.bind(_this); 13408 _this.onMouseUp = _this.onMouseUp.bind(_this); 13409 _this.setChildNodeRef = _this.setChildNodeRef.bind(_this); 13410 return _this; 13411 } 13412 13413 _createClass(OutsideClickHandler, [{ 13414 key: 'componentDidMount', 13415 value: function () { 13416 function componentDidMount() { 13417 var _props = this.props, 13418 disabled = _props.disabled, 13419 useCapture = _props.useCapture; 13420 13421 13422 if (!disabled) this.addMouseDownEventListener(useCapture); 13423 } 13424 13425 return componentDidMount; 13426 }() 13427 }, { 13428 key: 'componentDidUpdate', 13429 value: function () { 13430 function componentDidUpdate(_ref2) { 13431 var prevDisabled = _ref2.disabled; 13432 var _props2 = this.props, 13433 disabled = _props2.disabled, 13434 useCapture = _props2.useCapture; 13435 13436 if (prevDisabled !== disabled) { 13437 if (disabled) { 13438 this.removeEventListeners(); 13439 } else { 13440 this.addMouseDownEventListener(useCapture); 13441 } 13442 } 13443 } 13444 13445 return componentDidUpdate; 13446 }() 13447 }, { 13448 key: 'componentWillUnmount', 13449 value: function () { 13450 function componentWillUnmount() { 13451 this.removeEventListeners(); 13452 } 13453 13454 return componentWillUnmount; 13455 }() 13456 13457 // Use mousedown/mouseup to enforce that clicks remain outside the root's 13458 // descendant tree, even when dragged. This should also get triggered on 13459 // touch devices. 13460 13461 }, { 13462 key: 'onMouseDown', 13463 value: function () { 13464 function onMouseDown(e) { 13465 var useCapture = this.props.useCapture; 13466 13467 13468 var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target); 13469 if (!isDescendantOfRoot) { 13470 if (this.removeMouseUp) { 13471 this.removeMouseUp(); 13472 this.removeMouseUp = null; 13473 } 13474 this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture }); 13475 } 13476 } 13477 13478 return onMouseDown; 13479 }() 13480 13481 // Use mousedown/mouseup to enforce that clicks remain outside the root's 13482 // descendant tree, even when dragged. This should also get triggered on 13483 // touch devices. 13484 13485 }, { 13486 key: 'onMouseUp', 13487 value: function () { 13488 function onMouseUp(e) { 13489 var onOutsideClick = this.props.onOutsideClick; 13490 13491 13492 var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target); 13493 if (this.removeMouseUp) { 13494 this.removeMouseUp(); 13495 this.removeMouseUp = null; 13496 } 13497 13498 if (!isDescendantOfRoot) { 13499 onOutsideClick(e); 13500 } 13501 } 13502 13503 return onMouseUp; 13504 }() 13505 }, { 13506 key: 'setChildNodeRef', 13507 value: function () { 13508 function setChildNodeRef(ref) { 13509 this.childNode = ref; 13510 } 13511 13512 return setChildNodeRef; 13513 }() 13514 }, { 13515 key: 'addMouseDownEventListener', 13516 value: function () { 13517 function addMouseDownEventListener(useCapture) { 13518 this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture }); 13519 } 13520 13521 return addMouseDownEventListener; 13522 }() 13523 }, { 13524 key: 'removeEventListeners', 13525 value: function () { 13526 function removeEventListeners() { 13527 if (this.removeMouseDown) this.removeMouseDown(); 13528 if (this.removeMouseUp) this.removeMouseUp(); 13529 } 13530 13531 return removeEventListeners; 13532 }() 13533 }, { 13534 key: 'render', 13535 value: function () { 13536 function render() { 13537 var _props3 = this.props, 13538 children = _props3.children, 13539 display = _props3.display; 13540 13541 13542 return _react2['default'].createElement( 13543 'div', 13544 { 13545 ref: this.setChildNodeRef, 13546 style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined 13547 }, 13548 children 13549 ); 13550 } 13551 13552 return render; 13553 }() 13554 }]); 13555 13556 return OutsideClickHandler; 13557 }(_react2['default'].Component); 13558 13559 exports["default"] = OutsideClickHandler; 13560 13561 13562 OutsideClickHandler.propTypes = propTypes; 13563 OutsideClickHandler.defaultProps = defaultProps; 13564 13565 /***/ }), 13566 13567 /***/ 6606: 13568 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13569 13570 // eslint-disable-next-line import/no-unresolved 13571 module.exports = __webpack_require__(2239); 13572 13573 13574 /***/ }), 13575 13576 /***/ 235: 13577 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13578 13579 var e=__webpack_require__(9196),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]}; 13580 13581 13582 /***/ }), 13583 13584 /***/ 5080: 13585 /***/ (function(__unused_webpack_module, exports) { 13586 13587 "use strict"; 13588 13589 13590 Object.defineProperty(exports, "__esModule", ({ 13591 value: true 13592 })); 13593 var CHANNEL = exports.CHANNEL = '__direction__'; 13594 13595 var DIRECTIONS = exports.DIRECTIONS = { 13596 LTR: 'ltr', 13597 RTL: 'rtl' 13598 }; 13599 13600 /***/ }), 13601 13602 /***/ 6640: 13603 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13604 13605 "use strict"; 13606 13607 13608 Object.defineProperty(exports, "__esModule", ({ 13609 value: true 13610 })); 13611 13612 var _propTypes = __webpack_require__(2652); 13613 13614 var _propTypes2 = _interopRequireDefault(_propTypes); 13615 13616 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13617 13618 exports["default"] = _propTypes2['default'].shape({ 13619 getState: _propTypes2['default'].func, 13620 setState: _propTypes2['default'].func, 13621 subscribe: _propTypes2['default'].func 13622 }); 13623 13624 /***/ }), 13625 13626 /***/ 3688: 13627 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13628 13629 var __webpack_unused_export__; 13630 __webpack_unused_export__ = ({ 13631 value: true 13632 }); 13633 13634 var _arrayPrototype = __webpack_require__(116); 13635 13636 var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype); 13637 13638 var _globalCache = __webpack_require__(5371); 13639 13640 var _globalCache2 = _interopRequireDefault(_globalCache); 13641 13642 var _constants = __webpack_require__(6930); 13643 13644 var _getClassName = __webpack_require__(1689); 13645 13646 var _getClassName2 = _interopRequireDefault(_getClassName); 13647 13648 var _separateStyles2 = __webpack_require__(1881); 13649 13650 var _separateStyles3 = _interopRequireDefault(_separateStyles2); 13651 13652 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13653 13654 /** 13655 * Function required as part of the react-with-styles interface. Parses the styles provided by 13656 * react-with-styles to produce class names based on the style name and optionally the namespace if 13657 * available. 13658 * 13659 * stylesObject {Object} The styles object passed to withStyles. 13660 * 13661 * Return an object mapping style names to class names. 13662 */ 13663 function create(stylesObject) { 13664 var stylesToClasses = {}; 13665 var styleNames = Object.keys(stylesObject); 13666 var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {}; 13667 var _sharedState$namespac = sharedState.namespace, 13668 namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac; 13669 13670 styleNames.forEach(function (styleName) { 13671 var className = (0, _getClassName2['default'])(namespace, styleName); 13672 stylesToClasses[styleName] = className; 13673 }); 13674 return stylesToClasses; 13675 } 13676 13677 /** 13678 * Process styles to be consumed by a component. 13679 * 13680 * stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects 13681 * representing inline styles, or arrays thereof. 13682 * 13683 * Return an object with optional className and style properties to be spread on a component. 13684 */ 13685 function resolve(stylesArray) { 13686 var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity); 13687 13688 var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles), 13689 classNames = _separateStyles.classNames, 13690 hasInlineStyles = _separateStyles.hasInlineStyles, 13691 inlineStyles = _separateStyles.inlineStyles; 13692 13693 var specificClassNames = classNames.map(function (name, index) { 13694 return String(name) + ' ' + String(name) + '_' + String(index + 1); 13695 }); 13696 var className = specificClassNames.join(' '); 13697 13698 var result = { className: className }; 13699 if (hasInlineStyles) result.style = inlineStyles; 13700 return result; 13701 } 13702 13703 exports["default"] = { create: create, resolve: resolve }; 13704 13705 /***/ }), 13706 13707 /***/ 6930: 13708 /***/ (function(__unused_webpack_module, exports) { 13709 13710 Object.defineProperty(exports, "__esModule", ({ 13711 value: true 13712 })); 13713 var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS'; 13714 var MAX_SPECIFICITY = 20; 13715 13716 exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY; 13717 exports.MAX_SPECIFICITY = MAX_SPECIFICITY; 13718 13719 /***/ }), 13720 13721 /***/ 1689: 13722 /***/ (function(__unused_webpack_module, exports) { 13723 13724 Object.defineProperty(exports, "__esModule", ({ 13725 value: true 13726 })); 13727 exports["default"] = getClassName; 13728 /** 13729 * Construct a class name. 13730 * 13731 * namespace {String} Used to construct unique class names. 13732 * styleName {String} Name identifying the specific style. 13733 * 13734 * Return the class name. 13735 */ 13736 function getClassName(namespace, styleName) { 13737 var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : ''; 13738 return '' + namespaceSegment + String(styleName); 13739 } 13740 13741 /***/ }), 13742 13743 /***/ 1881: 13744 /***/ (function(__unused_webpack_module, exports) { 13745 13746 Object.defineProperty(exports, "__esModule", ({ 13747 value: true 13748 })); 13749 // This function takes an array of styles and separates them into styles that 13750 // are handled by Aphrodite and inline styles. 13751 function separateStyles(stylesArray) { 13752 var classNames = []; 13753 13754 // Since determining if an Object is empty requires collecting all of its 13755 // keys, and we want the best performance in this code because we are in the 13756 // render path, we are going to do a little bookkeeping ourselves. 13757 var hasInlineStyles = false; 13758 var inlineStyles = {}; 13759 13760 // This is run on potentially every node in the tree when rendering, where 13761 // performance is critical. Normally we would prefer using `forEach`, but 13762 // old-fashioned for loops are faster so that's what we have chosen here. 13763 for (var i = 0; i < stylesArray.length; i++) { 13764 // eslint-disable-line no-plusplus 13765 var style = stylesArray[i]; 13766 13767 // If this style is falsy, we just want to disregard it. This allows for 13768 // syntax like: 13769 // 13770 // css(isFoo && styles.foo) 13771 if (style) { 13772 if (typeof style === 'string') { 13773 classNames.push(style); 13774 } else { 13775 Object.assign(inlineStyles, style); 13776 hasInlineStyles = true; 13777 } 13778 } 13779 } 13780 13781 return { 13782 classNames: classNames, 13783 hasInlineStyles: hasInlineStyles, 13784 inlineStyles: inlineStyles 13785 }; 13786 } 13787 13788 exports["default"] = separateStyles; 13789 13790 /***/ }), 13791 13792 /***/ 5553: 13793 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 13794 13795 // eslint-disable-next-line import/no-unresolved 13796 module.exports = __webpack_require__(3688)["default"]; 13797 13798 13799 /***/ }), 13800 13801 /***/ 9349: 13802 /***/ (function(__unused_webpack_module, exports) { 13803 13804 "use strict"; 13805 13806 13807 Object.defineProperty(exports, "__esModule", ({ 13808 value: true 13809 })); 13810 var styleInterface = void 0; 13811 var styleTheme = void 0; 13812 13813 var START_MARK = 'react-with-styles.resolve.start'; 13814 var END_MARK = 'react-with-styles.resolve.end'; 13815 var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]'; 13816 13817 function registerTheme(theme) { 13818 styleTheme = theme; 13819 } 13820 13821 function registerInterface(interfaceToRegister) { 13822 styleInterface = interfaceToRegister; 13823 } 13824 13825 function create(makeFromTheme, createWithDirection) { 13826 var styles = createWithDirection(makeFromTheme(styleTheme)); 13827 return function () { 13828 return styles; 13829 }; 13830 } 13831 13832 function createLTR(makeFromTheme) { 13833 return create(makeFromTheme, styleInterface.createLTR || styleInterface.create); 13834 } 13835 13836 function createRTL(makeFromTheme) { 13837 return create(makeFromTheme, styleInterface.createRTL || styleInterface.create); 13838 } 13839 13840 function get() { 13841 return styleTheme; 13842 } 13843 13844 function resolve() { 13845 if (false) {} 13846 13847 for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) { 13848 styles[_key] = arguments[_key]; 13849 } 13850 13851 var result = styleInterface.resolve(styles); 13852 13853 if (false) {} 13854 13855 return result; 13856 } 13857 13858 function resolveLTR() { 13859 for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 13860 styles[_key2] = arguments[_key2]; 13861 } 13862 13863 if (styleInterface.resolveLTR) { 13864 return styleInterface.resolveLTR(styles); 13865 } 13866 13867 return resolve(styles); 13868 } 13869 13870 function resolveRTL() { 13871 for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 13872 styles[_key3] = arguments[_key3]; 13873 } 13874 13875 if (styleInterface.resolveRTL) { 13876 return styleInterface.resolveRTL(styles); 13877 } 13878 13879 return resolve(styles); 13880 } 13881 13882 function flush() { 13883 if (styleInterface.flush) { 13884 styleInterface.flush(); 13885 } 13886 } 13887 13888 exports["default"] = { 13889 registerTheme: registerTheme, 13890 registerInterface: registerInterface, 13891 create: createLTR, 13892 createLTR: createLTR, 13893 createRTL: createRTL, 13894 get: get, 13895 resolve: resolveLTR, 13896 resolveLTR: resolveLTR, 13897 resolveRTL: resolveRTL, 13898 flush: flush 13899 }; 13900 13901 /***/ }), 13902 13903 /***/ 3576: 13904 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 13905 13906 "use strict"; 13907 13908 13909 Object.defineProperty(exports, "__esModule", ({ 13910 value: true 13911 })); 13912 exports.withStylesPropTypes = exports.css = undefined; 13913 13914 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 13915 13916 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 13917 13918 exports.withStyles = withStyles; 13919 13920 var _object = __webpack_require__(4011); 13921 13922 var _object2 = _interopRequireDefault(_object); 13923 13924 var _react = __webpack_require__(9196); 13925 13926 var _react2 = _interopRequireDefault(_react); 13927 13928 var _propTypes = __webpack_require__(2652); 13929 13930 var _propTypes2 = _interopRequireDefault(_propTypes); 13931 13932 var _hoistNonReactStatics = __webpack_require__(1281); 13933 13934 var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); 13935 13936 var _constants = __webpack_require__(5080); 13937 13938 var _brcast = __webpack_require__(6640); 13939 13940 var _brcast2 = _interopRequireDefault(_brcast); 13941 13942 var _ThemedStyleSheet = __webpack_require__(9349); 13943 13944 var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); 13945 13946 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 13947 13948 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 13949 13950 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 13951 13952 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 13953 13954 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */ 13955 13956 // Add some named exports to assist in upgrading and for convenience 13957 var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR; 13958 var withStylesPropTypes = exports.withStylesPropTypes = { 13959 styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 13960 theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 13961 css: _propTypes2['default'].func.isRequired 13962 }; 13963 13964 var EMPTY_STYLES = {}; 13965 var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() { 13966 return EMPTY_STYLES; 13967 }; 13968 13969 var START_MARK = 'react-with-styles.createStyles.start'; 13970 var END_MARK = 'react-with-styles.createStyles.end'; 13971 13972 function baseClass(pureComponent) { 13973 if (pureComponent) { 13974 if (!_react2['default'].PureComponent) { 13975 throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later'); 13976 } 13977 13978 return _react2['default'].PureComponent; 13979 } 13980 13981 return _react2['default'].Component; 13982 } 13983 13984 var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']); 13985 13986 var defaultDirection = _constants.DIRECTIONS.LTR; 13987 13988 function withStyles(styleFn) { 13989 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 13990 _ref$stylesPropName = _ref.stylesPropName, 13991 stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName, 13992 _ref$themePropName = _ref.themePropName, 13993 themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName, 13994 _ref$cssPropName = _ref.cssPropName, 13995 cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName, 13996 _ref$flushBefore = _ref.flushBefore, 13997 flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore, 13998 _ref$pureComponent = _ref.pureComponent, 13999 pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent; 14000 14001 var styleDefLTR = void 0; 14002 var styleDefRTL = void 0; 14003 var currentThemeLTR = void 0; 14004 var currentThemeRTL = void 0; 14005 var BaseClass = baseClass(pureComponent); 14006 14007 function getResolveMethod(direction) { 14008 return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL; 14009 } 14010 14011 function getCurrentTheme(direction) { 14012 return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL; 14013 } 14014 14015 function getStyleDef(direction, wrappedComponentName) { 14016 var currentTheme = getCurrentTheme(direction); 14017 var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL; 14018 14019 var registeredTheme = _ThemedStyleSheet2['default'].get(); 14020 14021 // Return the existing styles if they've already been defined 14022 // and if the theme used to create them corresponds to the theme 14023 // registered with ThemedStyleSheet 14024 if (styleDef && currentTheme === registeredTheme) { 14025 return styleDef; 14026 } 14027 14028 if (false) {} 14029 14030 var isRTL = direction === _constants.DIRECTIONS.RTL; 14031 14032 if (isRTL) { 14033 styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN; 14034 14035 currentThemeRTL = registeredTheme; 14036 styleDef = styleDefRTL; 14037 } else { 14038 styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN; 14039 14040 currentThemeLTR = registeredTheme; 14041 styleDef = styleDefLTR; 14042 } 14043 14044 if (false) { var measureName; } 14045 14046 return styleDef; 14047 } 14048 14049 function getState(direction, wrappedComponentName) { 14050 return { 14051 resolveMethod: getResolveMethod(direction), 14052 styleDef: getStyleDef(direction, wrappedComponentName) 14053 }; 14054 } 14055 14056 return function () { 14057 function withStylesHOC(WrappedComponent) { 14058 var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; 14059 14060 // NOTE: Use a class here so components are ref-able if need be: 14061 // eslint-disable-next-line react/prefer-stateless-function 14062 14063 var WithStyles = function (_BaseClass) { 14064 _inherits(WithStyles, _BaseClass); 14065 14066 function WithStyles(props, context) { 14067 _classCallCheck(this, WithStyles); 14068 14069 var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context)); 14070 14071 var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection; 14072 14073 _this.state = getState(direction, wrappedComponentName); 14074 return _this; 14075 } 14076 14077 _createClass(WithStyles, [{ 14078 key: 'componentDidMount', 14079 value: function () { 14080 function componentDidMount() { 14081 var _this2 = this; 14082 14083 if (this.context[_constants.CHANNEL]) { 14084 // subscribe to future direction changes 14085 this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) { 14086 _this2.setState(getState(direction, wrappedComponentName)); 14087 }); 14088 } 14089 } 14090 14091 return componentDidMount; 14092 }() 14093 }, { 14094 key: 'componentWillUnmount', 14095 value: function () { 14096 function componentWillUnmount() { 14097 if (this.channelUnsubscribe) { 14098 this.channelUnsubscribe(); 14099 } 14100 } 14101 14102 return componentWillUnmount; 14103 }() 14104 }, { 14105 key: 'render', 14106 value: function () { 14107 function render() { 14108 var _ref2; 14109 14110 // As some components will depend on previous styles in 14111 // the component tree, we provide the option of flushing the 14112 // buffered styles (i.e. to a style tag) **before** the rendering 14113 // cycle begins. 14114 // 14115 // The interfaces provide the optional "flush" method which 14116 // is run in turn by ThemedStyleSheet.flush. 14117 if (flushBefore) { 14118 _ThemedStyleSheet2['default'].flush(); 14119 } 14120 14121 var _state = this.state, 14122 resolveMethod = _state.resolveMethod, 14123 styleDef = _state.styleDef; 14124 14125 14126 return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2))); 14127 } 14128 14129 return render; 14130 }() 14131 }]); 14132 14133 return WithStyles; 14134 }(BaseClass); 14135 14136 WithStyles.WrappedComponent = WrappedComponent; 14137 WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')'; 14138 WithStyles.contextTypes = contextTypes; 14139 if (WrappedComponent.propTypes) { 14140 WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes); 14141 delete WithStyles.propTypes[stylesPropName]; 14142 delete WithStyles.propTypes[themePropName]; 14143 delete WithStyles.propTypes[cssPropName]; 14144 } 14145 if (WrappedComponent.defaultProps) { 14146 WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps); 14147 } 14148 14149 return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent); 14150 } 14151 14152 return withStylesHOC; 14153 }(); 14154 } 14155 14156 /***/ }), 14157 14158 /***/ 9196: 14159 /***/ (function(module) { 14160 14161 "use strict"; 14162 module.exports = window["React"]; 14163 14164 /***/ }), 14165 14166 /***/ 6292: 14167 /***/ (function(module) { 14168 14169 "use strict"; 14170 module.exports = window["moment"]; 14171 14172 /***/ }), 14173 14174 /***/ 4080: 14175 /***/ (function() { 14176 14177 /* (ignored) */ 14178 14179 /***/ }), 14180 14181 /***/ 7472: 14182 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14183 14184 "use strict"; 14185 14186 14187 var GetIntrinsic = __webpack_require__(4219); 14188 14189 var $Array = GetIntrinsic('%Array%'); 14190 14191 // eslint-disable-next-line global-require 14192 var toStr = !$Array.isArray && __webpack_require__(9630)('Object.prototype.toString'); 14193 14194 // https://ecma-international.org/ecma-262/6.0/#sec-isarray 14195 14196 module.exports = $Array.isArray || function IsArray(argument) { 14197 return toStr(argument) === '[object Array]'; 14198 }; 14199 14200 14201 /***/ }), 14202 14203 /***/ 3665: 14204 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14205 14206 "use strict"; 14207 14208 14209 var GetIntrinsic = __webpack_require__(4219); 14210 14211 var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); 14212 var $RangeError = GetIntrinsic('%RangeError%'); 14213 var $SyntaxError = GetIntrinsic('%SyntaxError%'); 14214 var $TypeError = GetIntrinsic('%TypeError%'); 14215 14216 var IsIntegralNumber = __webpack_require__(485); 14217 14218 var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; 14219 14220 var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( 14221 // eslint-disable-next-line no-proto, no-negated-condition 14222 [].__proto__ !== $ArrayPrototype 14223 ? null 14224 : function (O, proto) { 14225 O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign 14226 return O; 14227 } 14228 ); 14229 14230 // https://www.ecma-international.org/ecma-262/12.0/#sec-arraycreate 14231 14232 module.exports = function ArrayCreate(length) { 14233 if (!IsIntegralNumber(length) || length < 0) { 14234 throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); 14235 } 14236 if (length > MAX_ARRAY_LENGTH) { 14237 throw new $RangeError('length is greater than (2**32 - 1)'); 14238 } 14239 var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; 14240 var A = []; // steps 3, 5 14241 if (proto !== $ArrayPrototype) { // step 4 14242 if (!$setProto) { 14243 throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); 14244 } 14245 $setProto(A, proto); 14246 } 14247 if (length !== 0) { // bypasses the need for step 6 14248 A.length = length; 14249 } 14250 /* step 6, the above as a shortcut for the below 14251 OrdinaryDefineOwnProperty(A, 'length', { 14252 '[[Configurable]]': false, 14253 '[[Enumerable]]': false, 14254 '[[Value]]': length, 14255 '[[Writable]]': true 14256 }); 14257 */ 14258 return A; 14259 }; 14260 14261 14262 /***/ }), 14263 14264 /***/ 1539: 14265 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14266 14267 "use strict"; 14268 14269 14270 var GetIntrinsic = __webpack_require__(4219); 14271 14272 var $species = GetIntrinsic('%Symbol.species%', true); 14273 var $TypeError = GetIntrinsic('%TypeError%'); 14274 14275 var ArrayCreate = __webpack_require__(3665); 14276 var Get = __webpack_require__(6448); 14277 var IsArray = __webpack_require__(5971); 14278 var IsConstructor = __webpack_require__(4065); 14279 var IsIntegralNumber = __webpack_require__(485); 14280 var Type = __webpack_require__(9747); 14281 14282 // https://ecma-international.org/ecma-262/12.0/#sec-arrayspeciescreate 14283 14284 module.exports = function ArraySpeciesCreate(originalArray, length) { 14285 if (!IsIntegralNumber(length) || length < 0) { 14286 throw new $TypeError('Assertion failed: length must be an integer >= 0'); 14287 } 14288 14289 var isArray = IsArray(originalArray); 14290 if (!isArray) { 14291 return ArrayCreate(length); 14292 } 14293 14294 var C = Get(originalArray, 'constructor'); 14295 // TODO: figure out how to make a cross-realm normal Array, a same-realm Array 14296 // if (IsConstructor(C)) { 14297 // if C is another realm's Array, C = undefined 14298 // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? 14299 // } 14300 if ($species && Type(C) === 'Object') { 14301 C = Get(C, $species); 14302 if (C === null) { 14303 C = void 0; 14304 } 14305 } 14306 14307 if (typeof C === 'undefined') { 14308 return ArrayCreate(length); 14309 } 14310 if (!IsConstructor(C)) { 14311 throw new $TypeError('C must be a constructor'); 14312 } 14313 return new C(length); // Construct(C, length); 14314 }; 14315 14316 14317 14318 /***/ }), 14319 14320 /***/ 8323: 14321 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14322 14323 "use strict"; 14324 14325 14326 var GetIntrinsic = __webpack_require__(4219); 14327 var callBound = __webpack_require__(9630); 14328 14329 var $TypeError = GetIntrinsic('%TypeError%'); 14330 14331 var IsArray = __webpack_require__(5971); 14332 14333 var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); 14334 14335 // https://ecma-international.org/ecma-262/6.0/#sec-call 14336 14337 module.exports = function Call(F, V) { 14338 var argumentsList = arguments.length > 2 ? arguments[2] : []; 14339 if (!IsArray(argumentsList)) { 14340 throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List'); 14341 } 14342 return $apply(F, V, argumentsList); 14343 }; 14344 14345 14346 /***/ }), 14347 14348 /***/ 5597: 14349 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14350 14351 "use strict"; 14352 14353 14354 var GetIntrinsic = __webpack_require__(4219); 14355 14356 var $TypeError = GetIntrinsic('%TypeError%'); 14357 14358 var DefineOwnProperty = __webpack_require__(1327); 14359 14360 var FromPropertyDescriptor = __webpack_require__(8487); 14361 var OrdinaryGetOwnProperty = __webpack_require__(6403); 14362 var IsDataDescriptor = __webpack_require__(1392); 14363 var IsExtensible = __webpack_require__(3428); 14364 var IsPropertyKey = __webpack_require__(3290); 14365 var SameValue = __webpack_require__(9836); 14366 var Type = __webpack_require__(9747); 14367 14368 // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty 14369 14370 module.exports = function CreateDataProperty(O, P, V) { 14371 if (Type(O) !== 'Object') { 14372 throw new $TypeError('Assertion failed: Type(O) is not Object'); 14373 } 14374 if (!IsPropertyKey(P)) { 14375 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 14376 } 14377 var oldDesc = OrdinaryGetOwnProperty(O, P); 14378 var extensible = !oldDesc || IsExtensible(O); 14379 var nonConfigurable = oldDesc && !oldDesc['[[Configurable]]']; 14380 if (nonConfigurable || !extensible) { 14381 return false; 14382 } 14383 return DefineOwnProperty( 14384 IsDataDescriptor, 14385 SameValue, 14386 FromPropertyDescriptor, 14387 O, 14388 P, 14389 { 14390 '[[Configurable]]': true, 14391 '[[Enumerable]]': true, 14392 '[[Value]]': V, 14393 '[[Writable]]': true 14394 } 14395 ); 14396 }; 14397 14398 14399 /***/ }), 14400 14401 /***/ 3323: 14402 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14403 14404 "use strict"; 14405 14406 14407 var GetIntrinsic = __webpack_require__(4219); 14408 14409 var $TypeError = GetIntrinsic('%TypeError%'); 14410 14411 var CreateDataProperty = __webpack_require__(5597); 14412 var IsPropertyKey = __webpack_require__(3290); 14413 var Type = __webpack_require__(9747); 14414 14415 // // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow 14416 14417 module.exports = function CreateDataPropertyOrThrow(O, P, V) { 14418 if (Type(O) !== 'Object') { 14419 throw new $TypeError('Assertion failed: Type(O) is not Object'); 14420 } 14421 if (!IsPropertyKey(P)) { 14422 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 14423 } 14424 var success = CreateDataProperty(O, P, V); 14425 if (!success) { 14426 throw new $TypeError('unable to create data property'); 14427 } 14428 return success; 14429 }; 14430 14431 14432 /***/ }), 14433 14434 /***/ 6356: 14435 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14436 14437 "use strict"; 14438 14439 14440 var GetIntrinsic = __webpack_require__(4219); 14441 14442 var $TypeError = GetIntrinsic('%TypeError%'); 14443 14444 var isPropertyDescriptor = __webpack_require__(8682); 14445 var DefineOwnProperty = __webpack_require__(1327); 14446 14447 var FromPropertyDescriptor = __webpack_require__(8487); 14448 var IsAccessorDescriptor = __webpack_require__(7857); 14449 var IsDataDescriptor = __webpack_require__(1392); 14450 var IsPropertyKey = __webpack_require__(3290); 14451 var SameValue = __webpack_require__(9836); 14452 var ToPropertyDescriptor = __webpack_require__(2402); 14453 var Type = __webpack_require__(9747); 14454 14455 // https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow 14456 14457 module.exports = function DefinePropertyOrThrow(O, P, desc) { 14458 if (Type(O) !== 'Object') { 14459 throw new $TypeError('Assertion failed: Type(O) is not Object'); 14460 } 14461 14462 if (!IsPropertyKey(P)) { 14463 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); 14464 } 14465 14466 var Desc = isPropertyDescriptor({ 14467 Type: Type, 14468 IsDataDescriptor: IsDataDescriptor, 14469 IsAccessorDescriptor: IsAccessorDescriptor 14470 }, desc) ? desc : ToPropertyDescriptor(desc); 14471 if (!isPropertyDescriptor({ 14472 Type: Type, 14473 IsDataDescriptor: IsDataDescriptor, 14474 IsAccessorDescriptor: IsAccessorDescriptor 14475 }, Desc)) { 14476 throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); 14477 } 14478 14479 return DefineOwnProperty( 14480 IsDataDescriptor, 14481 SameValue, 14482 FromPropertyDescriptor, 14483 O, 14484 P, 14485 Desc 14486 ); 14487 }; 14488 14489 14490 /***/ }), 14491 14492 /***/ 6739: 14493 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14494 14495 "use strict"; 14496 14497 14498 var GetIntrinsic = __webpack_require__(4219); 14499 14500 var $TypeError = GetIntrinsic('%TypeError%'); 14501 14502 var MAX_SAFE_INTEGER = __webpack_require__(8540); 14503 14504 var Call = __webpack_require__(8323); 14505 var CreateDataPropertyOrThrow = __webpack_require__(3323); 14506 var Get = __webpack_require__(6448); 14507 var HasProperty = __webpack_require__(3059); 14508 var IsArray = __webpack_require__(5971); 14509 var LengthOfArrayLike = __webpack_require__(2151); 14510 var ToString = __webpack_require__(6888); 14511 14512 // https://262.ecma-international.org/11.0/#sec-flattenintoarray 14513 14514 // eslint-disable-next-line max-params 14515 module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { 14516 var mapperFunction; 14517 if (arguments.length > 5) { 14518 mapperFunction = arguments[5]; 14519 } 14520 14521 var targetIndex = start; 14522 var sourceIndex = 0; 14523 while (sourceIndex < sourceLen) { 14524 var P = ToString(sourceIndex); 14525 var exists = HasProperty(source, P); 14526 if (exists === true) { 14527 var element = Get(source, P); 14528 if (typeof mapperFunction !== 'undefined') { 14529 if (arguments.length <= 6) { 14530 throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); 14531 } 14532 element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); 14533 } 14534 var shouldFlatten = false; 14535 if (depth > 0) { 14536 shouldFlatten = IsArray(element); 14537 } 14538 if (shouldFlatten) { 14539 var elementLen = LengthOfArrayLike(element); 14540 targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); 14541 } else { 14542 if (targetIndex >= MAX_SAFE_INTEGER) { 14543 throw new $TypeError('index too large'); 14544 } 14545 CreateDataPropertyOrThrow(target, ToString(targetIndex), element); 14546 targetIndex += 1; 14547 } 14548 } 14549 sourceIndex += 1; 14550 } 14551 14552 return targetIndex; 14553 }; 14554 14555 14556 /***/ }), 14557 14558 /***/ 8487: 14559 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14560 14561 "use strict"; 14562 14563 14564 var assertRecord = __webpack_require__(5114); 14565 14566 var Type = __webpack_require__(9747); 14567 14568 // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor 14569 14570 module.exports = function FromPropertyDescriptor(Desc) { 14571 if (typeof Desc === 'undefined') { 14572 return Desc; 14573 } 14574 14575 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 14576 14577 var obj = {}; 14578 if ('[[Value]]' in Desc) { 14579 obj.value = Desc['[[Value]]']; 14580 } 14581 if ('[[Writable]]' in Desc) { 14582 obj.writable = Desc['[[Writable]]']; 14583 } 14584 if ('[[Get]]' in Desc) { 14585 obj.get = Desc['[[Get]]']; 14586 } 14587 if ('[[Set]]' in Desc) { 14588 obj.set = Desc['[[Set]]']; 14589 } 14590 if ('[[Enumerable]]' in Desc) { 14591 obj.enumerable = Desc['[[Enumerable]]']; 14592 } 14593 if ('[[Configurable]]' in Desc) { 14594 obj.configurable = Desc['[[Configurable]]']; 14595 } 14596 return obj; 14597 }; 14598 14599 14600 /***/ }), 14601 14602 /***/ 6448: 14603 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14604 14605 "use strict"; 14606 14607 14608 var GetIntrinsic = __webpack_require__(4219); 14609 14610 var $TypeError = GetIntrinsic('%TypeError%'); 14611 14612 var inspect = __webpack_require__(3205); 14613 14614 var IsPropertyKey = __webpack_require__(3290); 14615 var Type = __webpack_require__(9747); 14616 14617 // https://ecma-international.org/ecma-262/6.0/#sec-get-o-p 14618 14619 module.exports = function Get(O, P) { 14620 // 7.3.1.1 14621 if (Type(O) !== 'Object') { 14622 throw new $TypeError('Assertion failed: Type(O) is not Object'); 14623 } 14624 // 7.3.1.2 14625 if (!IsPropertyKey(P)) { 14626 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); 14627 } 14628 // 7.3.1.3 14629 return O[P]; 14630 }; 14631 14632 14633 /***/ }), 14634 14635 /***/ 3059: 14636 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14637 14638 "use strict"; 14639 14640 14641 var GetIntrinsic = __webpack_require__(4219); 14642 14643 var $TypeError = GetIntrinsic('%TypeError%'); 14644 14645 var IsPropertyKey = __webpack_require__(3290); 14646 var Type = __webpack_require__(9747); 14647 14648 // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty 14649 14650 module.exports = function HasProperty(O, P) { 14651 if (Type(O) !== 'Object') { 14652 throw new $TypeError('Assertion failed: `O` must be an Object'); 14653 } 14654 if (!IsPropertyKey(P)) { 14655 throw new $TypeError('Assertion failed: `P` must be a Property Key'); 14656 } 14657 return P in O; 14658 }; 14659 14660 14661 /***/ }), 14662 14663 /***/ 7857: 14664 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14665 14666 "use strict"; 14667 14668 14669 var has = __webpack_require__(9284); 14670 14671 var assertRecord = __webpack_require__(5114); 14672 14673 var Type = __webpack_require__(9747); 14674 14675 // https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor 14676 14677 module.exports = function IsAccessorDescriptor(Desc) { 14678 if (typeof Desc === 'undefined') { 14679 return false; 14680 } 14681 14682 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 14683 14684 if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { 14685 return false; 14686 } 14687 14688 return true; 14689 }; 14690 14691 14692 /***/ }), 14693 14694 /***/ 5971: 14695 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14696 14697 "use strict"; 14698 14699 14700 var GetIntrinsic = __webpack_require__(4219); 14701 14702 var $Array = GetIntrinsic('%Array%'); 14703 14704 // eslint-disable-next-line global-require 14705 var toStr = !$Array.isArray && __webpack_require__(9630)('Object.prototype.toString'); 14706 14707 // https://ecma-international.org/ecma-262/6.0/#sec-isarray 14708 14709 module.exports = $Array.isArray || function IsArray(argument) { 14710 return toStr(argument) === '[object Array]'; 14711 }; 14712 14713 14714 /***/ }), 14715 14716 /***/ 1089: 14717 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14718 14719 "use strict"; 14720 14721 14722 // http://262.ecma-international.org/5.1/#sec-9.11 14723 14724 module.exports = __webpack_require__(4363); 14725 14726 14727 /***/ }), 14728 14729 /***/ 4065: 14730 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14731 14732 "use strict"; 14733 14734 14735 var GetIntrinsic = __webpack_require__(137); 14736 14737 var $construct = GetIntrinsic('%Reflect.construct%', true); 14738 14739 var DefinePropertyOrThrow = __webpack_require__(6356); 14740 try { 14741 DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); 14742 } catch (e) { 14743 // Accessor properties aren't supported 14744 DefinePropertyOrThrow = null; 14745 } 14746 14747 // https://ecma-international.org/ecma-262/6.0/#sec-isconstructor 14748 14749 if (DefinePropertyOrThrow && $construct) { 14750 var isConstructorMarker = {}; 14751 var badArrayLike = {}; 14752 DefinePropertyOrThrow(badArrayLike, 'length', { 14753 '[[Get]]': function () { 14754 throw isConstructorMarker; 14755 }, 14756 '[[Enumerable]]': true 14757 }); 14758 14759 module.exports = function IsConstructor(argument) { 14760 try { 14761 // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: 14762 $construct(argument, badArrayLike); 14763 } catch (err) { 14764 return err === isConstructorMarker; 14765 } 14766 }; 14767 } else { 14768 module.exports = function IsConstructor(argument) { 14769 // unfortunately there's no way to truly check this without try/catch `new argument` in old environments 14770 return typeof argument === 'function' && !!argument.prototype; 14771 }; 14772 } 14773 14774 14775 /***/ }), 14776 14777 /***/ 1392: 14778 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14779 14780 "use strict"; 14781 14782 14783 var has = __webpack_require__(9284); 14784 14785 var assertRecord = __webpack_require__(5114); 14786 14787 var Type = __webpack_require__(9747); 14788 14789 // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor 14790 14791 module.exports = function IsDataDescriptor(Desc) { 14792 if (typeof Desc === 'undefined') { 14793 return false; 14794 } 14795 14796 assertRecord(Type, 'Property Descriptor', 'Desc', Desc); 14797 14798 if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { 14799 return false; 14800 } 14801 14802 return true; 14803 }; 14804 14805 14806 /***/ }), 14807 14808 /***/ 3428: 14809 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14810 14811 "use strict"; 14812 14813 14814 var GetIntrinsic = __webpack_require__(4219); 14815 14816 var $preventExtensions = GetIntrinsic('%Object.preventExtensions%', true); 14817 var $isExtensible = GetIntrinsic('%Object.isExtensible%', true); 14818 14819 var isPrimitive = __webpack_require__(5019); 14820 14821 // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o 14822 14823 module.exports = $preventExtensions 14824 ? function IsExtensible(obj) { 14825 return !isPrimitive(obj) && $isExtensible(obj); 14826 } 14827 : function IsExtensible(obj) { 14828 return !isPrimitive(obj); 14829 }; 14830 14831 14832 /***/ }), 14833 14834 /***/ 485: 14835 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14836 14837 "use strict"; 14838 14839 14840 var abs = __webpack_require__(13); 14841 var floor = __webpack_require__(5127); 14842 var Type = __webpack_require__(9747); 14843 14844 var $isNaN = __webpack_require__(3234); 14845 var $isFinite = __webpack_require__(7061); 14846 14847 // https://tc39.es/ecma262/#sec-isintegralnumber 14848 14849 module.exports = function IsIntegralNumber(argument) { 14850 if (Type(argument) !== 'Number' || $isNaN(argument) || !$isFinite(argument)) { 14851 return false; 14852 } 14853 var absValue = abs(argument); 14854 return floor(absValue) === absValue; 14855 }; 14856 14857 14858 /***/ }), 14859 14860 /***/ 3290: 14861 /***/ (function(module) { 14862 14863 "use strict"; 14864 14865 14866 // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey 14867 14868 module.exports = function IsPropertyKey(argument) { 14869 return typeof argument === 'string' || typeof argument === 'symbol'; 14870 }; 14871 14872 14873 /***/ }), 14874 14875 /***/ 1275: 14876 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14877 14878 "use strict"; 14879 14880 14881 var GetIntrinsic = __webpack_require__(4219); 14882 14883 var $match = GetIntrinsic('%Symbol.match%', true); 14884 14885 var hasRegExpMatcher = __webpack_require__(4221); 14886 14887 var ToBoolean = __webpack_require__(3704); 14888 14889 // https://ecma-international.org/ecma-262/6.0/#sec-isregexp 14890 14891 module.exports = function IsRegExp(argument) { 14892 if (!argument || typeof argument !== 'object') { 14893 return false; 14894 } 14895 if ($match) { 14896 var isRegExp = argument[$match]; 14897 if (typeof isRegExp !== 'undefined') { 14898 return ToBoolean(isRegExp); 14899 } 14900 } 14901 return hasRegExpMatcher(argument); 14902 }; 14903 14904 14905 /***/ }), 14906 14907 /***/ 2151: 14908 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14909 14910 "use strict"; 14911 14912 14913 var GetIntrinsic = __webpack_require__(4219); 14914 14915 var $TypeError = GetIntrinsic('%TypeError%'); 14916 14917 var Get = __webpack_require__(6448); 14918 var ToLength = __webpack_require__(6840); 14919 var Type = __webpack_require__(9747); 14920 14921 // https://262.ecma-international.org/11.0/#sec-lengthofarraylike 14922 14923 module.exports = function LengthOfArrayLike(obj) { 14924 if (Type(obj) !== 'Object') { 14925 throw new $TypeError('Assertion failed: `obj` must be an Object'); 14926 } 14927 return ToLength(Get(obj, 'length')); 14928 }; 14929 14930 // TODO: use this all over 14931 14932 14933 /***/ }), 14934 14935 /***/ 6403: 14936 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14937 14938 "use strict"; 14939 14940 14941 var GetIntrinsic = __webpack_require__(4219); 14942 14943 var $gOPD = __webpack_require__(5180); 14944 var $TypeError = GetIntrinsic('%TypeError%'); 14945 14946 var callBound = __webpack_require__(9630); 14947 14948 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 14949 14950 var has = __webpack_require__(9284); 14951 14952 var IsArray = __webpack_require__(5971); 14953 var IsPropertyKey = __webpack_require__(3290); 14954 var IsRegExp = __webpack_require__(1275); 14955 var ToPropertyDescriptor = __webpack_require__(2402); 14956 var Type = __webpack_require__(9747); 14957 14958 // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty 14959 14960 module.exports = function OrdinaryGetOwnProperty(O, P) { 14961 if (Type(O) !== 'Object') { 14962 throw new $TypeError('Assertion failed: O must be an Object'); 14963 } 14964 if (!IsPropertyKey(P)) { 14965 throw new $TypeError('Assertion failed: P must be a Property Key'); 14966 } 14967 if (!has(O, P)) { 14968 return void 0; 14969 } 14970 if (!$gOPD) { 14971 // ES3 / IE 8 fallback 14972 var arrayLength = IsArray(O) && P === 'length'; 14973 var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; 14974 return { 14975 '[[Configurable]]': !(arrayLength || regexLastIndex), 14976 '[[Enumerable]]': $isEnumerable(O, P), 14977 '[[Value]]': O[P], 14978 '[[Writable]]': true 14979 }; 14980 } 14981 return ToPropertyDescriptor($gOPD(O, P)); 14982 }; 14983 14984 14985 /***/ }), 14986 14987 /***/ 6953: 14988 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 14989 14990 "use strict"; 14991 14992 14993 module.exports = __webpack_require__(3031); 14994 14995 14996 /***/ }), 14997 14998 /***/ 9836: 14999 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15000 15001 "use strict"; 15002 15003 15004 var $isNaN = __webpack_require__(3234); 15005 15006 // http://262.ecma-international.org/5.1/#sec-9.12 15007 15008 module.exports = function SameValue(x, y) { 15009 if (x === y) { // 0 === -0, but they are not identical. 15010 if (x === 0) { return 1 / x === 1 / y; } 15011 return true; 15012 } 15013 return $isNaN(x) && $isNaN(y); 15014 }; 15015 15016 15017 /***/ }), 15018 15019 /***/ 3704: 15020 /***/ (function(module) { 15021 15022 "use strict"; 15023 15024 15025 // http://262.ecma-international.org/5.1/#sec-9.2 15026 15027 module.exports = function ToBoolean(value) { return !!value; }; 15028 15029 15030 /***/ }), 15031 15032 /***/ 1723: 15033 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15034 15035 "use strict"; 15036 15037 15038 var abs = __webpack_require__(13); 15039 var floor = __webpack_require__(5127); 15040 var ToNumber = __webpack_require__(5541); 15041 15042 var $isNaN = __webpack_require__(3234); 15043 var $isFinite = __webpack_require__(7061); 15044 var $sign = __webpack_require__(2163); 15045 15046 // https://262.ecma-international.org/12.0/#sec-tointegerorinfinity 15047 15048 module.exports = function ToIntegerOrInfinity(value) { 15049 var number = ToNumber(value); 15050 if ($isNaN(number) || number === 0) { return 0; } 15051 if (!$isFinite(number)) { return number; } 15052 return $sign(number) * floor(abs(number)); 15053 }; 15054 15055 15056 /***/ }), 15057 15058 /***/ 6840: 15059 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15060 15061 "use strict"; 15062 15063 15064 var MAX_SAFE_INTEGER = __webpack_require__(8540); 15065 15066 var ToIntegerOrInfinity = __webpack_require__(1723); 15067 15068 module.exports = function ToLength(argument) { 15069 var len = ToIntegerOrInfinity(argument); 15070 if (len <= 0) { return 0; } // includes converting -0 to +0 15071 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } 15072 return len; 15073 }; 15074 15075 15076 /***/ }), 15077 15078 /***/ 5541: 15079 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15080 15081 "use strict"; 15082 15083 15084 var GetIntrinsic = __webpack_require__(4219); 15085 15086 var $TypeError = GetIntrinsic('%TypeError%'); 15087 var $Number = GetIntrinsic('%Number%'); 15088 var $RegExp = GetIntrinsic('%RegExp%'); 15089 var $parseInteger = GetIntrinsic('%parseInt%'); 15090 15091 var callBound = __webpack_require__(9630); 15092 var regexTester = __webpack_require__(8441); 15093 var isPrimitive = __webpack_require__(5019); 15094 15095 var $strSlice = callBound('String.prototype.slice'); 15096 var isBinary = regexTester(/^0b[01]+$/i); 15097 var isOctal = regexTester(/^0o[0-7]+$/i); 15098 var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); 15099 var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); 15100 var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); 15101 var hasNonWS = regexTester(nonWSregex); 15102 15103 // whitespace from: https://es5.github.io/#x15.5.4.20 15104 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 15105 var ws = [ 15106 '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', 15107 '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', 15108 '\u2029\uFEFF' 15109 ].join(''); 15110 var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); 15111 var $replace = callBound('String.prototype.replace'); 15112 var $trim = function (value) { 15113 return $replace(value, trimRegex, ''); 15114 }; 15115 15116 var ToPrimitive = __webpack_require__(6745); 15117 15118 // https://ecma-international.org/ecma-262/6.0/#sec-tonumber 15119 15120 module.exports = function ToNumber(argument) { 15121 var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); 15122 if (typeof value === 'symbol') { 15123 throw new $TypeError('Cannot convert a Symbol value to a number'); 15124 } 15125 if (typeof value === 'bigint') { 15126 throw new $TypeError('Conversion from \'BigInt\' to \'number\' is not allowed.'); 15127 } 15128 if (typeof value === 'string') { 15129 if (isBinary(value)) { 15130 return ToNumber($parseInteger($strSlice(value, 2), 2)); 15131 } else if (isOctal(value)) { 15132 return ToNumber($parseInteger($strSlice(value, 2), 8)); 15133 } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { 15134 return NaN; 15135 } 15136 var trimmed = $trim(value); 15137 if (trimmed !== value) { 15138 return ToNumber(trimmed); 15139 } 15140 15141 } 15142 return $Number(value); 15143 }; 15144 15145 15146 /***/ }), 15147 15148 /***/ 1283: 15149 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15150 15151 "use strict"; 15152 15153 15154 var GetIntrinsic = __webpack_require__(4219); 15155 15156 var $Object = GetIntrinsic('%Object%'); 15157 15158 var RequireObjectCoercible = __webpack_require__(6953); 15159 15160 // https://ecma-international.org/ecma-262/6.0/#sec-toobject 15161 15162 module.exports = function ToObject(value) { 15163 RequireObjectCoercible(value); 15164 return $Object(value); 15165 }; 15166 15167 15168 /***/ }), 15169 15170 /***/ 6745: 15171 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15172 15173 "use strict"; 15174 15175 15176 var toPrimitive = __webpack_require__(5249); 15177 15178 // https://ecma-international.org/ecma-262/6.0/#sec-toprimitive 15179 15180 module.exports = function ToPrimitive(input) { 15181 if (arguments.length > 1) { 15182 return toPrimitive(input, arguments[1]); 15183 } 15184 return toPrimitive(input); 15185 }; 15186 15187 15188 /***/ }), 15189 15190 /***/ 2402: 15191 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15192 15193 "use strict"; 15194 15195 15196 var has = __webpack_require__(9284); 15197 15198 var GetIntrinsic = __webpack_require__(4219); 15199 15200 var $TypeError = GetIntrinsic('%TypeError%'); 15201 15202 var Type = __webpack_require__(9747); 15203 var ToBoolean = __webpack_require__(3704); 15204 var IsCallable = __webpack_require__(1089); 15205 15206 // https://262.ecma-international.org/5.1/#sec-8.10.5 15207 15208 module.exports = function ToPropertyDescriptor(Obj) { 15209 if (Type(Obj) !== 'Object') { 15210 throw new $TypeError('ToPropertyDescriptor requires an object'); 15211 } 15212 15213 var desc = {}; 15214 if (has(Obj, 'enumerable')) { 15215 desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); 15216 } 15217 if (has(Obj, 'configurable')) { 15218 desc['[[Configurable]]'] = ToBoolean(Obj.configurable); 15219 } 15220 if (has(Obj, 'value')) { 15221 desc['[[Value]]'] = Obj.value; 15222 } 15223 if (has(Obj, 'writable')) { 15224 desc['[[Writable]]'] = ToBoolean(Obj.writable); 15225 } 15226 if (has(Obj, 'get')) { 15227 var getter = Obj.get; 15228 if (typeof getter !== 'undefined' && !IsCallable(getter)) { 15229 throw new $TypeError('getter must be a function'); 15230 } 15231 desc['[[Get]]'] = getter; 15232 } 15233 if (has(Obj, 'set')) { 15234 var setter = Obj.set; 15235 if (typeof setter !== 'undefined' && !IsCallable(setter)) { 15236 throw new $TypeError('setter must be a function'); 15237 } 15238 desc['[[Set]]'] = setter; 15239 } 15240 15241 if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { 15242 throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); 15243 } 15244 return desc; 15245 }; 15246 15247 15248 /***/ }), 15249 15250 /***/ 6888: 15251 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15252 15253 "use strict"; 15254 15255 15256 var GetIntrinsic = __webpack_require__(4219); 15257 15258 var $String = GetIntrinsic('%String%'); 15259 var $TypeError = GetIntrinsic('%TypeError%'); 15260 15261 // https://ecma-international.org/ecma-262/6.0/#sec-tostring 15262 15263 module.exports = function ToString(argument) { 15264 if (typeof argument === 'symbol') { 15265 throw new $TypeError('Cannot convert a Symbol value to a string'); 15266 } 15267 return $String(argument); 15268 }; 15269 15270 15271 /***/ }), 15272 15273 /***/ 9747: 15274 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15275 15276 "use strict"; 15277 15278 15279 var ES5Type = __webpack_require__(290); 15280 15281 // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values 15282 15283 module.exports = function Type(x) { 15284 if (typeof x === 'symbol') { 15285 return 'Symbol'; 15286 } 15287 if (typeof x === 'bigint') { 15288 return 'BigInt'; 15289 } 15290 return ES5Type(x); 15291 }; 15292 15293 15294 /***/ }), 15295 15296 /***/ 13: 15297 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15298 15299 "use strict"; 15300 15301 15302 var GetIntrinsic = __webpack_require__(4219); 15303 15304 var $abs = GetIntrinsic('%Math.abs%'); 15305 15306 // http://262.ecma-international.org/5.1/#sec-5.2 15307 15308 module.exports = function abs(x) { 15309 return $abs(x); 15310 }; 15311 15312 15313 /***/ }), 15314 15315 /***/ 5127: 15316 /***/ (function(module) { 15317 15318 "use strict"; 15319 15320 15321 // var modulo = require('./modulo'); 15322 var $floor = Math.floor; 15323 15324 // http://262.ecma-international.org/5.1/#sec-5.2 15325 15326 module.exports = function floor(x) { 15327 // return x - modulo(x, 1); 15328 return $floor(x); 15329 }; 15330 15331 15332 /***/ }), 15333 15334 /***/ 3031: 15335 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15336 15337 "use strict"; 15338 15339 15340 var GetIntrinsic = __webpack_require__(4219); 15341 15342 var $TypeError = GetIntrinsic('%TypeError%'); 15343 15344 // http://262.ecma-international.org/5.1/#sec-9.10 15345 15346 module.exports = function CheckObjectCoercible(value, optMessage) { 15347 if (value == null) { 15348 throw new $TypeError(optMessage || ('Cannot call method on ' + value)); 15349 } 15350 return value; 15351 }; 15352 15353 15354 /***/ }), 15355 15356 /***/ 290: 15357 /***/ (function(module) { 15358 15359 "use strict"; 15360 15361 15362 // https://262.ecma-international.org/5.1/#sec-8 15363 15364 module.exports = function Type(x) { 15365 if (x === null) { 15366 return 'Null'; 15367 } 15368 if (typeof x === 'undefined') { 15369 return 'Undefined'; 15370 } 15371 if (typeof x === 'function' || typeof x === 'object') { 15372 return 'Object'; 15373 } 15374 if (typeof x === 'number') { 15375 return 'Number'; 15376 } 15377 if (typeof x === 'boolean') { 15378 return 'Boolean'; 15379 } 15380 if (typeof x === 'string') { 15381 return 'String'; 15382 } 15383 }; 15384 15385 15386 /***/ }), 15387 15388 /***/ 137: 15389 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15390 15391 "use strict"; 15392 15393 15394 // TODO: remove, semver-major 15395 15396 module.exports = __webpack_require__(4219); 15397 15398 15399 /***/ }), 15400 15401 /***/ 1327: 15402 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15403 15404 "use strict"; 15405 15406 15407 var GetIntrinsic = __webpack_require__(4219); 15408 15409 var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); 15410 15411 if ($defineProperty) { 15412 try { 15413 $defineProperty({}, 'a', { value: 1 }); 15414 } catch (e) { 15415 // IE 8 has a broken defineProperty 15416 $defineProperty = null; 15417 } 15418 } 15419 15420 // node v0.6 has a bug where array lengths can be Set but not Defined 15421 var hasArrayLengthDefineBug; 15422 try { 15423 hasArrayLengthDefineBug = $defineProperty && $defineProperty([], 'length', { value: 1 }).length === 0; 15424 } catch (e) { 15425 // In Firefox 4-22, defining length on an array throws an exception. 15426 hasArrayLengthDefineBug = true; 15427 } 15428 15429 // eslint-disable-next-line global-require 15430 var isArray = hasArrayLengthDefineBug && __webpack_require__(7472); // this does not depend on any other AOs. 15431 15432 var callBound = __webpack_require__(9630); 15433 15434 var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 15435 15436 // eslint-disable-next-line max-params 15437 module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { 15438 if (!$defineProperty) { 15439 if (!IsDataDescriptor(desc)) { 15440 // ES3 does not support getters/setters 15441 return false; 15442 } 15443 if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { 15444 return false; 15445 } 15446 15447 // fallback for ES3 15448 if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { 15449 // a non-enumerable existing property 15450 return false; 15451 } 15452 15453 // property does not exist at all, or exists but is enumerable 15454 var V = desc['[[Value]]']; 15455 // eslint-disable-next-line no-param-reassign 15456 O[P] = V; // will use [[Define]] 15457 return SameValue(O[P], V); 15458 } 15459 if ( 15460 hasArrayLengthDefineBug 15461 && P === 'length' 15462 && '[[Value]]' in desc 15463 && isArray(O) 15464 && O.length !== desc['[[Value]]'] 15465 ) { 15466 // eslint-disable-next-line no-param-reassign 15467 O.length = desc['[[Value]]']; 15468 return O.length === desc['[[Value]]']; 15469 } 15470 15471 $defineProperty(O, P, FromPropertyDescriptor(desc)); 15472 return true; 15473 }; 15474 15475 15476 /***/ }), 15477 15478 /***/ 5114: 15479 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15480 15481 "use strict"; 15482 15483 15484 var GetIntrinsic = __webpack_require__(4219); 15485 15486 var $TypeError = GetIntrinsic('%TypeError%'); 15487 var $SyntaxError = GetIntrinsic('%SyntaxError%'); 15488 15489 var has = __webpack_require__(9284); 15490 15491 var predicates = { 15492 // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type 15493 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { 15494 if (Type(Desc) !== 'Object') { 15495 return false; 15496 } 15497 var allowed = { 15498 '[[Configurable]]': true, 15499 '[[Enumerable]]': true, 15500 '[[Get]]': true, 15501 '[[Set]]': true, 15502 '[[Value]]': true, 15503 '[[Writable]]': true 15504 }; 15505 15506 for (var key in Desc) { // eslint-disable-line 15507 if (has(Desc, key) && !allowed[key]) { 15508 return false; 15509 } 15510 } 15511 15512 var isData = has(Desc, '[[Value]]'); 15513 var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); 15514 if (isData && IsAccessor) { 15515 throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); 15516 } 15517 return true; 15518 } 15519 }; 15520 15521 module.exports = function assertRecord(Type, recordType, argumentName, value) { 15522 var predicate = predicates[recordType]; 15523 if (typeof predicate !== 'function') { 15524 throw new $SyntaxError('unknown record type: ' + recordType); 15525 } 15526 if (!predicate(Type, value)) { 15527 throw new $TypeError(argumentName + ' must be a ' + recordType); 15528 } 15529 }; 15530 15531 15532 /***/ }), 15533 15534 /***/ 5180: 15535 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15536 15537 "use strict"; 15538 15539 15540 var GetIntrinsic = __webpack_require__(4219); 15541 15542 var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); 15543 if ($gOPD) { 15544 try { 15545 $gOPD([], 'length'); 15546 } catch (e) { 15547 // IE 8 has a broken gOPD 15548 $gOPD = null; 15549 } 15550 } 15551 15552 module.exports = $gOPD; 15553 15554 15555 /***/ }), 15556 15557 /***/ 7061: 15558 /***/ (function(module) { 15559 15560 "use strict"; 15561 15562 15563 var $isNaN = Number.isNaN || function (a) { return a !== a; }; 15564 15565 module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; 15566 15567 15568 /***/ }), 15569 15570 /***/ 3234: 15571 /***/ (function(module) { 15572 15573 "use strict"; 15574 15575 15576 module.exports = Number.isNaN || function isNaN(a) { 15577 return a !== a; 15578 }; 15579 15580 15581 /***/ }), 15582 15583 /***/ 5019: 15584 /***/ (function(module) { 15585 15586 "use strict"; 15587 15588 15589 module.exports = function isPrimitive(value) { 15590 return value === null || (typeof value !== 'function' && typeof value !== 'object'); 15591 }; 15592 15593 15594 /***/ }), 15595 15596 /***/ 8682: 15597 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15598 15599 "use strict"; 15600 15601 15602 var GetIntrinsic = __webpack_require__(4219); 15603 15604 var has = __webpack_require__(9284); 15605 var $TypeError = GetIntrinsic('%TypeError%'); 15606 15607 module.exports = function IsPropertyDescriptor(ES, Desc) { 15608 if (ES.Type(Desc) !== 'Object') { 15609 return false; 15610 } 15611 var allowed = { 15612 '[[Configurable]]': true, 15613 '[[Enumerable]]': true, 15614 '[[Get]]': true, 15615 '[[Set]]': true, 15616 '[[Value]]': true, 15617 '[[Writable]]': true 15618 }; 15619 15620 for (var key in Desc) { // eslint-disable-line no-restricted-syntax 15621 if (has(Desc, key) && !allowed[key]) { 15622 return false; 15623 } 15624 } 15625 15626 if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { 15627 throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); 15628 } 15629 return true; 15630 }; 15631 15632 15633 /***/ }), 15634 15635 /***/ 8540: 15636 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15637 15638 "use strict"; 15639 15640 15641 var GetIntrinsic = __webpack_require__(4219); 15642 15643 var $Math = GetIntrinsic('%Math%'); 15644 var $Number = GetIntrinsic('%Number%'); 15645 15646 module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; 15647 15648 15649 /***/ }), 15650 15651 /***/ 8441: 15652 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 15653 15654 "use strict"; 15655 15656 15657 var callBound = __webpack_require__(9630); 15658 15659 var $exec = callBound('RegExp.prototype.exec'); 15660 15661 module.exports = function regexTester(regex) { 15662 return function test(s) { return $exec(regex, s) !== null; }; 15663 }; 15664 15665 15666 /***/ }), 15667 15668 /***/ 2163: 15669 /***/ (function(module) { 15670 15671 "use strict"; 15672 15673 15674 module.exports = function sign(number) { 15675 return number >= 0 ? 1 : -1; 15676 }; 15677 15678 15679 /***/ }) 15680 15681 /******/ }); 15682 /************************************************************************/ 15683 /******/ // The module cache 15684 /******/ var __webpack_module_cache__ = {}; 15685 /******/ 15686 /******/ // The require function 15687 /******/ function __webpack_require__(moduleId) { 15688 /******/ // Check if module is in cache 15689 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 15690 /******/ if (cachedModule !== undefined) { 15691 /******/ return cachedModule.exports; 15692 /******/ } 15693 /******/ // Create a new module (and put it into the cache) 15694 /******/ var module = __webpack_module_cache__[moduleId] = { 15695 /******/ // no module.id needed 15696 /******/ // no module.loaded needed 15697 /******/ exports: {} 15698 /******/ }; 15699 /******/ 15700 /******/ // Execute the module function 15701 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 15702 /******/ 15703 /******/ // Return the exports of the module 15704 /******/ return module.exports; 15705 /******/ } 15706 /******/ 15707 /************************************************************************/ 15708 /******/ /* webpack/runtime/compat get default export */ 15709 /******/ !function() { 15710 /******/ // getDefaultExport function for compatibility with non-harmony modules 15711 /******/ __webpack_require__.n = function(module) { 15712 /******/ var getter = module && module.__esModule ? 15713 /******/ function() { return module['default']; } : 15714 /******/ function() { return module; }; 15715 /******/ __webpack_require__.d(getter, { a: getter }); 15716 /******/ return getter; 15717 /******/ }; 15718 /******/ }(); 15719 /******/ 15720 /******/ /* webpack/runtime/define property getters */ 15721 /******/ !function() { 15722 /******/ // define getter functions for harmony exports 15723 /******/ __webpack_require__.d = function(exports, definition) { 15724 /******/ for(var key in definition) { 15725 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 15726 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 15727 /******/ } 15728 /******/ } 15729 /******/ }; 15730 /******/ }(); 15731 /******/ 15732 /******/ /* webpack/runtime/global */ 15733 /******/ !function() { 15734 /******/ __webpack_require__.g = (function() { 15735 /******/ if (typeof globalThis === 'object') return globalThis; 15736 /******/ try { 15737 /******/ return this || new Function('return this')(); 15738 /******/ } catch (e) { 15739 /******/ if (typeof window === 'object') return window; 15740 /******/ } 15741 /******/ })(); 15742 /******/ }(); 15743 /******/ 15744 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 15745 /******/ !function() { 15746 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 15747 /******/ }(); 15748 /******/ 15749 /******/ /* webpack/runtime/make namespace object */ 15750 /******/ !function() { 15751 /******/ // define __esModule on exports 15752 /******/ __webpack_require__.r = function(exports) { 15753 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 15754 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 15755 /******/ } 15756 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 15757 /******/ }; 15758 /******/ }(); 15759 /******/ 15760 /************************************************************************/ 15761 var __webpack_exports__ = {}; 15762 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 15763 !function() { 15764 "use strict"; 15765 // ESM COMPAT FLAG 15766 __webpack_require__.r(__webpack_exports__); 15767 15768 // EXPORTS 15769 __webpack_require__.d(__webpack_exports__, { 15770 "AnglePickerControl": function() { return /* reexport */ AnglePickerControl; }, 15771 "Animate": function() { return /* reexport */ Animate; }, 15772 "Autocomplete": function() { return /* reexport */ Autocomplete; }, 15773 "BaseControl": function() { return /* reexport */ base_control; }, 15774 "BlockQuotation": function() { return /* reexport */ external_wp_primitives_namespaceObject.BlockQuotation; }, 15775 "Button": function() { return /* reexport */ build_module_button; }, 15776 "ButtonGroup": function() { return /* reexport */ button_group; }, 15777 "Card": function() { return /* reexport */ card_component; }, 15778 "CardBody": function() { return /* reexport */ card_body_component; }, 15779 "CardDivider": function() { return /* reexport */ card_divider_component; }, 15780 "CardFooter": function() { return /* reexport */ card_footer_component; }, 15781 "CardHeader": function() { return /* reexport */ card_header_component; }, 15782 "CardMedia": function() { return /* reexport */ card_media_component; }, 15783 "CheckboxControl": function() { return /* reexport */ CheckboxControl; }, 15784 "Circle": function() { return /* reexport */ external_wp_primitives_namespaceObject.Circle; }, 15785 "ClipboardButton": function() { return /* reexport */ ClipboardButton; }, 15786 "ColorIndicator": function() { return /* reexport */ color_indicator; }, 15787 "ColorPalette": function() { return /* reexport */ ColorPalette; }, 15788 "ColorPicker": function() { return /* reexport */ LegacyAdapter; }, 15789 "ComboboxControl": function() { return /* reexport */ combobox_control; }, 15790 "CustomGradientPicker": function() { return /* reexport */ CustomGradientPicker; }, 15791 "CustomSelectControl": function() { return /* reexport */ CustomSelectControl; }, 15792 "Dashicon": function() { return /* reexport */ dashicon; }, 15793 "DatePicker": function() { return /* reexport */ date; }, 15794 "DateTimePicker": function() { return /* reexport */ date_time; }, 15795 "Disabled": function() { return /* reexport */ disabled; }, 15796 "Draggable": function() { return /* reexport */ Draggable; }, 15797 "DropZone": function() { return /* reexport */ DropZoneComponent; }, 15798 "DropZoneProvider": function() { return /* reexport */ DropZoneProvider; }, 15799 "Dropdown": function() { return /* reexport */ Dropdown; }, 15800 "DropdownMenu": function() { return /* reexport */ dropdown_menu; }, 15801 "DuotonePicker": function() { return /* reexport */ duotone_picker; }, 15802 "DuotoneSwatch": function() { return /* reexport */ duotone_swatch; }, 15803 "ExternalLink": function() { return /* reexport */ external_link; }, 15804 "Fill": function() { return /* reexport */ slot_fill_Fill; }, 15805 "Flex": function() { return /* reexport */ flex_component; }, 15806 "FlexBlock": function() { return /* reexport */ flex_block_component; }, 15807 "FlexItem": function() { return /* reexport */ flex_item_component; }, 15808 "FocalPointPicker": function() { return /* reexport */ focal_point_picker; }, 15809 "FocusReturnProvider": function() { return /* reexport */ with_focus_return_Provider; }, 15810 "FocusableIframe": function() { return /* reexport */ FocusableIframe; }, 15811 "FontSizePicker": function() { return /* reexport */ font_size_picker; }, 15812 "FormFileUpload": function() { return /* reexport */ form_file_upload; }, 15813 "FormToggle": function() { return /* reexport */ form_toggle; }, 15814 "FormTokenField": function() { return /* reexport */ form_token_field; }, 15815 "G": function() { return /* reexport */ external_wp_primitives_namespaceObject.G; }, 15816 "GradientPicker": function() { return /* reexport */ GradientPicker; }, 15817 "Guide": function() { return /* reexport */ Guide; }, 15818 "GuidePage": function() { return /* reexport */ GuidePage; }, 15819 "HorizontalRule": function() { return /* reexport */ external_wp_primitives_namespaceObject.HorizontalRule; }, 15820 "Icon": function() { return /* reexport */ build_module_icon; }, 15821 "IconButton": function() { return /* reexport */ deprecated; }, 15822 "IsolatedEventContainer": function() { return /* reexport */ isolated_event_container; }, 15823 "KeyboardShortcuts": function() { return /* reexport */ keyboard_shortcuts; }, 15824 "MenuGroup": function() { return /* reexport */ menu_group; }, 15825 "MenuItem": function() { return /* reexport */ menu_item; }, 15826 "MenuItemsChoice": function() { return /* reexport */ MenuItemsChoice; }, 15827 "Modal": function() { return /* reexport */ modal; }, 15828 "NavigableMenu": function() { return /* reexport */ navigable_container_menu; }, 15829 "Notice": function() { return /* reexport */ build_module_notice; }, 15830 "NoticeList": function() { return /* reexport */ list; }, 15831 "Panel": function() { return /* reexport */ panel; }, 15832 "PanelBody": function() { return /* reexport */ body; }, 15833 "PanelHeader": function() { return /* reexport */ panel_header; }, 15834 "PanelRow": function() { return /* reexport */ row; }, 15835 "Path": function() { return /* reexport */ external_wp_primitives_namespaceObject.Path; }, 15836 "Placeholder": function() { return /* reexport */ placeholder; }, 15837 "Polygon": function() { return /* reexport */ external_wp_primitives_namespaceObject.Polygon; }, 15838 "Popover": function() { return /* reexport */ popover; }, 15839 "QueryControls": function() { return /* reexport */ QueryControls; }, 15840 "RadioControl": function() { return /* reexport */ RadioControl; }, 15841 "RangeControl": function() { return /* reexport */ range_control; }, 15842 "Rect": function() { return /* reexport */ external_wp_primitives_namespaceObject.Rect; }, 15843 "ResizableBox": function() { return /* reexport */ resizable_box; }, 15844 "ResponsiveWrapper": function() { return /* reexport */ responsive_wrapper; }, 15845 "SVG": function() { return /* reexport */ external_wp_primitives_namespaceObject.SVG; }, 15846 "SandBox": function() { return /* reexport */ Sandbox; }, 15847 "ScrollLock": function() { return /* reexport */ ScrollLock; }, 15848 "SearchControl": function() { return /* reexport */ search_control; }, 15849 "SelectControl": function() { return /* reexport */ select_control; }, 15850 "Slot": function() { return /* reexport */ slot_fill_Slot; }, 15851 "SlotFillProvider": function() { return /* reexport */ Provider; }, 15852 "Snackbar": function() { return /* reexport */ snackbar; }, 15853 "SnackbarList": function() { return /* reexport */ snackbar_list; }, 15854 "Spinner": function() { return /* reexport */ Spinner; }, 15855 "TabPanel": function() { return /* reexport */ TabPanel; }, 15856 "TabbableContainer": function() { return /* reexport */ tabbable; }, 15857 "TextControl": function() { return /* reexport */ text_control; }, 15858 "TextHighlight": function() { return /* reexport */ text_highlight; }, 15859 "TextareaControl": function() { return /* reexport */ TextareaControl; }, 15860 "TimePicker": function() { return /* reexport */ time; }, 15861 "Tip": function() { return /* reexport */ build_module_tip; }, 15862 "ToggleControl": function() { return /* reexport */ ToggleControl; }, 15863 "Toolbar": function() { return /* reexport */ toolbar; }, 15864 "ToolbarButton": function() { return /* reexport */ toolbar_button; }, 15865 "ToolbarDropdownMenu": function() { return /* reexport */ toolbar_dropdown_menu; }, 15866 "ToolbarGroup": function() { return /* reexport */ toolbar_group; }, 15867 "ToolbarItem": function() { return /* reexport */ toolbar_item; }, 15868 "Tooltip": function() { return /* reexport */ tooltip; }, 15869 "TreeSelect": function() { return /* reexport */ TreeSelect; }, 15870 "VisuallyHidden": function() { return /* reexport */ visually_hidden_component; }, 15871 "__experimentalAlignmentMatrixControl": function() { return /* reexport */ AlignmentMatrixControl; }, 15872 "__experimentalBorderBoxControl": function() { return /* reexport */ border_box_control_component; }, 15873 "__experimentalBorderControl": function() { return /* reexport */ border_control_component; }, 15874 "__experimentalBoxControl": function() { return /* reexport */ BoxControl; }, 15875 "__experimentalConfirmDialog": function() { return /* reexport */ confirm_dialog_component; }, 15876 "__experimentalDimensionControl": function() { return /* reexport */ dimension_control; }, 15877 "__experimentalDivider": function() { return /* reexport */ divider_component; }, 15878 "__experimentalElevation": function() { return /* reexport */ elevation_component; }, 15879 "__experimentalFlyout": function() { return /* reexport */ flyout_component; }, 15880 "__experimentalGrid": function() { return /* reexport */ grid_component; }, 15881 "__experimentalHStack": function() { return /* reexport */ h_stack_component; }, 15882 "__experimentalHasSplitBorders": function() { return /* reexport */ hasSplitBorders; }, 15883 "__experimentalHeading": function() { return /* reexport */ heading_component; }, 15884 "__experimentalInputControl": function() { return /* reexport */ input_control; }, 15885 "__experimentalIsDefinedBorder": function() { return /* reexport */ isDefinedBorder; }, 15886 "__experimentalIsEmptyBorder": function() { return /* reexport */ isEmptyBorder; }, 15887 "__experimentalItem": function() { return /* reexport */ item_component; }, 15888 "__experimentalItemGroup": function() { return /* reexport */ item_group_component; }, 15889 "__experimentalNavigation": function() { return /* reexport */ Navigation; }, 15890 "__experimentalNavigationBackButton": function() { return /* reexport */ back_button; }, 15891 "__experimentalNavigationGroup": function() { return /* reexport */ NavigationGroup; }, 15892 "__experimentalNavigationItem": function() { return /* reexport */ NavigationItem; }, 15893 "__experimentalNavigationMenu": function() { return /* reexport */ NavigationMenu; }, 15894 "__experimentalNavigatorBackButton": function() { return /* reexport */ navigator_back_button_component; }, 15895 "__experimentalNavigatorButton": function() { return /* reexport */ navigator_button_component; }, 15896 "__experimentalNavigatorProvider": function() { return /* reexport */ navigator_provider_component; }, 15897 "__experimentalNavigatorScreen": function() { return /* reexport */ navigator_screen_component; }, 15898 "__experimentalNumberControl": function() { return /* reexport */ number_control; }, 15899 "__experimentalPaletteEdit": function() { return /* reexport */ PaletteEdit; }, 15900 "__experimentalParseQuantityAndUnitFromRawValue": function() { return /* reexport */ parseQuantityAndUnitFromRawValue; }, 15901 "__experimentalRadio": function() { return /* reexport */ build_module_radio; }, 15902 "__experimentalRadioGroup": function() { return /* reexport */ radio_group; }, 15903 "__experimentalScrollable": function() { return /* reexport */ scrollable_component; }, 15904 "__experimentalSpacer": function() { return /* reexport */ spacer_component; }, 15905 "__experimentalStyleProvider": function() { return /* reexport */ StyleProvider; }, 15906 "__experimentalSurface": function() { return /* reexport */ surface_component; }, 15907 "__experimentalText": function() { return /* reexport */ text_component; }, 15908 "__experimentalToggleGroupControl": function() { return /* reexport */ toggle_group_control_component; }, 15909 "__experimentalToggleGroupControlOption": function() { return /* reexport */ ToggleGroupControlOption; }, 15910 "__experimentalToggleGroupControlOptionIcon": function() { return /* reexport */ ToggleGroupControlOptionIcon; }, 15911 "__experimentalToolbarContext": function() { return /* reexport */ toolbar_context; }, 15912 "__experimentalToolsPanel": function() { return /* reexport */ tools_panel_component; }, 15913 "__experimentalToolsPanelContext": function() { return /* reexport */ ToolsPanelContext; }, 15914 "__experimentalToolsPanelItem": function() { return /* reexport */ tools_panel_item_component; }, 15915 "__experimentalTreeGrid": function() { return /* reexport */ tree_grid; }, 15916 "__experimentalTreeGridCell": function() { return /* reexport */ cell; }, 15917 "__experimentalTreeGridItem": function() { return /* reexport */ tree_grid_item; }, 15918 "__experimentalTreeGridRow": function() { return /* reexport */ tree_grid_row; }, 15919 "__experimentalTruncate": function() { return /* reexport */ truncate_component; }, 15920 "__experimentalUnitControl": function() { return /* reexport */ unit_control; }, 15921 "__experimentalUseCustomUnits": function() { return /* reexport */ useCustomUnits; }, 15922 "__experimentalUseNavigator": function() { return /* reexport */ use_navigator; }, 15923 "__experimentalUseSlot": function() { return /* reexport */ use_slot_useSlot; }, 15924 "__experimentalVStack": function() { return /* reexport */ v_stack_component; }, 15925 "__experimentalView": function() { return /* reexport */ component; }, 15926 "__experimentalZStack": function() { return /* reexport */ z_stack_component; }, 15927 "__unstableComposite": function() { return /* reexport */ Composite; }, 15928 "__unstableCompositeGroup": function() { return /* reexport */ CompositeGroup; }, 15929 "__unstableCompositeItem": function() { return /* reexport */ CompositeItem; }, 15930 "__unstableDisclosureContent": function() { return /* reexport */ DisclosureContent; }, 15931 "__unstableGetAnimateClassName": function() { return /* reexport */ getAnimateClassName; }, 15932 "__unstableMotion": function() { return /* reexport */ motion; }, 15933 "__unstableUseAutocompleteProps": function() { return /* reexport */ useAutocompleteProps; }, 15934 "__unstableUseCompositeState": function() { return /* reexport */ useCompositeState; }, 15935 "__unstableUseNavigateRegions": function() { return /* reexport */ useNavigateRegions; }, 15936 "createSlotFill": function() { return /* reexport */ createSlotFill; }, 15937 "navigateRegions": function() { return /* reexport */ navigate_regions; }, 15938 "withConstrainedTabbing": function() { return /* reexport */ with_constrained_tabbing; }, 15939 "withFallbackStyles": function() { return /* reexport */ with_fallback_styles; }, 15940 "withFilters": function() { return /* reexport */ withFilters; }, 15941 "withFocusOutside": function() { return /* reexport */ with_focus_outside; }, 15942 "withFocusReturn": function() { return /* reexport */ with_focus_return; }, 15943 "withNotices": function() { return /* reexport */ with_notices; }, 15944 "withSpokenMessages": function() { return /* reexport */ with_spoken_messages; } 15945 }); 15946 15947 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js 15948 var text_styles_namespaceObject = {}; 15949 __webpack_require__.r(text_styles_namespaceObject); 15950 __webpack_require__.d(text_styles_namespaceObject, { 15951 "Text": function() { return Text; }, 15952 "block": function() { return styles_block; }, 15953 "destructive": function() { return destructive; }, 15954 "highlighterText": function() { return highlighterText; }, 15955 "muted": function() { return muted; }, 15956 "positive": function() { return positive; }, 15957 "upperCase": function() { return upperCase; } 15958 }); 15959 15960 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/ui/tooltip/styles.js 15961 var tooltip_styles_namespaceObject = {}; 15962 __webpack_require__.r(tooltip_styles_namespaceObject); 15963 __webpack_require__.d(tooltip_styles_namespaceObject, { 15964 "TooltipContent": function() { return TooltipContent; }, 15965 "TooltipPopoverView": function() { return TooltipPopoverView; }, 15966 "TooltipShortcut": function() { return TooltipShortcut; }, 15967 "noOutline": function() { return noOutline; } 15968 }); 15969 15970 // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js 15971 var toggle_group_control_option_base_styles_namespaceObject = {}; 15972 __webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject); 15973 __webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, { 15974 "ButtonContentView": function() { return ButtonContentView; }, 15975 "LabelView": function() { return LabelView; }, 15976 "buttonActive": function() { return buttonActive; }, 15977 "buttonView": function() { return buttonView; }, 15978 "labelBlock": function() { return labelBlock; }, 15979 "medium": function() { return medium; }, 15980 "separatorActive": function() { return separatorActive; } 15981 }); 15982 15983 ;// CONCATENATED MODULE: external ["wp","primitives"] 15984 var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 15985 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 15986 function extends_extends() { 15987 extends_extends = Object.assign || function (target) { 15988 for (var i = 1; i < arguments.length; i++) { 15989 var source = arguments[i]; 15990 15991 for (var key in source) { 15992 if (Object.prototype.hasOwnProperty.call(source, key)) { 15993 target[key] = source[key]; 15994 } 15995 } 15996 } 15997 15998 return target; 15999 }; 16000 16001 return extends_extends.apply(this, arguments); 16002 } 16003 ;// CONCATENATED MODULE: external ["wp","element"] 16004 var external_wp_element_namespaceObject = window["wp"]["element"]; 16005 ;// CONCATENATED MODULE: external "lodash" 16006 var external_lodash_namespaceObject = window["lodash"]; 16007 // EXTERNAL MODULE: ./node_modules/classnames/index.js 16008 var classnames = __webpack_require__(4403); 16009 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 16010 ;// CONCATENATED MODULE: external ["wp","i18n"] 16011 var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 16012 ;// CONCATENATED MODULE: external ["wp","compose"] 16013 var external_wp_compose_namespaceObject = window["wp"]["compose"]; 16014 ;// CONCATENATED MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js 16015 function _defineProperty(obj, key, value) { 16016 if (key in obj) { 16017 Object.defineProperty(obj, key, { 16018 value: value, 16019 enumerable: true, 16020 configurable: true, 16021 writable: true 16022 }); 16023 } else { 16024 obj[key] = value; 16025 } 16026 16027 return obj; 16028 } 16029 16030 function ownKeys(object, enumerableOnly) { 16031 var keys = Object.keys(object); 16032 16033 if (Object.getOwnPropertySymbols) { 16034 var symbols = Object.getOwnPropertySymbols(object); 16035 if (enumerableOnly) symbols = symbols.filter(function (sym) { 16036 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16037 }); 16038 keys.push.apply(keys, symbols); 16039 } 16040 16041 return keys; 16042 } 16043 16044 function _objectSpread2(target) { 16045 for (var i = 1; i < arguments.length; i++) { 16046 var source = arguments[i] != null ? arguments[i] : {}; 16047 16048 if (i % 2) { 16049 ownKeys(Object(source), true).forEach(function (key) { 16050 _defineProperty(target, key, source[key]); 16051 }); 16052 } else if (Object.getOwnPropertyDescriptors) { 16053 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 16054 } else { 16055 ownKeys(Object(source)).forEach(function (key) { 16056 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16057 }); 16058 } 16059 } 16060 16061 return target; 16062 } 16063 16064 function _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(source, excluded) { 16065 if (source == null) return {}; 16066 var target = {}; 16067 var sourceKeys = Object.keys(source); 16068 var key, i; 16069 16070 for (i = 0; i < sourceKeys.length; i++) { 16071 key = sourceKeys[i]; 16072 if (excluded.indexOf(key) >= 0) continue; 16073 target[key] = source[key]; 16074 } 16075 16076 return target; 16077 } 16078 16079 function _unsupportedIterableToArray(o, minLen) { 16080 if (!o) return; 16081 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 16082 var n = Object.prototype.toString.call(o).slice(8, -1); 16083 if (n === "Object" && o.constructor) n = o.constructor.name; 16084 if (n === "Map" || n === "Set") return Array.from(o); 16085 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 16086 } 16087 16088 function _arrayLikeToArray(arr, len) { 16089 if (len == null || len > arr.length) len = arr.length; 16090 16091 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 16092 16093 return arr2; 16094 } 16095 16096 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 16097 var it; 16098 16099 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 16100 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 16101 if (it) o = it; 16102 var i = 0; 16103 return function () { 16104 if (i >= o.length) return { 16105 done: true 16106 }; 16107 return { 16108 done: false, 16109 value: o[i++] 16110 }; 16111 }; 16112 } 16113 16114 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 16115 } 16116 16117 it = o[Symbol.iterator](); 16118 return it.next.bind(it); 16119 } 16120 16121 16122 16123 // EXTERNAL MODULE: external "React" 16124 var external_React_ = __webpack_require__(9196); 16125 var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); 16126 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js 16127 function _rollupPluginBabelHelpers_0c84a174_defineProperty(obj, key, value) { 16128 if (key in obj) { 16129 Object.defineProperty(obj, key, { 16130 value: value, 16131 enumerable: true, 16132 configurable: true, 16133 writable: true 16134 }); 16135 } else { 16136 obj[key] = value; 16137 } 16138 16139 return obj; 16140 } 16141 16142 function _rollupPluginBabelHelpers_0c84a174_ownKeys(object, enumerableOnly) { 16143 var keys = Object.keys(object); 16144 16145 if (Object.getOwnPropertySymbols) { 16146 var symbols = Object.getOwnPropertySymbols(object); 16147 if (enumerableOnly) symbols = symbols.filter(function (sym) { 16148 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16149 }); 16150 keys.push.apply(keys, symbols); 16151 } 16152 16153 return keys; 16154 } 16155 16156 function _rollupPluginBabelHelpers_0c84a174_objectSpread2(target) { 16157 for (var i = 1; i < arguments.length; i++) { 16158 var source = arguments[i] != null ? arguments[i] : {}; 16159 16160 if (i % 2) { 16161 _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source), true).forEach(function (key) { 16162 _rollupPluginBabelHelpers_0c84a174_defineProperty(target, key, source[key]); 16163 }); 16164 } else if (Object.getOwnPropertyDescriptors) { 16165 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 16166 } else { 16167 _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source)).forEach(function (key) { 16168 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16169 }); 16170 } 16171 } 16172 16173 return target; 16174 } 16175 16176 function _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(source, excluded) { 16177 if (source == null) return {}; 16178 var target = {}; 16179 var sourceKeys = Object.keys(source); 16180 var key, i; 16181 16182 for (i = 0; i < sourceKeys.length; i++) { 16183 key = sourceKeys[i]; 16184 if (excluded.indexOf(key) >= 0) continue; 16185 target[key] = source[key]; 16186 } 16187 16188 return target; 16189 } 16190 16191 function _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o, minLen) { 16192 if (!o) return; 16193 if (typeof o === "string") return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen); 16194 var n = Object.prototype.toString.call(o).slice(8, -1); 16195 if (n === "Object" && o.constructor) n = o.constructor.name; 16196 if (n === "Map" || n === "Set") return Array.from(o); 16197 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen); 16198 } 16199 16200 function _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(arr, len) { 16201 if (len == null || len > arr.length) len = arr.length; 16202 16203 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 16204 16205 return arr2; 16206 } 16207 16208 function _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(o, allowArrayLike) { 16209 var it; 16210 16211 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 16212 if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 16213 if (it) o = it; 16214 var i = 0; 16215 return function () { 16216 if (i >= o.length) return { 16217 done: true 16218 }; 16219 return { 16220 done: false, 16221 value: o[i++] 16222 }; 16223 }; 16224 } 16225 16226 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 16227 } 16228 16229 it = o[Symbol.iterator](); 16230 return it.next.bind(it); 16231 } 16232 16233 16234 16235 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/SystemContext.js 16236 16237 16238 var SystemContext = /*#__PURE__*/(0,external_React_.createContext)({}); 16239 16240 16241 16242 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useCreateElement.js 16243 16244 16245 16246 16247 function isRenderProp(children) { 16248 return typeof children === "function"; 16249 } 16250 16251 /** 16252 * Custom hook that will call `children` if it's a function. If 16253 * `useCreateElement` has been passed to the context, it'll be used instead. 16254 * 16255 * @example 16256 * import React from "react"; 16257 * import { SystemProvider, useCreateElement } from "reakit-system"; 16258 * 16259 * const system = { 16260 * useCreateElement(type, props, children = props.children) { 16261 * // very similar to what `useCreateElement` does already 16262 * if (typeof children === "function") { 16263 * const { children: _, ...rest } = props; 16264 * return children(rest); 16265 * } 16266 * return React.createElement(type, props, children); 16267 * }, 16268 * }; 16269 * 16270 * function Component(props) { 16271 * return useCreateElement("div", props); 16272 * } 16273 * 16274 * function App() { 16275 * return ( 16276 * <SystemProvider unstable_system={system}> 16277 * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component> 16278 * </SystemProvider> 16279 * ); 16280 * } 16281 */ 16282 16283 var useCreateElement = function useCreateElement(type, props, children) { 16284 if (children === void 0) { 16285 children = props.children; 16286 } 16287 16288 var context = (0,external_React_.useContext)(SystemContext); 16289 16290 if (context.useCreateElement) { 16291 return context.useCreateElement(type, props, children); 16292 } 16293 16294 if (typeof type === "string" && isRenderProp(children)) { 16295 var _ = props.children, 16296 rest = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(props, ["children"]); 16297 16298 return children(rest); 16299 } 16300 16301 return /*#__PURE__*/(0,external_React_.createElement)(type, props, children); 16302 }; 16303 16304 16305 16306 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js 16307 function _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(obj, key, value) { 16308 if (key in obj) { 16309 Object.defineProperty(obj, key, { 16310 value: value, 16311 enumerable: true, 16312 configurable: true, 16313 writable: true 16314 }); 16315 } else { 16316 obj[key] = value; 16317 } 16318 16319 return obj; 16320 } 16321 16322 function _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(object, enumerableOnly) { 16323 var keys = Object.keys(object); 16324 16325 if (Object.getOwnPropertySymbols) { 16326 var symbols = Object.getOwnPropertySymbols(object); 16327 if (enumerableOnly) symbols = symbols.filter(function (sym) { 16328 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16329 }); 16330 keys.push.apply(keys, symbols); 16331 } 16332 16333 return keys; 16334 } 16335 16336 function _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(target) { 16337 for (var i = 1; i < arguments.length; i++) { 16338 var source = arguments[i] != null ? arguments[i] : {}; 16339 16340 if (i % 2) { 16341 _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source), true).forEach(function (key) { 16342 _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(target, key, source[key]); 16343 }); 16344 } else if (Object.getOwnPropertyDescriptors) { 16345 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 16346 } else { 16347 _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source)).forEach(function (key) { 16348 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16349 }); 16350 } 16351 } 16352 16353 return target; 16354 } 16355 16356 function es_rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(source, excluded) { 16357 if (source == null) return {}; 16358 var target = {}; 16359 var sourceKeys = Object.keys(source); 16360 var key, i; 16361 16362 for (i = 0; i < sourceKeys.length; i++) { 16363 key = sourceKeys[i]; 16364 if (excluded.indexOf(key) >= 0) continue; 16365 target[key] = source[key]; 16366 } 16367 16368 return target; 16369 } 16370 16371 function _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o, minLen) { 16372 if (!o) return; 16373 if (typeof o === "string") return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen); 16374 var n = Object.prototype.toString.call(o).slice(8, -1); 16375 if (n === "Object" && o.constructor) n = o.constructor.name; 16376 if (n === "Map" || n === "Set") return Array.from(o); 16377 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen); 16378 } 16379 16380 function _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(arr, len) { 16381 if (len == null || len > arr.length) len = arr.length; 16382 16383 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 16384 16385 return arr2; 16386 } 16387 16388 function _rollupPluginBabelHelpers_1f0bf8c2_createForOfIteratorHelperLoose(o, allowArrayLike) { 16389 var it; 16390 16391 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 16392 if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 16393 if (it) o = it; 16394 var i = 0; 16395 return function () { 16396 if (i >= o.length) return { 16397 done: true 16398 }; 16399 return { 16400 done: false, 16401 value: o[i++] 16402 }; 16403 }; 16404 } 16405 16406 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 16407 } 16408 16409 it = o[Symbol.iterator](); 16410 return it.next.bind(it); 16411 } 16412 16413 16414 16415 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isObject.js 16416 /** 16417 * Checks whether `arg` is an object or not. 16418 * 16419 * @returns {boolean} 16420 */ 16421 function isObject_isObject(arg) { 16422 return typeof arg === "object" && arg != null; 16423 } 16424 16425 16426 16427 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js 16428 16429 16430 /** 16431 * Checks whether `arg` is a plain object or not. 16432 * 16433 * @returns {boolean} 16434 */ 16435 16436 function isPlainObject(arg) { 16437 var _proto$constructor; 16438 16439 if (!isObject_isObject(arg)) return false; 16440 var proto = Object.getPrototypeOf(arg); 16441 if (proto == null) return true; 16442 return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString(); 16443 } 16444 16445 16446 16447 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js 16448 16449 16450 16451 16452 /** 16453 * Splits an object (`props`) into a tuple where the first item is an object 16454 * with the passed `keys`, and the second item is an object with these keys 16455 * omitted. 16456 * 16457 * @deprecated will be removed in version 2 16458 * 16459 * @example 16460 * import { splitProps } from "reakit-utils"; 16461 * 16462 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 16463 */ 16464 16465 function __deprecatedSplitProps(props, keys) { 16466 var propsKeys = Object.keys(props); 16467 var picked = {}; 16468 var omitted = {}; 16469 16470 for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) { 16471 var key = _propsKeys[_i]; 16472 16473 if (keys.indexOf(key) >= 0) { 16474 picked[key] = props[key]; 16475 } else { 16476 omitted[key] = props[key]; 16477 } 16478 } 16479 16480 return [picked, omitted]; 16481 } 16482 /** 16483 * Splits an object (`props`) into a tuple where the first item 16484 * is the `state` property, and the second item is the rest of the properties. 16485 * 16486 * It is also backward compatible with version 1. If `keys` are passed then 16487 * splits an object (`props`) into a tuple where the first item is an object 16488 * with the passed `keys`, and the second item is an object with these keys 16489 * omitted. 16490 * 16491 * @example 16492 * import { splitProps } from "reakit-utils"; 16493 * 16494 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 16495 * 16496 * @example 16497 * import { splitProps } from "reakit-utils"; 16498 * 16499 * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }] 16500 */ 16501 16502 16503 function splitProps(props, keys) { 16504 if (keys === void 0) { 16505 keys = []; 16506 } 16507 16508 if (!isPlainObject(props.state)) { 16509 return __deprecatedSplitProps(props, keys); 16510 } 16511 16512 var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])), 16513 picked = _deprecatedSplitProp[0], 16514 omitted = _deprecatedSplitProp[1]; 16515 16516 var state = picked.state, 16517 restPicked = es_rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(picked, ["state"]); 16518 16519 return [_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, state), restPicked), omitted]; 16520 } 16521 16522 16523 16524 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/shallowEqual.js 16525 /** 16526 * Compares two objects. 16527 * 16528 * @example 16529 * import { shallowEqual } from "reakit-utils"; 16530 * 16531 * shallowEqual({ a: "a" }, {}); // false 16532 * shallowEqual({ a: "a" }, { b: "b" }); // false 16533 * shallowEqual({ a: "a" }, { a: "a" }); // true 16534 * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false 16535 */ 16536 function shallowEqual(objA, objB) { 16537 if (objA === objB) return true; 16538 if (!objA) return false; 16539 if (!objB) return false; 16540 if (typeof objA !== "object") return false; 16541 if (typeof objB !== "object") return false; 16542 var aKeys = Object.keys(objA); 16543 var bKeys = Object.keys(objB); 16544 var length = aKeys.length; 16545 if (bKeys.length !== length) return false; 16546 16547 for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) { 16548 var key = _aKeys[_i]; 16549 16550 if (objA[key] !== objB[key]) { 16551 return false; 16552 } 16553 } 16554 16555 return true; 16556 } 16557 16558 16559 16560 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js 16561 16562 16563 16564 16565 /** 16566 * This higher order functions take `propsAreEqual` function and 16567 * returns a new function which normalizes the props. 16568 * 16569 * Normalizing in our case is making sure the `propsAreEqual` works with 16570 * both version 1 (object spreading) and version 2 (state object) state passing. 16571 * 16572 * To achieve this, the returned function in case of a state object 16573 * will spread the state object in both `prev` and `next props. 16574 * 16575 * Other case it just returns the function as is which makes sure 16576 * that we are still backward compatible 16577 */ 16578 function normalizePropsAreEqual(propsAreEqual) { 16579 if (propsAreEqual.name === "normalizePropsAreEqualInner") { 16580 return propsAreEqual; 16581 } 16582 16583 return function normalizePropsAreEqualInner(prev, next) { 16584 if (!isPlainObject(prev.state) || !isPlainObject(next.state)) { 16585 return propsAreEqual(prev, next); 16586 } 16587 16588 return propsAreEqual(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, prev.state), prev), _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, next.state), next)); 16589 }; 16590 } 16591 16592 16593 16594 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js 16595 16596 16597 16598 16599 16600 16601 16602 16603 function createComponent_forwardRef(component) { 16604 return /*#__PURE__*/(0,external_React_.forwardRef)(component); 16605 } 16606 16607 function memo(component, propsAreEqual) { 16608 return /*#__PURE__*/(0,external_React_.memo)(component, propsAreEqual); 16609 } 16610 16611 /** 16612 * Creates a React component. 16613 * 16614 * @example 16615 * import { createComponent } from "reakit-system"; 16616 * 16617 * const A = createComponent({ as: "a" }); 16618 * 16619 * @param options 16620 */ 16621 function createComponent(_ref) { 16622 var type = _ref.as, 16623 useHook = _ref.useHook, 16624 shouldMemo = _ref.memo, 16625 _ref$propsAreEqual = _ref.propsAreEqual, 16626 propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual, 16627 _ref$keys = _ref.keys, 16628 keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys, 16629 _ref$useCreateElement = _ref.useCreateElement, 16630 useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement : _ref$useCreateElement; 16631 16632 var Comp = function Comp(_ref2, ref) { 16633 var _ref2$as = _ref2.as, 16634 as = _ref2$as === void 0 ? type : _ref2$as, 16635 props = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_ref2, ["as"]); 16636 16637 if (useHook) { 16638 var _as$render; 16639 16640 var _splitProps = splitProps(props, keys), 16641 _options = _splitProps[0], 16642 htmlProps = _splitProps[1]; 16643 16644 var _useHook = useHook(_options, _rollupPluginBabelHelpers_0c84a174_objectSpread2({ 16645 ref: ref 16646 }, htmlProps)), 16647 wrapElement = _useHook.wrapElement, 16648 elementProps = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_useHook, ["wrapElement"]); // @ts-ignore 16649 16650 16651 var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys; 16652 var asOptions = asKeys && splitProps(props, asKeys)[0]; 16653 var allProps = asOptions ? _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, elementProps), asOptions) : elementProps; 16654 16655 var _element = useCreateElement$1(as, allProps); 16656 16657 if (wrapElement) { 16658 return wrapElement(_element); 16659 } 16660 16661 return _element; 16662 } 16663 16664 return useCreateElement$1(as, _rollupPluginBabelHelpers_0c84a174_objectSpread2({ 16665 ref: ref 16666 }, props)); 16667 }; 16668 16669 if (false) {} 16670 16671 Comp = createComponent_forwardRef(Comp); 16672 16673 if (shouldMemo) { 16674 Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual)); 16675 } 16676 16677 Comp.__keys = keys; 16678 Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual); 16679 return Comp; 16680 } 16681 16682 16683 16684 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js 16685 16686 16687 16688 /** 16689 * React custom hook that returns the value of any token defined in the 16690 * SystemContext. It's mainly used internally in [`useOptions`](#useoptions) 16691 * and [`useProps`](#useprops). 16692 * 16693 * @example 16694 * import { SystemProvider, useToken } from "reakit-system"; 16695 * 16696 * const system = { 16697 * token: "value", 16698 * }; 16699 * 16700 * function Component(props) { 16701 * const token = useToken("token", "default value"); 16702 * return <div {...props}>{token}</div>; 16703 * } 16704 * 16705 * function App() { 16706 * return ( 16707 * <SystemProvider unstable_system={system}> 16708 * <Component /> 16709 * </SystemProvider> 16710 * ); 16711 * } 16712 */ 16713 16714 function useToken(token, defaultValue) { 16715 (0,external_React_.useDebugValue)(token); 16716 var context = (0,external_React_.useContext)(SystemContext); 16717 return context[token] != null ? context[token] : defaultValue; 16718 } 16719 16720 16721 16722 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js 16723 16724 16725 16726 16727 /** 16728 * React custom hook that returns the props returned by a given 16729 * `use${name}Props` in the SystemContext. 16730 * 16731 * @example 16732 * import { SystemProvider, useProps } from "reakit-system"; 16733 * 16734 * const system = { 16735 * useAProps(options, htmlProps) { 16736 * return { 16737 * ...htmlProps, 16738 * href: options.url, 16739 * }; 16740 * }, 16741 * }; 16742 * 16743 * function A({ url, ...htmlProps }) { 16744 * const props = useProps("A", { url }, htmlProps); 16745 * return <a {...props} />; 16746 * } 16747 * 16748 * function App() { 16749 * return ( 16750 * <SystemProvider unstable_system={system}> 16751 * <A url="url">It will convert url into href in useAProps</A> 16752 * </SystemProvider> 16753 * ); 16754 * } 16755 */ 16756 16757 function useProps(name, options, htmlProps) { 16758 if (options === void 0) { 16759 options = {}; 16760 } 16761 16762 if (htmlProps === void 0) { 16763 htmlProps = {}; 16764 } 16765 16766 var hookName = "use" + name + "Props"; 16767 (0,external_React_.useDebugValue)(hookName); 16768 var useHook = useToken(hookName); 16769 16770 if (useHook) { 16771 return useHook(options, htmlProps); 16772 } 16773 16774 return htmlProps; 16775 } 16776 16777 16778 16779 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js 16780 16781 16782 16783 16784 16785 /** 16786 * React custom hook that returns the options returned by a given 16787 * `use${name}Options` in the SystemContext. 16788 * 16789 * @example 16790 * import React from "react"; 16791 * import { SystemProvider, useOptions } from "reakit-system"; 16792 * 16793 * const system = { 16794 * useAOptions(options, htmlProps) { 16795 * return { 16796 * ...options, 16797 * url: htmlProps.href, 16798 * }; 16799 * }, 16800 * }; 16801 * 16802 * function A({ url, ...htmlProps }) { 16803 * const options = useOptions("A", { url }, htmlProps); 16804 * return <a href={options.url} {...htmlProps} />; 16805 * } 16806 * 16807 * function App() { 16808 * return ( 16809 * <SystemProvider unstable_system={system}> 16810 * <A href="url"> 16811 * It will convert href into url in useAOptions and then url into href in A 16812 * </A> 16813 * </SystemProvider> 16814 * ); 16815 * } 16816 */ 16817 16818 function useOptions(name, options, htmlProps) { 16819 if (options === void 0) { 16820 options = {}; 16821 } 16822 16823 if (htmlProps === void 0) { 16824 htmlProps = {}; 16825 } 16826 16827 var hookName = "use" + name + "Options"; 16828 (0,external_React_.useDebugValue)(hookName); 16829 var useHook = useToken(hookName); 16830 16831 if (useHook) { 16832 return _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, options), useHook(options, htmlProps)); 16833 } 16834 16835 return options; 16836 } 16837 16838 16839 16840 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js 16841 /** 16842 * Transforms `arg` into an array if it's not already. 16843 * 16844 * @example 16845 * import { toArray } from "reakit-utils"; 16846 * 16847 * toArray("a"); // ["a"] 16848 * toArray(["a"]); // ["a"] 16849 */ 16850 function toArray(arg) { 16851 if (Array.isArray(arg)) { 16852 return arg; 16853 } 16854 16855 return typeof arg !== "undefined" ? [arg] : []; 16856 } 16857 16858 16859 16860 ;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 /** 16871 * Creates a React custom hook that will return component props. 16872 * 16873 * @example 16874 * import { createHook } from "reakit-system"; 16875 * 16876 * const useA = createHook({ 16877 * name: "A", 16878 * keys: ["url"], // custom props/options keys 16879 * useProps(options, htmlProps) { 16880 * return { 16881 * ...htmlProps, 16882 * href: options.url, 16883 * }; 16884 * }, 16885 * }); 16886 * 16887 * function A({ url, ...htmlProps }) { 16888 * const props = useA({ url }, htmlProps); 16889 * return <a {...props} />; 16890 * } 16891 * 16892 * @param options 16893 */ 16894 function createHook(options) { 16895 var _options$useState, _composedHooks$; 16896 16897 var composedHooks = toArray(options.compose); 16898 16899 var __useOptions = function __useOptions(hookOptions, htmlProps) { 16900 // Call the current hook's useOptions first 16901 if (options.useOptions) { 16902 hookOptions = options.useOptions(hookOptions, htmlProps); 16903 } // If there's name, call useOptions from the system context 16904 16905 16906 if (options.name) { 16907 hookOptions = useOptions(options.name, hookOptions, htmlProps); 16908 } // Run composed hooks useOptions 16909 16910 16911 if (options.compose) { 16912 for (var _iterator = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step; !(_step = _iterator()).done;) { 16913 var hook = _step.value; 16914 hookOptions = hook.__useOptions(hookOptions, htmlProps); 16915 } 16916 } 16917 16918 return hookOptions; 16919 }; 16920 16921 var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) { 16922 if (hookOptions === void 0) { 16923 hookOptions = {}; 16924 } 16925 16926 if (htmlProps === void 0) { 16927 htmlProps = {}; 16928 } 16929 16930 if (unstable_ignoreUseOptions === void 0) { 16931 unstable_ignoreUseOptions = false; 16932 } 16933 16934 // This won't execute when useHook was called from within another useHook 16935 if (!unstable_ignoreUseOptions) { 16936 hookOptions = __useOptions(hookOptions, htmlProps); 16937 } // Call the current hook's useProps 16938 16939 16940 if (options.useProps) { 16941 htmlProps = options.useProps(hookOptions, htmlProps); 16942 } // If there's name, call useProps from the system context 16943 16944 16945 if (options.name) { 16946 htmlProps = useProps(options.name, hookOptions, htmlProps); 16947 } 16948 16949 if (options.compose) { 16950 if (options.useComposeOptions) { 16951 hookOptions = options.useComposeOptions(hookOptions, htmlProps); 16952 } 16953 16954 if (options.useComposeProps) { 16955 htmlProps = options.useComposeProps(hookOptions, htmlProps); 16956 } else { 16957 for (var _iterator2 = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step2; !(_step2 = _iterator2()).done;) { 16958 var hook = _step2.value; 16959 htmlProps = hook(hookOptions, htmlProps, true); 16960 } 16961 } 16962 } // Remove undefined values from htmlProps 16963 16964 16965 var finalHTMLProps = {}; 16966 var definedHTMLProps = htmlProps || {}; 16967 16968 for (var prop in definedHTMLProps) { 16969 if (definedHTMLProps[prop] !== undefined) { 16970 finalHTMLProps[prop] = definedHTMLProps[prop]; 16971 } 16972 } 16973 16974 return finalHTMLProps; 16975 }; 16976 16977 useHook.__useOptions = __useOptions; 16978 var composedKeys = composedHooks.reduce(function (keys, hook) { 16979 keys.push.apply(keys, hook.__keys || []); 16980 return keys; 16981 }, []); // It's used by createComponent to split option props (keys) and html props 16982 16983 useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []); 16984 useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual; 16985 16986 if (false) {} 16987 16988 return useHook; 16989 } 16990 16991 16992 16993 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useForkRef.js 16994 16995 16996 // https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js 16997 16998 function setRef(ref, value) { 16999 if (value === void 0) { 17000 value = null; 17001 } 17002 17003 if (!ref) return; 17004 17005 if (typeof ref === "function") { 17006 ref(value); 17007 } else { 17008 ref.current = value; 17009 } 17010 } 17011 /** 17012 * Merges up to two React Refs into a single memoized function React Ref so you 17013 * can pass it to an element. 17014 * 17015 * @example 17016 * import React from "react"; 17017 * import { useForkRef } from "reakit-utils"; 17018 * 17019 * const Component = React.forwardRef((props, ref) => { 17020 * const internalRef = React.useRef(); 17021 * return <div {...props} ref={useForkRef(internalRef, ref)} />; 17022 * }); 17023 */ 17024 17025 17026 function useForkRef(refA, refB) { 17027 return (0,external_React_.useMemo)(function () { 17028 if (refA == null && refB == null) { 17029 return null; 17030 } 17031 17032 return function (value) { 17033 setRef(refA, value); 17034 setRef(refB, value); 17035 }; 17036 }, [refA, refB]); 17037 } 17038 17039 17040 17041 ;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js 17042 17043 17044 17045 17046 17047 function isRefObject(ref) { 17048 return isObject(ref) && "current" in ref; 17049 } 17050 /** 17051 * Logs `messages` to the console using `console.warn` based on a `condition`. 17052 * This should be used inside components. 17053 */ 17054 17055 17056 function useWarning(condition) { 17057 for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 17058 messages[_key - 1] = arguments[_key]; 17059 } 17060 17061 if (false) {} 17062 } 17063 17064 17065 17066 ;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js 17067 17068 17069 17070 17071 17072 17073 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getDocument.js 17074 /** 17075 * Returns `element.ownerDocument || document`. 17076 */ 17077 function getDocument(element) { 17078 return element ? element.ownerDocument || element : document; 17079 } 17080 17081 17082 17083 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getWindow.js 17084 17085 17086 // Thanks to Fluent UI for doing the [research on IE11 memory leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427) 17087 17088 var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window" 17089 // hits a memory leak, whereas aliasing it and calling "typeof _window" does not. 17090 // Caching the window value at the file scope lets us minimize the impact. 17091 17092 17093 try { 17094 _window = window; 17095 } catch (e) { 17096 /* no-op */ 17097 } 17098 /** 17099 * Returns `element.ownerDocument.defaultView || window`. 17100 */ 17101 17102 17103 function getWindow(element) { 17104 if (!element) { 17105 return _window; 17106 } 17107 17108 return getDocument(element).defaultView || _window; 17109 } 17110 17111 17112 17113 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/canUseDOM.js 17114 17115 17116 17117 function checkIsBrowser() { 17118 var _window = getWindow(); 17119 17120 return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement); 17121 } 17122 /** 17123 * It's `true` if it is running in a browser environment or `false` if it is not (SSR). 17124 * 17125 * @example 17126 * import { canUseDOM } from "reakit-utils"; 17127 * 17128 * const title = canUseDOM ? document.title : ""; 17129 */ 17130 17131 17132 var canUseDOM = checkIsBrowser(); 17133 17134 17135 17136 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js 17137 17138 17139 17140 17141 17142 /** 17143 * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side 17144 * rendering. 17145 */ 17146 17147 var useIsomorphicEffect = !canUseDOM ? external_React_.useEffect : external_React_.useLayoutEffect; 17148 17149 17150 17151 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useLiveRef.js 17152 17153 17154 17155 17156 17157 17158 /** 17159 * A `React.Ref` that keeps track of the passed `value`. 17160 */ 17161 17162 function useLiveRef(value) { 17163 var ref = (0,external_React_.useRef)(value); 17164 useIsomorphicEffect(function () { 17165 ref.current = value; 17166 }); 17167 return ref; 17168 } 17169 17170 17171 17172 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js 17173 /** 17174 * Returns `true` if `event.target` and `event.currentTarget` are the same. 17175 */ 17176 function isSelfTarget(event) { 17177 return event.target === event.currentTarget; 17178 } 17179 17180 17181 17182 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getActiveElement.js 17183 17184 17185 /** 17186 * Returns `element.ownerDocument.activeElement`. 17187 */ 17188 17189 function getActiveElement_getActiveElement(element) { 17190 var _getDocument = getDocument(element), 17191 activeElement = _getDocument.activeElement; 17192 17193 if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) { 17194 // In IE11, activeElement might be an empty object if we're interacting 17195 // with elements inside of an iframe. 17196 return null; 17197 } 17198 17199 return activeElement; 17200 } 17201 17202 17203 17204 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/contains.js 17205 /** 17206 * Similar to `Element.prototype.contains`, but a little bit faster when 17207 * `element` is the same as `child`. 17208 * 17209 * @example 17210 * import { contains } from "reakit-utils"; 17211 * 17212 * contains(document.getElementById("parent"), document.getElementById("child")); 17213 */ 17214 function contains(parent, child) { 17215 return parent === child || parent.contains(child); 17216 } 17217 17218 17219 17220 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocusWithin.js 17221 17222 17223 17224 17225 /** 17226 * Checks if `element` has focus within. Elements that are referenced by 17227 * `aria-activedescendant` are also considered. 17228 * 17229 * @example 17230 * import { hasFocusWithin } from "reakit-utils"; 17231 * 17232 * hasFocusWithin(document.getElementById("id")); 17233 */ 17234 17235 function hasFocusWithin(element) { 17236 var activeElement = getActiveElement_getActiveElement(element); 17237 if (!activeElement) return false; 17238 if (contains(element, activeElement)) return true; 17239 var activeDescendant = activeElement.getAttribute("aria-activedescendant"); 17240 if (!activeDescendant) return false; 17241 if (activeDescendant === element.id) return true; 17242 return !!element.querySelector("#" + activeDescendant); 17243 } 17244 17245 17246 17247 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPortalEvent.js 17248 17249 17250 /** 17251 * Returns `true` if `event` has been fired within a React Portal element. 17252 */ 17253 17254 function isPortalEvent(event) { 17255 return !contains(event.currentTarget, event.target); 17256 } 17257 17258 17259 17260 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isButton.js 17261 var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"]; 17262 /** 17263 * Checks whether `element` is a native HTML button element. 17264 * 17265 * @example 17266 * import { isButton } from "reakit-utils"; 17267 * 17268 * isButton(document.querySelector("button")); // true 17269 * isButton(document.querySelector("input[type='button']")); // true 17270 * isButton(document.querySelector("div")); // false 17271 * isButton(document.querySelector("input[type='text']")); // false 17272 * isButton(document.querySelector("div[role='button']")); // false 17273 * 17274 * @returns {boolean} 17275 */ 17276 17277 function isButton(element) { 17278 if (element.tagName === "BUTTON") return true; 17279 17280 if (element.tagName === "INPUT") { 17281 var input = element; 17282 return buttonInputTypes.indexOf(input.type) !== -1; 17283 } 17284 17285 return false; 17286 } 17287 17288 17289 17290 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/dom.js 17291 17292 17293 17294 17295 /** 17296 * Checks if a given string exists in the user agent string. 17297 */ 17298 17299 function isUA(string) { 17300 if (!canUseDOM) return false; 17301 return window.navigator.userAgent.indexOf(string) !== -1; 17302 } 17303 17304 17305 17306 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js 17307 /** 17308 * Ponyfill for `Element.prototype.matches` 17309 * 17310 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches 17311 */ 17312 function matches(element, selectors) { 17313 if ("matches" in element) { 17314 return element.matches(selectors); 17315 } 17316 17317 if ("msMatchesSelector" in element) { 17318 return element.msMatchesSelector(selectors); 17319 } 17320 17321 return element.webkitMatchesSelector(selectors); 17322 } 17323 17324 17325 17326 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js 17327 17328 17329 17330 17331 17332 /** @module tabbable */ 17333 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'])"; 17334 17335 function isVisible(element) { 17336 var htmlElement = element; 17337 return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; 17338 } 17339 17340 function hasNegativeTabIndex(element) { 17341 var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); 17342 return tabIndex < 0; 17343 } 17344 /** 17345 * Checks whether `element` is focusable or not. 17346 * 17347 * @memberof tabbable 17348 * 17349 * @example 17350 * import { isFocusable } from "reakit-utils"; 17351 * 17352 * isFocusable(document.querySelector("input")); // true 17353 * isFocusable(document.querySelector("input[tabindex='-1']")); // true 17354 * isFocusable(document.querySelector("input[hidden]")); // false 17355 * isFocusable(document.querySelector("input:disabled")); // false 17356 */ 17357 17358 17359 function isFocusable(element) { 17360 return matches(element, selector) && isVisible(element); 17361 } 17362 /** 17363 * Checks whether `element` is tabbable or not. 17364 * 17365 * @memberof tabbable 17366 * 17367 * @example 17368 * import { isTabbable } from "reakit-utils"; 17369 * 17370 * isTabbable(document.querySelector("input")); // true 17371 * isTabbable(document.querySelector("input[tabindex='-1']")); // false 17372 * isTabbable(document.querySelector("input[hidden]")); // false 17373 * isTabbable(document.querySelector("input:disabled")); // false 17374 */ 17375 17376 function isTabbable(element) { 17377 return isFocusable(element) && !hasNegativeTabIndex(element); 17378 } 17379 /** 17380 * Returns all the focusable elements in `container`. 17381 * 17382 * @memberof tabbable 17383 * 17384 * @param {Element} container 17385 * 17386 * @returns {Element[]} 17387 */ 17388 17389 function getAllFocusableIn(container) { 17390 var allFocusable = Array.from(container.querySelectorAll(selector)); 17391 allFocusable.unshift(container); 17392 return allFocusable.filter(isFocusable); 17393 } 17394 /** 17395 * Returns the first focusable element in `container`. 17396 * 17397 * @memberof tabbable 17398 * 17399 * @param {Element} container 17400 * 17401 * @returns {Element|null} 17402 */ 17403 17404 function getFirstFocusableIn(container) { 17405 var _getAllFocusableIn = getAllFocusableIn(container), 17406 first = _getAllFocusableIn[0]; 17407 17408 return first || null; 17409 } 17410 /** 17411 * Returns all the tabbable elements in `container`, including the container 17412 * itself. 17413 * 17414 * @memberof tabbable 17415 * 17416 * @param {Element} container 17417 * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones. 17418 * 17419 * @returns {Element[]} 17420 */ 17421 17422 function getAllTabbableIn(container, fallbackToFocusable) { 17423 var allFocusable = Array.from(container.querySelectorAll(selector)); 17424 var allTabbable = allFocusable.filter(isTabbable); 17425 17426 if (isTabbable(container)) { 17427 allTabbable.unshift(container); 17428 } 17429 17430 if (!allTabbable.length && fallbackToFocusable) { 17431 return allFocusable; 17432 } 17433 17434 return allTabbable; 17435 } 17436 /** 17437 * Returns the first tabbable element in `container`, including the container 17438 * itself if it's tabbable. 17439 * 17440 * @memberof tabbable 17441 * 17442 * @param {Element} container 17443 * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones. 17444 * 17445 * @returns {Element|null} 17446 */ 17447 17448 function getFirstTabbableIn(container, fallbackToFocusable) { 17449 var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable), 17450 first = _getAllTabbableIn[0]; 17451 17452 return first || null; 17453 } 17454 /** 17455 * Returns the last tabbable element in `container`, including the container 17456 * itself if it's tabbable. 17457 * 17458 * @memberof tabbable 17459 * 17460 * @param {Element} container 17461 * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones. 17462 * 17463 * @returns {Element|null} 17464 */ 17465 17466 function getLastTabbableIn(container, fallbackToFocusable) { 17467 var allTabbable = getAllTabbableIn(container, fallbackToFocusable); 17468 return allTabbable[allTabbable.length - 1] || null; 17469 } 17470 /** 17471 * Returns the next tabbable element in `container`. 17472 * 17473 * @memberof tabbable 17474 * 17475 * @param {Element} container 17476 * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones. 17477 * 17478 * @returns {Element|null} 17479 */ 17480 17481 function getNextTabbableIn(container, fallbackToFocusable) { 17482 var activeElement = getActiveElement(container); 17483 var allFocusable = getAllFocusableIn(container); 17484 var index = allFocusable.indexOf(activeElement); 17485 var slice = allFocusable.slice(index + 1); 17486 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 17487 } 17488 /** 17489 * Returns the previous tabbable element in `container`. 17490 * 17491 * @memberof tabbable 17492 * 17493 * @param {Element} container 17494 * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones. 17495 * 17496 * @returns {Element|null} 17497 */ 17498 17499 function getPreviousTabbableIn(container, fallbackToFocusable) { 17500 var activeElement = getActiveElement(container); 17501 var allFocusable = getAllFocusableIn(container).reverse(); 17502 var index = allFocusable.indexOf(activeElement); 17503 var slice = allFocusable.slice(index + 1); 17504 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 17505 } 17506 /** 17507 * Returns the closest focusable element. 17508 * 17509 * @memberof tabbable 17510 * 17511 * @param {Element} container 17512 * 17513 * @returns {Element|null} 17514 */ 17515 17516 function getClosestFocusable(element) { 17517 while (element && !isFocusable(element)) { 17518 element = closest(element, selector); 17519 } 17520 17521 return element; 17522 } 17523 17524 17525 17526 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Role/Role.js 17527 17528 17529 17530 17531 17532 // Automatically generated 17533 var ROLE_KEYS = ["unstable_system"]; 17534 17535 var useRole = createHook({ 17536 name: "Role", 17537 keys: ROLE_KEYS, 17538 propsAreEqual: function propsAreEqual(prev, next) { 17539 var prevSystem = prev.unstable_system, 17540 prevProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(prev, ["unstable_system"]); 17541 17542 var nextSystem = next.unstable_system, 17543 nextProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(next, ["unstable_system"]); 17544 17545 if (prevSystem !== nextSystem && !shallowEqual(prevSystem, nextSystem)) { 17546 return false; 17547 } 17548 17549 return shallowEqual(prevProps, nextProps); 17550 } 17551 }); 17552 var Role = createComponent({ 17553 as: "div", 17554 useHook: useRole 17555 }); 17556 17557 17558 17559 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 // Automatically generated 17577 var TABBABLE_KEYS = ["disabled", "focusable"]; 17578 17579 var isSafariOrFirefoxOnMac = isUA("Mac") && !isUA("Chrome") && (isUA("Safari") || isUA("Firefox")); 17580 17581 function focusIfNeeded(element) { 17582 if (!hasFocusWithin(element) && isFocusable(element)) { 17583 element.focus(); 17584 } 17585 } 17586 17587 function isNativeTabbable(element) { 17588 return ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "A"].includes(element.tagName); 17589 } 17590 17591 function supportsDisabledAttribute(element) { 17592 return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName); 17593 } 17594 17595 function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) { 17596 if (trulyDisabled) { 17597 if (nativeTabbable && !supportsDisabled) { 17598 // Anchor, audio and video tags don't support the `disabled` attribute. 17599 // We must pass tabIndex={-1} so they don't receive focus on tab. 17600 return -1; 17601 } // Elements that support the `disabled` attribute don't need tabIndex. 17602 17603 17604 return undefined; 17605 } 17606 17607 if (nativeTabbable) { 17608 // If the element is enabled and it's natively tabbable, we don't need to 17609 // specify a tabIndex attribute unless it's explicitly set by the user. 17610 return htmlTabIndex; 17611 } // If the element is enabled and is not natively tabbable, we have to 17612 // fallback tabIndex={0}. 17613 17614 17615 return htmlTabIndex || 0; 17616 } 17617 17618 function useDisableEvent(htmlEventRef, disabled) { 17619 return (0,external_React_.useCallback)(function (event) { 17620 var _htmlEventRef$current; 17621 17622 (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event); 17623 if (event.defaultPrevented) return; 17624 17625 if (disabled) { 17626 event.stopPropagation(); 17627 event.preventDefault(); 17628 } 17629 }, [htmlEventRef, disabled]); 17630 } 17631 17632 var useTabbable = createHook({ 17633 name: "Tabbable", 17634 compose: useRole, 17635 keys: TABBABLE_KEYS, 17636 useOptions: function useOptions(options, _ref) { 17637 var disabled = _ref.disabled; 17638 return _objectSpread2({ 17639 disabled: disabled 17640 }, options); 17641 }, 17642 useProps: function useProps(options, _ref2) { 17643 var htmlRef = _ref2.ref, 17644 htmlTabIndex = _ref2.tabIndex, 17645 htmlOnClickCapture = _ref2.onClickCapture, 17646 htmlOnMouseDownCapture = _ref2.onMouseDownCapture, 17647 htmlOnMouseDown = _ref2.onMouseDown, 17648 htmlOnKeyPressCapture = _ref2.onKeyPressCapture, 17649 htmlStyle = _ref2.style, 17650 htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]); 17651 17652 var ref = (0,external_React_.useRef)(null); 17653 var onClickCaptureRef = useLiveRef(htmlOnClickCapture); 17654 var onMouseDownCaptureRef = useLiveRef(htmlOnMouseDownCapture); 17655 var onMouseDownRef = useLiveRef(htmlOnMouseDown); 17656 var onKeyPressCaptureRef = useLiveRef(htmlOnKeyPressCapture); 17657 var trulyDisabled = !!options.disabled && !options.focusable; 17658 17659 var _React$useState = (0,external_React_.useState)(true), 17660 nativeTabbable = _React$useState[0], 17661 setNativeTabbable = _React$useState[1]; 17662 17663 var _React$useState2 = (0,external_React_.useState)(true), 17664 supportsDisabled = _React$useState2[0], 17665 setSupportsDisabled = _React$useState2[1]; 17666 17667 var style = options.disabled ? _objectSpread2({ 17668 pointerEvents: "none" 17669 }, htmlStyle) : htmlStyle; 17670 useIsomorphicEffect(function () { 17671 var tabbable = ref.current; 17672 17673 if (!tabbable) { 17674 false ? 0 : void 0; 17675 return; 17676 } 17677 17678 if (!isNativeTabbable(tabbable)) { 17679 setNativeTabbable(false); 17680 } 17681 17682 if (!supportsDisabledAttribute(tabbable)) { 17683 setSupportsDisabled(false); 17684 } 17685 }, []); 17686 var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled); 17687 var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled); 17688 var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled); 17689 var onMouseDown = (0,external_React_.useCallback)(function (event) { 17690 var _onMouseDownRef$curre; 17691 17692 (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); 17693 var element = event.currentTarget; 17694 if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down 17695 // like other browsers/platforms. Instead, they focus on the closest 17696 // focusable ancestor element, which is ultimately the body element. So 17697 // we make sure to give focus to the tabbable element on mouse down so 17698 // it works consistently across browsers. 17699 17700 if (!isSafariOrFirefoxOnMac) return; 17701 if (isPortalEvent(event)) return; 17702 if (!isButton(element)) return; // We can't focus right away after on mouse down, otherwise it would 17703 // prevent drag events from happening. So we schedule the focus to the 17704 // next animation frame. 17705 17706 var raf = requestAnimationFrame(function () { 17707 element.removeEventListener("mouseup", focusImmediately, true); 17708 focusIfNeeded(element); 17709 }); // If mouseUp happens before the next animation frame (which is common 17710 // on touch screens or by just tapping the trackpad on MacBook's), we 17711 // cancel the animation frame and immediately focus on the element. 17712 17713 var focusImmediately = function focusImmediately() { 17714 cancelAnimationFrame(raf); 17715 focusIfNeeded(element); 17716 }; // By listening to the event in the capture phase, we make sure the 17717 // focus event is fired before the onMouseUp and onMouseUpCapture React 17718 // events, which is aligned with the default browser behavior. 17719 17720 17721 element.addEventListener("mouseup", focusImmediately, { 17722 once: true, 17723 capture: true 17724 }); 17725 }, []); 17726 return _objectSpread2({ 17727 ref: useForkRef(ref, htmlRef), 17728 style: style, 17729 tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex), 17730 disabled: trulyDisabled && supportsDisabled ? true : undefined, 17731 "aria-disabled": options.disabled ? true : undefined, 17732 onClickCapture: onClickCapture, 17733 onMouseDownCapture: onMouseDownCapture, 17734 onMouseDown: onMouseDown, 17735 onKeyPressCapture: onKeyPressCapture 17736 }, htmlProps); 17737 } 17738 }); 17739 var Tabbable = createComponent({ 17740 as: "div", 17741 useHook: useTabbable 17742 }); 17743 17744 17745 17746 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Clickable/Clickable.js 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 // Automatically generated 17766 var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"]; 17767 17768 function isNativeClick(event) { 17769 var element = event.currentTarget; 17770 if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet 17771 17772 return isButton(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT"; 17773 } 17774 17775 var useClickable = createHook({ 17776 name: "Clickable", 17777 compose: useTabbable, 17778 keys: CLICKABLE_KEYS, 17779 useOptions: function useOptions(_ref) { 17780 var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, 17781 unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn, 17782 _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace, 17783 unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2, 17784 options = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]); 17785 17786 return _objectSpread2({ 17787 unstable_clickOnEnter: unstable_clickOnEnter, 17788 unstable_clickOnSpace: unstable_clickOnSpace 17789 }, options); 17790 }, 17791 useProps: function useProps(options, _ref2) { 17792 var htmlOnKeyDown = _ref2.onKeyDown, 17793 htmlOnKeyUp = _ref2.onKeyUp, 17794 htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref2, ["onKeyDown", "onKeyUp"]); 17795 17796 var _React$useState = (0,external_React_.useState)(false), 17797 active = _React$useState[0], 17798 setActive = _React$useState[1]; 17799 17800 var onKeyDownRef = useLiveRef(htmlOnKeyDown); 17801 var onKeyUpRef = useLiveRef(htmlOnKeyUp); 17802 var onKeyDown = (0,external_React_.useCallback)(function (event) { 17803 var _onKeyDownRef$current; 17804 17805 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 17806 if (event.defaultPrevented) return; 17807 if (options.disabled) return; 17808 if (event.metaKey) return; 17809 if (!isSelfTarget(event)) return; 17810 var isEnter = options.unstable_clickOnEnter && event.key === "Enter"; 17811 var isSpace = options.unstable_clickOnSpace && event.key === " "; 17812 17813 if (isEnter || isSpace) { 17814 if (isNativeClick(event)) return; 17815 event.preventDefault(); 17816 17817 if (isEnter) { 17818 event.currentTarget.click(); 17819 } else if (isSpace) { 17820 setActive(true); 17821 } 17822 } 17823 }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]); 17824 var onKeyUp = (0,external_React_.useCallback)(function (event) { 17825 var _onKeyUpRef$current; 17826 17827 (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event); 17828 if (event.defaultPrevented) return; 17829 if (options.disabled) return; 17830 if (event.metaKey) return; 17831 var isSpace = options.unstable_clickOnSpace && event.key === " "; 17832 17833 if (active && isSpace) { 17834 setActive(false); 17835 event.currentTarget.click(); 17836 } 17837 }, [options.disabled, options.unstable_clickOnSpace, active]); 17838 return _objectSpread2({ 17839 "data-active": active || undefined, 17840 onKeyDown: onKeyDown, 17841 onKeyUp: onKeyUp 17842 }, htmlProps); 17843 } 17844 }); 17845 var Clickable = createComponent({ 17846 as: "button", 17847 memo: true, 17848 useHook: useClickable 17849 }); 17850 17851 17852 17853 ;// CONCATENATED MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js 17854 function findFirstEnabledItem(items, excludeId) { 17855 if (excludeId) { 17856 return items.find(function (item) { 17857 return !item.disabled && item.id !== excludeId; 17858 }); 17859 } 17860 17861 return items.find(function (item) { 17862 return !item.disabled; 17863 }); 17864 } 17865 17866 function getCurrentId(options, passedId) { 17867 var _findFirstEnabledItem; 17868 17869 if (passedId || passedId === null) { 17870 return passedId; 17871 } 17872 17873 if (options.currentId || options.currentId === null) { 17874 return options.currentId; 17875 } 17876 17877 return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id; 17878 } 17879 17880 17881 17882 ;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-6742f591.js 17883 // Automatically generated 17884 var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"]; 17885 var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS; 17886 var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS; 17887 var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS; 17888 var COMPOSITE_ITEM_WIDGET_KEYS = (/* unused pure expression or super */ null && (COMPOSITE_ITEM_KEYS)); 17889 17890 17891 17892 ;// CONCATENATED MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js 17893 function userFocus(element) { 17894 element.userFocus = true; 17895 element.focus(); 17896 element.userFocus = false; 17897 } 17898 function hasUserFocus(element) { 17899 return !!element.userFocus; 17900 } 17901 function setUserFocus(element, value) { 17902 element.userFocus = value; 17903 } 17904 17905 17906 17907 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isTextField.js 17908 /** 17909 * Check whether the given element is a text field, where text field is defined 17910 * by the ability to select within the input, or that it is contenteditable. 17911 * 17912 * @example 17913 * import { isTextField } from "reakit-utils"; 17914 * 17915 * isTextField(document.querySelector("div")); // false 17916 * isTextField(document.querySelector("input")); // true 17917 * isTextField(document.querySelector("input[type='button']")); // false 17918 * isTextField(document.querySelector("textarea")); // true 17919 * isTextField(document.querySelector("div[contenteditable='true']")); // true 17920 */ 17921 function isTextField(element) { 17922 try { 17923 var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; 17924 var isTextArea = element.tagName === "TEXTAREA"; 17925 var isContentEditable = element.contentEditable === "true"; 17926 return isTextInput || isTextArea || isContentEditable || false; 17927 } catch (error) { 17928 // Safari throws an exception when trying to get `selectionStart` 17929 // on non-text <input> elements (which, understandably, don't 17930 // have the text selection API). We catch this via a try/catch 17931 // block, as opposed to a more explicit check of the element's 17932 // input types, because of Safari's non-standard behavior. This 17933 // also means we don't have to worry about the list of input 17934 // types that support `selectionStart` changing as the HTML spec 17935 // evolves over time. 17936 return false; 17937 } 17938 } 17939 17940 17941 17942 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js 17943 17944 17945 17946 /** 17947 * Checks if `element` has focus. Elements that are referenced by 17948 * `aria-activedescendant` are also considered. 17949 * 17950 * @example 17951 * import { hasFocus } from "reakit-utils"; 17952 * 17953 * hasFocus(document.getElementById("id")); 17954 */ 17955 17956 function hasFocus(element) { 17957 var activeElement = getActiveElement_getActiveElement(element); 17958 if (!activeElement) return false; 17959 if (activeElement === element) return true; 17960 var activeDescendant = activeElement.getAttribute("aria-activedescendant"); 17961 if (!activeDescendant) return false; 17962 return activeDescendant === element.id; 17963 } 17964 17965 17966 17967 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js 17968 17969 17970 17971 17972 /** 17973 * Ensures `element` will receive focus if it's not already. 17974 * 17975 * @example 17976 * import { ensureFocus } from "reakit-utils"; 17977 * 17978 * ensureFocus(document.activeElement); // does nothing 17979 * 17980 * const element = document.querySelector("input"); 17981 * 17982 * ensureFocus(element); // focuses element 17983 * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump 17984 * 17985 * function isActive(el) { 17986 * return el.dataset.active === "true"; 17987 * } 17988 * 17989 * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing 17990 * 17991 * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed. 17992 */ 17993 function ensureFocus(element, _temp) { 17994 var _ref = _temp === void 0 ? {} : _temp, 17995 preventScroll = _ref.preventScroll, 17996 _ref$isActive = _ref.isActive, 17997 isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive; 17998 17999 if (isActive(element)) return -1; 18000 element.focus({ 18001 preventScroll: preventScroll 18002 }); 18003 if (isActive(element)) return -1; 18004 return requestAnimationFrame(function () { 18005 element.focus({ 18006 preventScroll: preventScroll 18007 }); 18008 }); 18009 } 18010 18011 18012 18013 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdProvider.js 18014 18015 18016 var defaultPrefix = "id"; 18017 function generateRandomString(prefix) { 18018 if (prefix === void 0) { 18019 prefix = defaultPrefix; 18020 } 18021 18022 return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6); 18023 } 18024 18025 var unstable_IdContext = /*#__PURE__*/(0,external_React_.createContext)(generateRandomString); 18026 function unstable_IdProvider(_ref) { 18027 var children = _ref.children, 18028 _ref$prefix = _ref.prefix, 18029 prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix; 18030 var count = useRef(0); 18031 var generateId = useCallback(function (localPrefix) { 18032 if (localPrefix === void 0) { 18033 localPrefix = prefix; 18034 } 18035 18036 return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current; 18037 }, [prefix]); 18038 return /*#__PURE__*/createElement(unstable_IdContext.Provider, { 18039 value: generateId 18040 }, children); 18041 } 18042 18043 18044 18045 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/Id.js 18046 18047 18048 18049 18050 18051 18052 // Automatically generated 18053 var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"]; 18054 var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]); 18055 18056 var unstable_useId = createHook({ 18057 keys: ID_KEYS, 18058 useOptions: function useOptions(options, htmlProps) { 18059 var generateId = (0,external_React_.useContext)(unstable_IdContext); 18060 18061 var _React$useState = (0,external_React_.useState)(function () { 18062 // This comes from useIdState 18063 if (options.unstable_idCountRef) { 18064 options.unstable_idCountRef.current += 1; 18065 return "-" + options.unstable_idCountRef.current; 18066 } // If there's no useIdState, we check if `baseId` was passed (as a prop, 18067 // not from useIdState). 18068 18069 18070 if (options.baseId) { 18071 return "-" + generateId(""); 18072 } 18073 18074 return ""; 18075 }), 18076 suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState. 18077 // If there's neither, then it'll fallback to Context's generateId. 18078 // This generateId can result in a sequential ID (if there's a Provider) 18079 // or a random string (without Provider). 18080 18081 18082 var baseId = (0,external_React_.useMemo)(function () { 18083 return options.baseId || generateId(); 18084 }, [options.baseId, generateId]); 18085 var id = htmlProps.id || options.id || "" + baseId + suffix; 18086 return _objectSpread2(_objectSpread2({}, options), {}, { 18087 id: id 18088 }); 18089 }, 18090 useProps: function useProps(options, htmlProps) { 18091 return _objectSpread2({ 18092 id: options.id 18093 }, htmlProps); 18094 } 18095 }); 18096 var unstable_Id = createComponent({ 18097 as: "div", 18098 useHook: unstable_useId 18099 }); 18100 18101 18102 18103 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/createEvent.js 18104 18105 18106 /** 18107 * Creates an `Event` in a way that also works on IE 11. 18108 * 18109 * @example 18110 * import { createEvent } from "reakit-utils"; 18111 * 18112 * const el = document.getElementById("id"); 18113 * el.dispatchEvent(createEvent(el, "blur", { bubbles: false })); 18114 */ 18115 18116 function createEvent(element, type, eventInit) { 18117 if (typeof Event === "function") { 18118 return new Event(type, eventInit); 18119 } // IE 11 doesn't support Event constructors 18120 18121 18122 var event = getDocument(element).createEvent("Event"); 18123 event.initEvent(type, eventInit === null || eventInit === void 0 ? void 0 : eventInit.bubbles, eventInit === null || eventInit === void 0 ? void 0 : eventInit.cancelable); 18124 return event; 18125 } 18126 18127 18128 18129 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireEvent.js 18130 18131 18132 18133 /** 18134 * Creates and dispatches `Event` in a way that also works on IE 11. 18135 * 18136 * @example 18137 * import { fireEvent } from "reakit-utils"; 18138 * 18139 * fireEvent(document.getElementById("id"), "blur", { 18140 * bubbles: true, 18141 * cancelable: true, 18142 * }); 18143 */ 18144 18145 function fireEvent(element, type, eventInit) { 18146 return element.dispatchEvent(createEvent(element, type, eventInit)); 18147 } 18148 18149 18150 18151 ;// CONCATENATED MODULE: ./node_modules/reakit/es/setTextFieldValue-0a221f4e.js 18152 18153 18154 function setTextFieldValue(element, value) { 18155 if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) { 18156 var _Object$getOwnPropert; 18157 18158 var proto = Object.getPrototypeOf(element); 18159 var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set; 18160 18161 if (setValue) { 18162 setValue.call(element, value); 18163 fireEvent(element, "input", { 18164 bubbles: true 18165 }); 18166 } 18167 } 18168 } 18169 18170 18171 18172 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 function getWidget(itemElement) { 18203 return itemElement.querySelector("[data-composite-item-widget]"); 18204 } 18205 18206 function useItem(options) { 18207 return (0,external_React_.useMemo)(function () { 18208 var _options$items; 18209 18210 return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) { 18211 return options.id && item.id === options.id; 18212 }); 18213 }, [options.items, options.id]); 18214 } 18215 18216 function targetIsAnotherItem(event, items) { 18217 if (isSelfTarget(event)) return false; 18218 18219 for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { 18220 var item = _step.value; 18221 18222 if (item.ref.current === event.target) { 18223 return true; 18224 } 18225 } 18226 18227 return false; 18228 } 18229 18230 var useCompositeItem = createHook({ 18231 name: "CompositeItem", 18232 compose: [useClickable, unstable_useId], 18233 keys: COMPOSITE_ITEM_KEYS, 18234 propsAreEqual: function propsAreEqual(prev, next) { 18235 if (!next.id || prev.id !== next.id) { 18236 return useClickable.unstable_propsAreEqual(prev, next); 18237 } 18238 18239 var prevCurrentId = prev.currentId, 18240 prevMoves = prev.unstable_moves, 18241 prevProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(prev, ["currentId", "unstable_moves"]); 18242 18243 var nextCurrentId = next.currentId, 18244 nextMoves = next.unstable_moves, 18245 nextProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(next, ["currentId", "unstable_moves"]); 18246 18247 if (nextCurrentId !== prevCurrentId) { 18248 if (next.id === nextCurrentId || next.id === prevCurrentId) { 18249 return false; 18250 } 18251 } else if (prevMoves !== nextMoves) { 18252 return false; 18253 } 18254 18255 return useClickable.unstable_propsAreEqual(prevProps, nextProps); 18256 }, 18257 useOptions: function useOptions(options) { 18258 return _objectSpread2(_objectSpread2({}, options), {}, { 18259 id: options.id, 18260 currentId: getCurrentId(options), 18261 unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace 18262 }); 18263 }, 18264 useProps: function useProps(options, _ref) { 18265 var _options$items2; 18266 18267 var htmlRef = _ref.ref, 18268 _ref$tabIndex = _ref.tabIndex, 18269 htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex, 18270 htmlOnMouseDown = _ref.onMouseDown, 18271 htmlOnFocus = _ref.onFocus, 18272 htmlOnBlurCapture = _ref.onBlurCapture, 18273 htmlOnKeyDown = _ref.onKeyDown, 18274 htmlOnClick = _ref.onClick, 18275 htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["ref", "tabIndex", "onMouseDown", "onFocus", "onBlurCapture", "onKeyDown", "onClick"]); 18276 18277 var ref = (0,external_React_.useRef)(null); 18278 var id = options.id; 18279 var trulyDisabled = options.disabled && !options.focusable; 18280 var isCurrentItem = options.currentId === id; 18281 var isCurrentItemRef = useLiveRef(isCurrentItem); 18282 var hasFocusedComposite = (0,external_React_.useRef)(false); 18283 var item = useItem(options); 18284 var onMouseDownRef = useLiveRef(htmlOnMouseDown); 18285 var onFocusRef = useLiveRef(htmlOnFocus); 18286 var onBlurCaptureRef = useLiveRef(htmlOnBlurCapture); 18287 var onKeyDownRef = useLiveRef(htmlOnKeyDown); 18288 var onClickRef = useLiveRef(htmlOnClick); 18289 var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a 18290 // standalone component, without state props. 18291 !((_options$items2 = options.items) !== null && _options$items2 !== void 0 && _options$items2.length); 18292 (0,external_React_.useEffect)(function () { 18293 var _options$registerItem; 18294 18295 if (!id) return undefined; 18296 (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, { 18297 id: id, 18298 ref: ref, 18299 disabled: !!trulyDisabled 18300 }); 18301 return function () { 18302 var _options$unregisterIt; 18303 18304 (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id); 18305 }; 18306 }, [id, trulyDisabled, options.registerItem, options.unregisterItem]); 18307 (0,external_React_.useEffect)(function () { 18308 var element = ref.current; 18309 18310 if (!element) { 18311 false ? 0 : void 0; 18312 return; 18313 } // `moves` will be incremented whenever next, previous, up, down, first, 18314 // last or move have been called. This means that the composite item will 18315 // be focused whenever some of these functions are called. We're using 18316 // isCurrentItemRef instead of isCurrentItem because we don't want to 18317 // focus the item if isCurrentItem changes (and options.moves doesn't). 18318 18319 18320 if (options.unstable_moves && isCurrentItemRef.current) { 18321 userFocus(element); 18322 } 18323 }, [options.unstable_moves]); 18324 var onMouseDown = (0,external_React_.useCallback)(function (event) { 18325 var _onMouseDownRef$curre; 18326 18327 (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); 18328 setUserFocus(event.currentTarget, true); 18329 }, []); 18330 var onFocus = (0,external_React_.useCallback)(function (event) { 18331 var _onFocusRef$current, _options$setCurrentId; 18332 18333 var shouldFocusComposite = hasUserFocus(event.currentTarget); 18334 setUserFocus(event.currentTarget, false); 18335 (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); 18336 if (event.defaultPrevented) return; 18337 if (isPortalEvent(event)) return; 18338 if (!id) return; 18339 if (targetIsAnotherItem(event, options.items)) return; 18340 (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the 18341 // composite container receives focus, not the composite item. 18342 // But we don't want to do this if the target is another focusable 18343 // element inside the composite item, such as CompositeItemWidget. 18344 18345 if (shouldFocusComposite && options.unstable_virtual && options.baseId && isSelfTarget(event)) { 18346 var target = event.target; 18347 var composite = getDocument(target).getElementById(options.baseId); 18348 18349 if (composite) { 18350 hasFocusedComposite.current = true; 18351 ensureFocus(composite); 18352 } 18353 } 18354 }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]); 18355 var onBlurCapture = (0,external_React_.useCallback)(function (event) { 18356 var _onBlurCaptureRef$cur; 18357 18358 (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); 18359 if (event.defaultPrevented) return; 18360 18361 if (options.unstable_virtual && hasFocusedComposite.current) { 18362 // When hasFocusedComposite is true, composite has been focused right 18363 // after focusing this item. This is an intermediate blur event, so 18364 // we ignore it. 18365 hasFocusedComposite.current = false; 18366 event.preventDefault(); 18367 event.stopPropagation(); 18368 } 18369 }, [options.unstable_virtual]); 18370 var onKeyDown = (0,external_React_.useCallback)(function (event) { 18371 var _onKeyDownRef$current; 18372 18373 if (!isSelfTarget(event)) return; 18374 var isVertical = options.orientation !== "horizontal"; 18375 var isHorizontal = options.orientation !== "vertical"; 18376 var isGrid = !!(item !== null && item !== void 0 && item.groupId); 18377 var keyMap = { 18378 ArrowUp: (isGrid || isVertical) && options.up, 18379 ArrowRight: (isGrid || isHorizontal) && options.next, 18380 ArrowDown: (isGrid || isVertical) && options.down, 18381 ArrowLeft: (isGrid || isHorizontal) && options.previous, 18382 Home: function Home() { 18383 if (!isGrid || event.ctrlKey) { 18384 var _options$first; 18385 18386 (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options); 18387 } else { 18388 var _options$previous; 18389 18390 (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true); 18391 } 18392 }, 18393 End: function End() { 18394 if (!isGrid || event.ctrlKey) { 18395 var _options$last; 18396 18397 (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); 18398 } else { 18399 var _options$next; 18400 18401 (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true); 18402 } 18403 }, 18404 PageUp: function PageUp() { 18405 if (isGrid) { 18406 var _options$up; 18407 18408 (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true); 18409 } else { 18410 var _options$first2; 18411 18412 (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options); 18413 } 18414 }, 18415 PageDown: function PageDown() { 18416 if (isGrid) { 18417 var _options$down; 18418 18419 (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true); 18420 } else { 18421 var _options$last2; 18422 18423 (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options); 18424 } 18425 } 18426 }; 18427 var action = keyMap[event.key]; 18428 18429 if (action) { 18430 event.preventDefault(); 18431 action(); 18432 return; 18433 } 18434 18435 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 18436 if (event.defaultPrevented) return; 18437 18438 if (event.key.length === 1 && event.key !== " ") { 18439 var widget = getWidget(event.currentTarget); 18440 18441 if (widget && isTextField(widget)) { 18442 widget.focus(); 18443 setTextFieldValue(widget, ""); 18444 } 18445 } else if (event.key === "Delete" || event.key === "Backspace") { 18446 var _widget = getWidget(event.currentTarget); 18447 18448 if (_widget && isTextField(_widget)) { 18449 event.preventDefault(); 18450 setTextFieldValue(_widget, ""); 18451 } 18452 } 18453 }, [options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]); 18454 var onClick = (0,external_React_.useCallback)(function (event) { 18455 var _onClickRef$current; 18456 18457 (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); 18458 if (event.defaultPrevented) return; 18459 var element = event.currentTarget; 18460 var widget = getWidget(element); 18461 18462 if (widget && !hasFocusWithin(widget)) { 18463 // If there's a widget inside the composite item, we make sure it's 18464 // focused when pressing enter, space or clicking on the composite item. 18465 widget.focus(); 18466 } 18467 }, []); 18468 return _objectSpread2({ 18469 ref: useForkRef(ref, htmlRef), 18470 id: id, 18471 tabIndex: shouldTabIndex ? htmlTabIndex : -1, 18472 "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined, 18473 onMouseDown: onMouseDown, 18474 onFocus: onFocus, 18475 onBlurCapture: onBlurCapture, 18476 onKeyDown: onKeyDown, 18477 onClick: onClick 18478 }, htmlProps); 18479 } 18480 }); 18481 var CompositeItem = createComponent({ 18482 as: "button", 18483 memo: true, 18484 useHook: useCompositeItem 18485 }); 18486 18487 18488 18489 ;// CONCATENATED MODULE: external ["wp","dom"] 18490 var external_wp_dom_namespaceObject = window["wp"]["dom"]; 18491 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 18492 18493 18494 /** 18495 * WordPress dependencies 18496 */ 18497 18498 const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 18499 xmlns: "http://www.w3.org/2000/svg", 18500 viewBox: "0 0 24 24" 18501 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 18502 d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" 18503 })); 18504 /* harmony default export */ var library_close = (close_close); 18505 18506 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js 18507 // @ts-nocheck 18508 18509 /** 18510 * WordPress dependencies 18511 */ 18512 18513 /** 18514 * Module constants 18515 */ 18516 18517 const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space. 18518 18519 /** 18520 * Utility used to compute the popover position over the xAxis 18521 * 18522 * @param {Object} anchorRect Anchor Rect. 18523 * @param {Object} contentSize Content Size. 18524 * @param {string} xAxis Desired xAxis. 18525 * @param {string} corner Desired corner. 18526 * @param {boolean} stickyBoundaryElement The boundary element to use when 18527 * switching between sticky and normal 18528 * position. 18529 * @param {string} chosenYAxis yAxis to be used. 18530 * @param {Element} boundaryElement Boundary element. 18531 * @param {boolean} forcePosition Don't adjust position based on anchor. 18532 * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis 18533 * 18534 * @return {Object} Popover xAxis position and constraints. 18535 */ 18536 18537 function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) { 18538 const { 18539 width 18540 } = contentSize; // Correct xAxis for RTL support. 18541 18542 if (xAxis === 'left' && (0,external_wp_i18n_namespaceObject.isRTL)()) { 18543 xAxis = 'right'; 18544 } else if (xAxis === 'right' && (0,external_wp_i18n_namespaceObject.isRTL)()) { 18545 xAxis = 'left'; 18546 } 18547 18548 if (corner === 'left' && (0,external_wp_i18n_namespaceObject.isRTL)()) { 18549 corner = 'right'; 18550 } else if (corner === 'right' && (0,external_wp_i18n_namespaceObject.isRTL)()) { 18551 corner = 'left'; 18552 } // X axis alignment choices. 18553 18554 18555 const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2); 18556 const centerAlignment = { 18557 popoverLeft: anchorMidPoint, 18558 contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2) 18559 }; 18560 let leftAlignmentX = anchorRect.left; 18561 18562 if (corner === 'right') { 18563 leftAlignmentX = anchorRect.right; 18564 } else if (chosenYAxis !== 'middle' && !forceXAlignment) { 18565 leftAlignmentX = anchorMidPoint; 18566 } 18567 18568 let rightAlignmentX = anchorRect.right; 18569 18570 if (corner === 'left') { 18571 rightAlignmentX = anchorRect.left; 18572 } else if (chosenYAxis !== 'middle' && !forceXAlignment) { 18573 rightAlignmentX = anchorMidPoint; 18574 } 18575 18576 const leftAlignment = { 18577 popoverLeft: leftAlignmentX, 18578 contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX 18579 }; 18580 const rightAlignment = { 18581 popoverLeft: rightAlignmentX, 18582 contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width 18583 }; // Choosing the x axis. 18584 18585 let chosenXAxis = xAxis; 18586 let contentWidth = null; 18587 18588 if (!stickyBoundaryElement && !forcePosition) { 18589 if (xAxis === 'center' && centerAlignment.contentWidth === width) { 18590 chosenXAxis = 'center'; 18591 } else if (xAxis === 'left' && leftAlignment.contentWidth === width) { 18592 chosenXAxis = 'left'; 18593 } else if (xAxis === 'right' && rightAlignment.contentWidth === width) { 18594 chosenXAxis = 'right'; 18595 } else { 18596 chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right'; 18597 const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width 18598 18599 if (width > window.innerWidth) { 18600 contentWidth = window.innerWidth; 18601 } // If we can't find any alignment options that could fit 18602 // our content, then let's fallback to the center of the viewport. 18603 18604 18605 if (chosenWidth !== width) { 18606 chosenXAxis = 'center'; 18607 centerAlignment.popoverLeft = window.innerWidth / 2; 18608 } 18609 } 18610 } 18611 18612 let popoverLeft; 18613 18614 if (chosenXAxis === 'center') { 18615 popoverLeft = centerAlignment.popoverLeft; 18616 } else if (chosenXAxis === 'left') { 18617 popoverLeft = leftAlignment.popoverLeft; 18618 } else { 18619 popoverLeft = rightAlignment.popoverLeft; 18620 } 18621 18622 if (boundaryElement) { 18623 popoverLeft = Math.min(popoverLeft, boundaryElement.offsetLeft + boundaryElement.offsetWidth - width); // Avoid the popover being position beyond the left boundary if the 18624 // direction is left to right. 18625 18626 if (!(0,external_wp_i18n_namespaceObject.isRTL)()) { 18627 popoverLeft = Math.max(popoverLeft, 0); 18628 } 18629 } 18630 18631 return { 18632 xAxis: chosenXAxis, 18633 popoverLeft, 18634 contentWidth 18635 }; 18636 } 18637 /** 18638 * Utility used to compute the popover position over the yAxis 18639 * 18640 * @param {Object} anchorRect Anchor Rect. 18641 * @param {Object} contentSize Content Size. 18642 * @param {string} yAxis Desired yAxis. 18643 * @param {string} corner Desired corner. 18644 * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky 18645 * and normal position. 18646 * @param {Element} anchorRef The anchor element. 18647 * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned 18648 * parent container. 18649 * @param {boolean} forcePosition Don't adjust position based on anchor. 18650 * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access 18651 * scroll position to determine sticky behavior. 18652 * @return {Object} Popover xAxis position and constraints. 18653 */ 18654 18655 function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper) { 18656 const { 18657 height 18658 } = contentSize; 18659 18660 if (stickyBoundaryElement) { 18661 const stickyRect = stickyBoundaryElement.getBoundingClientRect(); 18662 const stickyPositionTop = stickyRect.top + height - relativeOffsetTop; 18663 const stickyPositionBottom = stickyRect.bottom - height - relativeOffsetTop; 18664 18665 if (anchorRect.top <= stickyPositionTop) { 18666 if (editorWrapper) { 18667 // If a popover cannot be positioned above the anchor, even after scrolling, we must 18668 // ensure we use the bottom position instead of the popover slot. This prevents the 18669 // popover from always restricting block content and interaction while selected if the 18670 // block is near the top of the site editor. 18671 const isRoomAboveInCanvas = height + HEIGHT_OFFSET < editorWrapper.scrollTop + anchorRect.top; 18672 18673 if (!isRoomAboveInCanvas) { 18674 return { 18675 yAxis: 'bottom', 18676 // If the bottom of the block is also below the bottom sticky position (ex - 18677 // block is also taller than the editor window), return the bottom sticky 18678 // position instead. We do this instead of the top sticky position both to 18679 // allow a smooth transition and more importantly to ensure every section of 18680 // the block can be free from popover obscuration at some point in the 18681 // scroll position. 18682 popoverTop: Math.min(anchorRect.bottom, stickyPositionBottom) 18683 }; 18684 } 18685 } // Default sticky behavior. 18686 18687 18688 return { 18689 yAxis, 18690 popoverTop: Math.min(anchorRect.bottom, stickyPositionTop) 18691 }; 18692 } 18693 } // Y axis alignment choices. 18694 18695 18696 let anchorMidPoint = anchorRect.top + anchorRect.height / 2; 18697 18698 if (corner === 'bottom') { 18699 anchorMidPoint = anchorRect.bottom; 18700 } else if (corner === 'top') { 18701 anchorMidPoint = anchorRect.top; 18702 } 18703 18704 const middleAlignment = { 18705 popoverTop: anchorMidPoint, 18706 contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2) 18707 }; 18708 const topAlignment = { 18709 popoverTop: anchorRect.top, 18710 contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET 18711 }; 18712 const bottomAlignment = { 18713 popoverTop: anchorRect.bottom, 18714 contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height 18715 }; // Choosing the y axis. 18716 18717 let chosenYAxis = yAxis; 18718 let contentHeight = null; 18719 18720 if (!stickyBoundaryElement && !forcePosition) { 18721 if (yAxis === 'middle' && middleAlignment.contentHeight === height) { 18722 chosenYAxis = 'middle'; 18723 } else if (yAxis === 'top' && topAlignment.contentHeight === height) { 18724 chosenYAxis = 'top'; 18725 } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) { 18726 chosenYAxis = 'bottom'; 18727 } else { 18728 chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom'; 18729 const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight; 18730 contentHeight = chosenHeight !== height ? chosenHeight : null; 18731 } 18732 } 18733 18734 let popoverTop; 18735 18736 if (chosenYAxis === 'middle') { 18737 popoverTop = middleAlignment.popoverTop; 18738 } else if (chosenYAxis === 'top') { 18739 popoverTop = topAlignment.popoverTop; 18740 } else { 18741 popoverTop = bottomAlignment.popoverTop; 18742 } 18743 18744 return { 18745 yAxis: chosenYAxis, 18746 popoverTop, 18747 contentHeight 18748 }; 18749 } 18750 /** 18751 * Utility used to compute the popover position and the content max width/height for a popover given 18752 * its anchor rect and its content size. 18753 * 18754 * @param {Object} anchorRect Anchor Rect. 18755 * @param {Object} contentSize Content Size. 18756 * @param {string} position Position. 18757 * @param {boolean} stickyBoundaryElement The boundary element to use when switching between 18758 * sticky and normal position. 18759 * @param {Element} anchorRef The anchor element. 18760 * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned 18761 * parent container. 18762 * @param {Element} boundaryElement Boundary element. 18763 * @param {boolean} forcePosition Don't adjust position based on anchor. 18764 * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis 18765 * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access 18766 * scroll position to determine sticky behavior. 18767 * @return {Object} Popover position and constraints. 18768 */ 18769 18770 function computePopoverPosition(anchorRect, contentSize) { 18771 let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top'; 18772 let stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined; 18773 let anchorRef = arguments.length > 4 ? arguments[4] : undefined; 18774 let relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined; 18775 let boundaryElement = arguments.length > 6 ? arguments[6] : undefined; 18776 let forcePosition = arguments.length > 7 ? arguments[7] : undefined; 18777 let forceXAlignment = arguments.length > 8 ? arguments[8] : undefined; 18778 let editorWrapper = arguments.length > 9 ? arguments[9] : undefined; 18779 const [yAxis, xAxis = 'center', corner] = position.split(' '); 18780 const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper); 18781 const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment); 18782 return { ...xAxisPosition, 18783 ...yAxisPosition 18784 }; 18785 } 18786 /** 18787 * Offsets the given rect by the position of the iframe that contains the 18788 * element. If the owner document is not in an iframe then it returns with the 18789 * original rect. If the popover container document and the anchor document are 18790 * the same, the original rect will also be returned. 18791 * 18792 * @param {DOMRect} rect bounds of the element 18793 * @param {Document} ownerDocument document of the element 18794 * @param {Element} container The popover container to position. 18795 * 18796 * @return {DOMRect} offsetted bounds 18797 */ 18798 18799 function offsetIframe(rect, ownerDocument, container) { 18800 const { 18801 defaultView 18802 } = ownerDocument; 18803 const { 18804 frameElement 18805 } = defaultView; 18806 18807 if (!frameElement || ownerDocument === container.ownerDocument) { 18808 return rect; 18809 } 18810 18811 const iframeRect = frameElement.getBoundingClientRect(); 18812 return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height); 18813 } 18814 18815 ;// CONCATENATED MODULE: external ["wp","deprecated"] 18816 var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 18817 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 18818 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dashicon/index.js 18819 18820 18821 18822 /** 18823 * @typedef OwnProps 18824 * 18825 * @property {import('./types').IconKey} icon Icon name 18826 * @property {string} [className] Class name 18827 */ 18828 18829 /** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */ 18830 18831 /** 18832 * @param {Props} props 18833 * @return {JSX.Element} Element 18834 */ 18835 function Dashicon(_ref) { 18836 let { 18837 icon, 18838 className, 18839 ...extraProps 18840 } = _ref; 18841 const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' '); 18842 return (0,external_wp_element_namespaceObject.createElement)("span", extends_extends({ 18843 className: iconClass 18844 }, extraProps)); 18845 } 18846 18847 /* harmony default export */ var dashicon = (Dashicon); 18848 18849 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js 18850 18851 18852 /** 18853 * External dependencies 18854 */ 18855 18856 /** 18857 * WordPress dependencies 18858 */ 18859 18860 18861 /** 18862 * Internal dependencies 18863 */ 18864 18865 18866 18867 function Icon(_ref) { 18868 let { 18869 icon = null, 18870 size = 24, 18871 ...additionalProps 18872 } = _ref; 18873 18874 if ('string' === typeof icon) { 18875 return (0,external_wp_element_namespaceObject.createElement)(dashicon, extends_extends({ 18876 icon: icon 18877 }, additionalProps)); 18878 } 18879 18880 if ((0,external_wp_element_namespaceObject.isValidElement)(icon) && dashicon === icon.type) { 18881 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { ...additionalProps 18882 }); 18883 } 18884 18885 if ('function' === typeof icon) { 18886 if (icon.prototype instanceof external_wp_element_namespaceObject.Component) { 18887 return (0,external_wp_element_namespaceObject.createElement)(icon, { 18888 size, 18889 ...additionalProps 18890 }); 18891 } 18892 18893 return icon({ 18894 size, 18895 ...additionalProps 18896 }); 18897 } 18898 18899 if (icon && (icon.type === 'svg' || icon.type === external_wp_primitives_namespaceObject.SVG)) { 18900 const appliedProps = { 18901 width: size, 18902 height: size, 18903 ...icon.props, 18904 ...additionalProps 18905 }; 18906 return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, appliedProps); 18907 } 18908 18909 if ((0,external_wp_element_namespaceObject.isValidElement)(icon)) { 18910 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { 18911 // @ts-ignore Just forwarding the size prop along 18912 size, 18913 ...additionalProps 18914 }); 18915 } 18916 18917 return icon; 18918 } 18919 18920 /* harmony default export */ var build_module_icon = (Icon); 18921 18922 ;// CONCATENATED MODULE: external ["wp","warning"] 18923 var external_wp_warning_namespaceObject = window["wp"]["warning"]; 18924 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-system-provider.js 18925 18926 18927 /** 18928 * External dependencies 18929 */ 18930 18931 /** 18932 * WordPress dependencies 18933 */ 18934 18935 18936 18937 const ComponentsContext = (0,external_wp_element_namespaceObject.createContext)( 18938 /** @type {Record<string, any>} */ 18939 {}); 18940 const useComponentsContext = () => (0,external_wp_element_namespaceObject.useContext)(ComponentsContext); 18941 /** 18942 * Runs an effect only on update (i.e., ignores the first render) 18943 * 18944 * @param {import('react').EffectCallback} effect 18945 * @param {import('react').DependencyList} deps 18946 */ 18947 18948 function useUpdateEffect(effect, deps) { 18949 const mounted = (0,external_wp_element_namespaceObject.useRef)(false); 18950 (0,external_wp_element_namespaceObject.useEffect)(() => { 18951 if (mounted.current) { 18952 return effect(); 18953 } 18954 18955 mounted.current = true; 18956 return undefined; 18957 }, deps); 18958 } 18959 /** 18960 * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value. 18961 * 18962 * Note: This function will warn if it detects an un-memoized `value` 18963 * 18964 * @param {Object} props 18965 * @param {Record<string, any>} props.value 18966 * @return {Record<string, any>} The consolidated value. 18967 */ 18968 18969 18970 function useContextSystemBridge(_ref) { 18971 let { 18972 value 18973 } = _ref; 18974 const parentContext = useComponentsContext(); 18975 const valueRef = (0,external_wp_element_namespaceObject.useRef)(value); 18976 useUpdateEffect(() => { 18977 if ( // Objects are equivalent. 18978 (0,external_lodash_namespaceObject.isEqual)(valueRef.current, value) && // But not the same reference. 18979 valueRef.current !== value) { 18980 typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; 18981 } 18982 }, [value]); // `parentContext` will always be memoized (i.e., the result of this hook itself) 18983 // or the default value from when the `ComponentsContext` was originally 18984 // initialized (which will never change, it's a static variable) 18985 // so this memoization will prevent `merge` and `cloneDeep` from rerunning unless 18986 // the references to `value` change OR the `parentContext` has an actual material change 18987 // (because again, it's guaranteed to be memoized or a static reference to the empty object 18988 // so we know that the only changes for `parentContext` are material ones... i.e., why we 18989 // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only 18990 // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are 18991 // correctly warning when the `value` isn't being properly memoized. All of that to say 18992 // that this should be super safe to assume that `useMemo` will only run on actual 18993 // changes to the two dependencies, therefore saving us calls to `merge` and `cloneDeep`! 18994 18995 const config = (0,external_wp_element_namespaceObject.useMemo)(() => { 18996 return (0,external_lodash_namespaceObject.merge)((0,external_lodash_namespaceObject.cloneDeep)(parentContext), value); 18997 }, [parentContext, value]); 18998 return config; 18999 } 19000 /** 19001 * A Provider component that can modify props for connected components within 19002 * the Context system. 19003 * 19004 * @example 19005 * ```jsx 19006 * <ContextSystemProvider value={{ Button: { size: 'small' }}}> 19007 * <Button>...</Button> 19008 * </ContextSystemProvider> 19009 * ``` 19010 * 19011 * @template {Record<string, any>} T 19012 * @param {Object} options 19013 * @param {import('react').ReactNode} options.children Children to render. 19014 * @param {T} options.value Props to render into connected components. 19015 * @return {JSX.Element} A Provider wrapped component. 19016 */ 19017 19018 19019 const BaseContextSystemProvider = _ref2 => { 19020 let { 19021 children, 19022 value 19023 } = _ref2; 19024 const contextValue = useContextSystemBridge({ 19025 value 19026 }); 19027 return (0,external_wp_element_namespaceObject.createElement)(ComponentsContext.Provider, { 19028 value: contextValue 19029 }, children); 19030 }; 19031 19032 const ContextSystemProvider = (0,external_wp_element_namespaceObject.memo)(BaseContextSystemProvider); 19033 19034 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/constants.js 19035 const REACT_TYPEOF_KEY = '$$typeof'; 19036 const COMPONENT_NAMESPACE = 'data-wp-component'; 19037 const CONNECTED_NAMESPACE = 'data-wp-c16t'; 19038 const CONTEXT_COMPONENT_NAMESPACE = 'data-wp-c5tc8t'; 19039 /** 19040 * Special key where the connected namespaces are stored. 19041 * This is attached to Context connected components as a static property. 19042 */ 19043 19044 const CONNECT_STATIC_NAMESPACE = '__contextSystemKey__'; 19045 19046 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/utils.js 19047 /** 19048 * Internal dependencies 19049 */ 19050 19051 /** 19052 * Creates a dedicated context namespace HTML attribute for components. 19053 * ns is short for "namespace" 19054 * 19055 * @example 19056 * ```jsx 19057 * <div {...ns('Container')} /> 19058 * ``` 19059 * 19060 * @param {string} componentName The name for the component. 19061 * @return {Record<string, any>} A props object with the namespaced HTML attribute. 19062 */ 19063 19064 function getNamespace(componentName) { 19065 return { 19066 [COMPONENT_NAMESPACE]: componentName 19067 }; 19068 } 19069 /** 19070 * Creates a dedicated connected context namespace HTML attribute for components. 19071 * ns is short for "namespace" 19072 * 19073 * @example 19074 * ```jsx 19075 * <div {...cns()} /> 19076 * ``` 19077 * 19078 * @return {Record<string, any>} A props object with the namespaced HTML attribute. 19079 */ 19080 19081 function getConnectedNamespace() { 19082 return { 19083 [CONNECTED_NAMESPACE]: true 19084 }; 19085 } 19086 19087 // EXTERNAL MODULE: ./node_modules/memize/index.js 19088 var memize = __webpack_require__(9756); 19089 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); 19090 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/get-styled-class-name-from-key.js 19091 /** 19092 * External dependencies 19093 */ 19094 19095 19096 /** 19097 * Generates the connected component CSS className based on the namespace. 19098 * 19099 * @param namespace The name of the connected component. 19100 * @return The generated CSS className. 19101 */ 19102 19103 function getStyledClassName(namespace) { 19104 const kebab = (0,external_lodash_namespaceObject.kebabCase)(namespace); 19105 return `components-$kebab}`; 19106 } 19107 19108 const getStyledClassNameFromKey = memize_default()(getStyledClassName); 19109 19110 ;// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js 19111 /* 19112 19113 Based off glamor's StyleSheet, thanks Sunil ❤️ 19114 19115 high performance StyleSheet for css-in-js systems 19116 19117 - uses multiple style tags behind the scenes for millions of rules 19118 - uses `insertRule` for appending in production for *much* faster performance 19119 19120 // usage 19121 19122 import { StyleSheet } from '@emotion/sheet' 19123 19124 let styleSheet = new StyleSheet({ key: '', container: document.head }) 19125 19126 styleSheet.insert('#box { border: 1px solid red; }') 19127 - appends a css rule into the stylesheet 19128 19129 styleSheet.flush() 19130 - empties the stylesheet of all its contents 19131 19132 */ 19133 // $FlowFixMe 19134 function sheetForTag(tag) { 19135 if (tag.sheet) { 19136 // $FlowFixMe 19137 return tag.sheet; 19138 } // this weirdness brought to you by firefox 19139 19140 /* istanbul ignore next */ 19141 19142 19143 for (var i = 0; i < document.styleSheets.length; i++) { 19144 if (document.styleSheets[i].ownerNode === tag) { 19145 // $FlowFixMe 19146 return document.styleSheets[i]; 19147 } 19148 } 19149 } 19150 19151 function createStyleElement(options) { 19152 var tag = document.createElement('style'); 19153 tag.setAttribute('data-emotion', options.key); 19154 19155 if (options.nonce !== undefined) { 19156 tag.setAttribute('nonce', options.nonce); 19157 } 19158 19159 tag.appendChild(document.createTextNode('')); 19160 tag.setAttribute('data-s', ''); 19161 return tag; 19162 } 19163 19164 var StyleSheet = /*#__PURE__*/function () { 19165 function StyleSheet(options) { 19166 var _this = this; 19167 19168 this._insertTag = function (tag) { 19169 var before; 19170 19171 if (_this.tags.length === 0) { 19172 if (_this.insertionPoint) { 19173 before = _this.insertionPoint.nextSibling; 19174 } else if (_this.prepend) { 19175 before = _this.container.firstChild; 19176 } else { 19177 before = _this.before; 19178 } 19179 } else { 19180 before = _this.tags[_this.tags.length - 1].nextSibling; 19181 } 19182 19183 _this.container.insertBefore(tag, before); 19184 19185 _this.tags.push(tag); 19186 }; 19187 19188 this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; 19189 this.tags = []; 19190 this.ctr = 0; 19191 this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets 19192 19193 this.key = options.key; 19194 this.container = options.container; 19195 this.prepend = options.prepend; 19196 this.insertionPoint = options.insertionPoint; 19197 this.before = null; 19198 } 19199 19200 var _proto = StyleSheet.prototype; 19201 19202 _proto.hydrate = function hydrate(nodes) { 19203 nodes.forEach(this._insertTag); 19204 }; 19205 19206 _proto.insert = function insert(rule) { 19207 // the max length is how many rules we have per style tag, it's 65000 in speedy mode 19208 // it's 1 in dev because we insert source maps that map a single rule to a location 19209 // and you can only have one source map per style tag 19210 if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { 19211 this._insertTag(createStyleElement(this)); 19212 } 19213 19214 var tag = this.tags[this.tags.length - 1]; 19215 19216 if (false) { var isImportRule; } 19217 19218 if (this.isSpeedy) { 19219 var sheet = sheetForTag(tag); 19220 19221 try { 19222 // this is the ultrafast version, works across browsers 19223 // the big drawback is that the css won't be editable in devtools 19224 sheet.insertRule(rule, sheet.cssRules.length); 19225 } catch (e) { 19226 if (false) {} 19227 } 19228 } else { 19229 tag.appendChild(document.createTextNode(rule)); 19230 } 19231 19232 this.ctr++; 19233 }; 19234 19235 _proto.flush = function flush() { 19236 // $FlowFixMe 19237 this.tags.forEach(function (tag) { 19238 return tag.parentNode && tag.parentNode.removeChild(tag); 19239 }); 19240 this.tags = []; 19241 this.ctr = 0; 19242 19243 if (false) {} 19244 }; 19245 19246 return StyleSheet; 19247 }(); 19248 19249 19250 19251 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Utility.js 19252 /** 19253 * @param {number} 19254 * @return {number} 19255 */ 19256 var abs = Math.abs 19257 19258 /** 19259 * @param {number} 19260 * @return {string} 19261 */ 19262 var Utility_from = String.fromCharCode 19263 19264 /** 19265 * @param {object} 19266 * @return {object} 19267 */ 19268 var Utility_assign = Object.assign 19269 19270 /** 19271 * @param {string} value 19272 * @param {number} length 19273 * @return {number} 19274 */ 19275 function hash (value, length) { 19276 return (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) 19277 } 19278 19279 /** 19280 * @param {string} value 19281 * @return {string} 19282 */ 19283 function trim (value) { 19284 return value.trim() 19285 } 19286 19287 /** 19288 * @param {string} value 19289 * @param {RegExp} pattern 19290 * @return {string?} 19291 */ 19292 function match (value, pattern) { 19293 return (value = pattern.exec(value)) ? value[0] : value 19294 } 19295 19296 /** 19297 * @param {string} value 19298 * @param {(string|RegExp)} pattern 19299 * @param {string} replacement 19300 * @return {string} 19301 */ 19302 function replace (value, pattern, replacement) { 19303 return value.replace(pattern, replacement) 19304 } 19305 19306 /** 19307 * @param {string} value 19308 * @param {string} search 19309 * @return {number} 19310 */ 19311 function indexof (value, search) { 19312 return value.indexOf(search) 19313 } 19314 19315 /** 19316 * @param {string} value 19317 * @param {number} index 19318 * @return {number} 19319 */ 19320 function Utility_charat (value, index) { 19321 return value.charCodeAt(index) | 0 19322 } 19323 19324 /** 19325 * @param {string} value 19326 * @param {number} begin 19327 * @param {number} end 19328 * @return {string} 19329 */ 19330 function Utility_substr (value, begin, end) { 19331 return value.slice(begin, end) 19332 } 19333 19334 /** 19335 * @param {string} value 19336 * @return {number} 19337 */ 19338 function Utility_strlen (value) { 19339 return value.length 19340 } 19341 19342 /** 19343 * @param {any[]} value 19344 * @return {number} 19345 */ 19346 function Utility_sizeof (value) { 19347 return value.length 19348 } 19349 19350 /** 19351 * @param {any} value 19352 * @param {any[]} array 19353 * @return {any} 19354 */ 19355 function Utility_append (value, array) { 19356 return array.push(value), value 19357 } 19358 19359 /** 19360 * @param {string[]} array 19361 * @param {function} callback 19362 * @return {string} 19363 */ 19364 function Utility_combine (array, callback) { 19365 return array.map(callback).join('') 19366 } 19367 19368 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Tokenizer.js 19369 19370 19371 var line = 1 19372 var column = 1 19373 var Tokenizer_length = 0 19374 var position = 0 19375 var character = 0 19376 var characters = '' 19377 19378 /** 19379 * @param {string} value 19380 * @param {object | null} root 19381 * @param {object | null} parent 19382 * @param {string} type 19383 * @param {string[] | string} props 19384 * @param {object[] | string} children 19385 * @param {number} length 19386 */ 19387 function node (value, root, parent, type, props, children, length) { 19388 return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''} 19389 } 19390 19391 /** 19392 * @param {object} root 19393 * @param {object} props 19394 * @return {object} 19395 */ 19396 function copy (root, props) { 19397 return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props) 19398 } 19399 19400 /** 19401 * @return {number} 19402 */ 19403 function Tokenizer_char () { 19404 return character 19405 } 19406 19407 /** 19408 * @return {number} 19409 */ 19410 function prev () { 19411 character = position > 0 ? Utility_charat(characters, --position) : 0 19412 19413 if (column--, character === 10) 19414 column = 1, line-- 19415 19416 return character 19417 } 19418 19419 /** 19420 * @return {number} 19421 */ 19422 function next () { 19423 character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0 19424 19425 if (column++, character === 10) 19426 column = 1, line++ 19427 19428 return character 19429 } 19430 19431 /** 19432 * @return {number} 19433 */ 19434 function peek () { 19435 return Utility_charat(characters, position) 19436 } 19437 19438 /** 19439 * @return {number} 19440 */ 19441 function caret () { 19442 return position 19443 } 19444 19445 /** 19446 * @param {number} begin 19447 * @param {number} end 19448 * @return {string} 19449 */ 19450 function slice (begin, end) { 19451 return Utility_substr(characters, begin, end) 19452 } 19453 19454 /** 19455 * @param {number} type 19456 * @return {number} 19457 */ 19458 function token (type) { 19459 switch (type) { 19460 // \0 \t \n \r \s whitespace token 19461 case 0: case 9: case 10: case 13: case 32: 19462 return 5 19463 // ! + , / > @ ~ isolate token 19464 case 33: case 43: case 44: case 47: case 62: case 64: case 126: 19465 // ; { } breakpoint token 19466 case 59: case 123: case 125: 19467 return 4 19468 // : accompanied token 19469 case 58: 19470 return 3 19471 // " ' ( [ opening delimit token 19472 case 34: case 39: case 40: case 91: 19473 return 2 19474 // ) ] closing delimit token 19475 case 41: case 93: 19476 return 1 19477 } 19478 19479 return 0 19480 } 19481 19482 /** 19483 * @param {string} value 19484 * @return {any[]} 19485 */ 19486 function alloc (value) { 19487 return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, [] 19488 } 19489 19490 /** 19491 * @param {any} value 19492 * @return {any} 19493 */ 19494 function dealloc (value) { 19495 return characters = '', value 19496 } 19497 19498 /** 19499 * @param {number} type 19500 * @return {string} 19501 */ 19502 function delimit (type) { 19503 return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) 19504 } 19505 19506 /** 19507 * @param {string} value 19508 * @return {string[]} 19509 */ 19510 function Tokenizer_tokenize (value) { 19511 return dealloc(tokenizer(alloc(value))) 19512 } 19513 19514 /** 19515 * @param {number} type 19516 * @return {string} 19517 */ 19518 function whitespace (type) { 19519 while (character = peek()) 19520 if (character < 33) 19521 next() 19522 else 19523 break 19524 19525 return token(type) > 2 || token(character) > 3 ? '' : ' ' 19526 } 19527 19528 /** 19529 * @param {string[]} children 19530 * @return {string[]} 19531 */ 19532 function tokenizer (children) { 19533 while (next()) 19534 switch (token(character)) { 19535 case 0: append(identifier(position - 1), children) 19536 break 19537 case 2: append(delimit(character), children) 19538 break 19539 default: append(from(character), children) 19540 } 19541 19542 return children 19543 } 19544 19545 /** 19546 * @param {number} index 19547 * @param {number} count 19548 * @return {string} 19549 */ 19550 function escaping (index, count) { 19551 while (--count && next()) 19552 // not 0-9 A-F a-f 19553 if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97)) 19554 break 19555 19556 return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) 19557 } 19558 19559 /** 19560 * @param {number} type 19561 * @return {number} 19562 */ 19563 function delimiter (type) { 19564 while (next()) 19565 switch (character) { 19566 // ] ) " ' 19567 case type: 19568 return position 19569 // " ' 19570 case 34: case 39: 19571 if (type !== 34 && type !== 39) 19572 delimiter(character) 19573 break 19574 // ( 19575 case 40: 19576 if (type === 41) 19577 delimiter(type) 19578 break 19579 // \ 19580 case 92: 19581 next() 19582 break 19583 } 19584 19585 return position 19586 } 19587 19588 /** 19589 * @param {number} type 19590 * @param {number} index 19591 * @return {number} 19592 */ 19593 function commenter (type, index) { 19594 while (next()) 19595 // // 19596 if (type + character === 47 + 10) 19597 break 19598 // /* 19599 else if (type + character === 42 + 42 && peek() === 47) 19600 break 19601 19602 return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next()) 19603 } 19604 19605 /** 19606 * @param {number} index 19607 * @return {string} 19608 */ 19609 function identifier (index) { 19610 while (!token(peek())) 19611 next() 19612 19613 return slice(index, position) 19614 } 19615 19616 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Enum.js 19617 var MS = '-ms-' 19618 var MOZ = '-moz-' 19619 var WEBKIT = '-webkit-' 19620 19621 var COMMENT = 'comm' 19622 var Enum_RULESET = 'rule' 19623 var DECLARATION = 'decl' 19624 19625 var PAGE = '@page' 19626 var MEDIA = '@media' 19627 var IMPORT = '@import' 19628 var CHARSET = '@charset' 19629 var VIEWPORT = '@viewport' 19630 var SUPPORTS = '@supports' 19631 var DOCUMENT = '@document' 19632 var NAMESPACE = '@namespace' 19633 var KEYFRAMES = '@keyframes' 19634 var FONT_FACE = '@font-face' 19635 var COUNTER_STYLE = '@counter-style' 19636 var FONT_FEATURE_VALUES = '@font-feature-values' 19637 19638 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Serializer.js 19639 19640 19641 19642 /** 19643 * @param {object[]} children 19644 * @param {function} callback 19645 * @return {string} 19646 */ 19647 function serialize (children, callback) { 19648 var output = '' 19649 var length = Utility_sizeof(children) 19650 19651 for (var i = 0; i < length; i++) 19652 output += callback(children[i], i, children, callback) || '' 19653 19654 return output 19655 } 19656 19657 /** 19658 * @param {object} element 19659 * @param {number} index 19660 * @param {object[]} children 19661 * @param {function} callback 19662 * @return {string} 19663 */ 19664 function stringify (element, index, children, callback) { 19665 switch (element.type) { 19666 case IMPORT: case DECLARATION: return element.return = element.return || element.value 19667 case COMMENT: return '' 19668 case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}' 19669 case Enum_RULESET: element.value = element.props.join(',') 19670 } 19671 19672 return Utility_strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' 19673 } 19674 19675 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Prefixer.js 19676 19677 19678 19679 /** 19680 * @param {string} value 19681 * @param {number} length 19682 * @return {string} 19683 */ 19684 function prefix (value, length) { 19685 switch (hash(value, length)) { 19686 // color-adjust 19687 case 5103: 19688 return WEBKIT + 'print-' + value + value 19689 // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) 19690 case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: 19691 // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break 19692 case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: 19693 // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, 19694 case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: 19695 // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) 19696 case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: 19697 return WEBKIT + value + value 19698 // appearance, user-select, transform, hyphens, text-size-adjust 19699 case 5349: case 4246: case 4810: case 6968: case 2756: 19700 return WEBKIT + value + MOZ + value + MS + value + value 19701 // flex, flex-direction 19702 case 6828: case 4268: 19703 return WEBKIT + value + MS + value + value 19704 // order 19705 case 6165: 19706 return WEBKIT + value + MS + 'flex-' + value + value 19707 // align-items 19708 case 5187: 19709 return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value 19710 // align-self 19711 case 5443: 19712 return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value 19713 // align-content 19714 case 4675: 19715 return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value 19716 // flex-shrink 19717 case 5548: 19718 return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value 19719 // flex-basis 19720 case 5292: 19721 return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value 19722 // flex-grow 19723 case 6060: 19724 return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value 19725 // transition 19726 case 4554: 19727 return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value 19728 // cursor 19729 case 6187: 19730 return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value 19731 // background, background-image 19732 case 5495: case 3959: 19733 return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1') 19734 // justify-content 19735 case 4968: 19736 return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value 19737 // (margin|padding)-inline-(start|end) 19738 case 4095: case 3583: case 4068: case 2532: 19739 return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value 19740 // (min|max)?(width|height|inline-size|block-size) 19741 case 8116: case 7059: case 5753: case 5535: 19742 case 5445: case 5701: case 4933: case 4677: 19743 case 5533: case 5789: case 5021: case 4765: 19744 // stretch, max-content, min-content, fill-available 19745 if (Utility_strlen(value) - 1 - length > 6) 19746 switch (Utility_charat(value, length + 1)) { 19747 // (m)ax-content, (m)in-content 19748 case 109: 19749 // - 19750 if (Utility_charat(value, length + 4) !== 45) 19751 break 19752 // (f)ill-available, (f)it-content 19753 case 102: 19754 return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value 19755 // (s)tretch 19756 case 115: 19757 return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value 19758 } 19759 break 19760 // position: sticky 19761 case 4949: 19762 // (s)ticky? 19763 if (Utility_charat(value, length + 1) !== 115) 19764 break 19765 // display: (flex|inline-flex) 19766 case 6444: 19767 switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) { 19768 // stic(k)y 19769 case 107: 19770 return replace(value, ':', ':' + WEBKIT) + value 19771 // (inline-)?fl(e)x 19772 case 101: 19773 return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value 19774 } 19775 break 19776 // writing-mode 19777 case 5936: 19778 switch (Utility_charat(value, length + 11)) { 19779 // vertical-l(r) 19780 case 114: 19781 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value 19782 // vertical-r(l) 19783 case 108: 19784 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value 19785 // horizontal(-)tb 19786 case 45: 19787 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value 19788 } 19789 19790 return WEBKIT + value + MS + value + value 19791 } 19792 19793 return value 19794 } 19795 19796 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Middleware.js 19797 19798 19799 19800 19801 19802 19803 /** 19804 * @param {function[]} collection 19805 * @return {function} 19806 */ 19807 function middleware (collection) { 19808 var length = Utility_sizeof(collection) 19809 19810 return function (element, index, children, callback) { 19811 var output = '' 19812 19813 for (var i = 0; i < length; i++) 19814 output += collection[i](element, index, children, callback) || '' 19815 19816 return output 19817 } 19818 } 19819 19820 /** 19821 * @param {function} callback 19822 * @return {function} 19823 */ 19824 function rulesheet (callback) { 19825 return function (element) { 19826 if (!element.root) 19827 if (element = element.return) 19828 callback(element) 19829 } 19830 } 19831 19832 /** 19833 * @param {object} element 19834 * @param {number} index 19835 * @param {object[]} children 19836 * @param {function} callback 19837 */ 19838 function prefixer (element, index, children, callback) { 19839 if (element.length > -1) 19840 if (!element.return) 19841 switch (element.type) { 19842 case DECLARATION: element.return = prefix(element.value, element.length) 19843 break 19844 case KEYFRAMES: 19845 return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback) 19846 case Enum_RULESET: 19847 if (element.length) 19848 return Utility_combine(element.props, function (value) { 19849 switch (match(value, /(::plac\w+|:read-\w+)/)) { 19850 // :read-(only|write) 19851 case ':read-only': case ':read-write': 19852 return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback) 19853 // :placeholder 19854 case '::placeholder': 19855 return serialize([ 19856 copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}), 19857 copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}), 19858 copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}) 19859 ], callback) 19860 } 19861 19862 return '' 19863 }) 19864 } 19865 } 19866 19867 /** 19868 * @param {object} element 19869 * @param {number} index 19870 * @param {object[]} children 19871 */ 19872 function namespace (element) { 19873 switch (element.type) { 19874 case RULESET: 19875 element.props = element.props.map(function (value) { 19876 return combine(tokenize(value), function (value, index, children) { 19877 switch (charat(value, 0)) { 19878 // \f 19879 case 12: 19880 return substr(value, 1, strlen(value)) 19881 // \0 ( + > ~ 19882 case 0: case 40: case 43: case 62: case 126: 19883 return value 19884 // : 19885 case 58: 19886 if (children[++index] === 'global') 19887 children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1) 19888 // \s 19889 case 32: 19890 return index === 1 ? '' : value 19891 default: 19892 switch (index) { 19893 case 0: element = value 19894 return sizeof(children) > 1 ? '' : value 19895 case index = sizeof(children) - 1: case 2: 19896 return index === 2 ? value + element + element : value + element 19897 default: 19898 return value 19899 } 19900 } 19901 }) 19902 }) 19903 } 19904 } 19905 19906 ;// CONCATENATED MODULE: ./node_modules/stylis/src/Parser.js 19907 19908 19909 19910 19911 /** 19912 * @param {string} value 19913 * @return {object[]} 19914 */ 19915 function compile (value) { 19916 return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value)) 19917 } 19918 19919 /** 19920 * @param {string} value 19921 * @param {object} root 19922 * @param {object?} parent 19923 * @param {string[]} rule 19924 * @param {string[]} rules 19925 * @param {string[]} rulesets 19926 * @param {number[]} pseudo 19927 * @param {number[]} points 19928 * @param {string[]} declarations 19929 * @return {object} 19930 */ 19931 function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { 19932 var index = 0 19933 var offset = 0 19934 var length = pseudo 19935 var atrule = 0 19936 var property = 0 19937 var previous = 0 19938 var variable = 1 19939 var scanning = 1 19940 var ampersand = 1 19941 var character = 0 19942 var type = '' 19943 var props = rules 19944 var children = rulesets 19945 var reference = rule 19946 var characters = type 19947 19948 while (scanning) 19949 switch (previous = character, character = next()) { 19950 // ( 19951 case 40: 19952 if (previous != 108 && characters.charCodeAt(length - 1) == 58) { 19953 if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1) 19954 ampersand = -1 19955 break 19956 } 19957 // " ' [ 19958 case 34: case 39: case 91: 19959 characters += delimit(character) 19960 break 19961 // \t \n \r \s 19962 case 9: case 10: case 13: case 32: 19963 characters += whitespace(previous) 19964 break 19965 // \ 19966 case 92: 19967 characters += escaping(caret() - 1, 7) 19968 continue 19969 // / 19970 case 47: 19971 switch (peek()) { 19972 case 42: case 47: 19973 Utility_append(comment(commenter(next(), caret()), root, parent), declarations) 19974 break 19975 default: 19976 characters += '/' 19977 } 19978 break 19979 // { 19980 case 123 * variable: 19981 points[index++] = Utility_strlen(characters) * ampersand 19982 // } ; \0 19983 case 125 * variable: case 59: case 0: 19984 switch (character) { 19985 // \0 } 19986 case 0: case 125: scanning = 0 19987 // ; 19988 case 59 + offset: 19989 if (property > 0 && (Utility_strlen(characters) - length)) 19990 Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations) 19991 break 19992 // @ ; 19993 case 59: characters += ';' 19994 // { rule/at-rule 19995 default: 19996 Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets) 19997 19998 if (character === 123) 19999 if (offset === 0) 20000 parse(characters, root, reference, reference, props, rulesets, length, points, children) 20001 else 20002 switch (atrule) { 20003 // d m s 20004 case 100: case 109: case 115: 20005 parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) 20006 break 20007 default: 20008 parse(characters, reference, reference, reference, [''], children, 0, points, children) 20009 } 20010 } 20011 20012 index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo 20013 break 20014 // : 20015 case 58: 20016 length = 1 + Utility_strlen(characters), property = previous 20017 default: 20018 if (variable < 1) 20019 if (character == 123) 20020 --variable 20021 else if (character == 125 && variable++ == 0 && prev() == 125) 20022 continue 20023 20024 switch (characters += Utility_from(character), character * variable) { 20025 // & 20026 case 38: 20027 ampersand = offset > 0 ? 1 : (characters += '\f', -1) 20028 break 20029 // , 20030 case 44: 20031 points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1 20032 break 20033 // @ 20034 case 64: 20035 // - 20036 if (peek() === 45) 20037 characters += delimit(next()) 20038 20039 atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++ 20040 break 20041 // - 20042 case 45: 20043 if (previous === 45 && Utility_strlen(characters) == 2) 20044 variable = 0 20045 } 20046 } 20047 20048 return rulesets 20049 } 20050 20051 /** 20052 * @param {string} value 20053 * @param {object} root 20054 * @param {object?} parent 20055 * @param {number} index 20056 * @param {number} offset 20057 * @param {string[]} rules 20058 * @param {number[]} points 20059 * @param {string} type 20060 * @param {string[]} props 20061 * @param {string[]} children 20062 * @param {number} length 20063 * @return {object} 20064 */ 20065 function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) { 20066 var post = offset - 1 20067 var rule = offset === 0 ? rules : [''] 20068 var size = Utility_sizeof(rule) 20069 20070 for (var i = 0, j = 0, k = 0; i < index; ++i) 20071 for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) 20072 if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x]))) 20073 props[k++] = z 20074 20075 return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length) 20076 } 20077 20078 /** 20079 * @param {number} value 20080 * @param {object} root 20081 * @param {object?} parent 20082 * @return {object} 20083 */ 20084 function comment (value, root, parent) { 20085 return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0) 20086 } 20087 20088 /** 20089 * @param {string} value 20090 * @param {object} root 20091 * @param {object?} parent 20092 * @param {number} length 20093 * @return {object} 20094 */ 20095 function declaration (value, root, parent, length) { 20096 return node(value, root, parent, DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length) 20097 } 20098 20099 ;// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js 20100 20101 20102 20103 20104 20105 var last = function last(arr) { 20106 return arr.length ? arr[arr.length - 1] : null; 20107 }; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244 20108 20109 20110 var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { 20111 var previous = 0; 20112 var character = 0; 20113 20114 while (true) { 20115 previous = character; 20116 character = peek(); // &\f 20117 20118 if (previous === 38 && character === 12) { 20119 points[index] = 1; 20120 } 20121 20122 if (token(character)) { 20123 break; 20124 } 20125 20126 next(); 20127 } 20128 20129 return slice(begin, position); 20130 }; 20131 20132 var toRules = function toRules(parsed, points) { 20133 // pretend we've started with a comma 20134 var index = -1; 20135 var character = 44; 20136 20137 do { 20138 switch (token(character)) { 20139 case 0: 20140 // &\f 20141 if (character === 38 && peek() === 12) { 20142 // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings 20143 // stylis inserts \f after & to know when & where it should replace this sequence with the context selector 20144 // and when it should just concatenate the outer and inner selectors 20145 // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here 20146 points[index] = 1; 20147 } 20148 20149 parsed[index] += identifierWithPointTracking(position - 1, points, index); 20150 break; 20151 20152 case 2: 20153 parsed[index] += delimit(character); 20154 break; 20155 20156 case 4: 20157 // comma 20158 if (character === 44) { 20159 // colon 20160 parsed[++index] = peek() === 58 ? '&\f' : ''; 20161 points[index] = parsed[index].length; 20162 break; 20163 } 20164 20165 // fallthrough 20166 20167 default: 20168 parsed[index] += Utility_from(character); 20169 } 20170 } while (character = next()); 20171 20172 return parsed; 20173 }; 20174 20175 var getRules = function getRules(value, points) { 20176 return dealloc(toRules(alloc(value), points)); 20177 }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 20178 20179 20180 var fixedElements = /* #__PURE__ */new WeakMap(); 20181 var compat = function compat(element) { 20182 if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo 20183 // negative .length indicates that this rule has been already prefixed 20184 element.length < 1) { 20185 return; 20186 } 20187 20188 var value = element.value, 20189 parent = element.parent; 20190 var isImplicitRule = element.column === parent.column && element.line === parent.line; 20191 20192 while (parent.type !== 'rule') { 20193 parent = parent.parent; 20194 if (!parent) return; 20195 } // short-circuit for the simplest case 20196 20197 20198 if (element.props.length === 1 && value.charCodeAt(0) !== 58 20199 /* colon */ 20200 && !fixedElements.get(parent)) { 20201 return; 20202 } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) 20203 // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" 20204 20205 20206 if (isImplicitRule) { 20207 return; 20208 } 20209 20210 fixedElements.set(element, true); 20211 var points = []; 20212 var rules = getRules(value, points); 20213 var parentRules = parent.props; 20214 20215 for (var i = 0, k = 0; i < rules.length; i++) { 20216 for (var j = 0; j < parentRules.length; j++, k++) { 20217 element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; 20218 } 20219 } 20220 }; 20221 var removeLabel = function removeLabel(element) { 20222 if (element.type === 'decl') { 20223 var value = element.value; 20224 20225 if ( // charcode for l 20226 value.charCodeAt(0) === 108 && // charcode for b 20227 value.charCodeAt(2) === 98) { 20228 // this ignores label 20229 element["return"] = ''; 20230 element.value = ''; 20231 } 20232 } 20233 }; 20234 var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; 20235 20236 var isIgnoringComment = function isIgnoringComment(element) { 20237 return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; 20238 }; 20239 20240 var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { 20241 return function (element, index, children) { 20242 if (element.type !== 'rule') return; 20243 var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); 20244 20245 if (unsafePseudoClasses && cache.compat !== true) { 20246 var prevElement = index > 0 ? children[index - 1] : null; 20247 20248 if (prevElement && isIgnoringComment(last(prevElement.children))) { 20249 return; 20250 } 20251 20252 unsafePseudoClasses.forEach(function (unsafePseudoClass) { 20253 console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); 20254 }); 20255 } 20256 }; 20257 }; 20258 20259 var isImportRule = function isImportRule(element) { 20260 return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; 20261 }; 20262 20263 var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { 20264 for (var i = index - 1; i >= 0; i--) { 20265 if (!isImportRule(children[i])) { 20266 return true; 20267 } 20268 } 20269 20270 return false; 20271 }; // use this to remove incorrect elements from further processing 20272 // so they don't get handed to the `sheet` (or anything else) 20273 // as that could potentially lead to additional logs which in turn could be overhelming to the user 20274 20275 20276 var nullifyElement = function nullifyElement(element) { 20277 element.type = ''; 20278 element.value = ''; 20279 element["return"] = ''; 20280 element.children = ''; 20281 element.props = ''; 20282 }; 20283 20284 var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { 20285 if (!isImportRule(element)) { 20286 return; 20287 } 20288 20289 if (element.parent) { 20290 console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); 20291 nullifyElement(element); 20292 } else if (isPrependedWithRegularRules(index, children)) { 20293 console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); 20294 nullifyElement(element); 20295 } 20296 }; 20297 20298 var defaultStylisPlugins = [prefixer]; 20299 20300 var createCache = function createCache(options) { 20301 var key = options.key; 20302 20303 if (false) {} 20304 20305 if ( key === 'css') { 20306 var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration 20307 // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) 20308 // note this very very intentionally targets all style elements regardless of the key to ensure 20309 // that creating a cache works inside of render of a React component 20310 20311 Array.prototype.forEach.call(ssrStyles, function (node) { 20312 // we want to only move elements which have a space in the data-emotion attribute value 20313 // because that indicates that it is an Emotion 11 server-side rendered style elements 20314 // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector 20315 // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) 20316 // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles 20317 // will not result in the Emotion 10 styles being destroyed 20318 var dataEmotionAttribute = node.getAttribute('data-emotion'); 20319 20320 if (dataEmotionAttribute.indexOf(' ') === -1) { 20321 return; 20322 } 20323 document.head.appendChild(node); 20324 node.setAttribute('data-s', ''); 20325 }); 20326 } 20327 20328 var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; 20329 20330 if (false) {} 20331 20332 var inserted = {}; // $FlowFixMe 20333 20334 var container; 20335 var nodesToHydrate = []; 20336 20337 { 20338 container = options.container || document.head; 20339 Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which 20340 // means that the style elements we're looking at are only Emotion 11 server-rendered style elements 20341 document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { 20342 var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe 20343 20344 for (var i = 1; i < attrib.length; i++) { 20345 inserted[attrib[i]] = true; 20346 } 20347 20348 nodesToHydrate.push(node); 20349 }); 20350 } 20351 20352 var _insert; 20353 20354 var omnipresentPlugins = [compat, removeLabel]; 20355 20356 if (false) {} 20357 20358 { 20359 var currentSheet; 20360 var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) { 20361 currentSheet.insert(rule); 20362 })]; 20363 var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); 20364 20365 var stylis = function stylis(styles) { 20366 return serialize(compile(styles), serializer); 20367 }; 20368 20369 _insert = function insert(selector, serialized, sheet, shouldCache) { 20370 currentSheet = sheet; 20371 20372 if (false) {} 20373 20374 stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); 20375 20376 if (shouldCache) { 20377 cache.inserted[serialized.name] = true; 20378 } 20379 }; 20380 } 20381 20382 var cache = { 20383 key: key, 20384 sheet: new StyleSheet({ 20385 key: key, 20386 container: container, 20387 nonce: options.nonce, 20388 speedy: options.speedy, 20389 prepend: options.prepend, 20390 insertionPoint: options.insertionPoint 20391 }), 20392 nonce: options.nonce, 20393 inserted: inserted, 20394 registered: {}, 20395 insert: _insert 20396 }; 20397 cache.sheet.hydrate(nodesToHydrate); 20398 return cache; 20399 }; 20400 20401 /* harmony default export */ var emotion_cache_browser_esm = (createCache); 20402 20403 ;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js 20404 /* eslint-disable */ 20405 // Inspired by https://github.com/garycourt/murmurhash-js 20406 // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 20407 function murmur2(str) { 20408 // 'm' and 'r' are mixing constants generated offline. 20409 // They're not really 'magic', they just happen to work well. 20410 // const m = 0x5bd1e995; 20411 // const r = 24; 20412 // Initialize the hash 20413 var h = 0; // Mix 4 bytes at a time into the hash 20414 20415 var k, 20416 i = 0, 20417 len = str.length; 20418 20419 for (; len >= 4; ++i, len -= 4) { 20420 k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; 20421 k = 20422 /* Math.imul(k, m): */ 20423 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); 20424 k ^= 20425 /* k >>> r: */ 20426 k >>> 24; 20427 h = 20428 /* Math.imul(k, m): */ 20429 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ 20430 /* Math.imul(h, m): */ 20431 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 20432 } // Handle the last few bytes of the input array 20433 20434 20435 switch (len) { 20436 case 3: 20437 h ^= (str.charCodeAt(i + 2) & 0xff) << 16; 20438 20439 case 2: 20440 h ^= (str.charCodeAt(i + 1) & 0xff) << 8; 20441 20442 case 1: 20443 h ^= str.charCodeAt(i) & 0xff; 20444 h = 20445 /* Math.imul(h, m): */ 20446 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 20447 } // Do a few final mixes of the hash to ensure the last few 20448 // bytes are well-incorporated. 20449 20450 20451 h ^= h >>> 13; 20452 h = 20453 /* Math.imul(h, m): */ 20454 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 20455 return ((h ^ h >>> 15) >>> 0).toString(36); 20456 } 20457 20458 /* harmony default export */ var hash_browser_esm = (murmur2); 20459 20460 ;// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js 20461 var unitlessKeys = { 20462 animationIterationCount: 1, 20463 borderImageOutset: 1, 20464 borderImageSlice: 1, 20465 borderImageWidth: 1, 20466 boxFlex: 1, 20467 boxFlexGroup: 1, 20468 boxOrdinalGroup: 1, 20469 columnCount: 1, 20470 columns: 1, 20471 flex: 1, 20472 flexGrow: 1, 20473 flexPositive: 1, 20474 flexShrink: 1, 20475 flexNegative: 1, 20476 flexOrder: 1, 20477 gridRow: 1, 20478 gridRowEnd: 1, 20479 gridRowSpan: 1, 20480 gridRowStart: 1, 20481 gridColumn: 1, 20482 gridColumnEnd: 1, 20483 gridColumnSpan: 1, 20484 gridColumnStart: 1, 20485 msGridRow: 1, 20486 msGridRowSpan: 1, 20487 msGridColumn: 1, 20488 msGridColumnSpan: 1, 20489 fontWeight: 1, 20490 lineHeight: 1, 20491 opacity: 1, 20492 order: 1, 20493 orphans: 1, 20494 tabSize: 1, 20495 widows: 1, 20496 zIndex: 1, 20497 zoom: 1, 20498 WebkitLineClamp: 1, 20499 // SVG-related properties 20500 fillOpacity: 1, 20501 floodOpacity: 1, 20502 stopOpacity: 1, 20503 strokeDasharray: 1, 20504 strokeDashoffset: 1, 20505 strokeMiterlimit: 1, 20506 strokeOpacity: 1, 20507 strokeWidth: 1 20508 }; 20509 20510 /* harmony default export */ var unitless_browser_esm = (unitlessKeys); 20511 20512 ;// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js 20513 function memoize(fn) { 20514 var cache = Object.create(null); 20515 return function (arg) { 20516 if (cache[arg] === undefined) cache[arg] = fn(arg); 20517 return cache[arg]; 20518 }; 20519 } 20520 20521 /* harmony default export */ var emotion_memoize_browser_esm = (memoize); 20522 20523 ;// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js 20524 20525 20526 20527 20528 var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; 20529 var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; 20530 var hyphenateRegex = /[A-Z]|^ms/g; 20531 var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; 20532 20533 var isCustomProperty = function isCustomProperty(property) { 20534 return property.charCodeAt(1) === 45; 20535 }; 20536 20537 var isProcessableValue = function isProcessableValue(value) { 20538 return value != null && typeof value !== 'boolean'; 20539 }; 20540 20541 var processStyleName = /* #__PURE__ */emotion_memoize_browser_esm(function (styleName) { 20542 return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); 20543 }); 20544 20545 var processStyleValue = function processStyleValue(key, value) { 20546 switch (key) { 20547 case 'animation': 20548 case 'animationName': 20549 { 20550 if (typeof value === 'string') { 20551 return value.replace(animationRegex, function (match, p1, p2) { 20552 cursor = { 20553 name: p1, 20554 styles: p2, 20555 next: cursor 20556 }; 20557 return p1; 20558 }); 20559 } 20560 } 20561 } 20562 20563 if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { 20564 return value + 'px'; 20565 } 20566 20567 return value; 20568 }; 20569 20570 if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } 20571 20572 function handleInterpolation(mergedProps, registered, interpolation) { 20573 if (interpolation == null) { 20574 return ''; 20575 } 20576 20577 if (interpolation.__emotion_styles !== undefined) { 20578 if (false) {} 20579 20580 return interpolation; 20581 } 20582 20583 switch (typeof interpolation) { 20584 case 'boolean': 20585 { 20586 return ''; 20587 } 20588 20589 case 'object': 20590 { 20591 if (interpolation.anim === 1) { 20592 cursor = { 20593 name: interpolation.name, 20594 styles: interpolation.styles, 20595 next: cursor 20596 }; 20597 return interpolation.name; 20598 } 20599 20600 if (interpolation.styles !== undefined) { 20601 var next = interpolation.next; 20602 20603 if (next !== undefined) { 20604 // not the most efficient thing ever but this is a pretty rare case 20605 // and there will be very few iterations of this generally 20606 while (next !== undefined) { 20607 cursor = { 20608 name: next.name, 20609 styles: next.styles, 20610 next: cursor 20611 }; 20612 next = next.next; 20613 } 20614 } 20615 20616 var styles = interpolation.styles + ";"; 20617 20618 if (false) {} 20619 20620 return styles; 20621 } 20622 20623 return createStringFromObject(mergedProps, registered, interpolation); 20624 } 20625 20626 case 'function': 20627 { 20628 if (mergedProps !== undefined) { 20629 var previousCursor = cursor; 20630 var result = interpolation(mergedProps); 20631 cursor = previousCursor; 20632 return handleInterpolation(mergedProps, registered, result); 20633 } else if (false) {} 20634 20635 break; 20636 } 20637 20638 case 'string': 20639 if (false) { var replaced, matched; } 20640 20641 break; 20642 } // finalize string values (regular strings and functions interpolated into css calls) 20643 20644 20645 if (registered == null) { 20646 return interpolation; 20647 } 20648 20649 var cached = registered[interpolation]; 20650 return cached !== undefined ? cached : interpolation; 20651 } 20652 20653 function createStringFromObject(mergedProps, registered, obj) { 20654 var string = ''; 20655 20656 if (Array.isArray(obj)) { 20657 for (var i = 0; i < obj.length; i++) { 20658 string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; 20659 } 20660 } else { 20661 for (var _key in obj) { 20662 var value = obj[_key]; 20663 20664 if (typeof value !== 'object') { 20665 if (registered != null && registered[value] !== undefined) { 20666 string += _key + "{" + registered[value] + "}"; 20667 } else if (isProcessableValue(value)) { 20668 string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; 20669 } 20670 } else { 20671 if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {} 20672 20673 if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { 20674 for (var _i = 0; _i < value.length; _i++) { 20675 if (isProcessableValue(value[_i])) { 20676 string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; 20677 } 20678 } 20679 } else { 20680 var interpolated = handleInterpolation(mergedProps, registered, value); 20681 20682 switch (_key) { 20683 case 'animation': 20684 case 'animationName': 20685 { 20686 string += processStyleName(_key) + ":" + interpolated + ";"; 20687 break; 20688 } 20689 20690 default: 20691 { 20692 if (false) {} 20693 20694 string += _key + "{" + interpolated + "}"; 20695 } 20696 } 20697 } 20698 } 20699 } 20700 } 20701 20702 return string; 20703 } 20704 20705 var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g; 20706 var sourceMapPattern; 20707 20708 if (false) {} // this is the cursor for keyframes 20709 // keyframes are stored on the SerializedStyles object as a linked list 20710 20711 20712 var cursor; 20713 var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { 20714 if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { 20715 return args[0]; 20716 } 20717 20718 var stringMode = true; 20719 var styles = ''; 20720 cursor = undefined; 20721 var strings = args[0]; 20722 20723 if (strings == null || strings.raw === undefined) { 20724 stringMode = false; 20725 styles += handleInterpolation(mergedProps, registered, strings); 20726 } else { 20727 if (false) {} 20728 20729 styles += strings[0]; 20730 } // we start at 1 since we've already handled the first arg 20731 20732 20733 for (var i = 1; i < args.length; i++) { 20734 styles += handleInterpolation(mergedProps, registered, args[i]); 20735 20736 if (stringMode) { 20737 if (false) {} 20738 20739 styles += strings[i]; 20740 } 20741 } 20742 20743 var sourceMap; 20744 20745 if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time 20746 20747 20748 labelPattern.lastIndex = 0; 20749 var identifierName = ''; 20750 var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 20751 20752 while ((match = labelPattern.exec(styles)) !== null) { 20753 identifierName += '-' + // $FlowFixMe we know it's not null 20754 match[1]; 20755 } 20756 20757 var name = hash_browser_esm(styles) + identifierName; 20758 20759 if (false) {} 20760 20761 return { 20762 name: name, 20763 styles: styles, 20764 next: cursor 20765 }; 20766 }; 20767 20768 20769 20770 ;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 var emotion_element_cbed451f_browser_esm_hasOwnProperty = {}.hasOwnProperty; 20781 20782 var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case 20783 // because this module is primarily intended for the browser and node 20784 // but it's also required in react native and similar environments sometimes 20785 // and we could have a special build just for that 20786 // but this is much easier and the native packages 20787 // might use a different theme context in the future anyway 20788 typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({ 20789 key: 'css' 20790 }) : null); 20791 20792 if (false) {} 20793 20794 var CacheProvider = EmotionCacheContext.Provider; 20795 var __unsafe_useEmotionCache = function useEmotionCache() { 20796 return (0,external_React_.useContext)(EmotionCacheContext); 20797 }; 20798 20799 var emotion_element_cbed451f_browser_esm_withEmotionCache = function withEmotionCache(func) { 20800 // $FlowFixMe 20801 return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { 20802 // the cache will never be null in the browser 20803 var cache = (0,external_React_.useContext)(EmotionCacheContext); 20804 return func(props, cache, ref); 20805 }); 20806 }; 20807 20808 var emotion_element_cbed451f_browser_esm_ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({}); 20809 20810 if (false) {} 20811 20812 var useTheme = function useTheme() { 20813 return useContext(emotion_element_cbed451f_browser_esm_ThemeContext); 20814 }; 20815 20816 var getTheme = function getTheme(outerTheme, theme) { 20817 if (typeof theme === 'function') { 20818 var mergedTheme = theme(outerTheme); 20819 20820 if (false) {} 20821 20822 return mergedTheme; 20823 } 20824 20825 if (false) {} 20826 20827 return _extends({}, outerTheme, theme); 20828 }; 20829 20830 var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) { 20831 return weakMemoize(function (theme) { 20832 return getTheme(outerTheme, theme); 20833 }); 20834 }))); 20835 var ThemeProvider = function ThemeProvider(props) { 20836 var theme = useContext(emotion_element_cbed451f_browser_esm_ThemeContext); 20837 20838 if (props.theme !== theme) { 20839 theme = createCacheWithTheme(theme)(props.theme); 20840 } 20841 20842 return /*#__PURE__*/createElement(emotion_element_cbed451f_browser_esm_ThemeContext.Provider, { 20843 value: theme 20844 }, props.children); 20845 }; 20846 function withTheme(Component) { 20847 var componentName = Component.displayName || Component.name || 'Component'; 20848 20849 var render = function render(props, ref) { 20850 var theme = useContext(emotion_element_cbed451f_browser_esm_ThemeContext); 20851 return /*#__PURE__*/createElement(Component, _extends({ 20852 theme: theme, 20853 ref: ref 20854 }, props)); 20855 }; // $FlowFixMe 20856 20857 20858 var WithTheme = /*#__PURE__*/forwardRef(render); 20859 WithTheme.displayName = "WithTheme(" + componentName + ")"; 20860 return hoistNonReactStatics(WithTheme, Component); 20861 } 20862 20863 var getLastPart = function getLastPart(functionName) { 20864 // The match may be something like 'Object.createEmotionProps' or 20865 // 'Loader.prototype.render' 20866 var parts = functionName.split('.'); 20867 return parts[parts.length - 1]; 20868 }; 20869 20870 var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { 20871 // V8 20872 var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); 20873 if (match) return getLastPart(match[1]); // Safari / Firefox 20874 20875 match = /^([A-Za-z0-9$.]+)@/.exec(line); 20876 if (match) return getLastPart(match[1]); 20877 return undefined; 20878 }; 20879 20880 var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS 20881 // identifiers, thus we only need to replace what is a valid character for JS, 20882 // but not for CSS. 20883 20884 var sanitizeIdentifier = function sanitizeIdentifier(identifier) { 20885 return identifier.replace(/\$/g, '-'); 20886 }; 20887 20888 var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { 20889 if (!stackTrace) return undefined; 20890 var lines = stackTrace.split('\n'); 20891 20892 for (var i = 0; i < lines.length; i++) { 20893 var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" 20894 20895 if (!functionName) continue; // If we reach one of these, we have gone too far and should quit 20896 20897 if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an 20898 // uppercase letter 20899 20900 if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); 20901 } 20902 20903 return undefined; 20904 }; 20905 20906 var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : function useInsertionEffect(create) { 20907 create(); 20908 }; 20909 function emotion_element_cbed451f_browser_esm_useInsertionEffectMaybe(create) { 20910 20911 useInsertionEffect(create); 20912 } 20913 20914 var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; 20915 var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; 20916 var emotion_element_cbed451f_browser_esm_createEmotionProps = function createEmotionProps(type, props) { 20917 if (false) {} 20918 20919 var newProps = {}; 20920 20921 for (var key in props) { 20922 if (emotion_element_cbed451f_browser_esm_hasOwnProperty.call(props, key)) { 20923 newProps[key] = props[key]; 20924 } 20925 } 20926 20927 newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when 20928 // the label hasn't already been computed 20929 20930 if (false) { var label; } 20931 20932 return newProps; 20933 }; 20934 20935 var Insertion = function Insertion(_ref) { 20936 var cache = _ref.cache, 20937 serialized = _ref.serialized, 20938 isStringTag = _ref.isStringTag; 20939 registerStyles(cache, serialized, isStringTag); 20940 var rules = emotion_element_cbed451f_browser_esm_useInsertionEffectMaybe(function () { 20941 return insertStyles(cache, serialized, isStringTag); 20942 }); 20943 20944 return null; 20945 }; 20946 20947 var emotion_element_cbed451f_browser_esm_Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (emotion_element_cbed451f_browser_esm_withEmotionCache(function (props, cache, ref) { 20948 var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works 20949 // not passing the registered cache to serializeStyles because it would 20950 // make certain babel optimisations not possible 20951 20952 if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { 20953 cssProp = cache.registered[cssProp]; 20954 } 20955 20956 var WrappedComponent = props[typePropName]; 20957 var registeredStyles = [cssProp]; 20958 var className = ''; 20959 20960 if (typeof props.className === 'string') { 20961 className = getRegisteredStyles(cache.registered, registeredStyles, props.className); 20962 } else if (props.className != null) { 20963 className = props.className + " "; 20964 } 20965 20966 var serialized = serializeStyles(registeredStyles, undefined, useContext(emotion_element_cbed451f_browser_esm_ThemeContext)); 20967 20968 if (false) { var labelFromStack; } 20969 20970 className += cache.key + "-" + serialized.name; 20971 var newProps = {}; 20972 20973 for (var key in props) { 20974 if (emotion_element_cbed451f_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { 20975 newProps[key] = props[key]; 20976 } 20977 } 20978 20979 newProps.ref = ref; 20980 newProps.className = className; 20981 return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, { 20982 cache: cache, 20983 serialized: serialized, 20984 isStringTag: typeof WrappedComponent === 'string' 20985 }), /*#__PURE__*/createElement(WrappedComponent, newProps)); 20986 }))); 20987 20988 if (false) {} 20989 20990 20991 20992 ;// CONCATENATED MODULE: ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js 20993 var isBrowser = "object" !== 'undefined'; 20994 function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) { 20995 var rawClassName = ''; 20996 classNames.split(' ').forEach(function (className) { 20997 if (registered[className] !== undefined) { 20998 registeredStyles.push(registered[className] + ";"); 20999 } else { 21000 rawClassName += className + " "; 21001 } 21002 }); 21003 return rawClassName; 21004 } 21005 var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) { 21006 var className = cache.key + "-" + serialized.name; 21007 21008 if ( // we only need to add the styles to the registered cache if the 21009 // class name could be used further down 21010 // the tree but if it's a string tag, we know it won't 21011 // so we don't have to add it to registered cache. 21012 // this improves memory usage since we can avoid storing the whole style string 21013 (isStringTag === false || // we need to always store it if we're in compat mode and 21014 // in node since emotion-server relies on whether a style is in 21015 // the registered cache to know whether a style is global or not 21016 // also, note that this check will be dead code eliminated in the browser 21017 isBrowser === false ) && cache.registered[className] === undefined) { 21018 cache.registered[className] = serialized.styles; 21019 } 21020 21021 if (cache.inserted[serialized.name] === undefined) { 21022 var current = serialized; 21023 21024 do { 21025 var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); 21026 21027 current = current.next; 21028 } while (current !== undefined); 21029 } 21030 }; 21031 21032 21033 21034 ;// CONCATENATED MODULE: ./node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js 21035 21036 21037 21038 21039 function insertWithoutScoping(cache, serialized) { 21040 if (cache.inserted[serialized.name] === undefined) { 21041 return cache.insert('', serialized, cache.sheet, true); 21042 } 21043 } 21044 21045 function merge(registered, css, className) { 21046 var registeredStyles = []; 21047 var rawClassName = emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, className); 21048 21049 if (registeredStyles.length < 2) { 21050 return className; 21051 } 21052 21053 return rawClassName + css(registeredStyles); 21054 } 21055 21056 var createEmotion = function createEmotion(options) { 21057 var cache = emotion_cache_browser_esm(options); // $FlowFixMe 21058 21059 cache.sheet.speedy = function (value) { 21060 if (false) {} 21061 21062 this.isSpeedy = value; 21063 }; 21064 21065 cache.compat = true; 21066 21067 var css = function css() { 21068 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 21069 args[_key] = arguments[_key]; 21070 } 21071 21072 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered, undefined); 21073 emotion_utils_browser_esm_insertStyles(cache, serialized, false); 21074 return cache.key + "-" + serialized.name; 21075 }; 21076 21077 var keyframes = function keyframes() { 21078 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 21079 args[_key2] = arguments[_key2]; 21080 } 21081 21082 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered); 21083 var animation = "animation-" + serialized.name; 21084 insertWithoutScoping(cache, { 21085 name: serialized.name, 21086 styles: "@keyframes " + animation + "{" + serialized.styles + "}" 21087 }); 21088 return animation; 21089 }; 21090 21091 var injectGlobal = function injectGlobal() { 21092 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 21093 args[_key3] = arguments[_key3]; 21094 } 21095 21096 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered); 21097 insertWithoutScoping(cache, serialized); 21098 }; 21099 21100 var cx = function cx() { 21101 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 21102 args[_key4] = arguments[_key4]; 21103 } 21104 21105 return merge(cache.registered, css, emotion_css_create_instance_esm_classnames(args)); 21106 }; 21107 21108 return { 21109 css: css, 21110 cx: cx, 21111 injectGlobal: injectGlobal, 21112 keyframes: keyframes, 21113 hydrate: function hydrate(ids) { 21114 ids.forEach(function (key) { 21115 cache.inserted[key] = true; 21116 }); 21117 }, 21118 flush: function flush() { 21119 cache.registered = {}; 21120 cache.inserted = {}; 21121 cache.sheet.flush(); 21122 }, 21123 // $FlowFixMe 21124 sheet: cache.sheet, 21125 cache: cache, 21126 getRegisteredStyles: emotion_utils_browser_esm_getRegisteredStyles.bind(null, cache.registered), 21127 merge: merge.bind(null, cache.registered, css) 21128 }; 21129 }; 21130 21131 var emotion_css_create_instance_esm_classnames = function classnames(args) { 21132 var cls = ''; 21133 21134 for (var i = 0; i < args.length; i++) { 21135 var arg = args[i]; 21136 if (arg == null) continue; 21137 var toAdd = void 0; 21138 21139 switch (typeof arg) { 21140 case 'boolean': 21141 break; 21142 21143 case 'object': 21144 { 21145 if (Array.isArray(arg)) { 21146 toAdd = classnames(arg); 21147 } else { 21148 toAdd = ''; 21149 21150 for (var k in arg) { 21151 if (arg[k] && k) { 21152 toAdd && (toAdd += ' '); 21153 toAdd += k; 21154 } 21155 } 21156 } 21157 21158 break; 21159 } 21160 21161 default: 21162 { 21163 toAdd = arg; 21164 } 21165 } 21166 21167 if (toAdd) { 21168 cls && (cls += ' '); 21169 cls += toAdd; 21170 } 21171 } 21172 21173 return cls; 21174 }; 21175 21176 /* harmony default export */ var emotion_css_create_instance_esm = (createEmotion); 21177 21178 ;// CONCATENATED MODULE: ./node_modules/@emotion/css/dist/emotion-css.esm.js 21179 21180 21181 21182 21183 21184 var _createEmotion = emotion_css_create_instance_esm({ 21185 key: 'css' 21186 }), 21187 flush = _createEmotion.flush, 21188 hydrate = _createEmotion.hydrate, 21189 emotion_css_esm_cx = _createEmotion.cx, 21190 emotion_css_esm_merge = _createEmotion.merge, 21191 emotion_css_esm_getRegisteredStyles = _createEmotion.getRegisteredStyles, 21192 injectGlobal = _createEmotion.injectGlobal, 21193 keyframes = _createEmotion.keyframes, 21194 css = _createEmotion.css, 21195 sheet = _createEmotion.sheet, 21196 cache = _createEmotion.cache; 21197 21198 21199 21200 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js 21201 /** 21202 * External dependencies 21203 */ 21204 21205 // eslint-disable-next-line no-restricted-imports 21206 21207 21208 /** 21209 * WordPress dependencies 21210 */ 21211 21212 21213 21214 const isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name', 'styles'].every(p => typeof o[p] !== 'undefined'); 21215 /** 21216 * Retrieve a `cx` function that knows how to handle `SerializedStyles` 21217 * returned by the `@emotion/react` `css` function in addition to what 21218 * `cx` normally knows how to handle. It also hooks into the Emotion 21219 * Cache, allowing `css` calls to work inside iframes. 21220 * 21221 * @example 21222 * import { css } from '@emotion/react'; 21223 * 21224 * const styles = css` 21225 * color: red 21226 * `; 21227 * 21228 * function RedText( { className, ...props } ) { 21229 * const cx = useCx(); 21230 * 21231 * const classes = cx(styles, className); 21232 * 21233 * return <span className={classes} {...props} />; 21234 * } 21235 */ 21236 21237 21238 const useCx = () => { 21239 const cache = __unsafe_useEmotionCache(); 21240 const cx = (0,external_wp_element_namespaceObject.useCallback)(function () { 21241 if (cache === null) { 21242 throw new Error('The `useCx` hook should be only used within a valid Emotion Cache Context'); 21243 } 21244 21245 for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { 21246 classNames[_key] = arguments[_key]; 21247 } 21248 21249 return emotion_css_esm_cx(...classNames.map(arg => { 21250 if (isSerializedStyles(arg)) { 21251 emotion_utils_browser_esm_insertStyles(cache, arg, false); 21252 return `$cache.key}-$arg.name}`; 21253 } 21254 21255 return arg; 21256 })); 21257 }, [cache]); 21258 return cx; 21259 }; 21260 21261 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/use-context-system.js 21262 /** 21263 * WordPress dependencies 21264 */ 21265 21266 /** 21267 * Internal dependencies 21268 */ 21269 21270 21271 21272 21273 21274 /** 21275 * @template TProps 21276 * @typedef {TProps & { className: string }} ConnectedProps 21277 */ 21278 21279 /** 21280 * Custom hook that derives registered props from the Context system. 21281 * These derived props are then consolidated with incoming component props. 21282 * 21283 * @template {{ className?: string }} P 21284 * @param {P} props Incoming props from the component. 21285 * @param {string} namespace The namespace to register and to derive context props from. 21286 * @return {ConnectedProps<P>} The connected props. 21287 */ 21288 21289 function useContextSystem(props, namespace) { 21290 const contextSystemProps = useComponentsContext(); 21291 21292 if (typeof namespace === 'undefined') { 21293 typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; 21294 } 21295 21296 const contextProps = (contextSystemProps === null || contextSystemProps === void 0 ? void 0 : contextSystemProps[namespace]) || {}; 21297 /* eslint-disable jsdoc/no-undefined-types */ 21298 21299 /** @type {ConnectedProps<P>} */ 21300 // @ts-ignore We fill in the missing properties below 21301 21302 const finalComponentProps = { ...getConnectedNamespace(), 21303 ...getNamespace(namespace) 21304 }; 21305 /* eslint-enable jsdoc/no-undefined-types */ 21306 21307 const { 21308 _overrides: overrideProps, 21309 ...otherContextProps 21310 } = contextProps; 21311 const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props; 21312 const cx = useCx(); 21313 const classes = cx(getStyledClassNameFromKey(namespace), props.className); // Provides the ability to customize the render of the component. 21314 21315 const rendered = typeof initialMergedProps.renderChildren === 'function' ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children; 21316 21317 for (const key in initialMergedProps) { 21318 // @ts-ignore filling in missing props 21319 finalComponentProps[key] = initialMergedProps[key]; 21320 } 21321 21322 for (const key in overrideProps) { 21323 // @ts-ignore filling in missing props 21324 finalComponentProps[key] = overrideProps[key]; 21325 } // @ts-ignore 21326 21327 21328 finalComponentProps.children = rendered; 21329 finalComponentProps.className = classes; 21330 return finalComponentProps; 21331 } 21332 21333 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-connect.js 21334 /** 21335 * External dependencies 21336 */ 21337 21338 21339 /** 21340 * WordPress dependencies 21341 */ 21342 21343 21344 /** 21345 * Internal dependencies 21346 */ 21347 21348 21349 21350 21351 /** 21352 * Forwards ref (React.ForwardRef) and "Connects" (or registers) a component 21353 * within the Context system under a specified namespace. 21354 * 21355 * This is an (experimental) evolution of the initial connect() HOC. 21356 * The hope is that we can improve render performance by removing functional 21357 * component wrappers. 21358 * 21359 * @param Component The component to register into the Context system. 21360 * @param namespace The namespace to register the component under. 21361 * @param options 21362 * @return The connected WordPressComponent 21363 */ 21364 function contextConnect(Component, namespace) { 21365 let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 21366 const { 21367 memo: memoProp = false 21368 } = options; 21369 let WrappedComponent = (0,external_wp_element_namespaceObject.forwardRef)(Component); 21370 21371 if (memoProp) { 21372 // @ts-ignore 21373 WrappedComponent = (0,external_wp_element_namespaceObject.memo)(WrappedComponent); 21374 } 21375 21376 if (typeof namespace === 'undefined') { 21377 typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; 21378 } // @ts-ignore internal property 21379 21380 21381 let mergedNamespace = WrappedComponent[CONNECT_STATIC_NAMESPACE] || [namespace]; 21382 /** 21383 * Consolidate (merge) namespaces before attaching it to the WrappedComponent. 21384 */ 21385 21386 if (Array.isArray(namespace)) { 21387 mergedNamespace = [...mergedNamespace, ...namespace]; 21388 } 21389 21390 if (typeof namespace === 'string') { 21391 mergedNamespace = [...mergedNamespace, namespace]; 21392 } 21393 21394 WrappedComponent.displayName = namespace; // @ts-ignore internal property 21395 21396 WrappedComponent[CONNECT_STATIC_NAMESPACE] = (0,external_lodash_namespaceObject.uniq)(mergedNamespace); // @ts-ignore WordPressComponent property 21397 21398 WrappedComponent.selector = `.$getStyledClassNameFromKey(namespace)}`; // @ts-ignore 21399 21400 return WrappedComponent; 21401 } 21402 /** 21403 * Attempts to retrieve the connected namespace from a component. 21404 * 21405 * @param Component The component to retrieve a namespace from. 21406 * @return The connected namespaces. 21407 */ 21408 21409 function getConnectNamespace(Component) { 21410 if (!Component) return []; 21411 let namespaces = []; // @ts-ignore internal property 21412 21413 if (Component[CONNECT_STATIC_NAMESPACE]) { 21414 // @ts-ignore internal property 21415 namespaces = Component[CONNECT_STATIC_NAMESPACE]; 21416 } // @ts-ignore 21417 21418 21419 if (Component.type && Component.type[CONNECT_STATIC_NAMESPACE]) { 21420 // @ts-ignore 21421 namespaces = Component.type[CONNECT_STATIC_NAMESPACE]; 21422 } 21423 21424 return namespaces; 21425 } 21426 /** 21427 * Checks to see if a component is connected within the Context system. 21428 * 21429 * @param Component The component to retrieve a namespace from. 21430 * @param match The namespace to check. 21431 */ 21432 21433 function hasConnectNamespace(Component, match) { 21434 if (!Component) return false; 21435 21436 if (typeof match === 'string') { 21437 return getConnectNamespace(Component).includes(match); 21438 } 21439 21440 if (Array.isArray(match)) { 21441 return match.some(result => getConnectNamespace(Component).includes(result)); 21442 } 21443 21444 return false; 21445 } 21446 21447 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/styles.js 21448 /** @type {import('react').CSSProperties} */ 21449 const visuallyHidden = { 21450 border: 0, 21451 clip: 'rect(1px, 1px, 1px, 1px)', 21452 WebkitClipPath: 'inset( 50% )', 21453 clipPath: 'inset( 50% )', 21454 height: '1px', 21455 margin: '-1px', 21456 overflow: 'hidden', 21457 padding: 0, 21458 position: 'absolute', 21459 width: '1px', 21460 wordWrap: 'normal' 21461 }; 21462 21463 ;// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.browser.esm.js 21464 21465 21466 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 21467 21468 var isPropValid = /* #__PURE__ */emotion_memoize_browser_esm(function (prop) { 21469 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 21470 /* o */ 21471 && prop.charCodeAt(1) === 110 21472 /* n */ 21473 && prop.charCodeAt(2) < 91; 21474 } 21475 /* Z+1 */ 21476 ); 21477 21478 /* harmony default export */ var emotion_is_prop_valid_browser_esm = (isPropValid); 21479 21480 ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js 21481 var emotion_utils_browser_esm_isBrowser = "object" !== 'undefined'; 21482 function dist_emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) { 21483 var rawClassName = ''; 21484 classNames.split(' ').forEach(function (className) { 21485 if (registered[className] !== undefined) { 21486 registeredStyles.push(registered[className] + ";"); 21487 } else { 21488 rawClassName += className + " "; 21489 } 21490 }); 21491 return rawClassName; 21492 } 21493 var emotion_utils_browser_esm_registerStyles = function registerStyles(cache, serialized, isStringTag) { 21494 var className = cache.key + "-" + serialized.name; 21495 21496 if ( // we only need to add the styles to the registered cache if the 21497 // class name could be used further down 21498 // the tree but if it's a string tag, we know it won't 21499 // so we don't have to add it to registered cache. 21500 // this improves memory usage since we can avoid storing the whole style string 21501 (isStringTag === false || // we need to always store it if we're in compat mode and 21502 // in node since emotion-server relies on whether a style is in 21503 // the registered cache to know whether a style is global or not 21504 // also, note that this check will be dead code eliminated in the browser 21505 emotion_utils_browser_esm_isBrowser === false ) && cache.registered[className] === undefined) { 21506 cache.registered[className] = serialized.styles; 21507 } 21508 }; 21509 var dist_emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) { 21510 emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); 21511 var className = cache.key + "-" + serialized.name; 21512 21513 if (cache.inserted[serialized.name] === undefined) { 21514 var current = serialized; 21515 21516 do { 21517 var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); 21518 21519 current = current.next; 21520 } while (current !== undefined); 21521 } 21522 }; 21523 21524 21525 21526 ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js 21527 21528 21529 21530 21531 21532 21533 21534 21535 var testOmitPropsOnStringTag = emotion_is_prop_valid_browser_esm; 21536 21537 var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { 21538 return key !== 'theme'; 21539 }; 21540 21541 var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { 21542 return typeof tag === 'string' && // 96 is one less than the char code 21543 // for "a" so this is checking that 21544 // it's a lowercase character 21545 tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; 21546 }; 21547 var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) { 21548 var shouldForwardProp; 21549 21550 if (options) { 21551 var optionsShouldForwardProp = options.shouldForwardProp; 21552 shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) { 21553 return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName); 21554 } : optionsShouldForwardProp; 21555 } 21556 21557 if (typeof shouldForwardProp !== 'function' && isReal) { 21558 shouldForwardProp = tag.__emotion_forwardProp; 21559 } 21560 21561 return shouldForwardProp; 21562 }; 21563 21564 var emotion_styled_base_browser_esm_useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : function useInsertionEffect(create) { 21565 create(); 21566 }; 21567 function emotion_styled_base_browser_esm_useInsertionEffectMaybe(create) { 21568 21569 emotion_styled_base_browser_esm_useInsertionEffect(create); 21570 } 21571 21572 var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; 21573 21574 var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) { 21575 var cache = _ref.cache, 21576 serialized = _ref.serialized, 21577 isStringTag = _ref.isStringTag; 21578 emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); 21579 var rules = emotion_styled_base_browser_esm_useInsertionEffectMaybe(function () { 21580 return dist_emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag); 21581 }); 21582 21583 return null; 21584 }; 21585 21586 var createStyled = function createStyled(tag, options) { 21587 if (false) {} 21588 21589 var isReal = tag.__emotion_real === tag; 21590 var baseTag = isReal && tag.__emotion_base || tag; 21591 var identifierName; 21592 var targetClassName; 21593 21594 if (options !== undefined) { 21595 identifierName = options.label; 21596 targetClassName = options.target; 21597 } 21598 21599 var shouldForwardProp = composeShouldForwardProps(tag, options, isReal); 21600 var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); 21601 var shouldUseAs = !defaultShouldForwardProp('as'); 21602 return function () { 21603 var args = arguments; 21604 var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; 21605 21606 if (identifierName !== undefined) { 21607 styles.push("label:" + identifierName + ";"); 21608 } 21609 21610 if (args[0] == null || args[0].raw === undefined) { 21611 styles.push.apply(styles, args); 21612 } else { 21613 if (false) {} 21614 21615 styles.push(args[0][0]); 21616 var len = args.length; 21617 var i = 1; 21618 21619 for (; i < len; i++) { 21620 if (false) {} 21621 21622 styles.push(args[i], args[0][i]); 21623 } 21624 } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class 21625 21626 21627 var Styled = emotion_element_cbed451f_browser_esm_withEmotionCache(function (props, cache, ref) { 21628 var FinalTag = shouldUseAs && props.as || baseTag; 21629 var className = ''; 21630 var classInterpolations = []; 21631 var mergedProps = props; 21632 21633 if (props.theme == null) { 21634 mergedProps = {}; 21635 21636 for (var key in props) { 21637 mergedProps[key] = props[key]; 21638 } 21639 21640 mergedProps.theme = (0,external_React_.useContext)(emotion_element_cbed451f_browser_esm_ThemeContext); 21641 } 21642 21643 if (typeof props.className === 'string') { 21644 className = dist_emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className); 21645 } else if (props.className != null) { 21646 className = props.className + " "; 21647 } 21648 21649 var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps); 21650 className += cache.key + "-" + serialized.name; 21651 21652 if (targetClassName !== undefined) { 21653 className += " " + targetClassName; 21654 } 21655 21656 var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp; 21657 var newProps = {}; 21658 21659 for (var _key in props) { 21660 if (shouldUseAs && _key === 'as') continue; 21661 21662 if ( // $FlowFixMe 21663 finalShouldForwardProp(_key)) { 21664 newProps[_key] = props[_key]; 21665 } 21666 } 21667 21668 newProps.className = className; 21669 newProps.ref = ref; 21670 return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, { 21671 cache: cache, 21672 serialized: serialized, 21673 isStringTag: typeof FinalTag === 'string' 21674 }), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps)); 21675 }); 21676 Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; 21677 Styled.defaultProps = tag.defaultProps; 21678 Styled.__emotion_real = Styled; 21679 Styled.__emotion_base = baseTag; 21680 Styled.__emotion_styles = styles; 21681 Styled.__emotion_forwardProp = shouldForwardProp; 21682 Object.defineProperty(Styled, 'toString', { 21683 value: function value() { 21684 if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string 21685 21686 21687 return "." + targetClassName; 21688 } 21689 }); 21690 21691 Styled.withComponent = function (nextTag, nextOptions) { 21692 return createStyled(nextTag, extends_extends({}, options, nextOptions, { 21693 shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) 21694 })).apply(void 0, styles); 21695 }; 21696 21697 return Styled; 21698 }; 21699 }; 21700 21701 /* harmony default export */ var emotion_styled_base_browser_esm = (createStyled); 21702 21703 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/view/component.js 21704 21705 21706 /** 21707 * External dependencies 21708 */ 21709 21710 /** 21711 * `View` is a core component that renders everything in the library. 21712 * It is the principle component in the entire library. 21713 * 21714 * @example 21715 * ```jsx 21716 * import { View } from `@wordpress/components`; 21717 * 21718 * function Example() { 21719 * return ( 21720 * <View> 21721 * Code is Poetry 21722 * </View> 21723 * ); 21724 * } 21725 * ``` 21726 * 21727 * @type {import('../ui/context').WordPressComponent<'div', { children?: import('react').ReactNode }, true>} 21728 */ 21729 // @ts-ignore 21730 const View = emotion_styled_base_browser_esm("div", true ? { 21731 target: "em57xhy0" 21732 } : 0)( true ? "" : 0); 21733 21734 View.selector = '.components-view'; 21735 View.displayName = 'View'; 21736 /* harmony default export */ var component = (View); 21737 21738 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/component.js 21739 21740 21741 21742 /** 21743 * Internal dependencies 21744 */ 21745 21746 21747 21748 /** 21749 * @param {import('../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props 21750 * @param {import('react').ForwardedRef<any>} forwardedRef 21751 */ 21752 21753 function VisuallyHidden(props, forwardedRef) { 21754 const { 21755 style: styleProp, 21756 ...contextProps 21757 } = useContextSystem(props, 'VisuallyHidden'); 21758 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({ 21759 ref: forwardedRef 21760 }, contextProps, { 21761 style: { ...visuallyHidden, 21762 ...(styleProp || {}) 21763 } 21764 })); 21765 } 21766 /** 21767 * `VisuallyHidden` is a component used to render text intended to be visually 21768 * hidden, but will show for alternate devices, for example a screen reader. 21769 * 21770 * @example 21771 * ```jsx 21772 * import { VisuallyHidden } from `@wordpress/components`; 21773 * 21774 * function Example() { 21775 * return ( 21776 * <VisuallyHidden> 21777 * <label>Code is Poetry</label> 21778 * </VisuallyHidden> 21779 * ); 21780 * } 21781 * ``` 21782 */ 21783 21784 21785 const ConnectedVisuallyHidden = contextConnect(VisuallyHidden, 'VisuallyHidden'); 21786 /* harmony default export */ var visually_hidden_component = (ConnectedVisuallyHidden); 21787 21788 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/index.js 21789 21790 21791 // @ts-nocheck 21792 21793 /** 21794 * External dependencies 21795 */ 21796 21797 21798 /** 21799 * WordPress dependencies 21800 */ 21801 21802 21803 21804 21805 /** 21806 * Internal dependencies 21807 */ 21808 21809 21810 21811 21812 const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick']; 21813 21814 function useDeprecatedProps(_ref) { 21815 let { 21816 isDefault, 21817 isPrimary, 21818 isSecondary, 21819 isTertiary, 21820 isLink, 21821 variant, 21822 ...otherProps 21823 } = _ref; 21824 let computedVariant = variant; 21825 21826 if (isPrimary) { 21827 var _computedVariant; 21828 21829 (_computedVariant = computedVariant) !== null && _computedVariant !== void 0 ? _computedVariant : computedVariant = 'primary'; 21830 } 21831 21832 if (isTertiary) { 21833 var _computedVariant2; 21834 21835 (_computedVariant2 = computedVariant) !== null && _computedVariant2 !== void 0 ? _computedVariant2 : computedVariant = 'tertiary'; 21836 } 21837 21838 if (isSecondary) { 21839 var _computedVariant3; 21840 21841 (_computedVariant3 = computedVariant) !== null && _computedVariant3 !== void 0 ? _computedVariant3 : computedVariant = 'secondary'; 21842 } 21843 21844 if (isDefault) { 21845 var _computedVariant4; 21846 21847 external_wp_deprecated_default()('Button isDefault prop', { 21848 since: '5.4', 21849 alternative: 'variant="secondary"', 21850 version: '6.2' 21851 }); 21852 (_computedVariant4 = computedVariant) !== null && _computedVariant4 !== void 0 ? _computedVariant4 : computedVariant = 'secondary'; 21853 } 21854 21855 if (isLink) { 21856 var _computedVariant5; 21857 21858 (_computedVariant5 = computedVariant) !== null && _computedVariant5 !== void 0 ? _computedVariant5 : computedVariant = 'link'; 21859 } 21860 21861 return { ...otherProps, 21862 variant: computedVariant 21863 }; 21864 } 21865 21866 function Button(props, ref) { 21867 const { 21868 href, 21869 target, 21870 isSmall, 21871 isPressed, 21872 isBusy, 21873 isDestructive, 21874 className, 21875 disabled, 21876 icon, 21877 iconPosition = 'left', 21878 iconSize, 21879 showTooltip, 21880 tooltipPosition, 21881 shortcut, 21882 label, 21883 children, 21884 text, 21885 variant, 21886 __experimentalIsFocusable: isFocusable, 21887 describedBy, 21888 ...additionalProps 21889 } = useDeprecatedProps(props); 21890 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Button, 'components-button__description'); 21891 const classes = classnames_default()('components-button', className, { 21892 'is-secondary': variant === 'secondary', 21893 'is-primary': variant === 'primary', 21894 'is-small': isSmall, 21895 'is-tertiary': variant === 'tertiary', 21896 'is-pressed': isPressed, 21897 'is-busy': isBusy, 21898 'is-link': variant === 'link', 21899 'is-destructive': isDestructive, 21900 'has-text': !!icon && !!children, 21901 'has-icon': !!icon 21902 }); 21903 const trulyDisabled = disabled && !isFocusable; 21904 const Tag = href !== undefined && !trulyDisabled ? 'a' : 'button'; 21905 const tagProps = Tag === 'a' ? { 21906 href, 21907 target 21908 } : { 21909 type: 'button', 21910 disabled: trulyDisabled, 21911 'aria-pressed': isPressed 21912 }; 21913 21914 if (disabled && isFocusable) { 21915 // In this case, the button will be disabled, but still focusable and 21916 // perceivable by screen reader users. 21917 tagProps['aria-disabled'] = true; 21918 21919 for (const disabledEvent of disabledEventsOnDisabledButton) { 21920 additionalProps[disabledEvent] = event => { 21921 event.stopPropagation(); 21922 event.preventDefault(); 21923 }; 21924 } 21925 } // Should show the tooltip if... 21926 21927 21928 const shouldShowTooltip = !trulyDisabled && ( // An explicit tooltip is passed or... 21929 showTooltip && label || // There's a shortcut or... 21930 shortcut || // There's a label and... 21931 !!label && ( // The children are empty and... 21932 !children || (0,external_lodash_namespaceObject.isArray)(children) && !children.length) && // The tooltip is not explicitly disabled. 21933 false !== showTooltip); 21934 const descriptionId = describedBy ? instanceId : null; 21935 const describedById = additionalProps['aria-describedby'] || descriptionId; 21936 const element = (0,external_wp_element_namespaceObject.createElement)(Tag, extends_extends({}, tagProps, additionalProps, { 21937 className: classes, 21938 "aria-label": additionalProps['aria-label'] || label, 21939 "aria-describedby": describedById, 21940 ref: ref 21941 }), icon && iconPosition === 'left' && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { 21942 icon: icon, 21943 size: iconSize 21944 }), text && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, text), icon && iconPosition === 'right' && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { 21945 icon: icon, 21946 size: iconSize 21947 }), children); 21948 21949 if (!shouldShowTooltip) { 21950 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element, describedBy && (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, (0,external_wp_element_namespaceObject.createElement)("span", { 21951 id: descriptionId 21952 }, describedBy))); 21953 } 21954 21955 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(tooltip, { 21956 text: describedBy ? describedBy : label, 21957 shortcut: shortcut, 21958 position: tooltipPosition 21959 }, element), describedBy && (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, (0,external_wp_element_namespaceObject.createElement)("span", { 21960 id: descriptionId 21961 }, describedBy))); 21962 } 21963 /* harmony default export */ var build_module_button = ((0,external_wp_element_namespaceObject.forwardRef)(Button)); 21964 21965 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js 21966 /** 21967 * WordPress dependencies 21968 */ 21969 21970 /* 21971 * Setting `overflow: hidden` on html and body elements resets body scroll in iOS. 21972 * Save scroll top so we can restore it after locking scroll. 21973 * 21974 * NOTE: It would be cleaner and possibly safer to find a localized solution such 21975 * as preventing default on certain touchmove events. 21976 */ 21977 21978 let previousScrollTop = 0; 21979 /** 21980 * @param {boolean} locked 21981 */ 21982 21983 function setLocked(locked) { 21984 const scrollingElement = document.scrollingElement || document.body; 21985 21986 if (locked) { 21987 previousScrollTop = scrollingElement.scrollTop; 21988 } 21989 21990 const methodName = locked ? 'add' : 'remove'; 21991 scrollingElement.classList[methodName]('lockscroll'); // Adding the class to the document element seems to be necessary in iOS. 21992 21993 document.documentElement.classList[methodName]('lockscroll'); 21994 21995 if (!locked) { 21996 scrollingElement.scrollTop = previousScrollTop; 21997 } 21998 } 21999 22000 let lockCounter = 0; 22001 /** 22002 * A component that will lock scrolling when it is mounted and unlock scrolling when it is unmounted. 22003 * 22004 * @return {null} Render nothing. 22005 */ 22006 22007 function ScrollLock() { 22008 (0,external_wp_element_namespaceObject.useEffect)(() => { 22009 if (lockCounter === 0) { 22010 setLocked(true); 22011 } 22012 22013 ++lockCounter; 22014 return () => { 22015 if (lockCounter === 1) { 22016 setLocked(false); 22017 } 22018 22019 --lockCounter; 22020 }; 22021 }, []); 22022 return null; 22023 } 22024 22025 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js 22026 // @ts-nocheck 22027 22028 /** 22029 * WordPress dependencies 22030 */ 22031 22032 const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)({ 22033 registerSlot: () => {}, 22034 unregisterSlot: () => {}, 22035 registerFill: () => {}, 22036 unregisterFill: () => {}, 22037 getSlot: () => {}, 22038 getFills: () => {}, 22039 subscribe: () => {} 22040 }); 22041 /* harmony default export */ var context = (SlotFillContext); 22042 22043 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js 22044 // @ts-nocheck 22045 22046 /** 22047 * WordPress dependencies 22048 */ 22049 22050 /** 22051 * Internal dependencies 22052 */ 22053 22054 22055 /** 22056 * React hook returning the active slot given a name. 22057 * 22058 * @param {string} name Slot name. 22059 * @return {Object} Slot object. 22060 */ 22061 22062 const useSlot = name => { 22063 const { 22064 getSlot, 22065 subscribe 22066 } = (0,external_wp_element_namespaceObject.useContext)(context); 22067 const [slot, setSlot] = (0,external_wp_element_namespaceObject.useState)(getSlot(name)); 22068 (0,external_wp_element_namespaceObject.useEffect)(() => { 22069 setSlot(getSlot(name)); 22070 const unsubscribe = subscribe(() => { 22071 setSlot(getSlot(name)); 22072 }); 22073 return unsubscribe; 22074 }, [name]); 22075 return slot; 22076 }; 22077 22078 /* harmony default export */ var use_slot = (useSlot); 22079 22080 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js 22081 22082 22083 // @ts-nocheck 22084 22085 /** 22086 * External dependencies 22087 */ 22088 22089 /** 22090 * WordPress dependencies 22091 */ 22092 22093 22094 /** 22095 * Internal dependencies 22096 */ 22097 22098 22099 22100 22101 function FillComponent(_ref) { 22102 let { 22103 name, 22104 children, 22105 registerFill, 22106 unregisterFill 22107 } = _ref; 22108 const slot = use_slot(name); 22109 const ref = (0,external_wp_element_namespaceObject.useRef)({ 22110 name, 22111 children 22112 }); 22113 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 22114 registerFill(name, ref.current); 22115 return () => unregisterFill(name, ref.current); 22116 }, []); 22117 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 22118 ref.current.children = children; 22119 22120 if (slot) { 22121 slot.forceUpdate(); 22122 } 22123 }, [children]); 22124 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 22125 if (name === ref.current.name) { 22126 // Ignore initial effect. 22127 return; 22128 } 22129 22130 unregisterFill(ref.current.name, ref.current); 22131 ref.current.name = name; 22132 registerFill(name, ref.current); 22133 }, [name]); 22134 22135 if (!slot || !slot.node) { 22136 return null; 22137 } // If a function is passed as a child, provide it with the fillProps. 22138 22139 22140 if ((0,external_lodash_namespaceObject.isFunction)(children)) { 22141 children = children(slot.props.fillProps); 22142 } 22143 22144 return (0,external_wp_element_namespaceObject.createPortal)(children, slot.node); 22145 } 22146 22147 const Fill = props => (0,external_wp_element_namespaceObject.createElement)(context.Consumer, null, _ref2 => { 22148 let { 22149 registerFill, 22150 unregisterFill 22151 } = _ref2; 22152 return (0,external_wp_element_namespaceObject.createElement)(FillComponent, extends_extends({}, props, { 22153 registerFill: registerFill, 22154 unregisterFill: unregisterFill 22155 })); 22156 }); 22157 22158 /* harmony default export */ var fill = (Fill); 22159 22160 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js 22161 22162 22163 // @ts-nocheck 22164 22165 /** 22166 * External dependencies 22167 */ 22168 22169 /** 22170 * WordPress dependencies 22171 */ 22172 22173 22174 /** 22175 * Internal dependencies 22176 */ 22177 22178 22179 22180 class SlotComponent extends external_wp_element_namespaceObject.Component { 22181 constructor() { 22182 super(...arguments); 22183 this.isUnmounted = false; 22184 this.bindNode = this.bindNode.bind(this); 22185 } 22186 22187 componentDidMount() { 22188 const { 22189 registerSlot 22190 } = this.props; 22191 registerSlot(this.props.name, this); 22192 } 22193 22194 componentWillUnmount() { 22195 const { 22196 unregisterSlot 22197 } = this.props; 22198 this.isUnmounted = true; 22199 unregisterSlot(this.props.name, this); 22200 } 22201 22202 componentDidUpdate(prevProps) { 22203 const { 22204 name, 22205 unregisterSlot, 22206 registerSlot 22207 } = this.props; 22208 22209 if (prevProps.name !== name) { 22210 unregisterSlot(prevProps.name); 22211 registerSlot(name, this); 22212 } 22213 } 22214 22215 bindNode(node) { 22216 this.node = node; 22217 } 22218 22219 forceUpdate() { 22220 if (this.isUnmounted) { 22221 return; 22222 } 22223 22224 super.forceUpdate(); 22225 } 22226 22227 render() { 22228 const { 22229 children, 22230 name, 22231 fillProps = {}, 22232 getFills 22233 } = this.props; 22234 const fills = (0,external_lodash_namespaceObject.map)(getFills(name, this), fill => { 22235 const fillChildren = (0,external_lodash_namespaceObject.isFunction)(fill.children) ? fill.children(fillProps) : fill.children; 22236 return external_wp_element_namespaceObject.Children.map(fillChildren, (child, childIndex) => { 22237 if (!child || (0,external_lodash_namespaceObject.isString)(child)) { 22238 return child; 22239 } 22240 22241 const childKey = child.key || childIndex; 22242 return (0,external_wp_element_namespaceObject.cloneElement)(child, { 22243 key: childKey 22244 }); 22245 }); 22246 }).filter( // In some cases fills are rendered only when some conditions apply. 22247 // This ensures that we only use non-empty fills when rendering, i.e., 22248 // it allows us to render wrappers only when the fills are actually present. 22249 (0,external_lodash_namespaceObject.negate)(external_wp_element_namespaceObject.isEmptyElement)); 22250 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_lodash_namespaceObject.isFunction)(children) ? children(fills) : fills); 22251 } 22252 22253 } 22254 22255 const Slot = props => (0,external_wp_element_namespaceObject.createElement)(context.Consumer, null, _ref => { 22256 let { 22257 registerSlot, 22258 unregisterSlot, 22259 getFills 22260 } = _ref; 22261 return (0,external_wp_element_namespaceObject.createElement)(SlotComponent, extends_extends({}, props, { 22262 registerSlot: registerSlot, 22263 unregisterSlot: unregisterSlot, 22264 getFills: getFills 22265 })); 22266 }); 22267 22268 /* harmony default export */ var slot = (Slot); 22269 22270 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js 22271 // @ts-nocheck 22272 22273 /** 22274 * WordPress dependencies 22275 */ 22276 22277 22278 const slot_fill_context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)({ 22279 slots: {}, 22280 fills: {}, 22281 registerSlot: () => { 22282 typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0; 22283 }, 22284 updateSlot: () => {}, 22285 unregisterSlot: () => {}, 22286 registerFill: () => {}, 22287 unregisterFill: () => {} 22288 }); 22289 /* harmony default export */ var slot_fill_context = (slot_fill_context_SlotFillContext); 22290 22291 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 22292 // @ts-nocheck 22293 22294 /** 22295 * WordPress dependencies 22296 */ 22297 22298 /** 22299 * Internal dependencies 22300 */ 22301 22302 22303 function use_slot_useSlot(name) { 22304 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); 22305 const slot = registry.slots[name] || {}; 22306 const slotFills = registry.fills[name]; 22307 const fills = (0,external_wp_element_namespaceObject.useMemo)(() => slotFills || [], [slotFills]); 22308 const updateSlot = (0,external_wp_element_namespaceObject.useCallback)(fillProps => { 22309 registry.updateSlot(name, fillProps); 22310 }, [name, registry.updateSlot]); 22311 const unregisterSlot = (0,external_wp_element_namespaceObject.useCallback)(slotRef => { 22312 registry.unregisterSlot(name, slotRef); 22313 }, [name, registry.unregisterSlot]); 22314 const registerFill = (0,external_wp_element_namespaceObject.useCallback)(fillRef => { 22315 registry.registerFill(name, fillRef); 22316 }, [name, registry.registerFill]); 22317 const unregisterFill = (0,external_wp_element_namespaceObject.useCallback)(fillRef => { 22318 registry.unregisterFill(name, fillRef); 22319 }, [name, registry.unregisterFill]); 22320 return { ...slot, 22321 updateSlot, 22322 unregisterSlot, 22323 fills, 22324 registerFill, 22325 unregisterFill 22326 }; 22327 } 22328 22329 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js 22330 // Unique ID creation requires a high quality random # generator. In the browser we therefore 22331 // require the crypto API and do not support built-in fallback to lower quality random number 22332 // generators (like Math.random()). 22333 var getRandomValues; 22334 var rnds8 = new Uint8Array(16); 22335 function rng() { 22336 // lazy load so that environments that need to polyfill have a chance to do so 22337 if (!getRandomValues) { 22338 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, 22339 // find the complete implementation of crypto (msCrypto) on IE11. 22340 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); 22341 22342 if (!getRandomValues) { 22343 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 22344 } 22345 } 22346 22347 return getRandomValues(rnds8); 22348 } 22349 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js 22350 /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); 22351 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js 22352 22353 22354 function validate(uuid) { 22355 return typeof uuid === 'string' && regex.test(uuid); 22356 } 22357 22358 /* harmony default export */ var esm_browser_validate = (validate); 22359 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js 22360 22361 /** 22362 * Convert array of 16 byte values to UUID string format of the form: 22363 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 22364 */ 22365 22366 var byteToHex = []; 22367 22368 for (var i = 0; i < 256; ++i) { 22369 byteToHex.push((i + 0x100).toString(16).substr(1)); 22370 } 22371 22372 function stringify_stringify(arr) { 22373 var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 22374 // Note: Be careful editing this code! It's been tuned for performance 22375 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 22376 var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one 22377 // of the following: 22378 // - One or more input array values don't map to a hex octet (leading to 22379 // "undefined" in the uuid) 22380 // - Invalid input values for the RFC `version` or `variant` fields 22381 22382 if (!esm_browser_validate(uuid)) { 22383 throw TypeError('Stringified UUID is invalid'); 22384 } 22385 22386 return uuid; 22387 } 22388 22389 /* harmony default export */ var esm_browser_stringify = (stringify_stringify); 22390 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js 22391 22392 22393 22394 function v4(options, buf, offset) { 22395 options = options || {}; 22396 var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 22397 22398 rnds[6] = rnds[6] & 0x0f | 0x40; 22399 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 22400 22401 if (buf) { 22402 offset = offset || 0; 22403 22404 for (var i = 0; i < 16; ++i) { 22405 buf[offset + i] = rnds[i]; 22406 } 22407 22408 return buf; 22409 } 22410 22411 return esm_browser_stringify(rnds); 22412 } 22413 22414 /* harmony default export */ var esm_browser_v4 = (v4); 22415 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/style-provider/index.js 22416 22417 // @ts-nocheck 22418 22419 /** 22420 * External dependencies 22421 */ 22422 22423 22424 22425 22426 const uuidCache = new Set(); 22427 const memoizedCreateCacheWithContainer = memize_default()(container => { 22428 // Emotion only accepts alphabetical and hyphenated keys so we just strip the numbers from the UUID. It _should_ be fine. 22429 let key = esm_browser_v4().replace(/[0-9]/g, ''); 22430 22431 while (uuidCache.has(key)) { 22432 key = esm_browser_v4().replace(/[0-9]/g, ''); 22433 } 22434 22435 uuidCache.add(key); 22436 return emotion_cache_browser_esm({ 22437 container, 22438 key 22439 }); 22440 }); 22441 function StyleProvider(_ref) { 22442 let { 22443 children, 22444 document 22445 } = _ref; 22446 22447 if (!document) { 22448 return null; 22449 } 22450 22451 const cache = memoizedCreateCacheWithContainer(document.head); 22452 return (0,external_wp_element_namespaceObject.createElement)(CacheProvider, { 22453 value: cache 22454 }, children); 22455 } 22456 22457 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js 22458 22459 // @ts-nocheck 22460 22461 /** 22462 * WordPress dependencies 22463 */ 22464 22465 /** 22466 * Internal dependencies 22467 */ 22468 22469 22470 22471 22472 function useForceUpdate() { 22473 const [, setState] = (0,external_wp_element_namespaceObject.useState)({}); 22474 const mounted = (0,external_wp_element_namespaceObject.useRef)(true); 22475 (0,external_wp_element_namespaceObject.useEffect)(() => { 22476 return () => { 22477 mounted.current = false; 22478 }; 22479 }, []); 22480 return () => { 22481 if (mounted.current) { 22482 setState({}); 22483 } 22484 }; 22485 } 22486 22487 function fill_Fill(_ref) { 22488 let { 22489 name, 22490 children 22491 } = _ref; 22492 const slot = use_slot_useSlot(name); 22493 const ref = (0,external_wp_element_namespaceObject.useRef)({ 22494 rerender: useForceUpdate() 22495 }); 22496 (0,external_wp_element_namespaceObject.useEffect)(() => { 22497 // We register fills so we can keep track of their existance. 22498 // Some Slot implementations need to know if there're already fills 22499 // registered so they can choose to render themselves or not. 22500 slot.registerFill(ref); 22501 return () => { 22502 slot.unregisterFill(ref); 22503 }; 22504 }, [slot.registerFill, slot.unregisterFill]); 22505 22506 if (!slot.ref || !slot.ref.current) { 22507 return null; 22508 } 22509 22510 if (typeof children === 'function') { 22511 children = children(slot.fillProps); 22512 } // When using a `Fill`, the `children` will be rendered in the document of the 22513 // `Slot`. This means that we need to wrap the `children` in a `StyleProvider` 22514 // to make sure we're referencing the right document/iframe (instead of the 22515 // context of the `Fill`'s parent). 22516 22517 22518 const wrappedChildren = (0,external_wp_element_namespaceObject.createElement)(StyleProvider, { 22519 document: slot.ref.current.ownerDocument 22520 }, children); 22521 return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current); 22522 } 22523 22524 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js 22525 22526 22527 // @ts-nocheck 22528 22529 /** 22530 * WordPress dependencies 22531 */ 22532 22533 22534 /** 22535 * Internal dependencies 22536 */ 22537 22538 22539 22540 function slot_Slot(_ref, forwardedRef) { 22541 let { 22542 name, 22543 fillProps = {}, 22544 as: Component = 'div', 22545 ...props 22546 } = _ref; 22547 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); 22548 const ref = (0,external_wp_element_namespaceObject.useRef)(); 22549 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 22550 registry.registerSlot(name, ref, fillProps); 22551 return () => { 22552 registry.unregisterSlot(name, ref); 22553 }; // We are not including fillProps in the deps because we don't want to 22554 // unregister and register the slot whenever fillProps change, which would 22555 // cause the fill to be re-mounted. We are only considering the initial value 22556 // of fillProps. 22557 }, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we 22558 // useLayoutEffect. 22559 22560 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 22561 registry.updateSlot(name, fillProps); 22562 }); 22563 return (0,external_wp_element_namespaceObject.createElement)(Component, extends_extends({ 22564 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]) 22565 }, props)); 22566 } 22567 22568 /* harmony default export */ var bubbles_virtually_slot = ((0,external_wp_element_namespaceObject.forwardRef)(slot_Slot)); 22569 22570 ;// CONCATENATED MODULE: external ["wp","isShallowEqual"] 22571 var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; 22572 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); 22573 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js 22574 22575 // @ts-nocheck 22576 22577 /** 22578 * WordPress dependencies 22579 */ 22580 22581 22582 /** 22583 * Internal dependencies 22584 */ 22585 22586 22587 22588 function useSlotRegistry() { 22589 const [slots, setSlots] = (0,external_wp_element_namespaceObject.useState)({}); 22590 const [fills, setFills] = (0,external_wp_element_namespaceObject.useState)({}); 22591 const registerSlot = (0,external_wp_element_namespaceObject.useCallback)((name, ref, fillProps) => { 22592 setSlots(prevSlots => { 22593 const slot = prevSlots[name] || {}; 22594 return { ...prevSlots, 22595 [name]: { ...slot, 22596 ref: ref || slot.ref, 22597 fillProps: fillProps || slot.fillProps || {} 22598 } 22599 }; 22600 }); 22601 }, []); 22602 const unregisterSlot = (0,external_wp_element_namespaceObject.useCallback)((name, ref) => { 22603 setSlots(prevSlots => { 22604 const { 22605 [name]: slot, 22606 ...nextSlots 22607 } = prevSlots; // Make sure we're not unregistering a slot registered by another element 22608 // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 22609 22610 if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) { 22611 return nextSlots; 22612 } 22613 22614 return prevSlots; 22615 }); 22616 }, []); 22617 const updateSlot = (0,external_wp_element_namespaceObject.useCallback)((name, fillProps) => { 22618 const slot = slots[name]; 22619 22620 if (!slot) { 22621 return; 22622 } 22623 22624 if (!external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) { 22625 slot.fillProps = fillProps; 22626 const slotFills = fills[name]; 22627 22628 if (slotFills) { 22629 // Force update fills. 22630 slotFills.map(fill => fill.current.rerender()); 22631 } 22632 } 22633 }, [slots, fills]); 22634 const registerFill = (0,external_wp_element_namespaceObject.useCallback)((name, ref) => { 22635 setFills(prevFills => ({ ...prevFills, 22636 [name]: [...(prevFills[name] || []), ref] 22637 })); 22638 }, []); 22639 const unregisterFill = (0,external_wp_element_namespaceObject.useCallback)((name, ref) => { 22640 setFills(prevFills => { 22641 if (prevFills[name]) { 22642 return { ...prevFills, 22643 [name]: prevFills[name].filter(fillRef => fillRef !== ref) 22644 }; 22645 } 22646 22647 return prevFills; 22648 }); 22649 }, []); // Memoizing the return value so it can be directly passed to Provider value 22650 22651 const registry = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 22652 slots, 22653 fills, 22654 registerSlot, 22655 updateSlot, 22656 unregisterSlot, 22657 registerFill, 22658 unregisterFill 22659 }), [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]); 22660 return registry; 22661 } 22662 22663 function SlotFillProvider(_ref) { 22664 let { 22665 children 22666 } = _ref; 22667 const registry = useSlotRegistry(); 22668 return (0,external_wp_element_namespaceObject.createElement)(slot_fill_context.Provider, { 22669 value: registry 22670 }, children); 22671 } 22672 22673 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js 22674 22675 // @ts-nocheck 22676 22677 /** 22678 * External dependencies 22679 */ 22680 22681 /** 22682 * WordPress dependencies 22683 */ 22684 22685 22686 /** 22687 * Internal dependencies 22688 */ 22689 22690 22691 class provider_SlotFillProvider extends external_wp_element_namespaceObject.Component { 22692 constructor() { 22693 super(...arguments); 22694 this.registerSlot = this.registerSlot.bind(this); 22695 this.registerFill = this.registerFill.bind(this); 22696 this.unregisterSlot = this.unregisterSlot.bind(this); 22697 this.unregisterFill = this.unregisterFill.bind(this); 22698 this.getSlot = this.getSlot.bind(this); 22699 this.getFills = this.getFills.bind(this); 22700 this.hasFills = this.hasFills.bind(this); 22701 this.subscribe = this.subscribe.bind(this); 22702 this.slots = {}; 22703 this.fills = {}; 22704 this.listeners = []; 22705 this.contextValue = { 22706 registerSlot: this.registerSlot, 22707 unregisterSlot: this.unregisterSlot, 22708 registerFill: this.registerFill, 22709 unregisterFill: this.unregisterFill, 22710 getSlot: this.getSlot, 22711 getFills: this.getFills, 22712 hasFills: this.hasFills, 22713 subscribe: this.subscribe 22714 }; 22715 } 22716 22717 registerSlot(name, slot) { 22718 const previousSlot = this.slots[name]; 22719 this.slots[name] = slot; 22720 this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot 22721 // But before the registerSlot call, we need to rerender the slot. 22722 22723 this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the 22724 // same name exists, force its update _after_ the new slot has been 22725 // assigned into the instance, such that its own rendering of children 22726 // will be empty (the new Slot will subsume all fills for this name). 22727 22728 if (previousSlot) { 22729 previousSlot.forceUpdate(); 22730 } 22731 } 22732 22733 registerFill(name, instance) { 22734 this.fills[name] = [...(this.fills[name] || []), instance]; 22735 this.forceUpdateSlot(name); 22736 } 22737 22738 unregisterSlot(name, instance) { 22739 // If a previous instance of a Slot by this name unmounts, do nothing, 22740 // as the slot and its fills should only be removed for the current 22741 // known instance. 22742 if (this.slots[name] !== instance) { 22743 return; 22744 } 22745 22746 delete this.slots[name]; 22747 this.triggerListeners(); 22748 } 22749 22750 unregisterFill(name, instance) { 22751 this.fills[name] = (0,external_lodash_namespaceObject.without)(this.fills[name], instance); 22752 this.forceUpdateSlot(name); 22753 } 22754 22755 getSlot(name) { 22756 return this.slots[name]; 22757 } 22758 22759 getFills(name, slotInstance) { 22760 // Fills should only be returned for the current instance of the slot 22761 // in which they occupy. 22762 if (this.slots[name] !== slotInstance) { 22763 return []; 22764 } 22765 22766 return this.fills[name]; 22767 } 22768 22769 hasFills(name) { 22770 return this.fills[name] && !!this.fills[name].length; 22771 } 22772 22773 forceUpdateSlot(name) { 22774 const slot = this.getSlot(name); 22775 22776 if (slot) { 22777 slot.forceUpdate(); 22778 } 22779 } 22780 22781 triggerListeners() { 22782 this.listeners.forEach(listener => listener()); 22783 } 22784 22785 subscribe(listener) { 22786 this.listeners.push(listener); 22787 return () => { 22788 this.listeners = (0,external_lodash_namespaceObject.without)(this.listeners, listener); 22789 }; 22790 } 22791 22792 render() { 22793 return (0,external_wp_element_namespaceObject.createElement)(context.Provider, { 22794 value: this.contextValue 22795 }, this.props.children); 22796 } 22797 22798 } 22799 22800 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js 22801 22802 22803 // @ts-nocheck 22804 22805 /** 22806 * WordPress dependencies 22807 */ 22808 22809 /** 22810 * Internal dependencies 22811 */ 22812 22813 22814 22815 22816 22817 22818 22819 22820 function slot_fill_Fill(props) { 22821 // We're adding both Fills here so they can register themselves before 22822 // their respective slot has been registered. Only the Fill that has a slot 22823 // will render. The other one will return null. 22824 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(fill, props), (0,external_wp_element_namespaceObject.createElement)(fill_Fill, props)); 22825 } 22826 const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => { 22827 let { 22828 bubblesVirtually, 22829 ...props 22830 } = _ref; 22831 22832 if (bubblesVirtually) { 22833 return (0,external_wp_element_namespaceObject.createElement)(bubbles_virtually_slot, extends_extends({}, props, { 22834 ref: ref 22835 })); 22836 } 22837 22838 return (0,external_wp_element_namespaceObject.createElement)(slot, props); 22839 }); 22840 function Provider(_ref2) { 22841 let { 22842 children, 22843 ...props 22844 } = _ref2; 22845 return (0,external_wp_element_namespaceObject.createElement)(provider_SlotFillProvider, props, (0,external_wp_element_namespaceObject.createElement)(SlotFillProvider, null, children)); 22846 } 22847 function createSlotFill(name) { 22848 const FillComponent = props => (0,external_wp_element_namespaceObject.createElement)(slot_fill_Fill, extends_extends({ 22849 name: name 22850 }, props)); 22851 22852 FillComponent.displayName = name + 'Fill'; 22853 22854 const SlotComponent = props => (0,external_wp_element_namespaceObject.createElement)(slot_fill_Slot, extends_extends({ 22855 name: name 22856 }, props)); 22857 22858 SlotComponent.displayName = name + 'Slot'; 22859 SlotComponent.__unstableName = name; 22860 return { 22861 Fill: FillComponent, 22862 Slot: SlotComponent 22863 }; 22864 } 22865 22866 22867 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js 22868 /** 22869 * External dependencies 22870 */ 22871 22872 /** 22873 * @typedef {'top' | 'top left' | 'top right' | 'middle' | 'middle left' | 'middle right' | 'bottom' | 'bottom left' | 'bottom right'} AppearOrigin 22874 * @typedef {'left' | 'right'} SlideInOrigin 22875 * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions 22876 * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions 22877 * @typedef {{ type: 'loading' }} LoadingOptions 22878 * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions 22879 */ 22880 22881 /* eslint-disable jsdoc/valid-types */ 22882 22883 /** 22884 * @param {GetAnimateOptions['type']} type The animation type 22885 * @return {'top' | 'left'} Default origin 22886 */ 22887 22888 function getDefaultOrigin(type) { 22889 return type === 'appear' ? 'top' : 'left'; 22890 } 22891 /* eslint-enable jsdoc/valid-types */ 22892 22893 /** 22894 * @param {GetAnimateOptions} options 22895 * 22896 * @return {string | void} ClassName that applies the animations 22897 */ 22898 22899 22900 function getAnimateClassName(options) { 22901 if (options.type === 'loading') { 22902 return classnames_default()('components-animate__loading'); 22903 } 22904 22905 const { 22906 type, 22907 origin = getDefaultOrigin(type) 22908 } = options; 22909 22910 if (type === 'appear') { 22911 const [yAxis, xAxis = 'center'] = origin.split(' '); 22912 return classnames_default()('components-animate__appear', { 22913 ['is-from-' + xAxis]: xAxis !== 'center', 22914 ['is-from-' + yAxis]: yAxis !== 'middle' 22915 }); 22916 } 22917 22918 if (type === 'slide-in') { 22919 return classnames_default()('components-animate__slide-in', 'is-from-' + origin); 22920 } 22921 } // @ts-ignore Reason: Planned for deprecation 22922 22923 function Animate(_ref) { 22924 let { 22925 type, 22926 options = {}, 22927 children 22928 } = _ref; 22929 return children({ 22930 className: getAnimateClassName({ 22931 type, 22932 ...options 22933 }) 22934 }); 22935 } 22936 22937 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js 22938 22939 22940 // @ts-nocheck 22941 22942 /** 22943 * External dependencies 22944 */ 22945 22946 /** 22947 * WordPress dependencies 22948 */ 22949 22950 22951 22952 22953 22954 /** 22955 * Internal dependencies 22956 */ 22957 22958 22959 22960 22961 22962 22963 /** 22964 * Name of slot in which popover should fill. 22965 * 22966 * @type {string} 22967 */ 22968 22969 const SLOT_NAME = 'Popover'; 22970 const slotNameContext = (0,external_wp_element_namespaceObject.createContext)(); 22971 22972 function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) { 22973 let anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 22974 let shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined; 22975 let container = arguments.length > 5 ? arguments[5] : undefined; 22976 22977 if (anchorRect) { 22978 return anchorRect; 22979 } 22980 22981 if (getAnchorRect) { 22982 if (!anchorRefFallback.current) { 22983 return; 22984 } 22985 22986 const rect = getAnchorRect(anchorRefFallback.current); 22987 return offsetIframe(rect, rect.ownerDocument || anchorRefFallback.current.ownerDocument, container); 22988 } 22989 22990 if (anchorRef !== false) { 22991 if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) { 22992 return; 22993 } // Duck-type to check if `anchorRef` is an instance of Range 22994 // `anchorRef instanceof window.Range` checks will break across document boundaries 22995 // such as in an iframe. 22996 22997 22998 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') { 22999 return offsetIframe((0,external_wp_dom_namespaceObject.getRectangleFromRange)(anchorRef), anchorRef.endContainer.ownerDocument, container); 23000 } // Duck-type to check if `anchorRef` is an instance of Element 23001 // `anchorRef instanceof window.Element` checks will break across document boundaries 23002 // such as in an iframe. 23003 23004 23005 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') { 23006 const rect = offsetIframe(anchorRef.getBoundingClientRect(), anchorRef.ownerDocument, container); 23007 23008 if (shouldAnchorIncludePadding) { 23009 return rect; 23010 } 23011 23012 return withoutPadding(rect, anchorRef); 23013 } 23014 23015 const { 23016 top, 23017 bottom 23018 } = anchorRef; 23019 const topRect = top.getBoundingClientRect(); 23020 const bottomRect = bottom.getBoundingClientRect(); 23021 const rect = offsetIframe(new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top), top.ownerDocument, container); 23022 23023 if (shouldAnchorIncludePadding) { 23024 return rect; 23025 } 23026 23027 return withoutPadding(rect, anchorRef); 23028 } 23029 23030 if (!anchorRefFallback.current) { 23031 return; 23032 } 23033 23034 const { 23035 parentNode 23036 } = anchorRefFallback.current; 23037 const rect = offsetIframe(parentNode.getBoundingClientRect(), parentNode.ownerDocument, container); 23038 23039 if (shouldAnchorIncludePadding) { 23040 return rect; 23041 } 23042 23043 return withoutPadding(rect, parentNode); 23044 } 23045 23046 function popover_getComputedStyle(node) { 23047 return node.ownerDocument.defaultView.getComputedStyle(node); 23048 } 23049 23050 function withoutPadding(rect, element) { 23051 const { 23052 paddingTop, 23053 paddingBottom, 23054 paddingLeft, 23055 paddingRight 23056 } = popover_getComputedStyle(element); 23057 const top = paddingTop ? parseInt(paddingTop, 10) : 0; 23058 const bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0; 23059 const left = paddingLeft ? parseInt(paddingLeft, 10) : 0; 23060 const right = paddingRight ? parseInt(paddingRight, 10) : 0; 23061 return { 23062 x: rect.left + left, 23063 y: rect.top + top, 23064 width: rect.width - left - right, 23065 height: rect.height - top - bottom, 23066 left: rect.left + left, 23067 right: rect.right - right, 23068 top: rect.top + top, 23069 bottom: rect.bottom - bottom 23070 }; 23071 } 23072 /** 23073 * Sets or removes an element attribute. 23074 * 23075 * @param {Element} element The element to modify. 23076 * @param {string} name The attribute name to set or remove. 23077 * @param {?string} value The value to set. A falsy value will remove the 23078 * attribute. 23079 */ 23080 23081 23082 function setAttribute(element, name, value) { 23083 if (!value) { 23084 if (element.hasAttribute(name)) { 23085 element.removeAttribute(name); 23086 } 23087 } else if (element.getAttribute(name) !== value) { 23088 element.setAttribute(name, value); 23089 } 23090 } 23091 /** 23092 * Sets or removes an element style property. 23093 * 23094 * @param {Element} element The element to modify. 23095 * @param {string} property The property to set or remove. 23096 * @param {?string} value The value to set. A falsy value will remove the 23097 * property. 23098 */ 23099 23100 23101 function setStyle(element, property) { 23102 let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 23103 23104 if (element.style[property] !== value) { 23105 element.style[property] = value; 23106 } 23107 } 23108 /** 23109 * Sets or removes an element class. 23110 * 23111 * @param {Element} element The element to modify. 23112 * @param {string} name The class to set or remove. 23113 * @param {boolean} toggle True to set the class, false to remove. 23114 */ 23115 23116 23117 function setClass(element, name, toggle) { 23118 if (toggle) { 23119 if (!element.classList.contains(name)) { 23120 element.classList.add(name); 23121 } 23122 } else if (element.classList.contains(name)) { 23123 element.classList.remove(name); 23124 } 23125 } 23126 23127 function getAnchorDocument(anchor) { 23128 if (!anchor) { 23129 return; 23130 } 23131 23132 if (anchor.endContainer) { 23133 return anchor.endContainer.ownerDocument; 23134 } 23135 23136 if (anchor.top) { 23137 return anchor.top.ownerDocument; 23138 } 23139 23140 return anchor.ownerDocument; 23141 } 23142 23143 const Popover = (_ref, ref) => { 23144 let { 23145 headerTitle, 23146 onClose, 23147 children, 23148 className, 23149 noArrow = true, 23150 isAlternate, 23151 // Disable reason: We generate the `...contentProps` rest as remainder 23152 // of props which aren't explicitly handled by this component. 23153 23154 /* eslint-disable no-unused-vars */ 23155 position = 'bottom right', 23156 range, 23157 focusOnMount = 'firstElement', 23158 anchorRef, 23159 shouldAnchorIncludePadding, 23160 anchorRect, 23161 getAnchorRect, 23162 expandOnMobile, 23163 animate = true, 23164 onFocusOutside, 23165 __unstableStickyBoundaryElement, 23166 __unstableSlotName = SLOT_NAME, 23167 __unstableObserveElement, 23168 __unstableBoundaryParent, 23169 __unstableForcePosition, 23170 __unstableForceXAlignment, 23171 __unstableEditorCanvasWrapper, 23172 23173 /* eslint-enable no-unused-vars */ 23174 ...contentProps 23175 } = _ref; 23176 const anchorRefFallback = (0,external_wp_element_namespaceObject.useRef)(null); 23177 const contentRef = (0,external_wp_element_namespaceObject.useRef)(null); 23178 const containerRef = (0,external_wp_element_namespaceObject.useRef)(); 23179 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); 23180 const [animateOrigin, setAnimateOrigin] = (0,external_wp_element_namespaceObject.useState)(); 23181 23182 const slotName = (0,external_wp_element_namespaceObject.useContext)(slotNameContext) || __unstableSlotName; 23183 23184 const slot = use_slot_useSlot(slotName); 23185 const isExpanded = expandOnMobile && isMobileViewport; 23186 const [containerResizeListener, contentSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 23187 noArrow = isExpanded || noArrow; 23188 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 23189 if (isExpanded) { 23190 setClass(containerRef.current, 'is-without-arrow', noArrow); 23191 setClass(containerRef.current, 'is-alternate', isAlternate); 23192 setAttribute(containerRef.current, 'data-x-axis'); 23193 setAttribute(containerRef.current, 'data-y-axis'); 23194 setStyle(containerRef.current, 'top'); 23195 setStyle(containerRef.current, 'left'); 23196 setStyle(contentRef.current, 'maxHeight'); 23197 setStyle(contentRef.current, 'maxWidth'); 23198 return; 23199 } 23200 23201 const refresh = () => { 23202 if (!containerRef.current || !contentRef.current) { 23203 return; 23204 } 23205 23206 let anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, containerRef.current); 23207 23208 if (!anchor) { 23209 return; 23210 } 23211 23212 const { 23213 offsetParent, 23214 ownerDocument 23215 } = containerRef.current; 23216 let relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body, 23217 // subtract the position from the anchor rect. If the position of 23218 // the popover is fixed, the offset parent is null or the body 23219 // element, in which case the position is relative to the viewport. 23220 // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent 23221 23222 if (offsetParent && offsetParent !== ownerDocument.body) { 23223 const offsetParentRect = offsetParent.getBoundingClientRect(); 23224 relativeOffsetTop = offsetParentRect.top; 23225 anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height); 23226 } 23227 23228 let boundaryElement; 23229 23230 if (__unstableBoundaryParent) { 23231 boundaryElement = containerRef.current.parentElement; 23232 } 23233 23234 const usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize; 23235 const { 23236 popoverTop, 23237 popoverLeft, 23238 xAxis, 23239 yAxis, 23240 contentHeight, 23241 contentWidth 23242 } = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition, __unstableForceXAlignment, __unstableEditorCanvasWrapper); 23243 23244 if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') { 23245 setStyle(containerRef.current, 'top', popoverTop + 'px'); 23246 setStyle(containerRef.current, 'left', popoverLeft + 'px'); 23247 } 23248 23249 setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle'); 23250 setClass(containerRef.current, 'is-alternate', isAlternate); 23251 setAttribute(containerRef.current, 'data-x-axis', xAxis); 23252 setAttribute(containerRef.current, 'data-y-axis', yAxis); 23253 setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : ''); 23254 setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position. 23255 23256 const yAxisMapping = { 23257 top: 'bottom', 23258 bottom: 'top' 23259 }; 23260 const xAxisMapping = { 23261 left: 'right', 23262 right: 'left' 23263 }; 23264 const animateYAxis = yAxisMapping[yAxis] || 'middle'; 23265 const animateXAxis = xAxisMapping[xAxis] || 'center'; 23266 setAnimateOrigin(animateXAxis + ' ' + animateYAxis); 23267 }; 23268 23269 refresh(); 23270 const { 23271 ownerDocument 23272 } = containerRef.current; 23273 const { 23274 defaultView 23275 } = ownerDocument; 23276 /* 23277 * There are sometimes we need to reposition or resize the popover that 23278 * are not handled by the resize/scroll window events (i.e. CSS changes 23279 * in the layout that changes the position of the anchor). 23280 * 23281 * For these situations, we refresh the popover every 0.5s 23282 */ 23283 23284 const intervalHandle = defaultView.setInterval(refresh, 500); 23285 let rafId; 23286 23287 const refreshOnAnimationFrame = () => { 23288 defaultView.cancelAnimationFrame(rafId); 23289 rafId = defaultView.requestAnimationFrame(refresh); 23290 }; // Sometimes a click trigger a layout change that affects the popover 23291 // position. This is an opportunity to immediately refresh rather than 23292 // at the interval. 23293 23294 23295 defaultView.addEventListener('click', refreshOnAnimationFrame); 23296 defaultView.addEventListener('resize', refresh); 23297 defaultView.addEventListener('scroll', refresh, true); 23298 const anchorDocument = getAnchorDocument(anchorRef); // If the anchor is within an iframe, the popover position also needs 23299 // to refrest when the iframe content is scrolled or resized. 23300 23301 if (anchorDocument && anchorDocument !== ownerDocument) { 23302 anchorDocument.defaultView.addEventListener('resize', refresh); 23303 anchorDocument.defaultView.addEventListener('scroll', refresh, true); 23304 } 23305 23306 let observer; 23307 23308 if (__unstableObserveElement) { 23309 observer = new defaultView.MutationObserver(refresh); 23310 observer.observe(__unstableObserveElement, { 23311 attributes: true 23312 }); 23313 } 23314 23315 return () => { 23316 defaultView.clearInterval(intervalHandle); 23317 defaultView.removeEventListener('resize', refresh); 23318 defaultView.removeEventListener('scroll', refresh, true); 23319 defaultView.removeEventListener('click', refreshOnAnimationFrame); 23320 defaultView.cancelAnimationFrame(rafId); 23321 23322 if (anchorDocument && anchorDocument !== ownerDocument) { 23323 var _anchorDocument$defau, _anchorDocument$defau2; 23324 23325 (_anchorDocument$defau = anchorDocument.defaultView) === null || _anchorDocument$defau === void 0 ? void 0 : _anchorDocument$defau.removeEventListener('resize', refresh); 23326 (_anchorDocument$defau2 = anchorDocument.defaultView) === null || _anchorDocument$defau2 === void 0 ? void 0 : _anchorDocument$defau2.removeEventListener('scroll', refresh, true); 23327 } 23328 23329 if (observer) { 23330 observer.disconnect(); 23331 } 23332 }; 23333 }, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableStickyBoundaryElement, __unstableObserveElement, __unstableBoundaryParent]); 23334 23335 const onDialogClose = (type, event) => { 23336 // Ideally the popover should have just a single onClose prop and 23337 // not three props that potentially do the same thing. 23338 if (type === 'focus-outside' && onFocusOutside) { 23339 onFocusOutside(event); 23340 } else if (onClose) { 23341 onClose(); 23342 } 23343 }; 23344 23345 const [dialogRef, dialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ 23346 focusOnMount, 23347 __unstableOnClose: onDialogClose, 23348 onClose: onDialogClose 23349 }); 23350 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, dialogRef, ref]); 23351 /** @type {false | string} */ 23352 23353 const animateClassName = Boolean(animate && animateOrigin) && getAnimateClassName({ 23354 type: 'appear', 23355 origin: animateOrigin 23356 }); // Disable reason: We care to capture the _bubbled_ events from inputs 23357 // within popover as inferring close intent. 23358 23359 let content = // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions 23360 // eslint-disable-next-line jsx-a11y/no-static-element-interactions 23361 (0,external_wp_element_namespaceObject.createElement)("div", extends_extends({ 23362 className: classnames_default()('components-popover', className, animateClassName, { 23363 'is-expanded': isExpanded, 23364 'is-without-arrow': noArrow, 23365 'is-alternate': isAlternate 23366 }) 23367 }, contentProps, { 23368 ref: mergedRefs 23369 }, dialogProps, { 23370 tabIndex: "-1" 23371 }), isExpanded && (0,external_wp_element_namespaceObject.createElement)(ScrollLock, null), isExpanded && (0,external_wp_element_namespaceObject.createElement)("div", { 23372 className: "components-popover__header" 23373 }, (0,external_wp_element_namespaceObject.createElement)("span", { 23374 className: "components-popover__header-title" 23375 }, headerTitle), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { 23376 className: "components-popover__close", 23377 icon: library_close, 23378 onClick: onClose 23379 })), (0,external_wp_element_namespaceObject.createElement)("div", { 23380 ref: contentRef, 23381 className: "components-popover__content" 23382 }, (0,external_wp_element_namespaceObject.createElement)("div", { 23383 style: { 23384 position: 'relative' 23385 } 23386 }, containerResizeListener, children))); 23387 23388 if (slot.ref) { 23389 content = (0,external_wp_element_namespaceObject.createElement)(slot_fill_Fill, { 23390 name: slotName 23391 }, content); 23392 } 23393 23394 if (anchorRef || anchorRect) { 23395 return content; 23396 } 23397 23398 return (0,external_wp_element_namespaceObject.createElement)("span", { 23399 ref: anchorRefFallback 23400 }, content); 23401 }; 23402 23403 const PopoverContainer = (0,external_wp_element_namespaceObject.forwardRef)(Popover); 23404 23405 function PopoverSlot(_ref2, ref) { 23406 let { 23407 name = SLOT_NAME 23408 } = _ref2; 23409 return (0,external_wp_element_namespaceObject.createElement)(slot_fill_Slot, { 23410 bubblesVirtually: true, 23411 name: name, 23412 className: "popover-slot", 23413 ref: ref 23414 }); 23415 } 23416 23417 PopoverContainer.Slot = (0,external_wp_element_namespaceObject.forwardRef)(PopoverSlot); 23418 PopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider; 23419 /* harmony default export */ var popover = (PopoverContainer); 23420 23421 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js 23422 23423 23424 /** 23425 * External dependencies 23426 */ 23427 23428 /** @typedef {string | { display: string, ariaLabel: string }} Shortcut */ 23429 23430 /** 23431 * @typedef Props 23432 * @property {Shortcut} shortcut Shortcut configuration 23433 * @property {string} [className] Classname 23434 */ 23435 23436 /** 23437 * @param {Props} props Props 23438 * @return {JSX.Element | null} Element 23439 */ 23440 23441 function Shortcut(_ref) { 23442 let { 23443 shortcut, 23444 className 23445 } = _ref; 23446 23447 if (!shortcut) { 23448 return null; 23449 } 23450 23451 let displayText; 23452 let ariaLabel; 23453 23454 if ((0,external_lodash_namespaceObject.isString)(shortcut)) { 23455 displayText = shortcut; 23456 } 23457 23458 if ((0,external_lodash_namespaceObject.isObject)(shortcut)) { 23459 displayText = shortcut.display; 23460 ariaLabel = shortcut.ariaLabel; 23461 } 23462 23463 return (0,external_wp_element_namespaceObject.createElement)("span", { 23464 className: className, 23465 "aria-label": ariaLabel 23466 }, displayText); 23467 } 23468 23469 /* harmony default export */ var build_module_shortcut = (Shortcut); 23470 23471 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js 23472 23473 // @ts-nocheck 23474 23475 /** 23476 * External dependencies 23477 */ 23478 23479 /** 23480 * WordPress dependencies 23481 */ 23482 23483 23484 23485 /** 23486 * Internal dependencies 23487 */ 23488 23489 23490 23491 /** 23492 * Time over children to wait before showing tooltip 23493 * 23494 * @type {number} 23495 */ 23496 23497 const TOOLTIP_DELAY = 700; 23498 const eventCatcher = (0,external_wp_element_namespaceObject.createElement)("div", { 23499 className: "event-catcher" 23500 }); 23501 23502 const getDisabledElement = _ref => { 23503 let { 23504 eventHandlers, 23505 child, 23506 childrenWithPopover 23507 } = _ref; 23508 return (0,external_wp_element_namespaceObject.cloneElement)((0,external_wp_element_namespaceObject.createElement)("span", { 23509 className: "disabled-element-wrapper" 23510 }, (0,external_wp_element_namespaceObject.cloneElement)(eventCatcher, eventHandlers), (0,external_wp_element_namespaceObject.cloneElement)(child, { 23511 children: childrenWithPopover 23512 })), eventHandlers); 23513 }; 23514 23515 const getRegularElement = _ref2 => { 23516 let { 23517 child, 23518 eventHandlers, 23519 childrenWithPopover 23520 } = _ref2; 23521 return (0,external_wp_element_namespaceObject.cloneElement)(child, { ...eventHandlers, 23522 children: childrenWithPopover 23523 }); 23524 }; 23525 23526 const addPopoverToGrandchildren = _ref3 => { 23527 let { 23528 grandchildren, 23529 isOver, 23530 position, 23531 text, 23532 shortcut 23533 } = _ref3; 23534 return (0,external_wp_element_namespaceObject.concatChildren)(grandchildren, isOver && (0,external_wp_element_namespaceObject.createElement)(popover, { 23535 focusOnMount: false, 23536 position: position, 23537 className: "components-tooltip", 23538 "aria-hidden": "true", 23539 animate: false, 23540 noArrow: true 23541 }, text, (0,external_wp_element_namespaceObject.createElement)(build_module_shortcut, { 23542 className: "components-tooltip__shortcut", 23543 shortcut: shortcut 23544 }))); 23545 }; 23546 23547 const emitToChild = (children, eventName, event) => { 23548 if (external_wp_element_namespaceObject.Children.count(children) !== 1) { 23549 return; 23550 } 23551 23552 const child = external_wp_element_namespaceObject.Children.only(children); // If the underlying element is disabled, do not emit the event. 23553 23554 if (child.props.disabled) { 23555 return; 23556 } 23557 23558 if (typeof child.props[eventName] === 'function') { 23559 child.props[eventName](event); 23560 } 23561 }; 23562 23563 function Tooltip(props) { 23564 const { 23565 children, 23566 position, 23567 text, 23568 shortcut, 23569 delay = TOOLTIP_DELAY 23570 } = props; 23571 /** 23572 * Whether a mouse is currently pressed, used in determining whether 23573 * to handle a focus event as displaying the tooltip immediately. 23574 * 23575 * @type {boolean} 23576 */ 23577 23578 const [isMouseDown, setIsMouseDown] = (0,external_wp_element_namespaceObject.useState)(false); 23579 const [isOver, setIsOver] = (0,external_wp_element_namespaceObject.useState)(false); 23580 const delayedSetIsOver = (0,external_wp_compose_namespaceObject.useDebounce)(setIsOver, delay); 23581 23582 const createMouseDown = event => { 23583 // Preserve original child callback behavior. 23584 emitToChild(children, 'onMouseDown', event); // On mouse down, the next `mouseup` should revert the value of the 23585 // instance property and remove its own event handler. The bind is 23586 // made on the document since the `mouseup` might not occur within 23587 // the bounds of the element. 23588 23589 document.addEventListener('mouseup', cancelIsMouseDown); 23590 setIsMouseDown(true); 23591 }; 23592 23593 const createMouseUp = event => { 23594 emitToChild(children, 'onMouseUp', event); 23595 document.removeEventListener('mouseup', cancelIsMouseDown); 23596 setIsMouseDown(false); 23597 }; 23598 23599 const createMouseEvent = type => { 23600 if (type === 'mouseUp') return createMouseUp; 23601 if (type === 'mouseDown') return createMouseDown; 23602 }; 23603 /** 23604 * Prebound `isInMouseDown` handler, created as a constant reference to 23605 * assure ability to remove in component unmount. 23606 * 23607 * @type {Function} 23608 */ 23609 23610 23611 const cancelIsMouseDown = createMouseEvent('mouseUp'); 23612 23613 const createToggleIsOver = (eventName, isDelayed) => { 23614 return event => { 23615 // Preserve original child callback behavior. 23616 emitToChild(children, eventName, event); // Mouse events behave unreliably in React for disabled elements, 23617 // firing on mouseenter but not mouseleave. Further, the default 23618 // behavior for disabled elements in some browsers is to ignore 23619 // mouse events. Don't bother trying to to handle them. 23620 // 23621 // See: https://github.com/facebook/react/issues/4251 23622 23623 if (event.currentTarget.disabled) { 23624 return; 23625 } // A focus event will occur as a result of a mouse click, but it 23626 // should be disambiguated between interacting with the button and 23627 // using an explicit focus shift as a cue to display the tooltip. 23628 23629 23630 if ('focus' === event.type && isMouseDown) { 23631 return; 23632 } // Needed in case unsetting is over while delayed set pending, i.e. 23633 // quickly blur/mouseleave before delayedSetIsOver is called. 23634 23635 23636 delayedSetIsOver.cancel(); 23637 23638 const _isOver = (0,external_lodash_namespaceObject.includes)(['focus', 'mouseenter'], event.type); 23639 23640 if (_isOver === isOver) { 23641 return; 23642 } 23643 23644 if (isDelayed) { 23645 delayedSetIsOver(_isOver); 23646 } else { 23647 setIsOver(_isOver); 23648 } 23649 }; 23650 }; 23651 23652 const clearOnUnmount = () => { 23653 delayedSetIsOver.cancel(); 23654 document.removeEventListener('mouseup', cancelIsMouseDown); 23655 }; 23656 23657 (0,external_wp_element_namespaceObject.useEffect)(() => clearOnUnmount, []); 23658 23659 if (external_wp_element_namespaceObject.Children.count(children) !== 1) { 23660 if (false) {} 23661 23662 return children; 23663 } 23664 23665 const eventHandlers = { 23666 onMouseEnter: createToggleIsOver('onMouseEnter', true), 23667 onMouseLeave: createToggleIsOver('onMouseLeave'), 23668 onClick: createToggleIsOver('onClick'), 23669 onFocus: createToggleIsOver('onFocus'), 23670 onBlur: createToggleIsOver('onBlur'), 23671 onMouseDown: createMouseEvent('mouseDown') 23672 }; 23673 const child = external_wp_element_namespaceObject.Children.only(children); 23674 const { 23675 children: grandchildren, 23676 disabled 23677 } = child.props; 23678 const getElementWithPopover = disabled ? getDisabledElement : getRegularElement; 23679 const popoverData = { 23680 isOver, 23681 position, 23682 text, 23683 shortcut 23684 }; 23685 const childrenWithPopover = addPopoverToGrandchildren({ 23686 grandchildren, 23687 ...popoverData 23688 }); 23689 return getElementWithPopover({ 23690 child, 23691 eventHandlers, 23692 childrenWithPopover 23693 }); 23694 } 23695 23696 /* harmony default export */ var tooltip = (Tooltip); 23697 23698 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js 23699 /** 23700 * External dependencies 23701 */ 23702 23703 /** 23704 * WordPress dependencies 23705 */ 23706 23707 23708 const GRID = [['top left', 'top center', 'top right'], ['center left', 'center center', 'center right'], ['bottom left', 'bottom center', 'bottom right']]; // Stored as map as i18n __() only accepts strings (not variables) 23709 23710 const ALIGNMENT_LABEL = { 23711 'top left': (0,external_wp_i18n_namespaceObject.__)('Top Left'), 23712 'top center': (0,external_wp_i18n_namespaceObject.__)('Top Center'), 23713 'top right': (0,external_wp_i18n_namespaceObject.__)('Top Right'), 23714 'center left': (0,external_wp_i18n_namespaceObject.__)('Center Left'), 23715 'center center': (0,external_wp_i18n_namespaceObject.__)('Center Center'), 23716 'center right': (0,external_wp_i18n_namespaceObject.__)('Center Right'), 23717 'bottom left': (0,external_wp_i18n_namespaceObject.__)('Bottom Left'), 23718 'bottom center': (0,external_wp_i18n_namespaceObject.__)('Bottom Center'), 23719 'bottom right': (0,external_wp_i18n_namespaceObject.__)('Bottom Right') 23720 }; // Transforms GRID into a flat Array of values. 23721 23722 const ALIGNMENTS = (0,external_lodash_namespaceObject.flattenDeep)(GRID); 23723 /** 23724 * Parses and transforms an incoming value to better match the alignment values 23725 * 23726 * @param {string} value An alignment value to parse. 23727 * 23728 * @return {string} The parsed value. 23729 */ 23730 23731 function transformValue(value) { 23732 const nextValue = value === 'center' ? 'center center' : value; 23733 return nextValue.replace('-', ' '); 23734 } 23735 /** 23736 * Creates an item ID based on a prefix ID and an alignment value. 23737 * 23738 * @param {string} prefixId An ID to prefix. 23739 * @param {string} value An alignment value. 23740 * 23741 * @return {string} The item id. 23742 */ 23743 23744 function getItemId(prefixId, value) { 23745 const valueId = transformValue(value).replace(' ', '-'); 23746 return `$prefixId}-$valueId}`; 23747 } 23748 /** 23749 * Retrieves the alignment index from a value. 23750 * 23751 * @param {string} alignment Value to check. 23752 * 23753 * @return {number} The index of a matching alignment. 23754 */ 23755 23756 function getAlignmentIndex() { 23757 let alignment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'center'; 23758 const item = transformValue(alignment).replace('-', ' '); 23759 const index = ALIGNMENTS.indexOf(item); 23760 return index > -1 ? index : undefined; 23761 } 23762 23763 // EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js 23764 var hoist_non_react_statics_cjs = __webpack_require__(1281); 23765 ;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 var pkg = { 23779 name: "@emotion/react", 23780 version: "11.9.0", 23781 main: "dist/emotion-react.cjs.js", 23782 module: "dist/emotion-react.esm.js", 23783 browser: { 23784 "./dist/emotion-react.cjs.js": "./dist/emotion-react.browser.cjs.js", 23785 "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" 23786 }, 23787 types: "types/index.d.ts", 23788 files: [ 23789 "src", 23790 "dist", 23791 "jsx-runtime", 23792 "jsx-dev-runtime", 23793 "_isolated-hnrs", 23794 "types/*.d.ts", 23795 "macro.js", 23796 "macro.d.ts", 23797 "macro.js.flow" 23798 ], 23799 sideEffects: false, 23800 author: "Emotion Contributors", 23801 license: "MIT", 23802 scripts: { 23803 "test:typescript": "dtslint types" 23804 }, 23805 dependencies: { 23806 "@babel/runtime": "^7.13.10", 23807 "@emotion/babel-plugin": "^11.7.1", 23808 "@emotion/cache": "^11.7.1", 23809 "@emotion/serialize": "^1.0.3", 23810 "@emotion/utils": "^1.1.0", 23811 "@emotion/weak-memoize": "^0.2.5", 23812 "hoist-non-react-statics": "^3.3.1" 23813 }, 23814 peerDependencies: { 23815 "@babel/core": "^7.0.0", 23816 react: ">=16.8.0" 23817 }, 23818 peerDependenciesMeta: { 23819 "@babel/core": { 23820 optional: true 23821 }, 23822 "@types/react": { 23823 optional: true 23824 } 23825 }, 23826 devDependencies: { 23827 "@babel/core": "^7.13.10", 23828 "@emotion/css": "11.9.0", 23829 "@emotion/css-prettifier": "1.0.1", 23830 "@emotion/server": "11.4.0", 23831 "@emotion/styled": "11.8.1", 23832 "@types/react": "^16.9.11", 23833 dtslint: "^4.2.1", 23834 "html-tag-names": "^1.1.2", 23835 react: "16.14.0", 23836 "svg-tag-names": "^1.1.1", 23837 typescript: "^4.5.5" 23838 }, 23839 repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", 23840 publishConfig: { 23841 access: "public" 23842 }, 23843 "umd:main": "dist/emotion-react.umd.min.js", 23844 preconstruct: { 23845 entrypoints: [ 23846 "./index.js", 23847 "./jsx-runtime.js", 23848 "./jsx-dev-runtime.js", 23849 "./_isolated-hnrs.js" 23850 ], 23851 umdName: "emotionReact" 23852 } 23853 }; 23854 23855 var jsx = function jsx(type, props) { 23856 var args = arguments; 23857 23858 if (props == null || !hasOwnProperty.call(props, 'css')) { 23859 // $FlowFixMe 23860 return createElement.apply(undefined, args); 23861 } 23862 23863 var argsLength = args.length; 23864 var createElementArgArray = new Array(argsLength); 23865 createElementArgArray[0] = Emotion; 23866 createElementArgArray[1] = createEmotionProps(type, props); 23867 23868 for (var i = 2; i < argsLength; i++) { 23869 createElementArgArray[i] = args[i]; 23870 } // $FlowFixMe 23871 23872 23873 return createElement.apply(null, createElementArgArray); 23874 }; 23875 23876 var emotion_react_browser_esm_useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : external_React_.useLayoutEffect; 23877 var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. 23878 // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild 23879 // initial client-side render from SSR, use place of hydrating tag 23880 23881 var Global = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { 23882 if (false) {} 23883 23884 var styles = props.styles; 23885 var serialized = serializeStyles([styles], undefined, useContext(ThemeContext)); 23886 // but it is based on a constant that will never change at runtime 23887 // it's effectively like having two implementations and switching them out 23888 // so it's not actually breaking anything 23889 23890 23891 var sheetRef = useRef(); 23892 emotion_react_browser_esm_useInsertionEffect(function () { 23893 var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 23894 23895 var sheet = new cache.sheet.constructor({ 23896 key: key, 23897 nonce: cache.sheet.nonce, 23898 container: cache.sheet.container, 23899 speedy: cache.sheet.isSpeedy 23900 }); 23901 var rehydrating = false; // $FlowFixMe 23902 23903 var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); 23904 23905 if (cache.sheet.tags.length) { 23906 sheet.before = cache.sheet.tags[0]; 23907 } 23908 23909 if (node !== null) { 23910 rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s 23911 23912 node.setAttribute('data-emotion', key); 23913 sheet.hydrate([node]); 23914 } 23915 23916 sheetRef.current = [sheet, rehydrating]; 23917 return function () { 23918 sheet.flush(); 23919 }; 23920 }, [cache]); 23921 emotion_react_browser_esm_useInsertionEffect(function () { 23922 var sheetRefCurrent = sheetRef.current; 23923 var sheet = sheetRefCurrent[0], 23924 rehydrating = sheetRefCurrent[1]; 23925 23926 if (rehydrating) { 23927 sheetRefCurrent[1] = false; 23928 return; 23929 } 23930 23931 if (serialized.next !== undefined) { 23932 // insert keyframes 23933 insertStyles(cache, serialized.next, true); 23934 } 23935 23936 if (sheet.tags.length) { 23937 // if this doesn't exist then it will be null so the style element will be appended 23938 var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; 23939 sheet.before = element; 23940 sheet.flush(); 23941 } 23942 23943 cache.insert("", serialized, sheet, false); 23944 }, [cache, serialized.name]); 23945 return null; 23946 }))); 23947 23948 if (false) {} 23949 23950 function emotion_react_browser_esm_css() { 23951 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 23952 args[_key] = arguments[_key]; 23953 } 23954 23955 return emotion_serialize_browser_esm_serializeStyles(args); 23956 } 23957 23958 var emotion_react_browser_esm_keyframes = function keyframes() { 23959 var insertable = emotion_react_browser_esm_css.apply(void 0, arguments); 23960 var name = "animation-" + insertable.name; // $FlowFixMe 23961 23962 return { 23963 name: name, 23964 styles: "@keyframes " + name + "{" + insertable.styles + "}", 23965 anim: 1, 23966 toString: function toString() { 23967 return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; 23968 } 23969 }; 23970 }; 23971 23972 var emotion_react_browser_esm_classnames = function classnames(args) { 23973 var len = args.length; 23974 var i = 0; 23975 var cls = ''; 23976 23977 for (; i < len; i++) { 23978 var arg = args[i]; 23979 if (arg == null) continue; 23980 var toAdd = void 0; 23981 23982 switch (typeof arg) { 23983 case 'boolean': 23984 break; 23985 23986 case 'object': 23987 { 23988 if (Array.isArray(arg)) { 23989 toAdd = classnames(arg); 23990 } else { 23991 if (false) {} 23992 23993 toAdd = ''; 23994 23995 for (var k in arg) { 23996 if (arg[k] && k) { 23997 toAdd && (toAdd += ' '); 23998 toAdd += k; 23999 } 24000 } 24001 } 24002 24003 break; 24004 } 24005 24006 default: 24007 { 24008 toAdd = arg; 24009 } 24010 } 24011 24012 if (toAdd) { 24013 cls && (cls += ' '); 24014 cls += toAdd; 24015 } 24016 } 24017 24018 return cls; 24019 }; 24020 24021 function emotion_react_browser_esm_merge(registered, css, className) { 24022 var registeredStyles = []; 24023 var rawClassName = getRegisteredStyles(registered, registeredStyles, className); 24024 24025 if (registeredStyles.length < 2) { 24026 return className; 24027 } 24028 24029 return rawClassName + css(registeredStyles); 24030 } 24031 24032 var emotion_react_browser_esm_Insertion = function Insertion(_ref) { 24033 var cache = _ref.cache, 24034 serializedArr = _ref.serializedArr; 24035 var rules = useInsertionEffectMaybe(function () { 24036 24037 for (var i = 0; i < serializedArr.length; i++) { 24038 var res = insertStyles(cache, serializedArr[i], false); 24039 } 24040 }); 24041 24042 return null; 24043 }; 24044 24045 var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { 24046 var hasRendered = false; 24047 var serializedArr = []; 24048 24049 var css = function css() { 24050 if (hasRendered && "production" !== 'production') {} 24051 24052 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 24053 args[_key] = arguments[_key]; 24054 } 24055 24056 var serialized = serializeStyles(args, cache.registered); 24057 serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` 24058 24059 registerStyles(cache, serialized, false); 24060 return cache.key + "-" + serialized.name; 24061 }; 24062 24063 var cx = function cx() { 24064 if (hasRendered && "production" !== 'production') {} 24065 24066 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 24067 args[_key2] = arguments[_key2]; 24068 } 24069 24070 return emotion_react_browser_esm_merge(cache.registered, css, emotion_react_browser_esm_classnames(args)); 24071 }; 24072 24073 var content = { 24074 css: css, 24075 cx: cx, 24076 theme: useContext(ThemeContext) 24077 }; 24078 var ele = props.children(content); 24079 hasRendered = true; 24080 return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(emotion_react_browser_esm_Insertion, { 24081 cache: cache, 24082 serializedArr: serializedArr 24083 }), ele); 24084 }))); 24085 24086 if (false) {} 24087 24088 if (false) { var globalKey, globalContext, isJest, emotion_react_browser_esm_isBrowser; } 24089 24090 24091 24092 ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs 24093 var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},colord_n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},colord_e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},colord_a=function(r){return{r:colord_e(r.r,0,255),g:colord_e(r.g,0,255),b:colord_e(r.b,0,255),a:colord_e(r.a)}},colord_o=function(r){return{r:colord_n(r.r),g:colord_n(r.g),b:colord_n(r.b),a:colord_n(r.a,3)}},colord_i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),l:colord_e(r.l,0,100),a:colord_e(r.a)}},d=function(r){return{h:colord_n(r.h),s:colord_n(r.s),l:colord_n(r.l),a:colord_n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=colord_i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?colord_n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?colord_n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:colord_a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?colord_a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),v:colord_e(r.v,0,100),a:colord_e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:colord_e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:colord_e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return colord_n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=colord_o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(colord_n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return colord_o(this.rgba)},r.prototype.toRgbString=function(){return r=colord_o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:colord_n(r.h),s:colord_n(r.s),v:colord_n(r.v),a:colord_n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):colord_n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):colord_n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; 24094 24095 ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs 24096 /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} 24097 24098 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js 24099 /** 24100 * External dependencies 24101 */ 24102 24103 24104 k([names]); 24105 /** 24106 * Generating a CSS compliant rgba() color value. 24107 * 24108 * @param {string} hexValue The hex value to convert to rgba(). 24109 * @param {number} alpha The alpha value for opacity. 24110 * @return {string} The converted rgba() color value. 24111 * 24112 * @example 24113 * rgba( '#000000', 0.5 ) 24114 * // rgba(0, 0, 0, 0.5) 24115 */ 24116 24117 function rgba() { 24118 let hexValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 24119 let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; 24120 return w(hexValue).alpha(alpha).toRgbString(); 24121 } 24122 24123 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js 24124 /** 24125 * External dependencies 24126 */ 24127 24128 /** 24129 * Internal dependencies 24130 */ 24131 24132 24133 const BASE = { 24134 black: '#000', 24135 white: '#fff' 24136 }; 24137 /** 24138 * TODO: Continue to update values as "G2" design evolves. 24139 * 24140 * "G2" refers to the movement to advance the interface of the block editor. 24141 * https://github.com/WordPress/gutenberg/issues/18667 24142 */ 24143 24144 const G2 = { 24145 blue: { 24146 medium: { 24147 focus: '#007cba', 24148 focusDark: '#fff' 24149 } 24150 }, 24151 gray: { 24152 900: '#1e1e1e', 24153 700: '#757575', 24154 // Meets 4.6:1 text contrast against white. 24155 600: '#949494', 24156 // Meets 3:1 UI or large text contrast against white. 24157 400: '#ccc', 24158 300: '#ddd', 24159 // Used for most borders. 24160 200: '#e0e0e0', 24161 // Used sparingly for light borders. 24162 100: '#f0f0f0' // Used for light gray backgrounds. 24163 24164 }, 24165 darkGray: { 24166 primary: '#1e1e1e', 24167 heading: '#050505' 24168 }, 24169 mediumGray: { 24170 text: '#757575' 24171 }, 24172 lightGray: { 24173 ui: '#949494', 24174 secondary: '#ccc', 24175 tertiary: '#e7e8e9' 24176 } 24177 }; 24178 const DARK_GRAY = { 24179 900: '#191e23', 24180 800: '#23282d', 24181 700: '#32373c', 24182 600: '#40464d', 24183 500: '#555d66', 24184 // Use this most of the time for dark items. 24185 400: '#606a73', 24186 300: '#6c7781', 24187 // Lightest gray that can be used for AA text contrast. 24188 200: '#7e8993', 24189 150: '#8d96a0', 24190 // Lightest gray that can be used for AA non-text contrast. 24191 100: '#8f98a1', 24192 placeholder: rgba(G2.gray[900], 0.62) 24193 }; 24194 const DARK_OPACITY = { 24195 900: rgba('#000510', 0.9), 24196 800: rgba('#00000a', 0.85), 24197 700: rgba('#06060b', 0.8), 24198 600: rgba('#000913', 0.75), 24199 500: rgba('#0a1829', 0.7), 24200 400: rgba('#0a1829', 0.65), 24201 300: rgba('#0e1c2e', 0.62), 24202 200: rgba('#162435', 0.55), 24203 100: rgba('#223443', 0.5), 24204 backgroundFill: rgba(DARK_GRAY[700], 0.7) 24205 }; 24206 const DARK_OPACITY_LIGHT = { 24207 900: rgba('#304455', 0.45), 24208 800: rgba('#425863', 0.4), 24209 700: rgba('#667886', 0.35), 24210 600: rgba('#7b86a2', 0.3), 24211 500: rgba('#9197a2', 0.25), 24212 400: rgba('#95959c', 0.2), 24213 300: rgba('#829493', 0.15), 24214 200: rgba('#8b8b96', 0.1), 24215 100: rgba('#747474', 0.05) 24216 }; 24217 const LIGHT_GRAY = { 24218 900: '#a2aab2', 24219 800: '#b5bcc2', 24220 700: '#ccd0d4', 24221 600: '#d7dade', 24222 500: '#e2e4e7', 24223 // Good for "grayed" items and borders. 24224 400: '#e8eaeb', 24225 // Good for "readonly" input fields and special text selection. 24226 300: '#edeff0', 24227 200: '#f3f4f5', 24228 100: '#f8f9f9', 24229 placeholder: rgba(BASE.white, 0.65) 24230 }; 24231 const LIGHT_OPACITY_LIGHT = { 24232 900: rgba(BASE.white, 0.5), 24233 800: rgba(BASE.white, 0.45), 24234 700: rgba(BASE.white, 0.4), 24235 600: rgba(BASE.white, 0.35), 24236 500: rgba(BASE.white, 0.3), 24237 400: rgba(BASE.white, 0.25), 24238 300: rgba(BASE.white, 0.2), 24239 200: rgba(BASE.white, 0.15), 24240 100: rgba(BASE.white, 0.1), 24241 backgroundFill: rgba(LIGHT_GRAY[300], 0.8) 24242 }; // Additional colors. 24243 // Some are from https://make.wordpress.org/design/handbook/foundations/colors/. 24244 24245 const BLUE = { 24246 wordpress: { 24247 700: '#00669b' 24248 }, 24249 dark: { 24250 900: '#0071a1' 24251 }, 24252 medium: { 24253 900: '#006589', 24254 800: '#00739c', 24255 700: '#007fac', 24256 600: '#008dbe', 24257 500: '#00a0d2', 24258 400: '#33b3db', 24259 300: '#66c6e4', 24260 200: '#bfe7f3', 24261 100: '#e5f5fa', 24262 highlight: '#b3e7fe', 24263 focus: '#007cba' 24264 } 24265 }; 24266 const ALERT = { 24267 yellow: '#f0b849', 24268 red: '#d94f4f', 24269 green: '#4ab866' 24270 }; 24271 const ADMIN = { 24272 theme: `var( --wp-admin-theme-color, $BLUE.wordpress[700]})`, 24273 themeDark10: `var( --wp-admin-theme-color-darker-10, $BLUE.medium.focus})` 24274 }; // Namespaced values for raw colors hex codes. 24275 24276 const UI = { 24277 theme: ADMIN.theme, 24278 background: BASE.white, 24279 backgroundDisabled: LIGHT_GRAY[200], 24280 border: G2.gray[700], 24281 borderHover: G2.gray[700], 24282 borderFocus: ADMIN.themeDark10, 24283 borderDisabled: G2.gray[400], 24284 borderLight: G2.gray[300], 24285 label: DARK_GRAY[500], 24286 textDisabled: DARK_GRAY[150], 24287 textDark: BASE.white, 24288 textLight: BASE.black 24289 }; // Using Object.assign instead of { ...spread } syntax helps TypeScript 24290 // to extract the correct type defs here. 24291 24292 const COLORS = Object.assign({}, BASE, { 24293 darkGray: (0,external_lodash_namespaceObject.merge)({}, DARK_GRAY, G2.darkGray), 24294 darkOpacity: DARK_OPACITY, 24295 darkOpacityLight: DARK_OPACITY_LIGHT, 24296 mediumGray: G2.mediumGray, 24297 gray: G2.gray, 24298 lightGray: (0,external_lodash_namespaceObject.merge)({}, LIGHT_GRAY, G2.lightGray), 24299 lightGrayLight: LIGHT_OPACITY_LIGHT, 24300 blue: (0,external_lodash_namespaceObject.merge)({}, BLUE, G2.blue), 24301 alert: ALERT, 24302 admin: ADMIN, 24303 ui: UI 24304 }); 24305 /* harmony default export */ var colors_values = ((/* unused pure expression or super */ null && (COLORS))); 24306 24307 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js 24308 /** 24309 * Allows users to opt-out of animations via OS-level preferences. 24310 * 24311 * @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name 24312 * @return {string} Generated CSS code for the reduced style 24313 */ 24314 function reduceMotion() { 24315 let prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transition'; 24316 let style; 24317 24318 switch (prop) { 24319 case 'transition': 24320 style = 'transition-duration: 0ms;'; 24321 break; 24322 24323 case 'animation': 24324 style = 'animation-duration: 1ms;'; 24325 break; 24326 24327 default: 24328 style = ` 24329 animation-duration: 1ms; 24330 transition-duration: 0ms; 24331 `; 24332 } 24333 24334 return ` 24335 @media ( prefers-reduced-motion: reduce ) { 24336 $style}; 24337 } 24338 `; 24339 } 24340 24341 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js 24342 24343 24344 function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 24345 24346 /** 24347 * External dependencies 24348 */ 24349 24350 /** 24351 * Internal dependencies 24352 */ 24353 24354 24355 24356 var _ref = true ? { 24357 name: "lp9rn7", 24358 styles: "border-radius:2px;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr );outline:none" 24359 } : 0; 24360 24361 const rootBase = () => { 24362 return _ref; 24363 }; 24364 24365 const rootSize = _ref2 => { 24366 let { 24367 size = 92 24368 } = _ref2; 24369 return /*#__PURE__*/emotion_react_browser_esm_css("grid-template-rows:repeat( 3, calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : 0), true ? "" : 0); 24370 }; 24371 24372 const Root = emotion_styled_base_browser_esm("div", true ? { 24373 target: "e1od1u4s3" 24374 } : 0)(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", rootSize, ";" + ( true ? "" : 0)); 24375 const Row = emotion_styled_base_browser_esm("div", true ? { 24376 target: "e1od1u4s2" 24377 } : 0)( true ? { 24378 name: "1x5gbbj", 24379 styles: "box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )" 24380 } : 0); 24381 24382 const pointActive = _ref3 => { 24383 let { 24384 isActive 24385 } = _ref3; 24386 const boxShadow = isActive ? `0 0 0 2px $COLORS.black}` : null; 24387 const pointColor = isActive ? COLORS.black : COLORS.lightGray[800]; 24388 const pointColorHover = isActive ? COLORS.black : COLORS.blue.medium.focus; 24389 return /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", boxShadow, ";color:", pointColor, ";*:hover>&{color:", pointColorHover, ";}" + ( true ? "" : 0), true ? "" : 0); 24390 }; 24391 24392 const pointBase = props => { 24393 return /*#__PURE__*/emotion_react_browser_esm_css("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", pointActive(props), ";" + ( true ? "" : 0), true ? "" : 0); 24394 }; 24395 const Point = emotion_styled_base_browser_esm("span", true ? { 24396 target: "e1od1u4s1" 24397 } : 0)("height:6px;width:6px;", pointBase, ";" + ( true ? "" : 0)); 24398 const Cell = emotion_styled_base_browser_esm("span", true ? { 24399 target: "e1od1u4s0" 24400 } : 0)( true ? { 24401 name: "rjf3ub", 24402 styles: "appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0" 24403 } : 0); 24404 24405 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js 24406 24407 24408 24409 /** 24410 * Internal dependencies 24411 */ 24412 24413 24414 24415 /** 24416 * Internal dependencies 24417 */ 24418 24419 24420 24421 function cell_Cell(_ref) { 24422 let { 24423 isActive = false, 24424 value, 24425 ...props 24426 } = _ref; 24427 const tooltipText = ALIGNMENT_LABEL[value]; 24428 return (0,external_wp_element_namespaceObject.createElement)(tooltip, { 24429 text: tooltipText 24430 }, (0,external_wp_element_namespaceObject.createElement)(CompositeItem, extends_extends({ 24431 as: Cell, 24432 role: "gridcell" 24433 }, props), (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, value), (0,external_wp_element_namespaceObject.createElement)(Point, { 24434 isActive: isActive, 24435 role: "presentation" 24436 }))); 24437 } 24438 24439 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useSealedState.js 24440 24441 24442 /** 24443 * React custom hook that returns the very first value passed to `initialState`, 24444 * even if it changes between re-renders. 24445 */ 24446 function useSealedState(initialState) { 24447 var _React$useState = (0,external_React_.useState)(initialState), 24448 sealed = _React$useState[0]; 24449 24450 return sealed; 24451 } 24452 24453 24454 24455 ;// CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js 24456 24457 24458 function groupItems(items) { 24459 var groups = [[]]; 24460 24461 var _loop = function _loop() { 24462 var item = _step.value; 24463 var group = groups.find(function (g) { 24464 return !g[0] || g[0].groupId === item.groupId; 24465 }); 24466 24467 if (group) { 24468 group.push(item); 24469 } else { 24470 groups.push([item]); 24471 } 24472 }; 24473 24474 for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { 24475 _loop(); 24476 } 24477 24478 return groups; 24479 } 24480 24481 function flatten(grid) { 24482 var flattened = []; 24483 24484 for (var _iterator = _createForOfIteratorHelperLoose(grid), _step; !(_step = _iterator()).done;) { 24485 var row = _step.value; 24486 flattened.push.apply(flattened, row); 24487 } 24488 24489 return flattened; 24490 } 24491 24492 function reverse(array) { 24493 return array.slice().reverse(); 24494 } 24495 24496 24497 24498 ;// CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js 24499 function findEnabledItemById(items, id) { 24500 if (!id) return undefined; 24501 return items === null || items === void 0 ? void 0 : items.find(function (item) { 24502 return item.id === id && !item.disabled; 24503 }); 24504 } 24505 24506 24507 24508 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/applyState.js 24509 function isUpdater(argument) { 24510 return typeof argument === "function"; 24511 } 24512 /** 24513 * Receives a `setState` argument and calls it with `currentValue` if it's a 24514 * function. Otherwise return the argument as the new value. 24515 * 24516 * @example 24517 * import { applyState } from "reakit-utils"; 24518 * 24519 * applyState((value) => value + 1, 1); // 2 24520 * applyState(2, 1); // 2 24521 */ 24522 24523 24524 function applyState(argument, currentValue) { 24525 if (isUpdater(argument)) { 24526 return argument(currentValue); 24527 } 24528 24529 return argument; 24530 } 24531 24532 24533 24534 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js 24535 24536 24537 24538 24539 function unstable_useIdState(initialState) { 24540 if (initialState === void 0) { 24541 initialState = {}; 24542 } 24543 24544 var _useSealedState = useSealedState(initialState), 24545 initialBaseId = _useSealedState.baseId; 24546 24547 var generateId = (0,external_React_.useContext)(unstable_IdContext); 24548 var idCountRef = (0,external_React_.useRef)(0); 24549 24550 var _React$useState = (0,external_React_.useState)(function () { 24551 return initialBaseId || generateId(); 24552 }), 24553 baseId = _React$useState[0], 24554 setBaseId = _React$useState[1]; 24555 24556 return { 24557 baseId: baseId, 24558 setBaseId: setBaseId, 24559 unstable_idCountRef: idCountRef 24560 }; 24561 } 24562 24563 24564 24565 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 function isElementPreceding(element1, element2) { 24579 return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING); 24580 } 24581 24582 function findDOMIndex(items, item) { 24583 return items.findIndex(function (currentItem) { 24584 if (!currentItem.ref.current || !item.ref.current) { 24585 return false; 24586 } 24587 24588 return isElementPreceding(item.ref.current, currentItem.ref.current); 24589 }); 24590 } 24591 24592 function getMaxLength(rows) { 24593 var maxLength = 0; 24594 24595 for (var _iterator = _createForOfIteratorHelperLoose(rows), _step; !(_step = _iterator()).done;) { 24596 var length = _step.value.length; 24597 24598 if (length > maxLength) { 24599 maxLength = length; 24600 } 24601 } 24602 24603 return maxLength; 24604 } 24605 24606 /** 24607 * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2] 24608 */ 24609 24610 function verticalizeItems(items) { 24611 var groups = groupItems(items); 24612 var maxLength = getMaxLength(groups); 24613 var verticalized = []; 24614 24615 for (var i = 0; i < maxLength; i += 1) { 24616 for (var _iterator = _createForOfIteratorHelperLoose(groups), _step; !(_step = _iterator()).done;) { 24617 var group = _step.value; 24618 24619 if (group[i]) { 24620 verticalized.push(_objectSpread2(_objectSpread2({}, group[i]), {}, { 24621 // If there's no groupId, it means that it's not a grid composite, 24622 // but a single row instead. So, instead of verticalizing it, that 24623 // is, assigning a different groupId based on the column index, we 24624 // keep it undefined so they will be part of the same group. 24625 // It's useful when using up/down on one-dimensional composites. 24626 groupId: group[i].groupId ? "" + i : undefined 24627 })); 24628 } 24629 } 24630 } 24631 24632 return verticalized; 24633 } 24634 24635 function createEmptyItem(groupId) { 24636 return { 24637 id: "__EMPTY_ITEM__", 24638 disabled: true, 24639 ref: { 24640 current: null 24641 }, 24642 groupId: groupId 24643 }; 24644 } 24645 /** 24646 * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]] 24647 */ 24648 24649 24650 function fillGroups(groups, currentId, shift) { 24651 var maxLength = getMaxLength(groups); 24652 24653 for (var _iterator = _createForOfIteratorHelperLoose(groups), _step; !(_step = _iterator()).done;) { 24654 var group = _step.value; 24655 24656 for (var i = 0; i < maxLength; i += 1) { 24657 var item = group[i]; 24658 24659 if (!item || shift && item.disabled) { 24660 var isFrist = i === 0; 24661 var previousItem = isFrist && shift ? findFirstEnabledItem(group) : group[i - 1]; 24662 group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId); 24663 } 24664 } 24665 } 24666 24667 return groups; 24668 } 24669 24670 var nullItem = { 24671 id: null, 24672 ref: { 24673 current: null 24674 } 24675 }; 24676 function placeItemsAfter(items, id, shouldInsertNullItem) { 24677 var index = items.findIndex(function (item) { 24678 return item.id === id; 24679 }); 24680 return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index)); 24681 } 24682 24683 function getItemsInGroup(items, groupId) { 24684 return items.filter(function (item) { 24685 return item.groupId === groupId; 24686 }); 24687 } 24688 24689 var map = { 24690 horizontal: "vertical", 24691 vertical: "horizontal" 24692 }; 24693 function getOppositeOrientation(orientation) { 24694 return orientation && map[orientation]; 24695 } 24696 24697 function addItemAtIndex(array, item, index) { 24698 if (!(index in array)) { 24699 return [].concat(array, [item]); 24700 } 24701 24702 return [].concat(array.slice(0, index), [item], array.slice(index)); 24703 } 24704 24705 function sortBasedOnDOMPosition(items) { 24706 var pairs = items.map(function (item, index) { 24707 return [index, item]; 24708 }); 24709 var isOrderDifferent = false; 24710 pairs.sort(function (_ref, _ref2) { 24711 var indexA = _ref[0], 24712 a = _ref[1]; 24713 var indexB = _ref2[0], 24714 b = _ref2[1]; 24715 var elementA = a.ref.current; 24716 var elementB = b.ref.current; 24717 if (!elementA || !elementB) return 0; // a before b 24718 24719 if (isElementPreceding(elementA, elementB)) { 24720 if (indexA > indexB) { 24721 isOrderDifferent = true; 24722 } 24723 24724 return -1; 24725 } // a after b 24726 24727 24728 if (indexA < indexB) { 24729 isOrderDifferent = true; 24730 } 24731 24732 return 1; 24733 }); 24734 24735 if (isOrderDifferent) { 24736 return pairs.map(function (_ref3) { 24737 var _ = _ref3[0], 24738 item = _ref3[1]; 24739 return item; 24740 }); 24741 } 24742 24743 return items; 24744 } 24745 24746 function setItemsBasedOnDOMPosition(items, setItems) { 24747 var sortedItems = sortBasedOnDOMPosition(items); 24748 24749 if (items !== sortedItems) { 24750 setItems(sortedItems); 24751 } 24752 } 24753 24754 function getCommonParent(items) { 24755 var _firstItem$ref$curren; 24756 24757 var firstItem = items[0], 24758 nextItems = items.slice(1); 24759 var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement; 24760 24761 var _loop = function _loop() { 24762 var parent = parentElement; 24763 24764 if (nextItems.every(function (item) { 24765 return parent.contains(item.ref.current); 24766 })) { 24767 return { 24768 v: parentElement 24769 }; 24770 } 24771 24772 parentElement = parentElement.parentElement; 24773 }; 24774 24775 while (parentElement) { 24776 var _ret = _loop(); 24777 24778 if (typeof _ret === "object") return _ret.v; 24779 } 24780 24781 return getDocument(parentElement).body; 24782 } // istanbul ignore next: JSDOM doesn't support IntersectionObverser 24783 // See https://github.com/jsdom/jsdom/issues/2032 24784 24785 24786 function useIntersectionObserver(items, setItems) { 24787 var previousItems = (0,external_React_.useRef)([]); 24788 (0,external_React_.useEffect)(function () { 24789 var callback = function callback() { 24790 var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered. 24791 24792 if (hasPreviousItems) { 24793 setItemsBasedOnDOMPosition(items, setItems); 24794 } 24795 24796 previousItems.current = items; 24797 }; 24798 24799 var root = getCommonParent(items); 24800 var observer = new IntersectionObserver(callback, { 24801 root: root 24802 }); 24803 24804 for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { 24805 var item = _step.value; 24806 24807 if (item.ref.current) { 24808 observer.observe(item.ref.current); 24809 } 24810 } 24811 24812 return function () { 24813 observer.disconnect(); 24814 }; 24815 }, [items]); 24816 } 24817 24818 function useTimeoutObserver(items, setItems) { 24819 (0,external_React_.useEffect)(function () { 24820 var callback = function callback() { 24821 return setItemsBasedOnDOMPosition(items, setItems); 24822 }; 24823 24824 var timeout = setTimeout(callback, 250); 24825 return function () { 24826 return clearTimeout(timeout); 24827 }; 24828 }); 24829 } 24830 24831 function useSortBasedOnDOMPosition(items, setItems) { 24832 if (typeof IntersectionObserver === "function") { 24833 useIntersectionObserver(items, setItems); 24834 } else { 24835 useTimeoutObserver(items, setItems); 24836 } 24837 } 24838 24839 function reducer(state, action) { 24840 var virtual = state.unstable_virtual, 24841 rtl = state.rtl, 24842 orientation = state.orientation, 24843 items = state.items, 24844 groups = state.groups, 24845 currentId = state.currentId, 24846 loop = state.loop, 24847 wrap = state.wrap, 24848 pastIds = state.pastIds, 24849 shift = state.shift, 24850 moves = state.unstable_moves, 24851 includesBaseElement = state.unstable_includesBaseElement, 24852 initialVirtual = state.initialVirtual, 24853 initialRTL = state.initialRTL, 24854 initialOrientation = state.initialOrientation, 24855 initialCurrentId = state.initialCurrentId, 24856 initialLoop = state.initialLoop, 24857 initialWrap = state.initialWrap, 24858 initialShift = state.initialShift, 24859 hasSetCurrentId = state.hasSetCurrentId; 24860 24861 switch (action.type) { 24862 case "registerGroup": 24863 { 24864 var _group = action.group; // If there are no groups yet, just add it as the first one 24865 24866 if (groups.length === 0) { 24867 return _objectSpread2(_objectSpread2({}, state), {}, { 24868 groups: [_group] 24869 }); 24870 } // Finds the group index based on DOM position 24871 24872 24873 var index = findDOMIndex(groups, _group); 24874 return _objectSpread2(_objectSpread2({}, state), {}, { 24875 groups: addItemAtIndex(groups, _group, index) 24876 }); 24877 } 24878 24879 case "unregisterGroup": 24880 { 24881 var _id = action.id; 24882 var nextGroups = groups.filter(function (group) { 24883 return group.id !== _id; 24884 }); // The group isn't registered, so do nothing 24885 24886 if (nextGroups.length === groups.length) { 24887 return state; 24888 } 24889 24890 return _objectSpread2(_objectSpread2({}, state), {}, { 24891 groups: nextGroups 24892 }); 24893 } 24894 24895 case "registerItem": 24896 { 24897 var _item = action.item; // Finds the item group based on the DOM hierarchy 24898 24899 var _group2 = groups.find(function (r) { 24900 var _r$ref$current; 24901 24902 return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current); 24903 }); // Group will be null if it's a one-dimensional composite 24904 24905 24906 var nextItem = _objectSpread2({ 24907 groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id 24908 }, _item); 24909 24910 var _index = findDOMIndex(items, nextItem); 24911 24912 var nextState = _objectSpread2(_objectSpread2({}, state), {}, { 24913 items: addItemAtIndex(items, nextItem, _index) 24914 }); 24915 24916 if (!hasSetCurrentId && !moves && initialCurrentId === undefined) { 24917 var _findFirstEnabledItem; 24918 24919 // Sets currentId to the first enabled item. This runs whenever an item 24920 // is registered because the first enabled item may be registered 24921 // asynchronously. 24922 return _objectSpread2(_objectSpread2({}, nextState), {}, { 24923 currentId: (_findFirstEnabledItem = findFirstEnabledItem(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id 24924 }); 24925 } 24926 24927 return nextState; 24928 } 24929 24930 case "unregisterItem": 24931 { 24932 var _id2 = action.id; 24933 var nextItems = items.filter(function (item) { 24934 return item.id !== _id2; 24935 }); // The item isn't registered, so do nothing 24936 24937 if (nextItems.length === items.length) { 24938 return state; 24939 } // Filters out the item that is being removed from the pastIds list 24940 24941 24942 var nextPastIds = pastIds.filter(function (pastId) { 24943 return pastId !== _id2; 24944 }); 24945 24946 var _nextState = _objectSpread2(_objectSpread2({}, state), {}, { 24947 pastIds: nextPastIds, 24948 items: nextItems 24949 }); // If the current item is the item that is being removed, focus pastId 24950 24951 24952 if (currentId && currentId === _id2) { 24953 var nextId = includesBaseElement ? null : getCurrentId(_objectSpread2(_objectSpread2({}, _nextState), {}, { 24954 currentId: nextPastIds[0] 24955 })); 24956 return _objectSpread2(_objectSpread2({}, _nextState), {}, { 24957 currentId: nextId 24958 }); 24959 } 24960 24961 return _nextState; 24962 } 24963 24964 case "move": 24965 { 24966 var _id3 = action.id; // move() does nothing 24967 24968 if (_id3 === undefined) { 24969 return state; 24970 } // Removes the current item and the item that is receiving focus from the 24971 // pastIds list 24972 24973 24974 var filteredPastIds = pastIds.filter(function (pastId) { 24975 return pastId !== currentId && pastId !== _id3; 24976 }); // If there's a currentId, add it to the pastIds list so it can be focused 24977 // if the new item gets removed or disabled 24978 24979 var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds; 24980 24981 var _nextState2 = _objectSpread2(_objectSpread2({}, state), {}, { 24982 pastIds: _nextPastIds 24983 }); // move(null) will focus the composite element itself, not an item 24984 24985 24986 if (_id3 === null) { 24987 return _objectSpread2(_objectSpread2({}, _nextState2), {}, { 24988 unstable_moves: moves + 1, 24989 currentId: getCurrentId(_nextState2, _id3) 24990 }); 24991 } 24992 24993 var _item2 = findEnabledItemById(items, _id3); 24994 24995 return _objectSpread2(_objectSpread2({}, _nextState2), {}, { 24996 unstable_moves: _item2 ? moves + 1 : moves, 24997 currentId: getCurrentId(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id) 24998 }); 24999 } 25000 25001 case "next": 25002 { 25003 // If there's no item focused, we just move the first one 25004 if (currentId == null) { 25005 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25006 type: "first" 25007 })); 25008 } // RTL doesn't make sense on vertical navigation 25009 25010 25011 var isHorizontal = orientation !== "vertical"; 25012 var isRTL = rtl && isHorizontal; 25013 var allItems = isRTL ? reverse(items) : items; 25014 var currentItem = allItems.find(function (item) { 25015 return item.id === currentId; 25016 }); // If there's no item focused, we just move the first one 25017 25018 if (!currentItem) { 25019 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25020 type: "first" 25021 })); 25022 } 25023 25024 var isGrid = !!currentItem.groupId; 25025 var currentIndex = allItems.indexOf(currentItem); 25026 25027 var _nextItems = allItems.slice(currentIndex + 1); 25028 25029 var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End 25030 25031 if (action.allTheWay) { 25032 // We reverse so we can get the last enabled item in the group. If it's 25033 // RTL, nextItems and nextItemsInGroup are already reversed and don't 25034 // have the items before the current one anymore. So we have to get 25035 // items in group again with allItems. 25036 var _nextItem2 = findFirstEnabledItem(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup)); 25037 25038 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25039 type: "move", 25040 id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id 25041 })); 25042 } 25043 25044 var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous 25045 // call, which is inherently horizontal. up/down will call next with 25046 // orientation set to vertical by default (see below on up/down cases). 25047 isGrid ? orientation || "horizontal" : orientation); 25048 var canLoop = loop && loop !== oppositeOrientation; 25049 var canWrap = isGrid && wrap && wrap !== oppositeOrientation; 25050 var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling 25051 // next directly, hasNullItem will only be true if it's not a grid and 25052 // loop is set to true, which means that pressing right or down keys on 25053 // grids will never focus the composite element. On one-dimensional 25054 // composites that don't loop, pressing right or down keys also doesn't 25055 // focus the composite element. 25056 action.hasNullItem || !isGrid && canLoop && includesBaseElement; 25057 25058 if (canLoop) { 25059 var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1] 25060 25061 var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem); 25062 25063 var _nextItem3 = findFirstEnabledItem(sortedItems, currentId); 25064 25065 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25066 type: "move", 25067 id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id 25068 })); 25069 } 25070 25071 if (canWrap) { 25072 var _nextItem4 = findFirstEnabledItem( // We can use nextItems, which contains all the next items, including 25073 // items from other groups, to wrap between groups. However, if there 25074 // is a null item (the composite element), we'll only use the next 25075 // items in the group. So moving next from the last item will focus 25076 // the composite element (null). On grid composites, horizontal 25077 // navigation never focuses the composite element, only vertical. 25078 hasNullItem ? nextItemsInGroup : _nextItems, currentId); 25079 25080 var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id; 25081 25082 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25083 type: "move", 25084 id: _nextId 25085 })); 25086 } 25087 25088 var _nextItem = findFirstEnabledItem(nextItemsInGroup, currentId); 25089 25090 if (!_nextItem && hasNullItem) { 25091 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25092 type: "move", 25093 id: null 25094 })); 25095 } 25096 25097 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25098 type: "move", 25099 id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id 25100 })); 25101 } 25102 25103 case "previous": 25104 { 25105 // If currentId is initially set to null, the composite element will be 25106 // focusable while navigating with arrow keys. But, if it's a grid, we 25107 // don't want to focus the composite element with horizontal navigation. 25108 var _isGrid = !!groups.length; 25109 25110 var _hasNullItem = !_isGrid && includesBaseElement; 25111 25112 var _nextState3 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { 25113 items: reverse(items) 25114 }), _objectSpread2(_objectSpread2({}, action), {}, { 25115 type: "next", 25116 hasNullItem: _hasNullItem 25117 })); 25118 25119 return _objectSpread2(_objectSpread2({}, _nextState3), {}, { 25120 items: items 25121 }); 25122 } 25123 25124 case "down": 25125 { 25126 var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it 25127 // with disabled fake items. Then, we reorganize the items list so 25128 // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2]. 25129 25130 var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift))); 25131 25132 var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop 25133 // is true or vertical. 25134 25135 25136 var _hasNullItem2 = _canLoop && includesBaseElement; 25137 25138 var _nextState4 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { 25139 orientation: "vertical", 25140 items: verticalItems 25141 }), _objectSpread2(_objectSpread2({}, action), {}, { 25142 type: "next", 25143 hasNullItem: _hasNullItem2 25144 })); 25145 25146 return _objectSpread2(_objectSpread2({}, _nextState4), {}, { 25147 orientation: orientation, 25148 items: items 25149 }); 25150 } 25151 25152 case "up": 25153 { 25154 var _shouldShift = shift && !action.allTheWay; 25155 25156 var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the 25157 // composite element when the up arrow key is pressed in the first row. 25158 25159 25160 var _hasNullItem3 = includesBaseElement; 25161 25162 var _nextState5 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { 25163 orientation: "vertical", 25164 items: _verticalItems 25165 }), _objectSpread2(_objectSpread2({}, action), {}, { 25166 type: "next", 25167 hasNullItem: _hasNullItem3 25168 })); 25169 25170 return _objectSpread2(_objectSpread2({}, _nextState5), {}, { 25171 orientation: orientation, 25172 items: items 25173 }); 25174 } 25175 25176 case "first": 25177 { 25178 var firstItem = findFirstEnabledItem(items); 25179 return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { 25180 type: "move", 25181 id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id 25182 })); 25183 } 25184 25185 case "last": 25186 { 25187 var _nextState6 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { 25188 items: reverse(items) 25189 }), _objectSpread2(_objectSpread2({}, action), {}, { 25190 type: "first" 25191 })); 25192 25193 return _objectSpread2(_objectSpread2({}, _nextState6), {}, { 25194 items: items 25195 }); 25196 } 25197 25198 case "sort": 25199 { 25200 return _objectSpread2(_objectSpread2({}, state), {}, { 25201 items: sortBasedOnDOMPosition(items), 25202 groups: sortBasedOnDOMPosition(groups) 25203 }); 25204 } 25205 25206 case "setVirtual": 25207 return _objectSpread2(_objectSpread2({}, state), {}, { 25208 unstable_virtual: applyState(action.virtual, virtual) 25209 }); 25210 25211 case "setRTL": 25212 return _objectSpread2(_objectSpread2({}, state), {}, { 25213 rtl: applyState(action.rtl, rtl) 25214 }); 25215 25216 case "setOrientation": 25217 return _objectSpread2(_objectSpread2({}, state), {}, { 25218 orientation: applyState(action.orientation, orientation) 25219 }); 25220 25221 case "setCurrentId": 25222 { 25223 var nextCurrentId = getCurrentId(_objectSpread2(_objectSpread2({}, state), {}, { 25224 currentId: applyState(action.currentId, currentId) 25225 })); 25226 return _objectSpread2(_objectSpread2({}, state), {}, { 25227 currentId: nextCurrentId, 25228 hasSetCurrentId: true 25229 }); 25230 } 25231 25232 case "setLoop": 25233 return _objectSpread2(_objectSpread2({}, state), {}, { 25234 loop: applyState(action.loop, loop) 25235 }); 25236 25237 case "setWrap": 25238 return _objectSpread2(_objectSpread2({}, state), {}, { 25239 wrap: applyState(action.wrap, wrap) 25240 }); 25241 25242 case "setShift": 25243 return _objectSpread2(_objectSpread2({}, state), {}, { 25244 shift: applyState(action.shift, shift) 25245 }); 25246 25247 case "setIncludesBaseElement": 25248 { 25249 return _objectSpread2(_objectSpread2({}, state), {}, { 25250 unstable_includesBaseElement: applyState(action.includesBaseElement, includesBaseElement) 25251 }); 25252 } 25253 25254 case "reset": 25255 return _objectSpread2(_objectSpread2({}, state), {}, { 25256 unstable_virtual: initialVirtual, 25257 rtl: initialRTL, 25258 orientation: initialOrientation, 25259 currentId: getCurrentId(_objectSpread2(_objectSpread2({}, state), {}, { 25260 currentId: initialCurrentId 25261 })), 25262 loop: initialLoop, 25263 wrap: initialWrap, 25264 shift: initialShift, 25265 unstable_moves: 0, 25266 pastIds: [] 25267 }); 25268 25269 case "setItems": 25270 { 25271 return _objectSpread2(_objectSpread2({}, state), {}, { 25272 items: action.items 25273 }); 25274 } 25275 25276 default: 25277 throw new Error(); 25278 } 25279 } 25280 25281 function useAction(fn) { 25282 return (0,external_React_.useCallback)(fn, []); 25283 } 25284 25285 function useIsUnmountedRef() { 25286 var isUnmountedRef = (0,external_React_.useRef)(false); 25287 useIsomorphicEffect(function () { 25288 return function () { 25289 isUnmountedRef.current = true; 25290 }; 25291 }, []); 25292 return isUnmountedRef; 25293 } 25294 25295 function useCompositeState(initialState) { 25296 if (initialState === void 0) { 25297 initialState = {}; 25298 } 25299 25300 var _useSealedState = useSealedState(initialState), 25301 _useSealedState$unsta = _useSealedState.unstable_virtual, 25302 virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta, 25303 _useSealedState$rtl = _useSealedState.rtl, 25304 rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl, 25305 orientation = _useSealedState.orientation, 25306 currentId = _useSealedState.currentId, 25307 _useSealedState$loop = _useSealedState.loop, 25308 loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop, 25309 _useSealedState$wrap = _useSealedState.wrap, 25310 wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap, 25311 _useSealedState$shift = _useSealedState.shift, 25312 shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift, 25313 unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement, 25314 sealed = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]); 25315 25316 var idState = unstable_useIdState(sealed); 25317 25318 var _React$useReducer = (0,external_React_.useReducer)(reducer, { 25319 unstable_virtual: virtual, 25320 rtl: rtl, 25321 orientation: orientation, 25322 items: [], 25323 groups: [], 25324 currentId: currentId, 25325 loop: loop, 25326 wrap: wrap, 25327 shift: shift, 25328 unstable_moves: 0, 25329 pastIds: [], 25330 unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null, 25331 initialVirtual: virtual, 25332 initialRTL: rtl, 25333 initialOrientation: orientation, 25334 initialCurrentId: currentId, 25335 initialLoop: loop, 25336 initialWrap: wrap, 25337 initialShift: shift 25338 }), 25339 _React$useReducer$ = _React$useReducer[0], 25340 pastIds = _React$useReducer$.pastIds, 25341 initialVirtual = _React$useReducer$.initialVirtual, 25342 initialRTL = _React$useReducer$.initialRTL, 25343 initialOrientation = _React$useReducer$.initialOrientation, 25344 initialCurrentId = _React$useReducer$.initialCurrentId, 25345 initialLoop = _React$useReducer$.initialLoop, 25346 initialWrap = _React$useReducer$.initialWrap, 25347 initialShift = _React$useReducer$.initialShift, 25348 hasSetCurrentId = _React$useReducer$.hasSetCurrentId, 25349 state = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]), 25350 dispatch = _React$useReducer[1]; 25351 25352 var _React$useState = (0,external_React_.useState)(false), 25353 hasActiveWidget = _React$useState[0], 25354 setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We 25355 // store the unmounted state here so we don't update the state if it's true. 25356 // This only happens in a very specific situation. 25357 // See https://github.com/reakit/reakit/issues/650 25358 25359 25360 var isUnmountedRef = useIsUnmountedRef(); 25361 var setItems = (0,external_React_.useCallback)(function (items) { 25362 return dispatch({ 25363 type: "setItems", 25364 items: items 25365 }); 25366 }, []); 25367 useSortBasedOnDOMPosition(state.items, setItems); 25368 return _objectSpread2(_objectSpread2(_objectSpread2({}, idState), state), {}, { 25369 unstable_hasActiveWidget: hasActiveWidget, 25370 unstable_setHasActiveWidget: setHasActiveWidget, 25371 registerItem: useAction(function (item) { 25372 if (isUnmountedRef.current) return; 25373 dispatch({ 25374 type: "registerItem", 25375 item: item 25376 }); 25377 }), 25378 unregisterItem: useAction(function (id) { 25379 if (isUnmountedRef.current) return; 25380 dispatch({ 25381 type: "unregisterItem", 25382 id: id 25383 }); 25384 }), 25385 registerGroup: useAction(function (group) { 25386 if (isUnmountedRef.current) return; 25387 dispatch({ 25388 type: "registerGroup", 25389 group: group 25390 }); 25391 }), 25392 unregisterGroup: useAction(function (id) { 25393 if (isUnmountedRef.current) return; 25394 dispatch({ 25395 type: "unregisterGroup", 25396 id: id 25397 }); 25398 }), 25399 move: useAction(function (id) { 25400 return dispatch({ 25401 type: "move", 25402 id: id 25403 }); 25404 }), 25405 next: useAction(function (allTheWay) { 25406 return dispatch({ 25407 type: "next", 25408 allTheWay: allTheWay 25409 }); 25410 }), 25411 previous: useAction(function (allTheWay) { 25412 return dispatch({ 25413 type: "previous", 25414 allTheWay: allTheWay 25415 }); 25416 }), 25417 up: useAction(function (allTheWay) { 25418 return dispatch({ 25419 type: "up", 25420 allTheWay: allTheWay 25421 }); 25422 }), 25423 down: useAction(function (allTheWay) { 25424 return dispatch({ 25425 type: "down", 25426 allTheWay: allTheWay 25427 }); 25428 }), 25429 first: useAction(function () { 25430 return dispatch({ 25431 type: "first" 25432 }); 25433 }), 25434 last: useAction(function () { 25435 return dispatch({ 25436 type: "last" 25437 }); 25438 }), 25439 sort: useAction(function () { 25440 return dispatch({ 25441 type: "sort" 25442 }); 25443 }), 25444 unstable_setVirtual: useAction(function (value) { 25445 return dispatch({ 25446 type: "setVirtual", 25447 virtual: value 25448 }); 25449 }), 25450 setRTL: useAction(function (value) { 25451 return dispatch({ 25452 type: "setRTL", 25453 rtl: value 25454 }); 25455 }), 25456 setOrientation: useAction(function (value) { 25457 return dispatch({ 25458 type: "setOrientation", 25459 orientation: value 25460 }); 25461 }), 25462 setCurrentId: useAction(function (value) { 25463 return dispatch({ 25464 type: "setCurrentId", 25465 currentId: value 25466 }); 25467 }), 25468 setLoop: useAction(function (value) { 25469 return dispatch({ 25470 type: "setLoop", 25471 loop: value 25472 }); 25473 }), 25474 setWrap: useAction(function (value) { 25475 return dispatch({ 25476 type: "setWrap", 25477 wrap: value 25478 }); 25479 }), 25480 setShift: useAction(function (value) { 25481 return dispatch({ 25482 type: "setShift", 25483 shift: value 25484 }); 25485 }), 25486 unstable_setIncludesBaseElement: useAction(function (value) { 25487 return dispatch({ 25488 type: "setIncludesBaseElement", 25489 includesBaseElement: value 25490 }); 25491 }), 25492 reset: useAction(function () { 25493 return dispatch({ 25494 type: "reset" 25495 }); 25496 }) 25497 }); 25498 } 25499 25500 25501 25502 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireBlurEvent.js 25503 25504 25505 25506 25507 function createFocusEvent(element, type, eventInit) { 25508 if (eventInit === void 0) { 25509 eventInit = {}; 25510 } 25511 25512 if (typeof FocusEvent === "function") { 25513 return new FocusEvent(type, eventInit); 25514 } 25515 25516 return createEvent(element, type, eventInit); 25517 } 25518 /** 25519 * Creates and dispatches a blur event in a way that also works on IE 11. 25520 * 25521 * @example 25522 * import { fireBlurEvent } from "reakit-utils"; 25523 * 25524 * fireBlurEvent(document.getElementById("id")); 25525 */ 25526 25527 25528 function fireBlurEvent(element, eventInit) { 25529 var event = createFocusEvent(element, "blur", eventInit); 25530 var defaultAllowed = element.dispatchEvent(event); 25531 25532 var bubbleInit = _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, eventInit), {}, { 25533 bubbles: true 25534 }); 25535 25536 element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit)); 25537 return defaultAllowed; 25538 } 25539 25540 25541 25542 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js 25543 25544 25545 25546 function createKeyboardEvent(element, type, eventInit) { 25547 if (eventInit === void 0) { 25548 eventInit = {}; 25549 } 25550 25551 if (typeof KeyboardEvent === "function") { 25552 return new KeyboardEvent(type, eventInit); 25553 } // IE 11 doesn't support Event constructors 25554 25555 25556 var event = getDocument(element).createEvent("KeyboardEvent"); 25557 event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, getWindow(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey); 25558 return event; 25559 } 25560 /** 25561 * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11. 25562 * 25563 * @example 25564 * import { fireKeyboardEvent } from "reakit-utils"; 25565 * 25566 * fireKeyboardEvent(document.getElementById("id"), "keydown", { 25567 * key: "ArrowDown", 25568 * shiftKey: true, 25569 * }); 25570 */ 25571 25572 25573 function fireKeyboardEvent(element, type, eventInit) { 25574 return element.dispatchEvent(createKeyboardEvent(element, type, eventInit)); 25575 } 25576 25577 25578 25579 ;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js 25580 25581 25582 25583 25584 25585 var isIE11 = canUseDOM && "msCrypto" in window; 25586 /** 25587 * Cross-browser method that returns the next active element (the element that 25588 * is receiving focus) after a blur event is dispatched. It receives the blur 25589 * event object as the argument. 25590 * 25591 * @example 25592 * import { getNextActiveElementOnBlur } from "reakit-utils"; 25593 * 25594 * const element = document.getElementById("id"); 25595 * element.addEventListener("blur", (event) => { 25596 * const nextActiveElement = getNextActiveElementOnBlur(event); 25597 * }); 25598 */ 25599 25600 function getNextActiveElementOnBlur(event) { 25601 // IE 11 doesn't support event.relatedTarget on blur. 25602 // document.activeElement points the the next active element. 25603 // On modern browsers, document.activeElement points to the current target. 25604 if (isIE11) { 25605 var activeElement = getActiveElement_getActiveElement(event.currentTarget); 25606 return activeElement; 25607 } 25608 25609 return event.relatedTarget; 25610 } 25611 25612 25613 25614 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js 25615 25616 25617 25618 25619 25620 25621 25622 25623 25624 25625 25626 25627 25628 25629 25630 25631 25632 25633 25634 25635 25636 25637 25638 25639 25640 25641 25642 25643 25644 var Composite_isIE11 = canUseDOM && "msCrypto" in window; 25645 25646 function canProxyKeyboardEvent(event) { 25647 if (!isSelfTarget(event)) return false; 25648 if (event.metaKey) return false; 25649 if (event.key === "Tab") return false; 25650 return true; 25651 } 25652 25653 function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) { 25654 var eventHandlerRef = useLiveRef(htmlEventHandler); 25655 return (0,external_React_.useCallback)(function (event) { 25656 var _eventHandlerRef$curr; 25657 25658 (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event); 25659 if (event.defaultPrevented) return; 25660 25661 if (virtual && canProxyKeyboardEvent(event)) { 25662 var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current; 25663 25664 if (currentElement) { 25665 if (!fireKeyboardEvent(currentElement, event.type, event)) { 25666 event.preventDefault(); 25667 } // The event will be triggered on the composite item and then 25668 // propagated up to this composite element again, so we can pretend 25669 // that it wasn't called on this component in the first place. 25670 25671 25672 if (event.currentTarget.contains(currentElement)) { 25673 event.stopPropagation(); 25674 } 25675 } 25676 } 25677 }, [virtual, currentItem]); 25678 } // istanbul ignore next 25679 25680 25681 function useActiveElementRef(elementRef) { 25682 var activeElementRef = (0,external_React_.useRef)(null); 25683 (0,external_React_.useEffect)(function () { 25684 var document = getDocument(elementRef.current); 25685 25686 var onFocus = function onFocus(event) { 25687 var target = event.target; 25688 activeElementRef.current = target; 25689 }; 25690 25691 document.addEventListener("focus", onFocus, true); 25692 return function () { 25693 document.removeEventListener("focus", onFocus, true); 25694 }; 25695 }, []); 25696 return activeElementRef; 25697 } 25698 25699 function findFirstEnabledItemInTheLastRow(items) { 25700 return findFirstEnabledItem(flatten(reverse(groupItems(items)))); 25701 } 25702 25703 function isItem(items, element) { 25704 return items === null || items === void 0 ? void 0 : items.some(function (item) { 25705 return !!element && item.ref.current === element; 25706 }); 25707 } 25708 25709 function useScheduleUserFocus(currentItem) { 25710 var currentItemRef = useLiveRef(currentItem); 25711 25712 var _React$useReducer = (0,external_React_.useReducer)(function (n) { 25713 return n + 1; 25714 }, 0), 25715 scheduled = _React$useReducer[0], 25716 schedule = _React$useReducer[1]; 25717 25718 (0,external_React_.useEffect)(function () { 25719 var _currentItemRef$curre; 25720 25721 var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current; 25722 25723 if (scheduled && currentElement) { 25724 userFocus(currentElement); 25725 } 25726 }, [scheduled]); 25727 return schedule; 25728 } 25729 25730 var useComposite = createHook({ 25731 name: "Composite", 25732 compose: [useTabbable], 25733 keys: COMPOSITE_KEYS, 25734 useOptions: function useOptions(options) { 25735 return _objectSpread2(_objectSpread2({}, options), {}, { 25736 currentId: getCurrentId(options) 25737 }); 25738 }, 25739 useProps: function useProps(options, _ref) { 25740 var htmlRef = _ref.ref, 25741 htmlOnFocusCapture = _ref.onFocusCapture, 25742 htmlOnFocus = _ref.onFocus, 25743 htmlOnBlurCapture = _ref.onBlurCapture, 25744 htmlOnKeyDown = _ref.onKeyDown, 25745 htmlOnKeyDownCapture = _ref.onKeyDownCapture, 25746 htmlOnKeyUpCapture = _ref.onKeyUpCapture, 25747 htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]); 25748 25749 var ref = (0,external_React_.useRef)(null); 25750 var currentItem = findEnabledItemById(options.items, options.currentId); 25751 var previousElementRef = (0,external_React_.useRef)(null); 25752 var onFocusCaptureRef = useLiveRef(htmlOnFocusCapture); 25753 var onFocusRef = useLiveRef(htmlOnFocus); 25754 var onBlurCaptureRef = useLiveRef(htmlOnBlurCapture); 25755 var onKeyDownRef = useLiveRef(htmlOnKeyDown); 25756 var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element 25757 // ref instead. 25758 25759 var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined; 25760 (0,external_React_.useEffect)(function () { 25761 var element = ref.current; 25762 25763 if (options.unstable_moves && !currentItem) { 25764 false ? 0 : void 0; // If composite.move(null) has been called, the composite container 25765 // will receive focus. 25766 25767 element === null || element === void 0 ? void 0 : element.focus(); 25768 } 25769 }, [options.unstable_moves, currentItem]); 25770 var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture); 25771 var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture); 25772 var onFocusCapture = (0,external_React_.useCallback)(function (event) { 25773 var _onFocusCaptureRef$cu; 25774 25775 (_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event); 25776 if (event.defaultPrevented) return; 25777 if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active 25778 // element ref instead. 25779 25780 var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget; 25781 var previousActiveElementWasItem = isItem(options.items, previousActiveElement); 25782 25783 if (isSelfTarget(event) && previousActiveElementWasItem) { 25784 // Composite has been focused as a result of an item receiving focus. 25785 // The composite item will move focus back to the composite 25786 // container. In this case, we don't want to propagate this 25787 // additional event nor call the onFocus handler passed to 25788 // <Composite onFocus={...} />. 25789 event.stopPropagation(); // We keep track of the previous active item element so we can 25790 // manually fire a blur event on it later when the focus is moved to 25791 // another item on the onBlurCapture event below. 25792 25793 previousElementRef.current = previousActiveElement; 25794 } 25795 }, [options.unstable_virtual, options.items]); 25796 var onFocus = (0,external_React_.useCallback)(function (event) { 25797 var _onFocusRef$current; 25798 25799 (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); 25800 if (event.defaultPrevented) return; 25801 25802 if (options.unstable_virtual) { 25803 if (isSelfTarget(event)) { 25804 // This means that the composite element has been focused while the 25805 // composite item has not. For example, by clicking on the 25806 // composite element without touching any item, or by tabbing into 25807 // the composite element. In this case, we want to trigger focus on 25808 // the item, just like it would happen with roving tabindex. 25809 // When it receives focus, the composite item will put focus back 25810 // on the composite element, in which case hasItemWithFocus will be 25811 // true. 25812 scheduleUserFocus(); 25813 } 25814 } else if (isSelfTarget(event)) { 25815 var _options$setCurrentId; 25816 25817 // When the roving tabindex composite gets intentionally focused (for 25818 // example, by clicking directly on it, and not on an item), we make 25819 // sure to set the current id to null (which means the composite 25820 // itself is focused). 25821 (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null); 25822 } 25823 }, [options.unstable_virtual, options.setCurrentId]); 25824 var onBlurCapture = (0,external_React_.useCallback)(function (event) { 25825 var _onBlurCaptureRef$cur; 25826 25827 (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); 25828 if (event.defaultPrevented) return; 25829 if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite 25830 // container (this component) to the composite item that is being 25831 // selected. Then we move focus back to the composite container. This 25832 // is so we can provide the same API as the roving tabindex method, 25833 // which means people can attach onFocus/onBlur handlers on the 25834 // CompositeItem component regardless of whether it's virtual or not. 25835 // This sequence of blurring and focusing items and composite may be 25836 // confusing, so we ignore intermediate focus and blurs by stopping its 25837 // propagation and not calling the passed onBlur handler (htmlOnBlur). 25838 25839 var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null; 25840 var nextActiveElement = getNextActiveElementOnBlur(event); 25841 var nextActiveElementIsItem = isItem(options.items, nextActiveElement); 25842 25843 if (isSelfTarget(event) && nextActiveElementIsItem) { 25844 // This is an intermediate blur event: blurring the composite 25845 // container to focus an item (nextActiveElement). 25846 if (nextActiveElement === currentElement) { 25847 // The next active element will be the same as the current item in 25848 // the state in two scenarios: 25849 // - Moving focus with keyboard: the state is updated before the 25850 // blur event is triggered, so here the current item is already 25851 // pointing to the next active element. 25852 // - Clicking on the current active item with a pointer: this 25853 // will trigger blur on the composite element and then the next 25854 // active element will be the same as the current item. Clicking on 25855 // an item other than the current one doesn't end up here as the 25856 // currentItem state will be updated only after it. 25857 if (previousElementRef.current && previousElementRef.current !== nextActiveElement) { 25858 // If there's a previous active item and it's not a click action, 25859 // then we fire a blur event on it so it will work just like if 25860 // it had DOM focus before (like when using roving tabindex). 25861 fireBlurEvent(previousElementRef.current, event); 25862 } 25863 } else if (currentElement) { 25864 // This will be true when the next active element is not the 25865 // current element, but there's a current item. This will only 25866 // happen when clicking with a pointer on a different item, when 25867 // there's already an item selected, in which case currentElement 25868 // is the item that is getting blurred, and nextActiveElement is 25869 // the item that is being clicked. 25870 fireBlurEvent(currentElement, event); 25871 } // We want to ignore intermediate blur events, so we stop its 25872 // propagation and return early so onFocus will not be called. 25873 25874 25875 event.stopPropagation(); 25876 } else { 25877 var targetIsItem = isItem(options.items, event.target); 25878 25879 if (!targetIsItem && currentElement) { 25880 // If target is not a composite item, it may be the composite 25881 // element itself (isSelfTarget) or a tabbable element inside the 25882 // composite widget. This may be triggered by clicking outside the 25883 // composite widget or by tabbing out of it. In either cases we 25884 // want to fire a blur event on the current item. 25885 fireBlurEvent(currentElement, event); 25886 } 25887 } 25888 }, [options.unstable_virtual, options.items, currentItem]); 25889 var onKeyDown = (0,external_React_.useCallback)(function (event) { 25890 var _onKeyDownRef$current, _options$groups; 25891 25892 (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); 25893 if (event.defaultPrevented) return; 25894 if (options.currentId !== null) return; 25895 if (!isSelfTarget(event)) return; 25896 var isVertical = options.orientation !== "horizontal"; 25897 var isHorizontal = options.orientation !== "vertical"; 25898 var isGrid = !!((_options$groups = options.groups) !== null && _options$groups !== void 0 && _options$groups.length); 25899 25900 var up = function up() { 25901 if (isGrid) { 25902 var item = findFirstEnabledItemInTheLastRow(options.items); 25903 25904 if (item !== null && item !== void 0 && item.id) { 25905 var _options$move; 25906 25907 (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id); 25908 } 25909 } else { 25910 var _options$last; 25911 25912 (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); 25913 } 25914 }; 25915 25916 var keyMap = { 25917 ArrowUp: (isGrid || isVertical) && up, 25918 ArrowRight: (isGrid || isHorizontal) && options.first, 25919 ArrowDown: (isGrid || isVertical) && options.first, 25920 ArrowLeft: (isGrid || isHorizontal) && options.last, 25921 Home: options.first, 25922 End: options.last, 25923 PageUp: options.first, 25924 PageDown: options.last 25925 }; 25926 var action = keyMap[event.key]; 25927 25928 if (action) { 25929 event.preventDefault(); 25930 action(); 25931 } 25932 }, [options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]); 25933 return _objectSpread2({ 25934 ref: useForkRef(ref, htmlRef), 25935 id: options.baseId, 25936 onFocus: onFocus, 25937 onFocusCapture: onFocusCapture, 25938 onBlurCapture: onBlurCapture, 25939 onKeyDownCapture: onKeyDownCapture, 25940 onKeyDown: onKeyDown, 25941 onKeyUpCapture: onKeyUpCapture, 25942 "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined 25943 }, htmlProps); 25944 }, 25945 useComposeProps: function useComposeProps(options, htmlProps) { 25946 htmlProps = useRole(options, htmlProps, true); 25947 var tabbableHTMLProps = useTabbable(options, htmlProps, true); 25948 25949 if (options.unstable_virtual || options.currentId === null) { 25950 // Composite will only be tabbable by default if the focus is managed 25951 // using aria-activedescendant, which requires DOM focus on the container 25952 // element (the composite) 25953 return _objectSpread2({ 25954 tabIndex: 0 25955 }, tabbableHTMLProps); 25956 } 25957 25958 return _objectSpread2(_objectSpread2({}, htmlProps), {}, { 25959 ref: tabbableHTMLProps.ref 25960 }); 25961 } 25962 }); 25963 var Composite = createComponent({ 25964 as: "div", 25965 useHook: useComposite, 25966 useCreateElement: function useCreateElement$1(type, props, children) { 25967 false ? 0 : void 0; 25968 return useCreateElement(type, props, children); 25969 } 25970 }); 25971 25972 25973 25974 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js 25975 25976 25977 25978 25979 25980 25981 // Automatically generated 25982 var GROUP_KEYS = []; 25983 25984 var useGroup = createHook({ 25985 name: "Group", 25986 compose: useRole, 25987 keys: GROUP_KEYS, 25988 useProps: function useProps(_, htmlProps) { 25989 return _objectSpread2({ 25990 role: "group" 25991 }, htmlProps); 25992 } 25993 }); 25994 var Group = createComponent({ 25995 as: "div", 25996 useHook: useGroup 25997 }); 25998 25999 26000 26001 ;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 var useCompositeGroup = createHook({ 26017 name: "CompositeGroup", 26018 compose: [useGroup, unstable_useId], 26019 keys: COMPOSITE_GROUP_KEYS, 26020 propsAreEqual: function propsAreEqual(prev, next) { 26021 if (!next.id || prev.id !== next.id) { 26022 return useGroup.unstable_propsAreEqual(prev, next); 26023 } 26024 26025 var prevCurrentId = prev.currentId, 26026 prevMoves = prev.unstable_moves, 26027 prevProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(prev, ["currentId", "unstable_moves"]); 26028 26029 var nextCurrentId = next.currentId, 26030 nextMoves = next.unstable_moves, 26031 nextProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(next, ["currentId", "unstable_moves"]); 26032 26033 if (prev.items && next.items) { 26034 var prevCurrentItem = findEnabledItemById(prev.items, prevCurrentId); 26035 var nextCurrentItem = findEnabledItemById(next.items, nextCurrentId); 26036 var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId; 26037 var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId; 26038 26039 if (next.id === nextGroupId || next.id === prevGroupId) { 26040 return false; 26041 } 26042 } 26043 26044 return useGroup.unstable_propsAreEqual(prevProps, nextProps); 26045 }, 26046 useProps: function useProps(options, _ref) { 26047 var htmlRef = _ref.ref, 26048 htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["ref"]); 26049 26050 var ref = (0,external_React_.useRef)(null); 26051 var id = options.id; // We need this to be called before CompositeItems' register 26052 26053 useIsomorphicEffect(function () { 26054 var _options$registerGrou; 26055 26056 if (!id) return undefined; 26057 (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, { 26058 id: id, 26059 ref: ref 26060 }); 26061 return function () { 26062 var _options$unregisterGr; 26063 26064 (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id); 26065 }; 26066 }, [id, options.registerGroup, options.unregisterGroup]); 26067 return _objectSpread2({ 26068 ref: useForkRef(ref, htmlRef) 26069 }, htmlProps); 26070 } 26071 }); 26072 var CompositeGroup = createComponent({ 26073 as: "div", 26074 useHook: useCompositeGroup 26075 }); 26076 26077 26078 26079 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js 26080 26081 26082 function alignment_matrix_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 26083 26084 /** 26085 * External dependencies 26086 */ 26087 26088 /** 26089 * Internal dependencies 26090 */ 26091 26092 26093 26094 const alignment_matrix_control_icon_styles_rootSize = () => { 26095 const padding = 1.5; 26096 const size = 24; 26097 return /*#__PURE__*/emotion_react_browser_esm_css({ 26098 gridTemplateRows: `repeat( 3, calc( $size - padding * 2}px / 3))`, 26099 padding, 26100 maxHeight: size, 26101 maxWidth: size 26102 }, true ? "" : 0, true ? "" : 0); 26103 }; 26104 26105 const rootPointerEvents = _ref => { 26106 let { 26107 disablePointerEvents 26108 } = _ref; 26109 return /*#__PURE__*/emotion_react_browser_esm_css({ 26110 pointerEvents: disablePointerEvents ? 'none' : null 26111 }, true ? "" : 0, true ? "" : 0); 26112 }; 26113 26114 const Wrapper = emotion_styled_base_browser_esm("div", true ? { 26115 target: "elqsdmc2" 26116 } : 0)( true ? { 26117 name: "ogl07i", 26118 styles: "box-sizing:border-box;padding:2px" 26119 } : 0); 26120 const alignment_matrix_control_icon_styles_Root = emotion_styled_base_browser_esm("div", true ? { 26121 target: "elqsdmc1" 26122 } : 0)("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", rootPointerEvents, ";" + ( true ? "" : 0)); 26123 26124 const alignment_matrix_control_icon_styles_pointActive = _ref2 => { 26125 let { 26126 isActive 26127 } = _ref2; 26128 const boxShadow = isActive ? `0 0 0 1px currentColor` : null; 26129 return /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", boxShadow, ";color:currentColor;*:hover>&{color:currentColor;}" + ( true ? "" : 0), true ? "" : 0); 26130 }; 26131 26132 const alignment_matrix_control_icon_styles_Point = emotion_styled_base_browser_esm("span", true ? { 26133 target: "elqsdmc0" 26134 } : 0)("height:2px;width:2px;", pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : 0)); 26135 const alignment_matrix_control_icon_styles_Cell = Cell; 26136 26137 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js 26138 26139 26140 26141 /** 26142 * External dependencies 26143 */ 26144 26145 /** 26146 * Internal dependencies 26147 */ 26148 26149 26150 26151 const BASE_SIZE = 24; 26152 function AlignmentMatrixControlIcon(_ref) { 26153 let { 26154 className, 26155 disablePointerEvents = true, 26156 size = BASE_SIZE, 26157 style = {}, 26158 value = 'center', 26159 ...props 26160 } = _ref; 26161 const alignIndex = getAlignmentIndex(value); 26162 const scale = (size / BASE_SIZE).toFixed(2); 26163 const classes = classnames_default()('component-alignment-matrix-control-icon', className); 26164 const styles = { ...style, 26165 transform: `scale($scale})` 26166 }; 26167 return (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Root, extends_extends({}, props, { 26168 className: classes, 26169 disablePointerEvents: disablePointerEvents, 26170 role: "presentation", 26171 size: size, 26172 style: styles 26173 }), ALIGNMENTS.map((align, index) => { 26174 const isActive = alignIndex === index; 26175 return (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Cell, { 26176 key: align 26177 }, (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Point, { 26178 isActive: isActive 26179 })); 26180 })); 26181 } 26182 26183 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js 26184 26185 26186 26187 /** 26188 * External dependencies 26189 */ 26190 26191 26192 /** 26193 * WordPress dependencies 26194 */ 26195 26196 26197 26198 26199 /** 26200 * Internal dependencies 26201 */ 26202 26203 26204 26205 26206 26207 26208 26209 function useBaseId(id) { 26210 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control'); 26211 return id || instanceId; 26212 } 26213 26214 function AlignmentMatrixControl(_ref) { 26215 let { 26216 className, 26217 id, 26218 label = (0,external_wp_i18n_namespaceObject.__)('Alignment Matrix Control'), 26219 defaultValue = 'center center', 26220 value, 26221 onChange = external_lodash_namespaceObject.noop, 26222 width = 92, 26223 ...props 26224 } = _ref; 26225 const [immutableDefaultValue] = (0,external_wp_element_namespaceObject.useState)(value !== null && value !== void 0 ? value : defaultValue); 26226 const baseId = useBaseId(id); 26227 const initialCurrentId = getItemId(baseId, immutableDefaultValue); 26228 const composite = useCompositeState({ 26229 baseId, 26230 currentId: initialCurrentId, 26231 rtl: (0,external_wp_i18n_namespaceObject.isRTL)() 26232 }); 26233 26234 const handleOnChange = nextValue => { 26235 onChange(nextValue); 26236 }; 26237 26238 (0,external_wp_element_namespaceObject.useEffect)(() => { 26239 if (typeof value !== 'undefined') { 26240 composite.setCurrentId(getItemId(baseId, value)); 26241 } 26242 }, [value, composite.setCurrentId]); 26243 const classes = classnames_default()('component-alignment-matrix-control', className); 26244 return (0,external_wp_element_namespaceObject.createElement)(Composite, extends_extends({}, props, composite, { 26245 "aria-label": label, 26246 as: Root, 26247 className: classes, 26248 role: "grid", 26249 width: width 26250 }), GRID.map((cells, index) => (0,external_wp_element_namespaceObject.createElement)(CompositeGroup, extends_extends({}, composite, { 26251 as: Row, 26252 role: "row", 26253 key: index 26254 }), cells.map(cell => { 26255 const cellId = getItemId(baseId, cell); 26256 const isActive = composite.currentId === cellId; 26257 return (0,external_wp_element_namespaceObject.createElement)(cell_Cell, extends_extends({}, composite, { 26258 id: cellId, 26259 isActive: isActive, 26260 key: cell, 26261 value: cell, 26262 onFocus: () => handleOnChange(cell), 26263 tabIndex: isActive ? 0 : -1 26264 })); 26265 })))); 26266 } 26267 AlignmentMatrixControl.Icon = AlignmentMatrixControlIcon; 26268 26269 ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js 26270 /*! ***************************************************************************** 26271 Copyright (c) Microsoft Corporation. 26272 26273 Permission to use, copy, modify, and/or distribute this software for any 26274 purpose with or without fee is hereby granted. 26275 26276 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 26277 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26278 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 26279 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 26280 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 26281 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 26282 PERFORMANCE OF THIS SOFTWARE. 26283 ***************************************************************************** */ 26284 /* global Reflect, Promise */ 26285 26286 var extendStatics = function(d, b) { 26287 extendStatics = Object.setPrototypeOf || 26288 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 26289 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 26290 return extendStatics(d, b); 26291 }; 26292 26293 function __extends(d, b) { 26294 if (typeof b !== "function" && b !== null) 26295 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 26296 extendStatics(d, b); 26297 function __() { this.constructor = d; } 26298 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 26299 } 26300 26301 var __assign = function() { 26302 __assign = Object.assign || function __assign(t) { 26303 for (var s, i = 1, n = arguments.length; i < n; i++) { 26304 s = arguments[i]; 26305 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 26306 } 26307 return t; 26308 } 26309 return __assign.apply(this, arguments); 26310 } 26311 26312 function __rest(s, e) { 26313 var t = {}; 26314 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 26315 t[p] = s[p]; 26316 if (s != null && typeof Object.getOwnPropertySymbols === "function") 26317 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 26318 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 26319 t[p[i]] = s[p[i]]; 26320 } 26321 return t; 26322 } 26323 26324 function __decorate(decorators, target, key, desc) { 26325 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 26326 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 26327 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 26328 return c > 3 && r && Object.defineProperty(target, key, r), r; 26329 } 26330 26331 function __param(paramIndex, decorator) { 26332 return function (target, key) { decorator(target, key, paramIndex); } 26333 } 26334 26335 function __metadata(metadataKey, metadataValue) { 26336 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 26337 } 26338 26339 function __awaiter(thisArg, _arguments, P, generator) { 26340 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 26341 return new (P || (P = Promise))(function (resolve, reject) { 26342 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 26343 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 26344 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 26345 step((generator = generator.apply(thisArg, _arguments || [])).next()); 26346 }); 26347 } 26348 26349 function __generator(thisArg, body) { 26350 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 26351 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 26352 function verb(n) { return function (v) { return step([n, v]); }; } 26353 function step(op) { 26354 if (f) throw new TypeError("Generator is already executing."); 26355 while (_) try { 26356 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 26357 if (y = 0, t) op = [op[0] & 2, t.value]; 26358 switch (op[0]) { 26359 case 0: case 1: t = op; break; 26360 case 4: _.label++; return { value: op[1], done: false }; 26361 case 5: _.label++; y = op[1]; op = [0]; continue; 26362 case 7: op = _.ops.pop(); _.trys.pop(); continue; 26363 default: 26364 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 26365 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 26366 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 26367 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 26368 if (t[2]) _.ops.pop(); 26369 _.trys.pop(); continue; 26370 } 26371 op = body.call(thisArg, _); 26372 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 26373 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 26374 } 26375 } 26376 26377 var __createBinding = Object.create ? (function(o, m, k, k2) { 26378 if (k2 === undefined) k2 = k; 26379 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 26380 }) : (function(o, m, k, k2) { 26381 if (k2 === undefined) k2 = k; 26382 o[k2] = m[k]; 26383 }); 26384 26385 function __exportStar(m, o) { 26386 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 26387 } 26388 26389 function __values(o) { 26390 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 26391 if (m) return m.call(o); 26392 if (o && typeof o.length === "number") return { 26393 next: function () { 26394 if (o && i >= o.length) o = void 0; 26395 return { value: o && o[i++], done: !o }; 26396 } 26397 }; 26398 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 26399 } 26400 26401 function tslib_es6_read(o, n) { 26402 var m = typeof Symbol === "function" && o[Symbol.iterator]; 26403 if (!m) return o; 26404 var i = m.call(o), r, ar = [], e; 26405 try { 26406 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 26407 } 26408 catch (error) { e = { error: error }; } 26409 finally { 26410 try { 26411 if (r && !r.done && (m = i["return"])) m.call(i); 26412 } 26413 finally { if (e) throw e.error; } 26414 } 26415 return ar; 26416 } 26417 26418 /** @deprecated */ 26419 function __spread() { 26420 for (var ar = [], i = 0; i < arguments.length; i++) 26421 ar = ar.concat(tslib_es6_read(arguments[i])); 26422 return ar; 26423 } 26424 26425 /** @deprecated */ 26426 function __spreadArrays() { 26427 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 26428 for (var r = Array(s), k = 0, i = 0; i < il; i++) 26429 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 26430 r[k] = a[j]; 26431 return r; 26432 } 26433 26434 function tslib_es6_spreadArray(to, from, pack) { 26435 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 26436 if (ar || !(i in from)) { 26437 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 26438 ar[i] = from[i]; 26439 } 26440 } 26441 return to.concat(ar || Array.prototype.slice.call(from)); 26442 } 26443 26444 function __await(v) { 26445 return this instanceof __await ? (this.v = v, this) : new __await(v); 26446 } 26447 26448 function __asyncGenerator(thisArg, _arguments, generator) { 26449 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 26450 var g = generator.apply(thisArg, _arguments || []), i, q = []; 26451 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 26452 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 26453 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 26454 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 26455 function fulfill(value) { resume("next", value); } 26456 function reject(value) { resume("throw", value); } 26457 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 26458 } 26459 26460 function __asyncDelegator(o) { 26461 var i, p; 26462 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 26463 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 26464 } 26465 26466 function __asyncValues(o) { 26467 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 26468 var m = o[Symbol.asyncIterator], i; 26469 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 26470 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 26471 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 26472 } 26473 26474 function __makeTemplateObject(cooked, raw) { 26475 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 26476 return cooked; 26477 }; 26478 26479 var __setModuleDefault = Object.create ? (function(o, v) { 26480 Object.defineProperty(o, "default", { enumerable: true, value: v }); 26481 }) : function(o, v) { 26482 o["default"] = v; 26483 }; 26484 26485 function __importStar(mod) { 26486 if (mod && mod.__esModule) return mod; 26487 var result = {}; 26488 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 26489 __setModuleDefault(result, mod); 26490 return result; 26491 } 26492 26493 function __importDefault(mod) { 26494 return (mod && mod.__esModule) ? mod : { default: mod }; 26495 } 26496 26497 function __classPrivateFieldGet(receiver, state, kind, f) { 26498 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 26499 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 26500 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 26501 } 26502 26503 function __classPrivateFieldSet(receiver, state, value, kind, f) { 26504 if (kind === "m") throw new TypeError("Private method is not writable"); 26505 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 26506 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 26507 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 26508 } 26509 26510 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.mjs 26511 var createDefinition = function (propNames) { return ({ 26512 isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); }, 26513 }); }; 26514 var featureDefinitions = { 26515 measureLayout: createDefinition(["layout", "layoutId", "drag"]), 26516 animation: createDefinition([ 26517 "animate", 26518 "exit", 26519 "variants", 26520 "whileHover", 26521 "whileTap", 26522 "whileFocus", 26523 "whileDrag", 26524 "whileInView", 26525 ]), 26526 exit: createDefinition(["exit"]), 26527 drag: createDefinition(["drag", "dragControls"]), 26528 focus: createDefinition(["whileFocus"]), 26529 hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), 26530 tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), 26531 pan: createDefinition([ 26532 "onPan", 26533 "onPanStart", 26534 "onPanSessionStart", 26535 "onPanEnd", 26536 ]), 26537 inView: createDefinition([ 26538 "whileInView", 26539 "onViewportEnter", 26540 "onViewportLeave", 26541 ]), 26542 }; 26543 function loadFeatures(features) { 26544 for (var key in features) { 26545 if (features[key] === null) 26546 continue; 26547 if (key === "projectionNodeConstructor") { 26548 featureDefinitions.projectionNodeConstructor = features[key]; 26549 } 26550 else { 26551 featureDefinitions[key].Component = features[key]; 26552 } 26553 } 26554 } 26555 26556 26557 26558 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.mjs 26559 26560 26561 var LazyContext = (0,external_React_.createContext)({ strict: false }); 26562 26563 26564 26565 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-features.mjs 26566 26567 26568 26569 26570 26571 26572 26573 26574 var featureNames = Object.keys(featureDefinitions); 26575 var numFeatures = featureNames.length; 26576 /** 26577 * Load features via renderless components based on the provided MotionProps. 26578 */ 26579 function useFeatures(props, visualElement, preloadedFeatures) { 26580 var features = []; 26581 var lazyContext = (0,external_React_.useContext)(LazyContext); 26582 if (!visualElement) 26583 return null; 26584 /** 26585 * If we're in development mode, check to make sure we're not rendering a motion component 26586 * as a child of LazyMotion, as this will break the file-size benefits of using it. 26587 */ 26588 if (false) {} 26589 for (var i = 0; i < numFeatures; i++) { 26590 var name_1 = featureNames[i]; 26591 var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component; 26592 /** 26593 * It might be possible in the future to use this moment to 26594 * dynamically request functionality. In initial tests this 26595 * was producing a lot of duplication amongst bundles. 26596 */ 26597 if (isEnabled(props) && Component) { 26598 features.push(external_React_.createElement(Component, __assign({ key: name_1 }, props, { visualElement: visualElement }))); 26599 } 26600 } 26601 return features; 26602 } 26603 26604 26605 26606 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs 26607 26608 26609 /** 26610 * @public 26611 */ 26612 var MotionConfigContext = (0,external_React_.createContext)({ 26613 transformPagePoint: function (p) { return p; }, 26614 isStatic: false, 26615 reducedMotion: "never", 26616 }); 26617 26618 26619 26620 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.mjs 26621 26622 26623 var MotionContext = (0,external_React_.createContext)({}); 26624 function useVisualElementContext() { 26625 return (0,external_React_.useContext)(MotionContext).visualElement; 26626 } 26627 26628 26629 26630 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs 26631 26632 26633 /** 26634 * @public 26635 */ 26636 var PresenceContext_PresenceContext = (0,external_React_.createContext)(null); 26637 26638 26639 26640 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.mjs 26641 var is_browser_isBrowser = typeof document !== "undefined"; 26642 26643 26644 26645 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs 26646 26647 26648 26649 var useIsomorphicLayoutEffect = is_browser_isBrowser ? external_React_.useLayoutEffect : external_React_.useEffect; 26650 26651 26652 26653 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-reduced-motion.mjs 26654 26655 26656 26657 26658 26659 // Does this device prefer reduced motion? Returns `null` server-side. 26660 var prefersReducedMotion = { current: null }; 26661 var hasDetected = false; 26662 function initPrefersReducedMotion() { 26663 hasDetected = true; 26664 if (!is_browser_isBrowser) 26665 return; 26666 if (window.matchMedia) { 26667 var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)"); 26668 var setReducedMotionPreferences = function () { 26669 return (prefersReducedMotion.current = motionMediaQuery_1.matches); 26670 }; 26671 motionMediaQuery_1.addListener(setReducedMotionPreferences); 26672 setReducedMotionPreferences(); 26673 } 26674 else { 26675 prefersReducedMotion.current = false; 26676 } 26677 } 26678 /** 26679 * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. 26680 * 26681 * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing 26682 * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. 26683 * 26684 * It will actively respond to changes and re-render your components with the latest setting. 26685 * 26686 * ```jsx 26687 * export function Sidebar({ isOpen }) { 26688 * const shouldReduceMotion = useReducedMotion() 26689 * const closedX = shouldReduceMotion ? 0 : "-100%" 26690 * 26691 * return ( 26692 * <motion.div animate={{ 26693 * opacity: isOpen ? 1 : 0, 26694 * x: isOpen ? 0 : closedX 26695 * }} /> 26696 * ) 26697 * } 26698 * ``` 26699 * 26700 * @return boolean 26701 * 26702 * @public 26703 */ 26704 function useReducedMotion() { 26705 /** 26706 * Lazy initialisation of prefersReducedMotion 26707 */ 26708 !hasDetected && initPrefersReducedMotion(); 26709 var _a = tslib_es6_read((0,external_React_.useState)(prefersReducedMotion.current), 1), shouldReduceMotion = _a[0]; 26710 /** 26711 * TODO See if people miss automatically updating shouldReduceMotion setting 26712 */ 26713 return shouldReduceMotion; 26714 } 26715 function useReducedMotionConfig() { 26716 var reducedMotionPreference = useReducedMotion(); 26717 var reducedMotion = (0,external_React_.useContext)(MotionConfigContext).reducedMotion; 26718 if (reducedMotion === "never") { 26719 return false; 26720 } 26721 else if (reducedMotion === "always") { 26722 return true; 26723 } 26724 else { 26725 return reducedMotionPreference; 26726 } 26727 } 26728 26729 26730 26731 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs 26732 26733 26734 26735 26736 26737 26738 26739 function useVisualElement(Component, visualState, props, createVisualElement) { 26740 var lazyContext = (0,external_React_.useContext)(LazyContext); 26741 var parent = useVisualElementContext(); 26742 var presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext); 26743 var shouldReduceMotion = useReducedMotionConfig(); 26744 var visualElementRef = (0,external_React_.useRef)(undefined); 26745 /** 26746 * If we haven't preloaded a renderer, check to see if we have one lazy-loaded 26747 */ 26748 if (!createVisualElement) 26749 createVisualElement = lazyContext.renderer; 26750 if (!visualElementRef.current && createVisualElement) { 26751 visualElementRef.current = createVisualElement(Component, { 26752 visualState: visualState, 26753 parent: parent, 26754 props: props, 26755 presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, 26756 blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, 26757 shouldReduceMotion: shouldReduceMotion, 26758 }); 26759 } 26760 var visualElement = visualElementRef.current; 26761 useIsomorphicLayoutEffect(function () { 26762 visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); 26763 }); 26764 (0,external_React_.useEffect)(function () { 26765 var _a; 26766 (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); 26767 }); 26768 useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []); 26769 return visualElement; 26770 } 26771 26772 26773 26774 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs 26775 function is_ref_object_isRefObject(ref) { 26776 return (typeof ref === "object" && 26777 Object.prototype.hasOwnProperty.call(ref, "current")); 26778 } 26779 26780 26781 26782 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs 26783 26784 26785 26786 /** 26787 * Creates a ref function that, when called, hydrates the provided 26788 * external ref and VisualElement. 26789 */ 26790 function useMotionRef(visualState, visualElement, externalRef) { 26791 return (0,external_React_.useCallback)(function (instance) { 26792 var _a; 26793 instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); 26794 if (visualElement) { 26795 instance 26796 ? visualElement.mount(instance) 26797 : visualElement.unmount(); 26798 } 26799 if (externalRef) { 26800 if (typeof externalRef === "function") { 26801 externalRef(instance); 26802 } 26803 else if (is_ref_object_isRefObject(externalRef)) { 26804 externalRef.current = instance; 26805 } 26806 } 26807 }, 26808 /** 26809 * Only pass a new ref callback to React if we've received a visual element 26810 * factory. Otherwise we'll be mounting/remounting every time externalRef 26811 * or other dependencies change. 26812 */ 26813 [visualElement]); 26814 } 26815 26816 26817 26818 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variants.mjs 26819 /** 26820 * Decides if the supplied variable is an array of variant labels 26821 */ 26822 function isVariantLabels(v) { 26823 return Array.isArray(v); 26824 } 26825 /** 26826 * Decides if the supplied variable is variant label 26827 */ 26828 function isVariantLabel(v) { 26829 return typeof v === "string" || isVariantLabels(v); 26830 } 26831 /** 26832 * Creates an object containing the latest state of every MotionValue on a VisualElement 26833 */ 26834 function getCurrent(visualElement) { 26835 var current = {}; 26836 visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); }); 26837 return current; 26838 } 26839 /** 26840 * Creates an object containing the latest velocity of every MotionValue on a VisualElement 26841 */ 26842 function getVelocity(visualElement) { 26843 var velocity = {}; 26844 visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); }); 26845 return velocity; 26846 } 26847 function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { 26848 var _a; 26849 if (currentValues === void 0) { currentValues = {}; } 26850 if (currentVelocity === void 0) { currentVelocity = {}; } 26851 /** 26852 * If the variant definition is a function, resolve. 26853 */ 26854 if (typeof definition === "function") { 26855 definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); 26856 } 26857 /** 26858 * If the variant definition is a variant label, or 26859 * the function returned a variant label, resolve. 26860 */ 26861 if (typeof definition === "string") { 26862 definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; 26863 } 26864 /** 26865 * At this point we've resolved both functions and variant labels, 26866 * but the resolved variant label might itself have been a function. 26867 * If so, resolve. This can only have returned a valid target object. 26868 */ 26869 if (typeof definition === "function") { 26870 definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); 26871 } 26872 return definition; 26873 } 26874 function resolveVariant(visualElement, definition, custom) { 26875 var props = visualElement.getProps(); 26876 return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement)); 26877 } 26878 function checkIfControllingVariants(props) { 26879 var _a; 26880 return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || 26881 isVariantLabel(props.initial) || 26882 isVariantLabel(props.animate) || 26883 isVariantLabel(props.whileHover) || 26884 isVariantLabel(props.whileDrag) || 26885 isVariantLabel(props.whileTap) || 26886 isVariantLabel(props.whileFocus) || 26887 isVariantLabel(props.exit)); 26888 } 26889 function checkIfVariantNode(props) { 26890 return Boolean(checkIfControllingVariants(props) || props.variants); 26891 } 26892 26893 26894 26895 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs 26896 26897 26898 function getCurrentTreeVariants(props, context) { 26899 if (checkIfControllingVariants(props)) { 26900 var initial = props.initial, animate = props.animate; 26901 return { 26902 initial: initial === false || isVariantLabel(initial) 26903 ? initial 26904 : undefined, 26905 animate: isVariantLabel(animate) ? animate : undefined, 26906 }; 26907 } 26908 return props.inherit !== false ? context : {}; 26909 } 26910 26911 26912 26913 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.mjs 26914 26915 26916 26917 26918 function useCreateMotionContext(props) { 26919 var _a = getCurrentTreeVariants(props, (0,external_React_.useContext)(MotionContext)), initial = _a.initial, animate = _a.animate; 26920 return (0,external_React_.useMemo)(function () { return ({ initial: initial, animate: animate }); }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); 26921 } 26922 function variantLabelsAsDependency(prop) { 26923 return Array.isArray(prop) ? prop.join(" ") : prop; 26924 } 26925 26926 26927 26928 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.mjs 26929 26930 26931 /** 26932 * Creates a constant value over the lifecycle of a component. 26933 * 26934 * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer 26935 * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` 26936 * you can ensure that initialisers don't execute twice or more. 26937 */ 26938 function useConstant(init) { 26939 var ref = (0,external_React_.useRef)(null); 26940 if (ref.current === null) { 26941 ref.current = init(); 26942 } 26943 return ref.current; 26944 } 26945 26946 26947 26948 ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/on-next-frame.mjs 26949 const defaultTimestep = (1 / 60) * 1000; 26950 const getCurrentTime = typeof performance !== "undefined" 26951 ? () => performance.now() 26952 : () => Date.now(); 26953 const onNextFrame = typeof window !== "undefined" 26954 ? (callback) => window.requestAnimationFrame(callback) 26955 : (callback) => setTimeout(() => callback(getCurrentTime()), defaultTimestep); 26956 26957 26958 26959 ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/create-render-step.mjs 26960 function createRenderStep(runNextFrame) { 26961 let toRun = []; 26962 let toRunNextFrame = []; 26963 let numToRun = 0; 26964 let isProcessing = false; 26965 let flushNextFrame = false; 26966 const toKeepAlive = new WeakSet(); 26967 const step = { 26968 schedule: (callback, keepAlive = false, immediate = false) => { 26969 const addToCurrentFrame = immediate && isProcessing; 26970 const buffer = addToCurrentFrame ? toRun : toRunNextFrame; 26971 if (keepAlive) 26972 toKeepAlive.add(callback); 26973 if (buffer.indexOf(callback) === -1) { 26974 buffer.push(callback); 26975 if (addToCurrentFrame && isProcessing) 26976 numToRun = toRun.length; 26977 } 26978 return callback; 26979 }, 26980 cancel: (callback) => { 26981 const index = toRunNextFrame.indexOf(callback); 26982 if (index !== -1) 26983 toRunNextFrame.splice(index, 1); 26984 toKeepAlive.delete(callback); 26985 }, 26986 process: (frameData) => { 26987 if (isProcessing) { 26988 flushNextFrame = true; 26989 return; 26990 } 26991 isProcessing = true; 26992 [toRun, toRunNextFrame] = [toRunNextFrame, toRun]; 26993 toRunNextFrame.length = 0; 26994 numToRun = toRun.length; 26995 if (numToRun) { 26996 for (let i = 0; i < numToRun; i++) { 26997 const callback = toRun[i]; 26998 callback(frameData); 26999 if (toKeepAlive.has(callback)) { 27000 step.schedule(callback); 27001 runNextFrame(); 27002 } 27003 } 27004 } 27005 isProcessing = false; 27006 if (flushNextFrame) { 27007 flushNextFrame = false; 27008 step.process(frameData); 27009 } 27010 }, 27011 }; 27012 return step; 27013 } 27014 27015 27016 27017 ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/index.mjs 27018 27019 27020 27021 const maxElapsed = 40; 27022 let useDefaultElapsed = true; 27023 let runNextFrame = false; 27024 let isProcessing = false; 27025 const es_frame = { 27026 delta: 0, 27027 timestamp: 0, 27028 }; 27029 const stepsOrder = [ 27030 "read", 27031 "update", 27032 "preRender", 27033 "render", 27034 "postRender", 27035 ]; 27036 const steps = stepsOrder.reduce((acc, key) => { 27037 acc[key] = createRenderStep(() => (runNextFrame = true)); 27038 return acc; 27039 }, {}); 27040 const sync = stepsOrder.reduce((acc, key) => { 27041 const step = steps[key]; 27042 acc[key] = (process, keepAlive = false, immediate = false) => { 27043 if (!runNextFrame) 27044 startLoop(); 27045 return step.schedule(process, keepAlive, immediate); 27046 }; 27047 return acc; 27048 }, {}); 27049 const cancelSync = stepsOrder.reduce((acc, key) => { 27050 acc[key] = steps[key].cancel; 27051 return acc; 27052 }, {}); 27053 const flushSync = stepsOrder.reduce((acc, key) => { 27054 acc[key] = () => steps[key].process(es_frame); 27055 return acc; 27056 }, {}); 27057 const processStep = (stepId) => steps[stepId].process(es_frame); 27058 const processFrame = (timestamp) => { 27059 runNextFrame = false; 27060 es_frame.delta = useDefaultElapsed 27061 ? defaultTimestep 27062 : Math.max(Math.min(timestamp - es_frame.timestamp, maxElapsed), 1); 27063 es_frame.timestamp = timestamp; 27064 isProcessing = true; 27065 stepsOrder.forEach(processStep); 27066 isProcessing = false; 27067 if (runNextFrame) { 27068 useDefaultElapsed = false; 27069 onNextFrame(processFrame); 27070 } 27071 }; 27072 const startLoop = () => { 27073 runNextFrame = true; 27074 useDefaultElapsed = true; 27075 if (!isProcessing) 27076 onNextFrame(processFrame); 27077 }; 27078 const getFrameData = () => es_frame; 27079 27080 /* harmony default export */ var es = (sync); 27081 27082 27083 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix.mjs 27084 const mix = (from, to, progress) => -progress * from + progress * to + from; 27085 27086 27087 27088 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/velocity-per-second.mjs 27089 function velocityPerSecond(velocity, frameDuration) { 27090 return frameDuration ? velocity * (1000 / frameDuration) : 0; 27091 } 27092 27093 27094 27095 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/array.mjs 27096 27097 27098 function addUniqueItem(arr, item) { 27099 arr.indexOf(item) === -1 && arr.push(item); 27100 } 27101 function removeItem(arr, item) { 27102 var index = arr.indexOf(item); 27103 index > -1 && arr.splice(index, 1); 27104 } 27105 // Adapted from array-move 27106 function moveItem(_a, fromIndex, toIndex) { 27107 var _b = __read(_a), arr = _b.slice(0); 27108 var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; 27109 if (startIndex >= 0 && startIndex < arr.length) { 27110 var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; 27111 var _c = __read(arr.splice(fromIndex, 1), 1), item = _c[0]; 27112 arr.splice(endIndex, 0, item); 27113 } 27114 return arr; 27115 } 27116 27117 27118 27119 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/subscription-manager.mjs 27120 27121 27122 var SubscriptionManager = /** @class */ (function () { 27123 function SubscriptionManager() { 27124 this.subscriptions = []; 27125 } 27126 SubscriptionManager.prototype.add = function (handler) { 27127 var _this = this; 27128 addUniqueItem(this.subscriptions, handler); 27129 return function () { return removeItem(_this.subscriptions, handler); }; 27130 }; 27131 SubscriptionManager.prototype.notify = function (a, b, c) { 27132 var numSubscriptions = this.subscriptions.length; 27133 if (!numSubscriptions) 27134 return; 27135 if (numSubscriptions === 1) { 27136 /** 27137 * If there's only a single handler we can just call it without invoking a loop. 27138 */ 27139 this.subscriptions[0](a, b, c); 27140 } 27141 else { 27142 for (var i = 0; i < numSubscriptions; i++) { 27143 /** 27144 * Check whether the handler exists before firing as it's possible 27145 * the subscriptions were modified during this loop running. 27146 */ 27147 var handler = this.subscriptions[i]; 27148 handler && handler(a, b, c); 27149 } 27150 } 27151 }; 27152 SubscriptionManager.prototype.getSize = function () { 27153 return this.subscriptions.length; 27154 }; 27155 SubscriptionManager.prototype.clear = function () { 27156 this.subscriptions.length = 0; 27157 }; 27158 return SubscriptionManager; 27159 }()); 27160 27161 27162 27163 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/index.mjs 27164 27165 27166 27167 27168 var isFloat = function (value) { 27169 return !isNaN(parseFloat(value)); 27170 }; 27171 /** 27172 * `MotionValue` is used to track the state and velocity of motion values. 27173 * 27174 * @public 27175 */ 27176 var MotionValue = /** @class */ (function () { 27177 /** 27178 * @param init - The initiating value 27179 * @param config - Optional configuration options 27180 * 27181 * - `transformer`: A function to transform incoming values with. 27182 * 27183 * @internal 27184 */ 27185 function MotionValue(init) { 27186 var _this = this; 27187 /** 27188 * Duration, in milliseconds, since last updating frame. 27189 * 27190 * @internal 27191 */ 27192 this.timeDelta = 0; 27193 /** 27194 * Timestamp of the last time this `MotionValue` was updated. 27195 * 27196 * @internal 27197 */ 27198 this.lastUpdated = 0; 27199 /** 27200 * Functions to notify when the `MotionValue` updates. 27201 * 27202 * @internal 27203 */ 27204 this.updateSubscribers = new SubscriptionManager(); 27205 /** 27206 * Functions to notify when the velocity updates. 27207 * 27208 * @internal 27209 */ 27210 this.velocityUpdateSubscribers = new SubscriptionManager(); 27211 /** 27212 * Functions to notify when the `MotionValue` updates and `render` is set to `true`. 27213 * 27214 * @internal 27215 */ 27216 this.renderSubscribers = new SubscriptionManager(); 27217 /** 27218 * Tracks whether this value can output a velocity. Currently this is only true 27219 * if the value is numerical, but we might be able to widen the scope here and support 27220 * other value types. 27221 * 27222 * @internal 27223 */ 27224 this.canTrackVelocity = false; 27225 this.updateAndNotify = function (v, render) { 27226 if (render === void 0) { render = true; } 27227 _this.prev = _this.current; 27228 _this.current = v; 27229 // Update timestamp 27230 var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp; 27231 if (_this.lastUpdated !== timestamp) { 27232 _this.timeDelta = delta; 27233 _this.lastUpdated = timestamp; 27234 es.postRender(_this.scheduleVelocityCheck); 27235 } 27236 // Update update subscribers 27237 if (_this.prev !== _this.current) { 27238 _this.updateSubscribers.notify(_this.current); 27239 } 27240 // Update velocity subscribers 27241 if (_this.velocityUpdateSubscribers.getSize()) { 27242 _this.velocityUpdateSubscribers.notify(_this.getVelocity()); 27243 } 27244 // Update render subscribers 27245 if (render) { 27246 _this.renderSubscribers.notify(_this.current); 27247 } 27248 }; 27249 /** 27250 * Schedule a velocity check for the next frame. 27251 * 27252 * This is an instanced and bound function to prevent generating a new 27253 * function once per frame. 27254 * 27255 * @internal 27256 */ 27257 this.scheduleVelocityCheck = function () { return es.postRender(_this.velocityCheck); }; 27258 /** 27259 * Updates `prev` with `current` if the value hasn't been updated this frame. 27260 * This ensures velocity calculations return `0`. 27261 * 27262 * This is an instanced and bound function to prevent generating a new 27263 * function once per frame. 27264 * 27265 * @internal 27266 */ 27267 this.velocityCheck = function (_a) { 27268 var timestamp = _a.timestamp; 27269 if (timestamp !== _this.lastUpdated) { 27270 _this.prev = _this.current; 27271 _this.velocityUpdateSubscribers.notify(_this.getVelocity()); 27272 } 27273 }; 27274 this.hasAnimated = false; 27275 this.prev = this.current = init; 27276 this.canTrackVelocity = isFloat(this.current); 27277 } 27278 /** 27279 * Adds a function that will be notified when the `MotionValue` is updated. 27280 * 27281 * It returns a function that, when called, will cancel the subscription. 27282 * 27283 * When calling `onChange` inside a React component, it should be wrapped with the 27284 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 27285 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 27286 * 27287 * ```jsx 27288 * export const MyComponent = () => { 27289 * const x = useMotionValue(0) 27290 * const y = useMotionValue(0) 27291 * const opacity = useMotionValue(1) 27292 * 27293 * useEffect(() => { 27294 * function updateOpacity() { 27295 * const maxXY = Math.max(x.get(), y.get()) 27296 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 27297 * opacity.set(newOpacity) 27298 * } 27299 * 27300 * const unsubscribeX = x.onChange(updateOpacity) 27301 * const unsubscribeY = y.onChange(updateOpacity) 27302 * 27303 * return () => { 27304 * unsubscribeX() 27305 * unsubscribeY() 27306 * } 27307 * }, []) 27308 * 27309 * return <motion.div style={{ x }} /> 27310 * } 27311 * ``` 27312 * 27313 * @internalremarks 27314 * 27315 * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. 27316 * 27317 * ```jsx 27318 * useOnChange(x, () => {}) 27319 * ``` 27320 * 27321 * @param subscriber - A function that receives the latest value. 27322 * @returns A function that, when called, will cancel this subscription. 27323 * 27324 * @public 27325 */ 27326 MotionValue.prototype.onChange = function (subscription) { 27327 return this.updateSubscribers.add(subscription); 27328 }; 27329 MotionValue.prototype.clearListeners = function () { 27330 this.updateSubscribers.clear(); 27331 }; 27332 /** 27333 * Adds a function that will be notified when the `MotionValue` requests a render. 27334 * 27335 * @param subscriber - A function that's provided the latest value. 27336 * @returns A function that, when called, will cancel this subscription. 27337 * 27338 * @internal 27339 */ 27340 MotionValue.prototype.onRenderRequest = function (subscription) { 27341 // Render immediately 27342 subscription(this.get()); 27343 return this.renderSubscribers.add(subscription); 27344 }; 27345 /** 27346 * Attaches a passive effect to the `MotionValue`. 27347 * 27348 * @internal 27349 */ 27350 MotionValue.prototype.attach = function (passiveEffect) { 27351 this.passiveEffect = passiveEffect; 27352 }; 27353 /** 27354 * Sets the state of the `MotionValue`. 27355 * 27356 * @remarks 27357 * 27358 * ```jsx 27359 * const x = useMotionValue(0) 27360 * x.set(10) 27361 * ``` 27362 * 27363 * @param latest - Latest value to set. 27364 * @param render - Whether to notify render subscribers. Defaults to `true` 27365 * 27366 * @public 27367 */ 27368 MotionValue.prototype.set = function (v, render) { 27369 if (render === void 0) { render = true; } 27370 if (!render || !this.passiveEffect) { 27371 this.updateAndNotify(v, render); 27372 } 27373 else { 27374 this.passiveEffect(v, this.updateAndNotify); 27375 } 27376 }; 27377 /** 27378 * Returns the latest state of `MotionValue` 27379 * 27380 * @returns - The latest state of `MotionValue` 27381 * 27382 * @public 27383 */ 27384 MotionValue.prototype.get = function () { 27385 return this.current; 27386 }; 27387 /** 27388 * @public 27389 */ 27390 MotionValue.prototype.getPrevious = function () { 27391 return this.prev; 27392 }; 27393 /** 27394 * Returns the latest velocity of `MotionValue` 27395 * 27396 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 27397 * 27398 * @public 27399 */ 27400 MotionValue.prototype.getVelocity = function () { 27401 // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful 27402 return this.canTrackVelocity 27403 ? // These casts could be avoided if parseFloat would be typed better 27404 velocityPerSecond(parseFloat(this.current) - 27405 parseFloat(this.prev), this.timeDelta) 27406 : 0; 27407 }; 27408 /** 27409 * Registers a new animation to control this `MotionValue`. Only one 27410 * animation can drive a `MotionValue` at one time. 27411 * 27412 * ```jsx 27413 * value.start() 27414 * ``` 27415 * 27416 * @param animation - A function that starts the provided animation 27417 * 27418 * @internal 27419 */ 27420 MotionValue.prototype.start = function (animation) { 27421 var _this = this; 27422 this.stop(); 27423 return new Promise(function (resolve) { 27424 _this.hasAnimated = true; 27425 _this.stopAnimation = animation(resolve); 27426 }).then(function () { return _this.clearAnimation(); }); 27427 }; 27428 /** 27429 * Stop the currently active animation. 27430 * 27431 * @public 27432 */ 27433 MotionValue.prototype.stop = function () { 27434 if (this.stopAnimation) 27435 this.stopAnimation(); 27436 this.clearAnimation(); 27437 }; 27438 /** 27439 * Returns `true` if this value is currently animating. 27440 * 27441 * @public 27442 */ 27443 MotionValue.prototype.isAnimating = function () { 27444 return !!this.stopAnimation; 27445 }; 27446 MotionValue.prototype.clearAnimation = function () { 27447 this.stopAnimation = null; 27448 }; 27449 /** 27450 * Destroy and clean up subscribers to this `MotionValue`. 27451 * 27452 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 27453 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 27454 * created a `MotionValue` via the `motionValue` function. 27455 * 27456 * @public 27457 */ 27458 MotionValue.prototype.destroy = function () { 27459 this.updateSubscribers.clear(); 27460 this.renderSubscribers.clear(); 27461 this.stop(); 27462 }; 27463 return MotionValue; 27464 }()); 27465 /** 27466 * @internal 27467 */ 27468 function motionValue(init) { 27469 return new MotionValue(init); 27470 } 27471 27472 27473 27474 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs 27475 var isMotionValue = function (value) { 27476 return Boolean(value !== null && typeof value === "object" && value.getVelocity); 27477 }; 27478 27479 27480 27481 ;// CONCATENATED MODULE: ./node_modules/hey-listen/dist/hey-listen.es.js 27482 var warning = function () { }; 27483 var invariant = function () { }; 27484 if (false) {} 27485 27486 27487 27488 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/clamp.mjs 27489 const clamp = (min, max, v) => Math.min(Math.max(v, min), max); 27490 27491 27492 27493 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/find-spring.mjs 27494 27495 27496 27497 const safeMin = 0.001; 27498 const minDuration = 0.01; 27499 const maxDuration = 10.0; 27500 const minDamping = 0.05; 27501 const maxDamping = 1; 27502 function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) { 27503 let envelope; 27504 let derivative; 27505 warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less"); 27506 let dampingRatio = 1 - bounce; 27507 dampingRatio = clamp(minDamping, maxDamping, dampingRatio); 27508 duration = clamp(minDuration, maxDuration, duration / 1000); 27509 if (dampingRatio < 1) { 27510 envelope = (undampedFreq) => { 27511 const exponentialDecay = undampedFreq * dampingRatio; 27512 const delta = exponentialDecay * duration; 27513 const a = exponentialDecay - velocity; 27514 const b = calcAngularFreq(undampedFreq, dampingRatio); 27515 const c = Math.exp(-delta); 27516 return safeMin - (a / b) * c; 27517 }; 27518 derivative = (undampedFreq) => { 27519 const exponentialDecay = undampedFreq * dampingRatio; 27520 const delta = exponentialDecay * duration; 27521 const d = delta * velocity + velocity; 27522 const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; 27523 const f = Math.exp(-delta); 27524 const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); 27525 const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; 27526 return (factor * ((d - e) * f)) / g; 27527 }; 27528 } 27529 else { 27530 envelope = (undampedFreq) => { 27531 const a = Math.exp(-undampedFreq * duration); 27532 const b = (undampedFreq - velocity) * duration + 1; 27533 return -safeMin + a * b; 27534 }; 27535 derivative = (undampedFreq) => { 27536 const a = Math.exp(-undampedFreq * duration); 27537 const b = (velocity - undampedFreq) * (duration * duration); 27538 return a * b; 27539 }; 27540 } 27541 const initialGuess = 5 / duration; 27542 const undampedFreq = approximateRoot(envelope, derivative, initialGuess); 27543 duration = duration * 1000; 27544 if (isNaN(undampedFreq)) { 27545 return { 27546 stiffness: 100, 27547 damping: 10, 27548 duration, 27549 }; 27550 } 27551 else { 27552 const stiffness = Math.pow(undampedFreq, 2) * mass; 27553 return { 27554 stiffness, 27555 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 27556 duration, 27557 }; 27558 } 27559 } 27560 const rootIterations = 12; 27561 function approximateRoot(envelope, derivative, initialGuess) { 27562 let result = initialGuess; 27563 for (let i = 1; i < rootIterations; i++) { 27564 result = result - envelope(result) / derivative(result); 27565 } 27566 return result; 27567 } 27568 function calcAngularFreq(undampedFreq, dampingRatio) { 27569 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 27570 } 27571 27572 27573 27574 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/spring.mjs 27575 27576 27577 27578 const durationKeys = ["duration", "bounce"]; 27579 const physicsKeys = ["stiffness", "damping", "mass"]; 27580 function isSpringType(options, keys) { 27581 return keys.some((key) => options[key] !== undefined); 27582 } 27583 function getSpringOptions(options) { 27584 let springOptions = Object.assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options); 27585 if (!isSpringType(options, physicsKeys) && 27586 isSpringType(options, durationKeys)) { 27587 const derived = findSpring(options); 27588 springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 }); 27589 springOptions.isResolvedFromDuration = true; 27590 } 27591 return springOptions; 27592 } 27593 function spring(_a) { 27594 var { from = 0.0, to = 1.0, restSpeed = 2, restDelta } = _a, options = __rest(_a, ["from", "to", "restSpeed", "restDelta"]); 27595 const state = { done: false, value: from }; 27596 let { stiffness, damping, mass, velocity, duration, isResolvedFromDuration, } = getSpringOptions(options); 27597 let resolveSpring = zero; 27598 let resolveVelocity = zero; 27599 function createSpring() { 27600 const initialVelocity = velocity ? -(velocity / 1000) : 0.0; 27601 const initialDelta = to - from; 27602 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 27603 const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; 27604 if (restDelta === undefined) { 27605 restDelta = Math.min(Math.abs(to - from) / 100, 0.4); 27606 } 27607 if (dampingRatio < 1) { 27608 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); 27609 resolveSpring = (t) => { 27610 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 27611 return (to - 27612 envelope * 27613 (((initialVelocity + 27614 dampingRatio * undampedAngularFreq * initialDelta) / 27615 angularFreq) * 27616 Math.sin(angularFreq * t) + 27617 initialDelta * Math.cos(angularFreq * t))); 27618 }; 27619 resolveVelocity = (t) => { 27620 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 27621 return (dampingRatio * 27622 undampedAngularFreq * 27623 envelope * 27624 ((Math.sin(angularFreq * t) * 27625 (initialVelocity + 27626 dampingRatio * 27627 undampedAngularFreq * 27628 initialDelta)) / 27629 angularFreq + 27630 initialDelta * Math.cos(angularFreq * t)) - 27631 envelope * 27632 (Math.cos(angularFreq * t) * 27633 (initialVelocity + 27634 dampingRatio * 27635 undampedAngularFreq * 27636 initialDelta) - 27637 angularFreq * 27638 initialDelta * 27639 Math.sin(angularFreq * t))); 27640 }; 27641 } 27642 else if (dampingRatio === 1) { 27643 resolveSpring = (t) => to - 27644 Math.exp(-undampedAngularFreq * t) * 27645 (initialDelta + 27646 (initialVelocity + undampedAngularFreq * initialDelta) * 27647 t); 27648 } 27649 else { 27650 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 27651 resolveSpring = (t) => { 27652 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 27653 const freqForT = Math.min(dampedAngularFreq * t, 300); 27654 return (to - 27655 (envelope * 27656 ((initialVelocity + 27657 dampingRatio * undampedAngularFreq * initialDelta) * 27658 Math.sinh(freqForT) + 27659 dampedAngularFreq * 27660 initialDelta * 27661 Math.cosh(freqForT))) / 27662 dampedAngularFreq); 27663 }; 27664 } 27665 } 27666 createSpring(); 27667 return { 27668 next: (t) => { 27669 const current = resolveSpring(t); 27670 if (!isResolvedFromDuration) { 27671 const currentVelocity = resolveVelocity(t) * 1000; 27672 const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; 27673 const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta; 27674 state.done = 27675 isBelowVelocityThreshold && isBelowDisplacementThreshold; 27676 } 27677 else { 27678 state.done = t >= duration; 27679 } 27680 state.value = state.done ? to : current; 27681 return state; 27682 }, 27683 flipTarget: () => { 27684 velocity = -velocity; 27685 [from, to] = [to, from]; 27686 createSpring(); 27687 }, 27688 }; 27689 } 27690 spring.needsInterpolation = (a, b) => typeof a === "string" || typeof b === "string"; 27691 const zero = (_t) => 0; 27692 27693 27694 27695 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/progress.mjs 27696 const progress = (from, to, value) => { 27697 const toFromDifference = to - from; 27698 return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; 27699 }; 27700 27701 27702 27703 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/utils.mjs 27704 const utils_clamp = (min, max) => (v) => Math.max(Math.min(v, max), min); 27705 const sanitize = (v) => (v % 1 ? Number(v.toFixed(5)) : v); 27706 const floatRegex = /(-)?([\d]*\.?[\d])+/g; 27707 const colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi; 27708 const singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i; 27709 function isString(v) { 27710 return typeof v === 'string'; 27711 } 27712 27713 27714 27715 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/index.mjs 27716 27717 27718 const number = { 27719 test: (v) => typeof v === 'number', 27720 parse: parseFloat, 27721 transform: (v) => v, 27722 }; 27723 const alpha = Object.assign(Object.assign({}, number), { transform: utils_clamp(0, 1) }); 27724 const scale = Object.assign(Object.assign({}, number), { default: 1 }); 27725 27726 27727 27728 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/utils.mjs 27729 27730 27731 const isColorString = (type, testProp) => (v) => { 27732 return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) || 27733 (testProp && Object.prototype.hasOwnProperty.call(v, testProp))); 27734 }; 27735 const splitColor = (aName, bName, cName) => (v) => { 27736 if (!isString(v)) 27737 return v; 27738 const [a, b, c, alpha] = v.match(floatRegex); 27739 return { 27740 [aName]: parseFloat(a), 27741 [bName]: parseFloat(b), 27742 [cName]: parseFloat(c), 27743 alpha: alpha !== undefined ? parseFloat(alpha) : 1, 27744 }; 27745 }; 27746 27747 27748 27749 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/rgba.mjs 27750 27751 27752 27753 27754 const clampRgbUnit = utils_clamp(0, 255); 27755 const rgbUnit = Object.assign(Object.assign({}, number), { transform: (v) => Math.round(clampRgbUnit(v)) }); 27756 const rgba_rgba = { 27757 test: isColorString('rgb', 'red'), 27758 parse: splitColor('red', 'green', 'blue'), 27759 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => 'rgba(' + 27760 rgbUnit.transform(red) + 27761 ', ' + 27762 rgbUnit.transform(green) + 27763 ', ' + 27764 rgbUnit.transform(blue) + 27765 ', ' + 27766 sanitize(alpha.transform(alpha$1)) + 27767 ')', 27768 }; 27769 27770 27771 27772 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hex.mjs 27773 27774 27775 27776 function parseHex(v) { 27777 let r = ''; 27778 let g = ''; 27779 let b = ''; 27780 let a = ''; 27781 if (v.length > 5) { 27782 r = v.substr(1, 2); 27783 g = v.substr(3, 2); 27784 b = v.substr(5, 2); 27785 a = v.substr(7, 2); 27786 } 27787 else { 27788 r = v.substr(1, 1); 27789 g = v.substr(2, 1); 27790 b = v.substr(3, 1); 27791 a = v.substr(4, 1); 27792 r += r; 27793 g += g; 27794 b += b; 27795 a += a; 27796 } 27797 return { 27798 red: parseInt(r, 16), 27799 green: parseInt(g, 16), 27800 blue: parseInt(b, 16), 27801 alpha: a ? parseInt(a, 16) / 255 : 1, 27802 }; 27803 } 27804 const hex = { 27805 test: isColorString('#'), 27806 parse: parseHex, 27807 transform: rgba_rgba.transform, 27808 }; 27809 27810 27811 27812 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/units.mjs 27813 27814 27815 const createUnitType = (unit) => ({ 27816 test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1, 27817 parse: parseFloat, 27818 transform: (v) => `${v}${unit}`, 27819 }); 27820 const degrees = createUnitType('deg'); 27821 const percent = createUnitType('%'); 27822 const px = createUnitType('px'); 27823 const vh = createUnitType('vh'); 27824 const vw = createUnitType('vw'); 27825 const progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) }); 27826 27827 27828 27829 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hsla.mjs 27830 27831 27832 27833 27834 27835 const hsla = { 27836 test: isColorString('hsl', 'hue'), 27837 parse: splitColor('hue', 'saturation', 'lightness'), 27838 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { 27839 return ('hsla(' + 27840 Math.round(hue) + 27841 ', ' + 27842 percent.transform(sanitize(saturation)) + 27843 ', ' + 27844 percent.transform(sanitize(lightness)) + 27845 ', ' + 27846 sanitize(alpha.transform(alpha$1)) + 27847 ')'); 27848 }, 27849 }; 27850 27851 27852 27853 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/hsla-to-rgba.mjs 27854 function hueToRgb(p, q, t) { 27855 if (t < 0) 27856 t += 1; 27857 if (t > 1) 27858 t -= 1; 27859 if (t < 1 / 6) 27860 return p + (q - p) * 6 * t; 27861 if (t < 1 / 2) 27862 return q; 27863 if (t < 2 / 3) 27864 return p + (q - p) * (2 / 3 - t) * 6; 27865 return p; 27866 } 27867 function hslaToRgba({ hue, saturation, lightness, alpha }) { 27868 hue /= 360; 27869 saturation /= 100; 27870 lightness /= 100; 27871 let red = 0; 27872 let green = 0; 27873 let blue = 0; 27874 if (!saturation) { 27875 red = green = blue = lightness; 27876 } 27877 else { 27878 const q = lightness < 0.5 27879 ? lightness * (1 + saturation) 27880 : lightness + saturation - lightness * saturation; 27881 const p = 2 * lightness - q; 27882 red = hueToRgb(p, q, hue + 1 / 3); 27883 green = hueToRgb(p, q, hue); 27884 blue = hueToRgb(p, q, hue - 1 / 3); 27885 } 27886 return { 27887 red: Math.round(red * 255), 27888 green: Math.round(green * 255), 27889 blue: Math.round(blue * 255), 27890 alpha, 27891 }; 27892 } 27893 27894 27895 27896 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-color.mjs 27897 27898 27899 27900 27901 27902 const mixLinearColor = (from, to, v) => { 27903 const fromExpo = from * from; 27904 const toExpo = to * to; 27905 return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo)); 27906 }; 27907 const colorTypes = [hex, rgba_rgba, hsla]; 27908 const getColorType = (v) => colorTypes.find((type) => type.test(v)); 27909 const notAnimatable = (color) => `'${color}' is not an animatable color. Use the equivalent color code instead.`; 27910 const mixColor = (from, to) => { 27911 let fromColorType = getColorType(from); 27912 let toColorType = getColorType(to); 27913 invariant(!!fromColorType, notAnimatable(from)); 27914 invariant(!!toColorType, notAnimatable(to)); 27915 let fromColor = fromColorType.parse(from); 27916 let toColor = toColorType.parse(to); 27917 if (fromColorType === hsla) { 27918 fromColor = hslaToRgba(fromColor); 27919 fromColorType = rgba_rgba; 27920 } 27921 if (toColorType === hsla) { 27922 toColor = hslaToRgba(toColor); 27923 toColorType = rgba_rgba; 27924 } 27925 const blended = Object.assign({}, fromColor); 27926 return (v) => { 27927 for (const key in blended) { 27928 if (key !== "alpha") { 27929 blended[key] = mixLinearColor(fromColor[key], toColor[key], v); 27930 } 27931 } 27932 blended.alpha = mix(fromColor.alpha, toColor.alpha, v); 27933 return fromColorType.transform(blended); 27934 }; 27935 }; 27936 27937 27938 27939 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/index.mjs 27940 27941 27942 27943 27944 27945 const color = { 27946 test: (v) => rgba_rgba.test(v) || hex.test(v) || hsla.test(v), 27947 parse: (v) => { 27948 if (rgba_rgba.test(v)) { 27949 return rgba_rgba.parse(v); 27950 } 27951 else if (hsla.test(v)) { 27952 return hsla.parse(v); 27953 } 27954 else { 27955 return hex.parse(v); 27956 } 27957 }, 27958 transform: (v) => { 27959 return isString(v) 27960 ? v 27961 : v.hasOwnProperty('red') 27962 ? rgba_rgba.transform(v) 27963 : hsla.transform(v); 27964 }, 27965 }; 27966 27967 27968 27969 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/index.mjs 27970 27971 27972 27973 27974 const colorToken = '${c}'; 27975 const numberToken = '${n}'; 27976 function test(v) { 27977 var _a, _b, _c, _d; 27978 return (isNaN(v) && 27979 isString(v) && 27980 ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0); 27981 } 27982 function analyse(v) { 27983 if (typeof v === 'number') 27984 v = `${v}`; 27985 const values = []; 27986 let numColors = 0; 27987 const colors = v.match(colorRegex); 27988 if (colors) { 27989 numColors = colors.length; 27990 v = v.replace(colorRegex, colorToken); 27991 values.push(...colors.map(color.parse)); 27992 } 27993 const numbers = v.match(floatRegex); 27994 if (numbers) { 27995 v = v.replace(floatRegex, numberToken); 27996 values.push(...numbers.map(number.parse)); 27997 } 27998 return { values, numColors, tokenised: v }; 27999 } 28000 function complex_parse(v) { 28001 return analyse(v).values; 28002 } 28003 function createTransformer(v) { 28004 const { values, numColors, tokenised } = analyse(v); 28005 const numValues = values.length; 28006 return (v) => { 28007 let output = tokenised; 28008 for (let i = 0; i < numValues; i++) { 28009 output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i])); 28010 } 28011 return output; 28012 }; 28013 } 28014 const convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v; 28015 function getAnimatableNone(v) { 28016 const parsed = complex_parse(v); 28017 const transformer = createTransformer(v); 28018 return transformer(parsed.map(convertNumbersToZero)); 28019 } 28020 const complex = { test, parse: complex_parse, createTransformer, getAnimatableNone }; 28021 28022 28023 28024 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/inc.mjs 28025 const zeroPoint = { 28026 x: 0, 28027 y: 0, 28028 z: 0 28029 }; 28030 const isNum = (v) => typeof v === 'number'; 28031 28032 28033 28034 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/pipe.mjs 28035 const combineFunctions = (a, b) => (v) => b(a(v)); 28036 const pipe = (...transformers) => transformers.reduce(combineFunctions); 28037 28038 28039 28040 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-complex.mjs 28041 28042 28043 28044 28045 28046 28047 28048 function getMixer(origin, target) { 28049 if (isNum(origin)) { 28050 return (v) => mix(origin, target, v); 28051 } 28052 else if (color.test(origin)) { 28053 return mixColor(origin, target); 28054 } 28055 else { 28056 return mixComplex(origin, target); 28057 } 28058 } 28059 const mixArray = (from, to) => { 28060 const output = [...from]; 28061 const numValues = output.length; 28062 const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i])); 28063 return (v) => { 28064 for (let i = 0; i < numValues; i++) { 28065 output[i] = blendValue[i](v); 28066 } 28067 return output; 28068 }; 28069 }; 28070 const mixObject = (origin, target) => { 28071 const output = Object.assign(Object.assign({}, origin), target); 28072 const blendValue = {}; 28073 for (const key in output) { 28074 if (origin[key] !== undefined && target[key] !== undefined) { 28075 blendValue[key] = getMixer(origin[key], target[key]); 28076 } 28077 } 28078 return (v) => { 28079 for (const key in blendValue) { 28080 output[key] = blendValue[key](v); 28081 } 28082 return output; 28083 }; 28084 }; 28085 function mix_complex_analyse(value) { 28086 const parsed = complex.parse(value); 28087 const numValues = parsed.length; 28088 let numNumbers = 0; 28089 let numRGB = 0; 28090 let numHSL = 0; 28091 for (let i = 0; i < numValues; i++) { 28092 if (numNumbers || typeof parsed[i] === "number") { 28093 numNumbers++; 28094 } 28095 else { 28096 if (parsed[i].hue !== undefined) { 28097 numHSL++; 28098 } 28099 else { 28100 numRGB++; 28101 } 28102 } 28103 } 28104 return { parsed, numNumbers, numRGB, numHSL }; 28105 } 28106 const mixComplex = (origin, target) => { 28107 const template = complex.createTransformer(target); 28108 const originStats = mix_complex_analyse(origin); 28109 const targetStats = mix_complex_analyse(target); 28110 const canInterpolate = originStats.numHSL === targetStats.numHSL && 28111 originStats.numRGB === targetStats.numRGB && 28112 originStats.numNumbers >= targetStats.numNumbers; 28113 if (canInterpolate) { 28114 return pipe(mixArray(originStats.parsed, targetStats.parsed), template); 28115 } 28116 else { 28117 warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`); 28118 return (p) => `${p > 0 ? target : origin}`; 28119 } 28120 }; 28121 28122 28123 28124 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/interpolate.mjs 28125 28126 28127 28128 28129 28130 28131 28132 28133 28134 const mixNumber = (from, to) => (p) => mix(from, to, p); 28135 function detectMixerFactory(v) { 28136 if (typeof v === 'number') { 28137 return mixNumber; 28138 } 28139 else if (typeof v === 'string') { 28140 if (color.test(v)) { 28141 return mixColor; 28142 } 28143 else { 28144 return mixComplex; 28145 } 28146 } 28147 else if (Array.isArray(v)) { 28148 return mixArray; 28149 } 28150 else if (typeof v === 'object') { 28151 return mixObject; 28152 } 28153 } 28154 function createMixers(output, ease, customMixer) { 28155 const mixers = []; 28156 const mixerFactory = customMixer || detectMixerFactory(output[0]); 28157 const numMixers = output.length - 1; 28158 for (let i = 0; i < numMixers; i++) { 28159 let mixer = mixerFactory(output[i], output[i + 1]); 28160 if (ease) { 28161 const easingFunction = Array.isArray(ease) ? ease[i] : ease; 28162 mixer = pipe(easingFunction, mixer); 28163 } 28164 mixers.push(mixer); 28165 } 28166 return mixers; 28167 } 28168 function fastInterpolate([from, to], [mixer]) { 28169 return (v) => mixer(progress(from, to, v)); 28170 } 28171 function slowInterpolate(input, mixers) { 28172 const inputLength = input.length; 28173 const lastInputIndex = inputLength - 1; 28174 return (v) => { 28175 let mixerIndex = 0; 28176 let foundMixerIndex = false; 28177 if (v <= input[0]) { 28178 foundMixerIndex = true; 28179 } 28180 else if (v >= input[lastInputIndex]) { 28181 mixerIndex = lastInputIndex - 1; 28182 foundMixerIndex = true; 28183 } 28184 if (!foundMixerIndex) { 28185 let i = 1; 28186 for (; i < inputLength; i++) { 28187 if (input[i] > v || i === lastInputIndex) { 28188 break; 28189 } 28190 } 28191 mixerIndex = i - 1; 28192 } 28193 const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v); 28194 return mixers[mixerIndex](progressInRange); 28195 }; 28196 } 28197 function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { 28198 const inputLength = input.length; 28199 invariant(inputLength === output.length, 'Both input and output ranges must be the same length'); 28200 invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.'); 28201 if (input[0] > input[inputLength - 1]) { 28202 input = [].concat(input); 28203 output = [].concat(output); 28204 input.reverse(); 28205 output.reverse(); 28206 } 28207 const mixers = createMixers(output, ease, mixer); 28208 const interpolator = inputLength === 2 28209 ? fastInterpolate(input, mixers) 28210 : slowInterpolate(input, mixers); 28211 return isClamp 28212 ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) 28213 : interpolator; 28214 } 28215 28216 28217 28218 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/utils.mjs 28219 const reverseEasing = easing => p => 1 - easing(1 - p); 28220 const mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; 28221 const createExpoIn = (power) => p => Math.pow(p, power); 28222 const createBackIn = (power) => p => p * p * ((power + 1) * p - power); 28223 const createAnticipate = (power) => { 28224 const backEasing = createBackIn(power); 28225 return p => (p *= 2) < 1 28226 ? 0.5 * backEasing(p) 28227 : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); 28228 }; 28229 28230 28231 28232 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/index.mjs 28233 28234 28235 const DEFAULT_OVERSHOOT_STRENGTH = 1.525; 28236 const BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0; 28237 const BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0; 28238 const BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0; 28239 const linear = p => p; 28240 const easeIn = createExpoIn(2); 28241 const easeOut = reverseEasing(easeIn); 28242 const easeInOut = mirrorEasing(easeIn); 28243 const circIn = p => 1 - Math.sin(Math.acos(p)); 28244 const circOut = reverseEasing(circIn); 28245 const circInOut = mirrorEasing(circOut); 28246 const backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH); 28247 const backOut = reverseEasing(backIn); 28248 const backInOut = mirrorEasing(backIn); 28249 const anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH); 28250 const ca = 4356.0 / 361.0; 28251 const cb = 35442.0 / 1805.0; 28252 const cc = 16061.0 / 1805.0; 28253 const bounceOut = (p) => { 28254 if (p === 1 || p === 0) 28255 return p; 28256 const p2 = p * p; 28257 return p < BOUNCE_FIRST_THRESHOLD 28258 ? 7.5625 * p2 28259 : p < BOUNCE_SECOND_THRESHOLD 28260 ? 9.075 * p2 - 9.9 * p + 3.4 28261 : p < BOUNCE_THIRD_THRESHOLD 28262 ? ca * p2 - cb * p + cc 28263 : 10.8 * p * p - 20.52 * p + 10.72; 28264 }; 28265 const bounceIn = reverseEasing(bounceOut); 28266 const bounceInOut = (p) => p < 0.5 28267 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) 28268 : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5; 28269 28270 28271 28272 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/keyframes.mjs 28273 28274 28275 28276 function defaultEasing(values, easing) { 28277 return values.map(() => easing || easeInOut).splice(0, values.length - 1); 28278 } 28279 function defaultOffset(values) { 28280 const numValues = values.length; 28281 return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0); 28282 } 28283 function convertOffsetToTimes(offset, duration) { 28284 return offset.map((o) => o * duration); 28285 } 28286 function keyframes_keyframes({ from = 0, to = 1, ease, offset, duration = 300, }) { 28287 const state = { done: false, value: from }; 28288 const values = Array.isArray(to) ? to : [from, to]; 28289 const times = convertOffsetToTimes(offset && offset.length === values.length 28290 ? offset 28291 : defaultOffset(values), duration); 28292 function createInterpolator() { 28293 return interpolate(times, values, { 28294 ease: Array.isArray(ease) ? ease : defaultEasing(values, ease), 28295 }); 28296 } 28297 let interpolator = createInterpolator(); 28298 return { 28299 next: (t) => { 28300 state.value = interpolator(t); 28301 state.done = t >= duration; 28302 return state; 28303 }, 28304 flipTarget: () => { 28305 values.reverse(); 28306 interpolator = createInterpolator(); 28307 }, 28308 }; 28309 } 28310 28311 28312 28313 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/decay.mjs 28314 function decay({ velocity = 0, from = 0, power = 0.8, timeConstant = 350, restDelta = 0.5, modifyTarget, }) { 28315 const state = { done: false, value: from }; 28316 let amplitude = power * velocity; 28317 const ideal = from + amplitude; 28318 const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); 28319 if (target !== ideal) 28320 amplitude = target - from; 28321 return { 28322 next: (t) => { 28323 const delta = -amplitude * Math.exp(-t / timeConstant); 28324 state.done = !(delta > restDelta || delta < -restDelta); 28325 state.value = state.done ? target : target + delta; 28326 return state; 28327 }, 28328 flipTarget: () => { }, 28329 }; 28330 } 28331 28332 28333 28334 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.mjs 28335 28336 28337 28338 28339 const types = { keyframes: keyframes_keyframes, spring: spring, decay: decay }; 28340 function detectAnimationFromOptions(config) { 28341 if (Array.isArray(config.to)) { 28342 return keyframes_keyframes; 28343 } 28344 else if (types[config.type]) { 28345 return types[config.type]; 28346 } 28347 const keys = new Set(Object.keys(config)); 28348 if (keys.has("ease") || 28349 (keys.has("duration") && !keys.has("dampingRatio"))) { 28350 return keyframes_keyframes; 28351 } 28352 else if (keys.has("dampingRatio") || 28353 keys.has("stiffness") || 28354 keys.has("mass") || 28355 keys.has("damping") || 28356 keys.has("restSpeed") || 28357 keys.has("restDelta")) { 28358 return spring; 28359 } 28360 return keyframes_keyframes; 28361 } 28362 28363 28364 28365 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/elapsed.mjs 28366 function loopElapsed(elapsed, duration, delay = 0) { 28367 return elapsed - duration - delay; 28368 } 28369 function reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) { 28370 return isForwardPlayback 28371 ? loopElapsed(duration + -elapsed, duration, delay) 28372 : duration - (elapsed - duration) + delay; 28373 } 28374 function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) { 28375 return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay; 28376 } 28377 28378 28379 28380 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/index.mjs 28381 28382 28383 28384 28385 28386 28387 const framesync = (update) => { 28388 const passTimestamp = ({ delta }) => update(delta); 28389 return { 28390 start: () => es.update(passTimestamp, true), 28391 stop: () => cancelSync.update(passTimestamp), 28392 }; 28393 }; 28394 function animate(_a) { 28395 var _b, _c; 28396 var { from, autoplay = true, driver = framesync, elapsed = 0, repeat: repeatMax = 0, repeatType = "loop", repeatDelay = 0, onPlay, onStop, onComplete, onRepeat, onUpdate } = _a, options = __rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]); 28397 let { to } = options; 28398 let driverControls; 28399 let repeatCount = 0; 28400 let computedDuration = options.duration; 28401 let latest; 28402 let isComplete = false; 28403 let isForwardPlayback = true; 28404 let interpolateFromNumber; 28405 const animator = detectAnimationFromOptions(options); 28406 if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) { 28407 interpolateFromNumber = interpolate([0, 100], [from, to], { 28408 clamp: false, 28409 }); 28410 from = 0; 28411 to = 100; 28412 } 28413 const animation = animator(Object.assign(Object.assign({}, options), { from, to })); 28414 function repeat() { 28415 repeatCount++; 28416 if (repeatType === "reverse") { 28417 isForwardPlayback = repeatCount % 2 === 0; 28418 elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback); 28419 } 28420 else { 28421 elapsed = loopElapsed(elapsed, computedDuration, repeatDelay); 28422 if (repeatType === "mirror") 28423 animation.flipTarget(); 28424 } 28425 isComplete = false; 28426 onRepeat && onRepeat(); 28427 } 28428 function complete() { 28429 driverControls.stop(); 28430 onComplete && onComplete(); 28431 } 28432 function update(delta) { 28433 if (!isForwardPlayback) 28434 delta = -delta; 28435 elapsed += delta; 28436 if (!isComplete) { 28437 const state = animation.next(Math.max(0, elapsed)); 28438 latest = state.value; 28439 if (interpolateFromNumber) 28440 latest = interpolateFromNumber(latest); 28441 isComplete = isForwardPlayback ? state.done : elapsed <= 0; 28442 } 28443 onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest); 28444 if (isComplete) { 28445 if (repeatCount === 0) 28446 computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed); 28447 if (repeatCount < repeatMax) { 28448 hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat(); 28449 } 28450 else { 28451 complete(); 28452 } 28453 } 28454 } 28455 function play() { 28456 onPlay === null || onPlay === void 0 ? void 0 : onPlay(); 28457 driverControls = driver(update); 28458 driverControls.start(); 28459 } 28460 autoplay && play(); 28461 return { 28462 stop: () => { 28463 onStop === null || onStop === void 0 ? void 0 : onStop(); 28464 driverControls.stop(); 28465 }, 28466 }; 28467 } 28468 28469 28470 28471 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/inertia.mjs 28472 28473 28474 28475 28476 function inertia({ from = 0, velocity = 0, min, max, power = 0.8, timeConstant = 750, bounceStiffness = 500, bounceDamping = 10, restDelta = 1, modifyTarget, driver, onUpdate, onComplete, onStop, }) { 28477 let currentAnimation; 28478 function isOutOfBounds(v) { 28479 return (min !== undefined && v < min) || (max !== undefined && v > max); 28480 } 28481 function boundaryNearest(v) { 28482 if (min === undefined) 28483 return max; 28484 if (max === undefined) 28485 return min; 28486 return Math.abs(min - v) < Math.abs(max - v) ? min : max; 28487 } 28488 function startAnimation(options) { 28489 currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); 28490 currentAnimation = animate(Object.assign(Object.assign({}, options), { driver, onUpdate: (v) => { 28491 var _a; 28492 onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v); 28493 (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v); 28494 }, onComplete, 28495 onStop })); 28496 } 28497 function startSpring(options) { 28498 startAnimation(Object.assign({ type: "spring", stiffness: bounceStiffness, damping: bounceDamping, restDelta }, options)); 28499 } 28500 if (isOutOfBounds(from)) { 28501 startSpring({ from, velocity, to: boundaryNearest(from) }); 28502 } 28503 else { 28504 let target = power * velocity + from; 28505 if (typeof modifyTarget !== "undefined") 28506 target = modifyTarget(target); 28507 const boundary = boundaryNearest(target); 28508 const heading = boundary === min ? -1 : 1; 28509 let prev; 28510 let current; 28511 const checkBoundary = (v) => { 28512 prev = current; 28513 current = v; 28514 velocity = velocityPerSecond(v - prev, getFrameData().delta); 28515 if ((heading === 1 && v > boundary) || 28516 (heading === -1 && v < boundary)) { 28517 startSpring({ from: v, to: boundary, velocity }); 28518 } 28519 }; 28520 startAnimation({ 28521 type: "decay", 28522 from, 28523 velocity, 28524 timeConstant, 28525 power, 28526 restDelta, 28527 modifyTarget, 28528 onUpdate: isOutOfBounds(target) ? checkBoundary : undefined, 28529 }); 28530 } 28531 return { 28532 stop: () => currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(), 28533 }; 28534 } 28535 28536 28537 28538 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/time-conversion.mjs 28539 /** 28540 * Converts seconds to milliseconds 28541 * 28542 * @param seconds - Time in seconds. 28543 * @return milliseconds - Converted time in milliseconds. 28544 */ 28545 var secondsToMilliseconds = function (seconds) { return seconds * 1000; }; 28546 28547 28548 28549 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/cubic-bezier.mjs 28550 28551 28552 const cubic_bezier_a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1; 28553 const cubic_bezier_b = (a1, a2) => 3.0 * a2 - 6.0 * a1; 28554 const cubic_bezier_c = (a1) => 3.0 * a1; 28555 const calcBezier = (t, a1, a2) => ((cubic_bezier_a(a1, a2) * t + cubic_bezier_b(a1, a2)) * t + cubic_bezier_c(a1)) * t; 28556 const getSlope = (t, a1, a2) => 3.0 * cubic_bezier_a(a1, a2) * t * t + 2.0 * cubic_bezier_b(a1, a2) * t + cubic_bezier_c(a1); 28557 const subdivisionPrecision = 0.0000001; 28558 const subdivisionMaxIterations = 10; 28559 function binarySubdivide(aX, aA, aB, mX1, mX2) { 28560 let currentX; 28561 let currentT; 28562 let i = 0; 28563 do { 28564 currentT = aA + (aB - aA) / 2.0; 28565 currentX = calcBezier(currentT, mX1, mX2) - aX; 28566 if (currentX > 0.0) { 28567 aB = currentT; 28568 } 28569 else { 28570 aA = currentT; 28571 } 28572 } while (Math.abs(currentX) > subdivisionPrecision && 28573 ++i < subdivisionMaxIterations); 28574 return currentT; 28575 } 28576 const newtonIterations = 8; 28577 const newtonMinSlope = 0.001; 28578 function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { 28579 for (let i = 0; i < newtonIterations; ++i) { 28580 const currentSlope = getSlope(aGuessT, mX1, mX2); 28581 if (currentSlope === 0.0) { 28582 return aGuessT; 28583 } 28584 const currentX = calcBezier(aGuessT, mX1, mX2) - aX; 28585 aGuessT -= currentX / currentSlope; 28586 } 28587 return aGuessT; 28588 } 28589 const kSplineTableSize = 11; 28590 const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); 28591 function cubicBezier(mX1, mY1, mX2, mY2) { 28592 if (mX1 === mY1 && mX2 === mY2) 28593 return linear; 28594 const sampleValues = new Float32Array(kSplineTableSize); 28595 for (let i = 0; i < kSplineTableSize; ++i) { 28596 sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); 28597 } 28598 function getTForX(aX) { 28599 let intervalStart = 0.0; 28600 let currentSample = 1; 28601 const lastSample = kSplineTableSize - 1; 28602 for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { 28603 intervalStart += kSampleStepSize; 28604 } 28605 --currentSample; 28606 const dist = (aX - sampleValues[currentSample]) / 28607 (sampleValues[currentSample + 1] - sampleValues[currentSample]); 28608 const guessForT = intervalStart + dist * kSampleStepSize; 28609 const initialSlope = getSlope(guessForT, mX1, mX2); 28610 if (initialSlope >= newtonMinSlope) { 28611 return newtonRaphsonIterate(aX, guessForT, mX1, mX2); 28612 } 28613 else if (initialSlope === 0.0) { 28614 return guessForT; 28615 } 28616 else { 28617 return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); 28618 } 28619 } 28620 return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); 28621 } 28622 28623 28624 28625 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/easing.mjs 28626 28627 28628 28629 28630 var easingLookup = { 28631 linear: linear, 28632 easeIn: easeIn, 28633 easeInOut: easeInOut, 28634 easeOut: easeOut, 28635 circIn: circIn, 28636 circInOut: circInOut, 28637 circOut: circOut, 28638 backIn: backIn, 28639 backInOut: backInOut, 28640 backOut: backOut, 28641 anticipate: anticipate, 28642 bounceIn: bounceIn, 28643 bounceInOut: bounceInOut, 28644 bounceOut: bounceOut, 28645 }; 28646 var easingDefinitionToFunction = function (definition) { 28647 if (Array.isArray(definition)) { 28648 // If cubic bezier definition, create bezier curve 28649 invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); 28650 var _a = tslib_es6_read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3]; 28651 return cubicBezier(x1, y1, x2, y2); 28652 } 28653 else if (typeof definition === "string") { 28654 // Else lookup from table 28655 invariant(easingLookup[definition] !== undefined, "Invalid easing type '".concat(definition, "'")); 28656 return easingLookup[definition]; 28657 } 28658 return definition; 28659 }; 28660 var isEasingArray = function (ease) { 28661 return Array.isArray(ease) && typeof ease[0] !== "number"; 28662 }; 28663 28664 28665 28666 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs 28667 28668 28669 /** 28670 * Check if a value is animatable. Examples: 28671 * 28672 * ✅: 100, "100px", "#fff" 28673 * ❌: "block", "url(2.jpg)" 28674 * @param value 28675 * 28676 * @internal 28677 */ 28678 var isAnimatable = function (key, value) { 28679 // If the list of keys tat might be non-animatable grows, replace with Set 28680 if (key === "zIndex") 28681 return false; 28682 // If it's a number or a keyframes array, we can animate it. We might at some point 28683 // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, 28684 // but for now lets leave it like this for performance reasons 28685 if (typeof value === "number" || Array.isArray(value)) 28686 return true; 28687 if (typeof value === "string" && // It's animatable if we have a string 28688 complex.test(value) && // And it contains numbers and/or colors 28689 !value.startsWith("url(") // Unless it starts with "url(" 28690 ) { 28691 return true; 28692 } 28693 return false; 28694 }; 28695 28696 28697 28698 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs 28699 var isKeyframesTarget = function (v) { 28700 return Array.isArray(v); 28701 }; 28702 28703 28704 28705 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs 28706 28707 28708 28709 var underDampedSpring = function () { return ({ 28710 type: "spring", 28711 stiffness: 500, 28712 damping: 25, 28713 restSpeed: 10, 28714 }); }; 28715 var criticallyDampedSpring = function (to) { return ({ 28716 type: "spring", 28717 stiffness: 550, 28718 damping: to === 0 ? 2 * Math.sqrt(550) : 30, 28719 restSpeed: 10, 28720 }); }; 28721 var linearTween = function () { return ({ 28722 type: "keyframes", 28723 ease: "linear", 28724 duration: 0.3, 28725 }); }; 28726 var default_transitions_keyframes = function (values) { return ({ 28727 type: "keyframes", 28728 duration: 0.8, 28729 values: values, 28730 }); }; 28731 var defaultTransitions = { 28732 x: underDampedSpring, 28733 y: underDampedSpring, 28734 z: underDampedSpring, 28735 rotate: underDampedSpring, 28736 rotateX: underDampedSpring, 28737 rotateY: underDampedSpring, 28738 rotateZ: underDampedSpring, 28739 scaleX: criticallyDampedSpring, 28740 scaleY: criticallyDampedSpring, 28741 scale: criticallyDampedSpring, 28742 opacity: linearTween, 28743 backgroundColor: linearTween, 28744 color: linearTween, 28745 default: criticallyDampedSpring, 28746 }; 28747 var getDefaultTransition = function (valueKey, to) { 28748 var transitionFactory; 28749 if (isKeyframesTarget(to)) { 28750 transitionFactory = default_transitions_keyframes; 28751 } 28752 else { 28753 transitionFactory = 28754 defaultTransitions[valueKey] || defaultTransitions.default; 28755 } 28756 return __assign({ to: to }, transitionFactory(to)); 28757 }; 28758 28759 28760 28761 ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/filter.mjs 28762 28763 28764 28765 const maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']); 28766 function applyDefaultFilter(v) { 28767 let [name, value] = v.slice(0, -1).split('('); 28768 if (name === 'drop-shadow') 28769 return v; 28770 const [number] = value.match(floatRegex) || []; 28771 if (!number) 28772 return v; 28773 const unit = value.replace(number, ''); 28774 let defaultValue = maxDefaults.has(name) ? 1 : 0; 28775 if (number !== value) 28776 defaultValue *= 100; 28777 return name + '(' + defaultValue + unit + ')'; 28778 } 28779 const functionRegex = /([a-z-]*)\(.*?\)/g; 28780 const filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v) => { 28781 const functions = v.match(functionRegex); 28782 return functions ? functions.map(applyDefaultFilter).join(' ') : v; 28783 } }); 28784 28785 28786 28787 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs 28788 28789 28790 28791 var type_int_int = __assign(__assign({}, number), { transform: Math.round }); 28792 28793 28794 28795 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs 28796 28797 28798 28799 var numberValueTypes = { 28800 // Border props 28801 borderWidth: px, 28802 borderTopWidth: px, 28803 borderRightWidth: px, 28804 borderBottomWidth: px, 28805 borderLeftWidth: px, 28806 borderRadius: px, 28807 radius: px, 28808 borderTopLeftRadius: px, 28809 borderTopRightRadius: px, 28810 borderBottomRightRadius: px, 28811 borderBottomLeftRadius: px, 28812 // Positioning props 28813 width: px, 28814 maxWidth: px, 28815 height: px, 28816 maxHeight: px, 28817 size: px, 28818 top: px, 28819 right: px, 28820 bottom: px, 28821 left: px, 28822 // Spacing props 28823 padding: px, 28824 paddingTop: px, 28825 paddingRight: px, 28826 paddingBottom: px, 28827 paddingLeft: px, 28828 margin: px, 28829 marginTop: px, 28830 marginRight: px, 28831 marginBottom: px, 28832 marginLeft: px, 28833 // Transform props 28834 rotate: degrees, 28835 rotateX: degrees, 28836 rotateY: degrees, 28837 rotateZ: degrees, 28838 scale: scale, 28839 scaleX: scale, 28840 scaleY: scale, 28841 scaleZ: scale, 28842 skew: degrees, 28843 skewX: degrees, 28844 skewY: degrees, 28845 distance: px, 28846 translateX: px, 28847 translateY: px, 28848 translateZ: px, 28849 x: px, 28850 y: px, 28851 z: px, 28852 perspective: px, 28853 transformPerspective: px, 28854 opacity: alpha, 28855 originX: progressPercentage, 28856 originY: progressPercentage, 28857 originZ: px, 28858 // Misc 28859 zIndex: type_int_int, 28860 // SVG 28861 fillOpacity: alpha, 28862 strokeOpacity: alpha, 28863 numOctaves: type_int_int, 28864 }; 28865 28866 28867 28868 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs 28869 28870 28871 28872 28873 /** 28874 * A map of default value types for common values 28875 */ 28876 var defaultValueTypes = __assign(__assign({}, numberValueTypes), { 28877 // Color props 28878 color: color, backgroundColor: color, outlineColor: color, fill: color, stroke: color, 28879 // Border props 28880 borderColor: color, borderTopColor: color, borderRightColor: color, borderBottomColor: color, borderLeftColor: color, filter: filter, WebkitFilter: filter }); 28881 /** 28882 * Gets the default ValueType for the provided value key 28883 */ 28884 var getDefaultValueType = function (key) { return defaultValueTypes[key]; }; 28885 28886 28887 28888 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs 28889 28890 28891 28892 function animatable_none_getAnimatableNone(key, value) { 28893 var _a; 28894 var defaultValueType = getDefaultValueType(key); 28895 if (defaultValueType !== filter) 28896 defaultValueType = complex; 28897 // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target 28898 return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); 28899 } 28900 28901 28902 28903 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs 28904 var instantAnimationState = { 28905 current: false, 28906 }; 28907 28908 28909 28910 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs 28911 28912 28913 var isCustomValue = function (v) { 28914 return Boolean(v && typeof v === "object" && v.mix && v.toValue); 28915 }; 28916 var resolveFinalValueInKeyframes = function (v) { 28917 // TODO maybe throw if v.length - 1 is placeholder token? 28918 return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; 28919 }; 28920 28921 28922 28923 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/transitions.mjs 28924 28925 28926 28927 28928 28929 28930 28931 28932 28933 28934 28935 /** 28936 * Decide whether a transition is defined on a given Transition. 28937 * This filters out orchestration options and returns true 28938 * if any options are left. 28939 */ 28940 function isTransitionDefined(_a) { 28941 _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); 28942 return !!Object.keys(transition).length; 28943 } 28944 var legacyRepeatWarning = false; 28945 /** 28946 * Convert Framer Motion's Transition type into Popmotion-compatible options. 28947 */ 28948 function convertTransitionToAnimationOptions(_a) { 28949 var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); 28950 var options = __assign({}, transition); 28951 if (times) 28952 options["offset"] = times; 28953 /** 28954 * Convert any existing durations from seconds to milliseconds 28955 */ 28956 if (transition.duration) 28957 options["duration"] = secondsToMilliseconds(transition.duration); 28958 if (transition.repeatDelay) 28959 options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); 28960 /** 28961 * Map easing names to Popmotion's easing functions 28962 */ 28963 if (ease) { 28964 options["ease"] = isEasingArray(ease) 28965 ? ease.map(easingDefinitionToFunction) 28966 : easingDefinitionToFunction(ease); 28967 } 28968 /** 28969 * Support legacy transition API 28970 */ 28971 if (transition.type === "tween") 28972 options.type = "keyframes"; 28973 /** 28974 * TODO: These options are officially removed from the API. 28975 */ 28976 if (yoyo || loop || flip) { 28977 warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); 28978 legacyRepeatWarning = true; 28979 if (yoyo) { 28980 options.repeatType = "reverse"; 28981 } 28982 else if (loop) { 28983 options.repeatType = "loop"; 28984 } 28985 else if (flip) { 28986 options.repeatType = "mirror"; 28987 } 28988 options.repeat = loop || yoyo || flip || transition.repeat; 28989 } 28990 /** 28991 * TODO: Popmotion 9 has the ability to automatically detect whether to use 28992 * a keyframes or spring animation, but does so by detecting velocity and other spring options. 28993 * It'd be good to introduce a similar thing here. 28994 */ 28995 if (transition.type !== "spring") 28996 options.type = "keyframes"; 28997 return options; 28998 } 28999 /** 29000 * Get the delay for a value by checking Transition with decreasing specificity. 29001 */ 29002 function getDelayFromTransition(transition, key) { 29003 var _a, _b; 29004 var valueTransition = getValueTransition(transition, key) || {}; 29005 return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0; 29006 } 29007 function hydrateKeyframes(options) { 29008 if (Array.isArray(options.to) && options.to[0] === null) { 29009 options.to = tslib_es6_spreadArray([], tslib_es6_read(options.to), false); 29010 options.to[0] = options.from; 29011 } 29012 return options; 29013 } 29014 function getPopmotionAnimationOptions(transition, options, key) { 29015 var _a; 29016 if (Array.isArray(options.to)) { 29017 (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8); 29018 } 29019 hydrateKeyframes(options); 29020 /** 29021 * Get a default transition if none is determined to be defined. 29022 */ 29023 if (!isTransitionDefined(transition)) { 29024 transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to)); 29025 } 29026 return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition)); 29027 } 29028 /** 29029 * 29030 */ 29031 function getAnimation(key, value, target, transition, onComplete) { 29032 var _a; 29033 var valueTransition = getValueTransition(transition, key); 29034 var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); 29035 var isTargetAnimatable = isAnimatable(key, target); 29036 if (origin === "none" && isTargetAnimatable && typeof target === "string") { 29037 /** 29038 * If we're trying to animate from "none", try and get an animatable version 29039 * of the target. This could be improved to work both ways. 29040 */ 29041 origin = animatable_none_getAnimatableNone(key, target); 29042 } 29043 else if (isZero(origin) && typeof target === "string") { 29044 origin = getZeroUnit(target); 29045 } 29046 else if (!Array.isArray(target) && 29047 isZero(target) && 29048 typeof origin === "string") { 29049 target = getZeroUnit(origin); 29050 } 29051 var isOriginAnimatable = isAnimatable(key, origin); 29052 warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate ".concat(key, " from \"").concat(origin, "\" to \"").concat(target, "\". ").concat(origin, " is not an animatable value - to enable this animation set ").concat(origin, " to a value animatable to ").concat(target, " via the `style` property.")); 29053 function start() { 29054 var options = { 29055 from: origin, 29056 to: target, 29057 velocity: value.getVelocity(), 29058 onComplete: onComplete, 29059 onUpdate: function (v) { return value.set(v); }, 29060 }; 29061 return valueTransition.type === "inertia" || 29062 valueTransition.type === "decay" 29063 ? inertia(__assign(__assign({}, options), valueTransition)) 29064 : animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) { 29065 var _a; 29066 options.onUpdate(v); 29067 (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); 29068 }, onComplete: function () { 29069 var _a; 29070 options.onComplete(); 29071 (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); 29072 } })); 29073 } 29074 function set() { 29075 var _a, _b; 29076 var finalTarget = resolveFinalValueInKeyframes(target); 29077 value.set(finalTarget); 29078 onComplete(); 29079 (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget); 29080 (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition); 29081 return { stop: function () { } }; 29082 } 29083 return !isOriginAnimatable || 29084 !isTargetAnimatable || 29085 valueTransition.type === false 29086 ? set 29087 : start; 29088 } 29089 function isZero(value) { 29090 return (value === 0 || 29091 (typeof value === "string" && 29092 parseFloat(value) === 0 && 29093 value.indexOf(" ") === -1)); 29094 } 29095 function getZeroUnit(potentialUnitType) { 29096 return typeof potentialUnitType === "number" 29097 ? 0 29098 : animatable_none_getAnimatableNone("", potentialUnitType); 29099 } 29100 function getValueTransition(transition, key) { 29101 return transition[key] || transition["default"] || transition; 29102 } 29103 /** 29104 * Start animation on a MotionValue. This function is an interface between 29105 * Framer Motion and Popmotion 29106 * 29107 * @internal 29108 */ 29109 function startAnimation(key, value, target, transition) { 29110 if (transition === void 0) { transition = {}; } 29111 if (instantAnimationState.current) { 29112 transition = { type: false }; 29113 } 29114 return value.start(function (onComplete) { 29115 var delayTimer; 29116 var controls; 29117 var animation = getAnimation(key, value, target, transition, onComplete); 29118 var delay = getDelayFromTransition(transition, key); 29119 var start = function () { return (controls = animation()); }; 29120 if (delay) { 29121 delayTimer = window.setTimeout(start, secondsToMilliseconds(delay)); 29122 } 29123 else { 29124 start(); 29125 } 29126 return function () { 29127 clearTimeout(delayTimer); 29128 controls === null || controls === void 0 ? void 0 : controls.stop(); 29129 }; 29130 }); 29131 } 29132 29133 29134 29135 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animate.mjs 29136 29137 29138 29139 29140 /** 29141 * Animate a single value or a `MotionValue`. 29142 * 29143 * The first argument is either a `MotionValue` to animate, or an initial animation value. 29144 * 29145 * The second is either a value to animate to, or an array of keyframes to animate through. 29146 * 29147 * The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`. 29148 * 29149 * Returns `AnimationPlaybackControls`, currently just a `stop` method. 29150 * 29151 * ```javascript 29152 * const x = useMotionValue(0) 29153 * 29154 * useEffect(() => { 29155 * const controls = animate(x, 100, { 29156 * type: "spring", 29157 * stiffness: 2000, 29158 * onComplete: v => {} 29159 * }) 29160 * 29161 * return controls.stop 29162 * }) 29163 * ``` 29164 * 29165 * @public 29166 */ 29167 function animate_animate(from, to, transition) { 29168 if (transition === void 0) { transition = {}; } 29169 var value = isMotionValue(from) ? from : motionValue(from); 29170 startAnimation("", value, to, transition); 29171 return { 29172 stop: function () { return value.stop(); }, 29173 isAnimating: function () { return value.isAnimating(); }, 29174 }; 29175 } 29176 29177 29178 29179 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs 29180 29181 29182 29183 var borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; 29184 var numBorders = borders.length; 29185 var asNumber = function (value) { 29186 return typeof value === "string" ? parseFloat(value) : value; 29187 }; 29188 var isPx = function (value) { 29189 return typeof value === "number" || px.test(value); 29190 }; 29191 function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { 29192 var _a, _b, _c, _d; 29193 if (shouldCrossfadeOpacity) { 29194 target.opacity = mix(0, 29195 // (follow?.opacity as number) ?? 0, 29196 // TODO Reinstate this if only child 29197 (_a = lead.opacity) !== null && _a !== void 0 ? _a : 1, easeCrossfadeIn(progress)); 29198 target.opacityExit = mix((_b = follow.opacity) !== null && _b !== void 0 ? _b : 1, 0, easeCrossfadeOut(progress)); 29199 } 29200 else if (isOnlyMember) { 29201 target.opacity = mix((_c = follow.opacity) !== null && _c !== void 0 ? _c : 1, (_d = lead.opacity) !== null && _d !== void 0 ? _d : 1, progress); 29202 } 29203 /** 29204 * Mix border radius 29205 */ 29206 for (var i = 0; i < numBorders; i++) { 29207 var borderLabel = "border".concat(borders[i], "Radius"); 29208 var followRadius = getRadius(follow, borderLabel); 29209 var leadRadius = getRadius(lead, borderLabel); 29210 if (followRadius === undefined && leadRadius === undefined) 29211 continue; 29212 followRadius || (followRadius = 0); 29213 leadRadius || (leadRadius = 0); 29214 var canMix = followRadius === 0 || 29215 leadRadius === 0 || 29216 isPx(followRadius) === isPx(leadRadius); 29217 if (canMix) { 29218 target[borderLabel] = Math.max(mix(asNumber(followRadius), asNumber(leadRadius), progress), 0); 29219 if (percent.test(leadRadius) || percent.test(followRadius)) { 29220 target[borderLabel] += "%"; 29221 } 29222 } 29223 else { 29224 target[borderLabel] = leadRadius; 29225 } 29226 } 29227 /** 29228 * Mix rotation 29229 */ 29230 if (follow.rotate || lead.rotate) { 29231 target.rotate = mix(follow.rotate || 0, lead.rotate || 0, progress); 29232 } 29233 } 29234 function getRadius(values, radiusName) { 29235 var _a; 29236 return (_a = values[radiusName]) !== null && _a !== void 0 ? _a : values.borderRadius; 29237 } 29238 // /** 29239 // * We only want to mix the background color if there's a follow element 29240 // * that we're not crossfading opacity between. For instance with switch 29241 // * AnimateSharedLayout animations, this helps the illusion of a continuous 29242 // * element being animated but also cuts down on the number of paints triggered 29243 // * for elements where opacity is doing that work for us. 29244 // */ 29245 // if ( 29246 // !hasFollowElement && 29247 // latestLeadValues.backgroundColor && 29248 // latestFollowValues.backgroundColor 29249 // ) { 29250 // /** 29251 // * This isn't ideal performance-wise as mixColor is creating a new function every frame. 29252 // * We could probably create a mixer that runs at the start of the animation but 29253 // * the idea behind the crossfader is that it runs dynamically between two potentially 29254 // * changing targets (ie opacity or borderRadius may be animating independently via variants) 29255 // */ 29256 // leadState.backgroundColor = followState.backgroundColor = mixColor( 29257 // latestFollowValues.backgroundColor as string, 29258 // latestLeadValues.backgroundColor as string 29259 // )(p) 29260 // } 29261 var easeCrossfadeIn = compress(0, 0.5, circOut); 29262 var easeCrossfadeOut = compress(0.5, 0.95, linear); 29263 function compress(min, max, easing) { 29264 return function (p) { 29265 // Could replace ifs with clamp 29266 if (p < min) 29267 return 0; 29268 if (p > max) 29269 return 1; 29270 return easing(progress(min, max, p)); 29271 }; 29272 } 29273 29274 29275 29276 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs 29277 /** 29278 * Reset an axis to the provided origin box. 29279 * 29280 * This is a mutative operation. 29281 */ 29282 function copyAxisInto(axis, originAxis) { 29283 axis.min = originAxis.min; 29284 axis.max = originAxis.max; 29285 } 29286 /** 29287 * Reset a box to the provided origin box. 29288 * 29289 * This is a mutative operation. 29290 */ 29291 function copyBoxInto(box, originBox) { 29292 copyAxisInto(box.x, originBox.x); 29293 copyAxisInto(box.y, originBox.y); 29294 } 29295 29296 29297 29298 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs 29299 function isIdentityScale(scale) { 29300 return scale === undefined || scale === 1; 29301 } 29302 function hasScale(_a) { 29303 var scale = _a.scale, scaleX = _a.scaleX, scaleY = _a.scaleY; 29304 return (!isIdentityScale(scale) || 29305 !isIdentityScale(scaleX) || 29306 !isIdentityScale(scaleY)); 29307 } 29308 function hasTransform(values) { 29309 return (hasScale(values) || 29310 hasTranslate(values.x) || 29311 hasTranslate(values.y) || 29312 values.z || 29313 values.rotate || 29314 values.rotateX || 29315 values.rotateY); 29316 } 29317 function hasTranslate(value) { 29318 return value && value !== "0%"; 29319 } 29320 29321 29322 29323 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs 29324 29325 29326 29327 29328 /** 29329 * Scales a point based on a factor and an originPoint 29330 */ 29331 function scalePoint(point, scale, originPoint) { 29332 var distanceFromOrigin = point - originPoint; 29333 var scaled = scale * distanceFromOrigin; 29334 return originPoint + scaled; 29335 } 29336 /** 29337 * Applies a translate/scale delta to a point 29338 */ 29339 function applyPointDelta(point, translate, scale, originPoint, boxScale) { 29340 if (boxScale !== undefined) { 29341 point = scalePoint(point, boxScale, originPoint); 29342 } 29343 return scalePoint(point, scale, originPoint) + translate; 29344 } 29345 /** 29346 * Applies a translate/scale delta to an axis 29347 */ 29348 function applyAxisDelta(axis, translate, scale, originPoint, boxScale) { 29349 if (translate === void 0) { translate = 0; } 29350 if (scale === void 0) { scale = 1; } 29351 axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); 29352 axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); 29353 } 29354 /** 29355 * Applies a translate/scale delta to a box 29356 */ 29357 function applyBoxDelta(box, _a) { 29358 var x = _a.x, y = _a.y; 29359 applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); 29360 applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); 29361 } 29362 /** 29363 * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms 29364 * in a tree upon our box before then calculating how to project it into our desired viewport-relative box 29365 * 29366 * This is the final nested loop within updateLayoutDelta for future refactoring 29367 */ 29368 function applyTreeDeltas(box, treeScale, treePath, isSharedTransition) { 29369 var _a, _b; 29370 if (isSharedTransition === void 0) { isSharedTransition = false; } 29371 var treeLength = treePath.length; 29372 if (!treeLength) 29373 return; 29374 // Reset the treeScale 29375 treeScale.x = treeScale.y = 1; 29376 var node; 29377 var delta; 29378 for (var i = 0; i < treeLength; i++) { 29379 node = treePath[i]; 29380 delta = node.projectionDelta; 29381 if (((_b = (_a = node.instance) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === "contents") 29382 continue; 29383 if (isSharedTransition && 29384 node.options.layoutScroll && 29385 node.scroll && 29386 node !== node.root) { 29387 transformBox(box, { x: -node.scroll.x, y: -node.scroll.y }); 29388 } 29389 if (delta) { 29390 // Incoporate each ancestor's scale into a culmulative treeScale for this component 29391 treeScale.x *= delta.x.scale; 29392 treeScale.y *= delta.y.scale; 29393 // Apply each ancestor's calculated delta into this component's recorded layout box 29394 applyBoxDelta(box, delta); 29395 } 29396 if (isSharedTransition && hasTransform(node.latestValues)) { 29397 transformBox(box, node.latestValues); 29398 } 29399 } 29400 } 29401 function translateAxis(axis, distance) { 29402 axis.min = axis.min + distance; 29403 axis.max = axis.max + distance; 29404 } 29405 /** 29406 * Apply a transform to an axis from the latest resolved motion values. 29407 * This function basically acts as a bridge between a flat motion value map 29408 * and applyAxisDelta 29409 */ 29410 function transformAxis(axis, transforms, _a) { 29411 var _b = tslib_es6_read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; 29412 var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5; 29413 var originPoint = mix(axis.min, axis.max, axisOrigin); 29414 // Apply the axis delta to the final axis 29415 applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale); 29416 } 29417 /** 29418 * The names of the motion values we want to apply as translation, scale and origin. 29419 */ 29420 var xKeys = ["x", "scaleX", "originX"]; 29421 var yKeys = ["y", "scaleY", "originY"]; 29422 /** 29423 * Apply a transform to a box from the latest resolved motion values. 29424 */ 29425 function transformBox(box, transform) { 29426 transformAxis(box.x, transform, xKeys); 29427 transformAxis(box.y, transform, yKeys); 29428 } 29429 29430 29431 29432 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point.mjs 29433 const isPoint = (point) => point.hasOwnProperty('x') && point.hasOwnProperty('y'); 29434 29435 29436 29437 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point-3d.mjs 29438 29439 29440 const isPoint3D = (point) => isPoint(point) && point.hasOwnProperty('z'); 29441 29442 29443 29444 ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/distance.mjs 29445 29446 29447 29448 29449 const distance1D = (a, b) => Math.abs(a - b); 29450 function distance(a, b) { 29451 if (isNum(a) && isNum(b)) { 29452 return distance1D(a, b); 29453 } 29454 else if (isPoint(a) && isPoint(b)) { 29455 const xDelta = distance1D(a.x, b.x); 29456 const yDelta = distance1D(a.y, b.y); 29457 const zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0; 29458 return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2)); 29459 } 29460 } 29461 29462 29463 29464 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs 29465 29466 29467 function calcLength(axis) { 29468 return axis.max - axis.min; 29469 } 29470 function isNear(value, target, maxDistance) { 29471 if (target === void 0) { target = 0; } 29472 if (maxDistance === void 0) { maxDistance = 0.01; } 29473 return distance(value, target) < maxDistance; 29474 } 29475 function calcAxisDelta(delta, source, target, origin) { 29476 if (origin === void 0) { origin = 0.5; } 29477 delta.origin = origin; 29478 delta.originPoint = mix(source.min, source.max, delta.origin); 29479 delta.scale = calcLength(target) / calcLength(source); 29480 if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale)) 29481 delta.scale = 1; 29482 delta.translate = 29483 mix(target.min, target.max, delta.origin) - delta.originPoint; 29484 if (isNear(delta.translate) || isNaN(delta.translate)) 29485 delta.translate = 0; 29486 } 29487 function calcBoxDelta(delta, source, target, origin) { 29488 calcAxisDelta(delta.x, source.x, target.x, origin === null || origin === void 0 ? void 0 : origin.originX); 29489 calcAxisDelta(delta.y, source.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY); 29490 } 29491 function calcRelativeAxis(target, relative, parent) { 29492 target.min = parent.min + relative.min; 29493 target.max = target.min + calcLength(relative); 29494 } 29495 function calcRelativeBox(target, relative, parent) { 29496 calcRelativeAxis(target.x, relative.x, parent.x); 29497 calcRelativeAxis(target.y, relative.y, parent.y); 29498 } 29499 function calcRelativeAxisPosition(target, layout, parent) { 29500 target.min = layout.min - parent.min; 29501 target.max = target.min + calcLength(layout); 29502 } 29503 function calcRelativePosition(target, layout, parent) { 29504 calcRelativeAxisPosition(target.x, layout.x, parent.x); 29505 calcRelativeAxisPosition(target.y, layout.y, parent.y); 29506 } 29507 29508 29509 29510 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs 29511 29512 29513 29514 29515 29516 /** 29517 * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse 29518 */ 29519 function removePointDelta(point, translate, scale, originPoint, boxScale) { 29520 point -= translate; 29521 point = scalePoint(point, 1 / scale, originPoint); 29522 if (boxScale !== undefined) { 29523 point = scalePoint(point, 1 / boxScale, originPoint); 29524 } 29525 return point; 29526 } 29527 /** 29528 * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse 29529 */ 29530 function removeAxisDelta(axis, translate, scale, origin, boxScale, originAxis, sourceAxis) { 29531 if (translate === void 0) { translate = 0; } 29532 if (scale === void 0) { scale = 1; } 29533 if (origin === void 0) { origin = 0.5; } 29534 if (originAxis === void 0) { originAxis = axis; } 29535 if (sourceAxis === void 0) { sourceAxis = axis; } 29536 if (percent.test(translate)) { 29537 translate = parseFloat(translate); 29538 var relativeProgress = mix(sourceAxis.min, sourceAxis.max, translate / 100); 29539 translate = relativeProgress - sourceAxis.min; 29540 } 29541 if (typeof translate !== "number") 29542 return; 29543 var originPoint = mix(originAxis.min, originAxis.max, origin); 29544 if (axis === originAxis) 29545 originPoint -= translate; 29546 axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); 29547 axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); 29548 } 29549 /** 29550 * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse 29551 * and acts as a bridge between motion values and removeAxisDelta 29552 */ 29553 function removeAxisTransforms(axis, transforms, _a, origin, sourceAxis) { 29554 var _b = tslib_es6_read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; 29555 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); 29556 } 29557 /** 29558 * The names of the motion values we want to apply as translation, scale and origin. 29559 */ 29560 var delta_remove_xKeys = ["x", "scaleX", "originX"]; 29561 var delta_remove_yKeys = ["y", "scaleY", "originY"]; 29562 /** 29563 * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse 29564 * and acts as a bridge between motion values and removeAxisDelta 29565 */ 29566 function removeBoxTransforms(box, transforms, originBox, sourceBox) { 29567 removeAxisTransforms(box.x, transforms, delta_remove_xKeys, originBox === null || originBox === void 0 ? void 0 : originBox.x, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.x); 29568 removeAxisTransforms(box.y, transforms, delta_remove_yKeys, originBox === null || originBox === void 0 ? void 0 : originBox.y, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.y); 29569 } 29570 29571 29572 29573 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/models.mjs 29574 var createAxisDelta = function () { return ({ 29575 translate: 0, 29576 scale: 1, 29577 origin: 0, 29578 originPoint: 0, 29579 }); }; 29580 var createDelta = function () { return ({ 29581 x: createAxisDelta(), 29582 y: createAxisDelta(), 29583 }); }; 29584 var createAxis = function () { return ({ min: 0, max: 0 }); }; 29585 var createBox = function () { return ({ 29586 x: createAxis(), 29587 y: createAxis(), 29588 }); }; 29589 29590 29591 29592 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/utils.mjs 29593 function isAxisDeltaZero(delta) { 29594 return delta.translate === 0 && delta.scale === 1; 29595 } 29596 function isDeltaZero(delta) { 29597 return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); 29598 } 29599 function boxEquals(a, b) { 29600 return (a.x.min === b.x.min && 29601 a.x.max === b.x.max && 29602 a.y.min === b.y.min && 29603 a.y.max === b.y.max); 29604 } 29605 29606 29607 29608 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/shared/stack.mjs 29609 29610 29611 var NodeStack = /** @class */ (function () { 29612 function NodeStack() { 29613 this.members = []; 29614 } 29615 NodeStack.prototype.add = function (node) { 29616 addUniqueItem(this.members, node); 29617 node.scheduleRender(); 29618 }; 29619 NodeStack.prototype.remove = function (node) { 29620 removeItem(this.members, node); 29621 if (node === this.prevLead) { 29622 this.prevLead = undefined; 29623 } 29624 if (node === this.lead) { 29625 var prevLead = this.members[this.members.length - 1]; 29626 if (prevLead) { 29627 this.promote(prevLead); 29628 } 29629 } 29630 }; 29631 NodeStack.prototype.relegate = function (node) { 29632 var indexOfNode = this.members.findIndex(function (member) { return node === member; }); 29633 if (indexOfNode === 0) 29634 return false; 29635 /** 29636 * Find the next projection node that is present 29637 */ 29638 var prevLead; 29639 for (var i = indexOfNode; i >= 0; i--) { 29640 var member = this.members[i]; 29641 if (member.isPresent !== false) { 29642 prevLead = member; 29643 break; 29644 } 29645 } 29646 if (prevLead) { 29647 this.promote(prevLead); 29648 return true; 29649 } 29650 else { 29651 return false; 29652 } 29653 }; 29654 NodeStack.prototype.promote = function (node, preserveFollowOpacity) { 29655 var _a; 29656 var prevLead = this.lead; 29657 if (node === prevLead) 29658 return; 29659 this.prevLead = prevLead; 29660 this.lead = node; 29661 node.show(); 29662 if (prevLead) { 29663 prevLead.instance && prevLead.scheduleRender(); 29664 node.scheduleRender(); 29665 node.resumeFrom = prevLead; 29666 if (preserveFollowOpacity) { 29667 node.resumeFrom.preserveOpacity = true; 29668 } 29669 if (prevLead.snapshot) { 29670 node.snapshot = prevLead.snapshot; 29671 node.snapshot.latestValues = 29672 prevLead.animationValues || prevLead.latestValues; 29673 node.snapshot.isShared = true; 29674 } 29675 if ((_a = node.root) === null || _a === void 0 ? void 0 : _a.isUpdating) { 29676 node.isLayoutDirty = true; 29677 } 29678 var crossfade = node.options.crossfade; 29679 if (crossfade === false) { 29680 prevLead.hide(); 29681 } 29682 /** 29683 * TODO: 29684 * - Test border radius when previous node was deleted 29685 * - boxShadow mixing 29686 * - Shared between element A in scrolled container and element B (scroll stays the same or changes) 29687 * - Shared between element A in transformed container and element B (transform stays the same or changes) 29688 * - Shared between element A in scrolled page and element B (scroll stays the same or changes) 29689 * --- 29690 * - Crossfade opacity of root nodes 29691 * - layoutId changes after animation 29692 * - layoutId changes mid animation 29693 */ 29694 } 29695 }; 29696 NodeStack.prototype.exitAnimationComplete = function () { 29697 this.members.forEach(function (node) { 29698 var _a, _b, _c, _d, _e; 29699 (_b = (_a = node.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); 29700 (_e = (_c = node.resumingFrom) === null || _c === void 0 ? void 0 : (_d = _c.options).onExitComplete) === null || _e === void 0 ? void 0 : _e.call(_d); 29701 }); 29702 }; 29703 NodeStack.prototype.scheduleRender = function () { 29704 this.members.forEach(function (node) { 29705 node.instance && node.scheduleRender(false); 29706 }); 29707 }; 29708 /** 29709 * Clear any leads that have been removed this render to prevent them from being 29710 * used in future animations and to prevent memory leaks 29711 */ 29712 NodeStack.prototype.removeLeadSnapshot = function () { 29713 if (this.lead && this.lead.snapshot) { 29714 this.lead.snapshot = undefined; 29715 } 29716 }; 29717 return NodeStack; 29718 }()); 29719 29720 29721 29722 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs 29723 var scaleCorrectors = {}; 29724 function addScaleCorrector(correctors) { 29725 Object.assign(scaleCorrectors, correctors); 29726 } 29727 29728 29729 29730 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/transform.mjs 29731 var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1)"; 29732 function buildProjectionTransform(delta, treeScale, latestTransform) { 29733 /** 29734 * The translations we use to calculate are always relative to the viewport coordinate space. 29735 * But when we apply scales, we also scale the coordinate space of an element and its children. 29736 * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need 29737 * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. 29738 */ 29739 var xTranslate = delta.x.translate / treeScale.x; 29740 var yTranslate = delta.y.translate / treeScale.y; 29741 var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) "); 29742 if (latestTransform) { 29743 var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY; 29744 if (rotate) 29745 transform += "rotate(".concat(rotate, "deg) "); 29746 if (rotateX) 29747 transform += "rotateX(".concat(rotateX, "deg) "); 29748 if (rotateY) 29749 transform += "rotateY(".concat(rotateY, "deg) "); 29750 } 29751 transform += "scale(".concat(delta.x.scale, ", ").concat(delta.y.scale, ")"); 29752 return transform === identityProjection ? "none" : transform; 29753 } 29754 29755 29756 29757 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs 29758 function eachAxis(callback) { 29759 return [callback("x"), callback("y")]; 29760 } 29761 29762 29763 29764 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/transform.mjs 29765 /** 29766 * A list of all transformable axes. We'll use this list to generated a version 29767 * of each axes for each transform. 29768 */ 29769 var transformAxes = ["", "X", "Y", "Z"]; 29770 /** 29771 * An ordered array of each transformable value. By default, transform values 29772 * will be sorted to this order. 29773 */ 29774 var order = ["translate", "scale", "rotate", "skew"]; 29775 /** 29776 * Generate a list of every possible transform key. 29777 */ 29778 var transformProps = ["transformPerspective", "x", "y", "z"]; 29779 order.forEach(function (operationKey) { 29780 return transformAxes.forEach(function (axesKey) { 29781 return transformProps.push(operationKey + axesKey); 29782 }); 29783 }); 29784 /** 29785 * A function to use with Array.sort to sort transform keys by their default order. 29786 */ 29787 function sortTransformProps(a, b) { 29788 return transformProps.indexOf(a) - transformProps.indexOf(b); 29789 } 29790 /** 29791 * A quick lookup for transform props. 29792 */ 29793 var transformPropSet = new Set(transformProps); 29794 function isTransformProp(key) { 29795 return transformPropSet.has(key); 29796 } 29797 /** 29798 * A quick lookup for transform origin props 29799 */ 29800 var transformOriginProps = new Set(["originX", "originY", "originZ"]); 29801 function isTransformOriginProp(key) { 29802 return transformOriginProps.has(key); 29803 } 29804 29805 29806 29807 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs 29808 var compareByDepth = function (a, b) { 29809 return a.depth - b.depth; 29810 }; 29811 29812 29813 29814 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs 29815 29816 29817 29818 var FlatTree = /** @class */ (function () { 29819 function FlatTree() { 29820 this.children = []; 29821 this.isDirty = false; 29822 } 29823 FlatTree.prototype.add = function (child) { 29824 addUniqueItem(this.children, child); 29825 this.isDirty = true; 29826 }; 29827 FlatTree.prototype.remove = function (child) { 29828 removeItem(this.children, child); 29829 this.isDirty = true; 29830 }; 29831 FlatTree.prototype.forEach = function (callback) { 29832 this.isDirty && this.children.sort(compareByDepth); 29833 this.isDirty = false; 29834 this.children.forEach(callback); 29835 }; 29836 return FlatTree; 29837 }()); 29838 29839 29840 29841 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs 29842 29843 29844 29845 /** 29846 * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself 29847 * 29848 * TODO: Remove and move to library 29849 * 29850 * @internal 29851 */ 29852 function resolveMotionValue(value) { 29853 var unwrappedValue = isMotionValue(value) ? value.get() : value; 29854 return isCustomValue(unwrappedValue) 29855 ? unwrappedValue.toValue() 29856 : unwrappedValue; 29857 } 29858 29859 29860 29861 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs 29862 29863 29864 29865 29866 29867 29868 29869 29870 29871 29872 29873 29874 29875 29876 29877 29878 29879 29880 29881 29882 29883 29884 /** 29885 * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 29886 * which has a noticeable difference in spring animations 29887 */ 29888 var animationTarget = 1000; 29889 /** 29890 * This should only ever be modified on the client otherwise it'll 29891 * persist through server requests. If we need instanced states we 29892 * could lazy-init via root. 29893 */ 29894 var globalProjectionState = { 29895 /** 29896 * Global flag as to whether the tree has animated since the last time 29897 * we resized the window 29898 */ 29899 hasAnimatedSinceResize: true, 29900 /** 29901 * We set this to true once, on the first update. Any nodes added to the tree beyond that 29902 * update will be given a `data-projection-id` attribute. 29903 */ 29904 hasEverUpdated: false, 29905 }; 29906 function createProjectionNode(_a) { 29907 var attachResizeListener = _a.attachResizeListener, defaultParent = _a.defaultParent, measureScroll = _a.measureScroll, resetTransform = _a.resetTransform; 29908 return /** @class */ (function () { 29909 function ProjectionNode(id, latestValues, parent) { 29910 var _this = this; 29911 if (latestValues === void 0) { latestValues = {}; } 29912 if (parent === void 0) { parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent(); } 29913 /** 29914 * A Set containing all this component's children. This is used to iterate 29915 * through the children. 29916 * 29917 * TODO: This could be faster to iterate as a flat array stored on the root node. 29918 */ 29919 this.children = new Set(); 29920 /** 29921 * Options for the node. We use this to configure what kind of layout animations 29922 * we should perform (if any). 29923 */ 29924 this.options = {}; 29925 /** 29926 * We use this to detect when its safe to shut down part of a projection tree. 29927 * We have to keep projecting children for scale correction and relative projection 29928 * until all their parents stop performing layout animations. 29929 */ 29930 this.isTreeAnimating = false; 29931 this.isAnimationBlocked = false; 29932 /** 29933 * Flag to true if we think this layout has been changed. We can't always know this, 29934 * currently we set it to true every time a component renders, or if it has a layoutDependency 29935 * if that has changed between renders. Additionally, components can be grouped by LayoutGroup 29936 * and if one node is dirtied, they all are. 29937 */ 29938 this.isLayoutDirty = false; 29939 /** 29940 * Block layout updates for instant layout transitions throughout the tree. 29941 */ 29942 this.updateManuallyBlocked = false; 29943 this.updateBlockedByResize = false; 29944 /** 29945 * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` 29946 * call. 29947 */ 29948 this.isUpdating = false; 29949 /** 29950 * If this is an SVG element we currently disable projection transforms 29951 */ 29952 this.isSVG = false; 29953 /** 29954 * Flag to true (during promotion) if a node doing an instant layout transition needs to reset 29955 * its projection styles. 29956 */ 29957 this.needsReset = false; 29958 /** 29959 * Flags whether this node should have its transform reset prior to measuring. 29960 */ 29961 this.shouldResetTransform = false; 29962 /** 29963 * An object representing the calculated contextual/accumulated/tree scale. 29964 * This will be used to scale calculcated projection transforms, as these are 29965 * calculated in screen-space but need to be scaled for elements to actually 29966 * make it to their calculated destinations. 29967 * 29968 * TODO: Lazy-init 29969 */ 29970 this.treeScale = { x: 1, y: 1 }; 29971 /** 29972 * 29973 */ 29974 this.eventHandlers = new Map(); 29975 // Note: Currently only running on root node 29976 this.potentialNodes = new Map(); 29977 this.checkUpdateFailed = function () { 29978 if (_this.isUpdating) { 29979 _this.isUpdating = false; 29980 _this.clearAllSnapshots(); 29981 } 29982 }; 29983 this.updateProjection = function () { 29984 _this.nodes.forEach(resolveTargetDelta); 29985 _this.nodes.forEach(calcProjection); 29986 }; 29987 this.hasProjected = false; 29988 this.isVisible = true; 29989 this.animationProgress = 0; 29990 /** 29991 * Shared layout 29992 */ 29993 // TODO Only running on root node 29994 this.sharedNodes = new Map(); 29995 this.id = id; 29996 this.latestValues = latestValues; 29997 this.root = parent ? parent.root || parent : this; 29998 this.path = parent ? tslib_es6_spreadArray(tslib_es6_spreadArray([], tslib_es6_read(parent.path), false), [parent], false) : []; 29999 this.parent = parent; 30000 this.depth = parent ? parent.depth + 1 : 0; 30001 id && this.root.registerPotentialNode(id, this); 30002 for (var i = 0; i < this.path.length; i++) { 30003 this.path[i].shouldResetTransform = true; 30004 } 30005 if (this.root === this) 30006 this.nodes = new FlatTree(); 30007 } 30008 ProjectionNode.prototype.addEventListener = function (name, handler) { 30009 if (!this.eventHandlers.has(name)) { 30010 this.eventHandlers.set(name, new SubscriptionManager()); 30011 } 30012 return this.eventHandlers.get(name).add(handler); 30013 }; 30014 ProjectionNode.prototype.notifyListeners = function (name) { 30015 var args = []; 30016 for (var _i = 1; _i < arguments.length; _i++) { 30017 args[_i - 1] = arguments[_i]; 30018 } 30019 var subscriptionManager = this.eventHandlers.get(name); 30020 subscriptionManager === null || subscriptionManager === void 0 ? void 0 : subscriptionManager.notify.apply(subscriptionManager, tslib_es6_spreadArray([], tslib_es6_read(args), false)); 30021 }; 30022 ProjectionNode.prototype.hasListeners = function (name) { 30023 return this.eventHandlers.has(name); 30024 }; 30025 ProjectionNode.prototype.registerPotentialNode = function (id, node) { 30026 this.potentialNodes.set(id, node); 30027 }; 30028 /** 30029 * Lifecycles 30030 */ 30031 ProjectionNode.prototype.mount = function (instance, isLayoutDirty) { 30032 var _this = this; 30033 var _a; 30034 if (isLayoutDirty === void 0) { isLayoutDirty = false; } 30035 if (this.instance) 30036 return; 30037 this.isSVG = 30038 instance instanceof SVGElement && instance.tagName !== "svg"; 30039 this.instance = instance; 30040 var _b = this.options, layoutId = _b.layoutId, layout = _b.layout, visualElement = _b.visualElement; 30041 if (visualElement && !visualElement.getInstance()) { 30042 visualElement.mount(instance); 30043 } 30044 this.root.nodes.add(this); 30045 (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.add(this); 30046 this.id && this.root.potentialNodes.delete(this.id); 30047 if (isLayoutDirty && (layout || layoutId)) { 30048 this.isLayoutDirty = true; 30049 } 30050 if (attachResizeListener) { 30051 var unblockTimeout_1; 30052 var resizeUnblockUpdate_1 = function () { 30053 return (_this.root.updateBlockedByResize = false); 30054 }; 30055 attachResizeListener(instance, function () { 30056 _this.root.updateBlockedByResize = true; 30057 clearTimeout(unblockTimeout_1); 30058 unblockTimeout_1 = window.setTimeout(resizeUnblockUpdate_1, 250); 30059 if (globalProjectionState.hasAnimatedSinceResize) { 30060 globalProjectionState.hasAnimatedSinceResize = false; 30061 _this.nodes.forEach(finishAnimation); 30062 } 30063 }); 30064 } 30065 if (layoutId) { 30066 this.root.registerSharedNode(layoutId, this); 30067 } 30068 // Only register the handler if it requires layout animation 30069 if (this.options.animate !== false && 30070 visualElement && 30071 (layoutId || layout)) { 30072 this.addEventListener("didUpdate", function (_a) { 30073 var _b, _c, _d, _e, _f; 30074 var delta = _a.delta, hasLayoutChanged = _a.hasLayoutChanged, hasRelativeTargetChanged = _a.hasRelativeTargetChanged, newLayout = _a.layout; 30075 if (_this.isTreeAnimationBlocked()) { 30076 _this.target = undefined; 30077 _this.relativeTarget = undefined; 30078 return; 30079 } 30080 // TODO: Check here if an animation exists 30081 var layoutTransition = (_c = (_b = _this.options.transition) !== null && _b !== void 0 ? _b : visualElement.getDefaultTransition()) !== null && _c !== void 0 ? _c : defaultLayoutTransition; 30082 var _g = visualElement.getProps(), onLayoutAnimationStart = _g.onLayoutAnimationStart, onLayoutAnimationComplete = _g.onLayoutAnimationComplete; 30083 /** 30084 * The target layout of the element might stay the same, 30085 * but its position relative to its parent has changed. 30086 */ 30087 var targetChanged = !_this.targetLayout || 30088 !boxEquals(_this.targetLayout, newLayout) || 30089 hasRelativeTargetChanged; 30090 /** 30091 * If the layout hasn't seemed to have changed, it might be that the 30092 * element is visually in the same place in the document but its position 30093 * relative to its parent has indeed changed. So here we check for that. 30094 */ 30095 var hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; 30096 if (((_d = _this.resumeFrom) === null || _d === void 0 ? void 0 : _d.instance) || 30097 hasOnlyRelativeTargetChanged || 30098 (hasLayoutChanged && 30099 (targetChanged || !_this.currentAnimation))) { 30100 if (_this.resumeFrom) { 30101 _this.resumingFrom = _this.resumeFrom; 30102 _this.resumingFrom.resumingFrom = undefined; 30103 } 30104 _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); 30105 var animationOptions = __assign(__assign({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete }); 30106 if (visualElement.shouldReduceMotion) { 30107 animationOptions.delay = 0; 30108 animationOptions.type = false; 30109 } 30110 _this.startAnimation(animationOptions); 30111 } 30112 else { 30113 /** 30114 * If the layout hasn't changed and we have an animation that hasn't started yet, 30115 * finish it immediately. Otherwise it will be animating from a location 30116 * that was probably never commited to screen and look like a jumpy box. 30117 */ 30118 if (!hasLayoutChanged && 30119 _this.animationProgress === 0) { 30120 _this.finishAnimation(); 30121 } 30122 _this.isLead() && ((_f = (_e = _this.options).onExitComplete) === null || _f === void 0 ? void 0 : _f.call(_e)); 30123 } 30124 _this.targetLayout = newLayout; 30125 }); 30126 } 30127 }; 30128 ProjectionNode.prototype.unmount = function () { 30129 var _a, _b; 30130 this.options.layoutId && this.willUpdate(); 30131 this.root.nodes.remove(this); 30132 (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.remove(this); 30133 (_b = this.parent) === null || _b === void 0 ? void 0 : _b.children.delete(this); 30134 this.instance = undefined; 30135 cancelSync.preRender(this.updateProjection); 30136 }; 30137 // only on the root 30138 ProjectionNode.prototype.blockUpdate = function () { 30139 this.updateManuallyBlocked = true; 30140 }; 30141 ProjectionNode.prototype.unblockUpdate = function () { 30142 this.updateManuallyBlocked = false; 30143 }; 30144 ProjectionNode.prototype.isUpdateBlocked = function () { 30145 return this.updateManuallyBlocked || this.updateBlockedByResize; 30146 }; 30147 ProjectionNode.prototype.isTreeAnimationBlocked = function () { 30148 var _a; 30149 return (this.isAnimationBlocked || 30150 ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimationBlocked()) || 30151 false); 30152 }; 30153 // Note: currently only running on root node 30154 ProjectionNode.prototype.startUpdate = function () { 30155 var _a; 30156 if (this.isUpdateBlocked()) 30157 return; 30158 this.isUpdating = true; 30159 (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach(resetRotation); 30160 }; 30161 ProjectionNode.prototype.willUpdate = function (shouldNotifyListeners) { 30162 var _a, _b, _c; 30163 if (shouldNotifyListeners === void 0) { shouldNotifyListeners = true; } 30164 if (this.root.isUpdateBlocked()) { 30165 (_b = (_a = this.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); 30166 return; 30167 } 30168 !this.root.isUpdating && this.root.startUpdate(); 30169 if (this.isLayoutDirty) 30170 return; 30171 this.isLayoutDirty = true; 30172 for (var i = 0; i < this.path.length; i++) { 30173 var node = this.path[i]; 30174 node.shouldResetTransform = true; 30175 /** 30176 * TODO: Check we haven't updated the scroll 30177 * since the last didUpdate 30178 */ 30179 node.updateScroll(); 30180 } 30181 var _d = this.options, layoutId = _d.layoutId, layout = _d.layout; 30182 if (layoutId === undefined && !layout) 30183 return; 30184 var transformTemplate = (_c = this.options.visualElement) === null || _c === void 0 ? void 0 : _c.getProps().transformTemplate; 30185 this.prevTransformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); 30186 this.updateSnapshot(); 30187 shouldNotifyListeners && this.notifyListeners("willUpdate"); 30188 }; 30189 // Note: Currently only running on root node 30190 ProjectionNode.prototype.didUpdate = function () { 30191 var updateWasBlocked = this.isUpdateBlocked(); 30192 // When doing an instant transition, we skip the layout update, 30193 // but should still clean up the measurements so that the next 30194 // snapshot could be taken correctly. 30195 if (updateWasBlocked) { 30196 this.unblockUpdate(); 30197 this.clearAllSnapshots(); 30198 this.nodes.forEach(clearMeasurements); 30199 return; 30200 } 30201 if (!this.isUpdating) 30202 return; 30203 this.isUpdating = false; 30204 /** 30205 * Search for and mount newly-added projection elements. 30206 * 30207 * TODO: Every time a new component is rendered we could search up the tree for 30208 * the closest mounted node and query from there rather than document. 30209 */ 30210 if (this.potentialNodes.size) { 30211 this.potentialNodes.forEach(mountNodeEarly); 30212 this.potentialNodes.clear(); 30213 } 30214 /** 30215 * Write 30216 */ 30217 this.nodes.forEach(resetTransformStyle); 30218 /** 30219 * Read ================== 30220 */ 30221 // Update layout measurements of updated children 30222 this.nodes.forEach(updateLayout); 30223 /** 30224 * Write 30225 */ 30226 // Notify listeners that the layout is updated 30227 this.nodes.forEach(notifyLayoutUpdate); 30228 this.clearAllSnapshots(); 30229 // Flush any scheduled updates 30230 flushSync.update(); 30231 flushSync.preRender(); 30232 flushSync.render(); 30233 }; 30234 ProjectionNode.prototype.clearAllSnapshots = function () { 30235 this.nodes.forEach(clearSnapshot); 30236 this.sharedNodes.forEach(removeLeadSnapshots); 30237 }; 30238 ProjectionNode.prototype.scheduleUpdateProjection = function () { 30239 es.preRender(this.updateProjection, false, true); 30240 }; 30241 ProjectionNode.prototype.scheduleCheckAfterUnmount = function () { 30242 var _this = this; 30243 /** 30244 * If the unmounting node is in a layoutGroup and did trigger a willUpdate, 30245 * we manually call didUpdate to give a chance to the siblings to animate. 30246 * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. 30247 */ 30248 es.postRender(function () { 30249 if (_this.isLayoutDirty) { 30250 _this.root.didUpdate(); 30251 } 30252 else { 30253 _this.root.checkUpdateFailed(); 30254 } 30255 }); 30256 }; 30257 /** 30258 * Update measurements 30259 */ 30260 ProjectionNode.prototype.updateSnapshot = function () { 30261 if (this.snapshot || !this.instance) 30262 return; 30263 var measured = this.measure(); 30264 var layout = this.removeTransform(this.removeElementScroll(measured)); 30265 roundBox(layout); 30266 this.snapshot = { 30267 measured: measured, 30268 layout: layout, 30269 latestValues: {}, 30270 }; 30271 }; 30272 ProjectionNode.prototype.updateLayout = function () { 30273 var _a; 30274 if (!this.instance) 30275 return; 30276 // TODO: Incorporate into a forwarded scroll offset 30277 this.updateScroll(); 30278 if (!(this.options.alwaysMeasureLayout && this.isLead()) && 30279 !this.isLayoutDirty) { 30280 return; 30281 } 30282 /** 30283 * When a node is mounted, it simply resumes from the prevLead's 30284 * snapshot instead of taking a new one, but the ancestors scroll 30285 * might have updated while the prevLead is unmounted. We need to 30286 * update the scroll again to make sure the layout we measure is 30287 * up to date. 30288 */ 30289 if (this.resumeFrom && !this.resumeFrom.instance) { 30290 for (var i = 0; i < this.path.length; i++) { 30291 var node = this.path[i]; 30292 node.updateScroll(); 30293 } 30294 } 30295 var measured = this.measure(); 30296 roundBox(measured); 30297 var prevLayout = this.layout; 30298 this.layout = { 30299 measured: measured, 30300 actual: this.removeElementScroll(measured), 30301 }; 30302 this.layoutCorrected = createBox(); 30303 this.isLayoutDirty = false; 30304 this.projectionDelta = undefined; 30305 this.notifyListeners("measure", this.layout.actual); 30306 (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notifyLayoutMeasure(this.layout.actual, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.actual); 30307 }; 30308 ProjectionNode.prototype.updateScroll = function () { 30309 if (this.options.layoutScroll && this.instance) { 30310 this.scroll = measureScroll(this.instance); 30311 } 30312 }; 30313 ProjectionNode.prototype.resetTransform = function () { 30314 var _a; 30315 if (!resetTransform) 30316 return; 30317 var isResetRequested = this.isLayoutDirty || this.shouldResetTransform; 30318 var hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); 30319 var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; 30320 var transformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); 30321 var transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; 30322 if (isResetRequested && 30323 (hasProjection || 30324 hasTransform(this.latestValues) || 30325 transformTemplateHasChanged)) { 30326 resetTransform(this.instance, transformTemplateValue); 30327 this.shouldResetTransform = false; 30328 this.scheduleRender(); 30329 } 30330 }; 30331 ProjectionNode.prototype.measure = function () { 30332 var visualElement = this.options.visualElement; 30333 if (!visualElement) 30334 return createBox(); 30335 var box = visualElement.measureViewportBox(); 30336 // Remove viewport scroll to give page-relative coordinates 30337 var scroll = this.root.scroll; 30338 if (scroll) { 30339 translateAxis(box.x, scroll.x); 30340 translateAxis(box.y, scroll.y); 30341 } 30342 return box; 30343 }; 30344 ProjectionNode.prototype.removeElementScroll = function (box) { 30345 var boxWithoutScroll = createBox(); 30346 copyBoxInto(boxWithoutScroll, box); 30347 /** 30348 * Performance TODO: Keep a cumulative scroll offset down the tree 30349 * rather than loop back up the path. 30350 */ 30351 for (var i = 0; i < this.path.length; i++) { 30352 var node = this.path[i]; 30353 var scroll_1 = node.scroll, options = node.options; 30354 if (node !== this.root && scroll_1 && options.layoutScroll) { 30355 translateAxis(boxWithoutScroll.x, scroll_1.x); 30356 translateAxis(boxWithoutScroll.y, scroll_1.y); 30357 } 30358 } 30359 return boxWithoutScroll; 30360 }; 30361 ProjectionNode.prototype.applyTransform = function (box, transformOnly) { 30362 if (transformOnly === void 0) { transformOnly = false; } 30363 var withTransforms = createBox(); 30364 copyBoxInto(withTransforms, box); 30365 for (var i = 0; i < this.path.length; i++) { 30366 var node = this.path[i]; 30367 if (!transformOnly && 30368 node.options.layoutScroll && 30369 node.scroll && 30370 node !== node.root) { 30371 transformBox(withTransforms, { 30372 x: -node.scroll.x, 30373 y: -node.scroll.y, 30374 }); 30375 } 30376 if (!hasTransform(node.latestValues)) 30377 continue; 30378 transformBox(withTransforms, node.latestValues); 30379 } 30380 if (hasTransform(this.latestValues)) { 30381 transformBox(withTransforms, this.latestValues); 30382 } 30383 return withTransforms; 30384 }; 30385 ProjectionNode.prototype.removeTransform = function (box) { 30386 var _a; 30387 var boxWithoutTransform = createBox(); 30388 copyBoxInto(boxWithoutTransform, box); 30389 for (var i = 0; i < this.path.length; i++) { 30390 var node = this.path[i]; 30391 if (!node.instance) 30392 continue; 30393 if (!hasTransform(node.latestValues)) 30394 continue; 30395 hasScale(node.latestValues) && node.updateSnapshot(); 30396 var sourceBox = createBox(); 30397 var nodeBox = node.measure(); 30398 copyBoxInto(sourceBox, nodeBox); 30399 removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layout, sourceBox); 30400 } 30401 if (hasTransform(this.latestValues)) { 30402 removeBoxTransforms(boxWithoutTransform, this.latestValues); 30403 } 30404 return boxWithoutTransform; 30405 }; 30406 /** 30407 * 30408 */ 30409 ProjectionNode.prototype.setTargetDelta = function (delta) { 30410 this.targetDelta = delta; 30411 this.root.scheduleUpdateProjection(); 30412 }; 30413 ProjectionNode.prototype.setOptions = function (options) { 30414 var _a; 30415 this.options = __assign(__assign(__assign({}, this.options), options), { crossfade: (_a = options.crossfade) !== null && _a !== void 0 ? _a : true }); 30416 }; 30417 ProjectionNode.prototype.clearMeasurements = function () { 30418 this.scroll = undefined; 30419 this.layout = undefined; 30420 this.snapshot = undefined; 30421 this.prevTransformTemplateValue = undefined; 30422 this.targetDelta = undefined; 30423 this.target = undefined; 30424 this.isLayoutDirty = false; 30425 }; 30426 /** 30427 * Frame calculations 30428 */ 30429 ProjectionNode.prototype.resolveTargetDelta = function () { 30430 var _a; 30431 var _b = this.options, layout = _b.layout, layoutId = _b.layoutId; 30432 /** 30433 * If we have no layout, we can't perform projection, so early return 30434 */ 30435 if (!this.layout || !(layout || layoutId)) 30436 return; 30437 /** 30438 * If we don't have a targetDelta but do have a layout, we can attempt to resolve 30439 * a relativeParent. This will allow a component to perform scale correction 30440 * even if no animation has started. 30441 */ 30442 // TODO If this is unsuccessful this currently happens every frame 30443 if (!this.targetDelta && !this.relativeTarget) { 30444 // TODO: This is a semi-repetition of further down this function, make DRY 30445 this.relativeParent = this.getClosestProjectingParent(); 30446 if (this.relativeParent && this.relativeParent.layout) { 30447 this.relativeTarget = createBox(); 30448 this.relativeTargetOrigin = createBox(); 30449 calcRelativePosition(this.relativeTargetOrigin, this.layout.actual, this.relativeParent.layout.actual); 30450 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 30451 } 30452 } 30453 /** 30454 * If we have no relative target or no target delta our target isn't valid 30455 * for this frame. 30456 */ 30457 if (!this.relativeTarget && !this.targetDelta) 30458 return; 30459 /** 30460 * Lazy-init target data structure 30461 */ 30462 if (!this.target) { 30463 this.target = createBox(); 30464 this.targetWithTransforms = createBox(); 30465 } 30466 /** 30467 * If we've got a relative box for this component, resolve it into a target relative to the parent. 30468 */ 30469 if (this.relativeTarget && 30470 this.relativeTargetOrigin && 30471 ((_a = this.relativeParent) === null || _a === void 0 ? void 0 : _a.target)) { 30472 calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); 30473 /** 30474 * If we've only got a targetDelta, resolve it into a target 30475 */ 30476 } 30477 else if (this.targetDelta) { 30478 if (Boolean(this.resumingFrom)) { 30479 // TODO: This is creating a new object every frame 30480 this.target = this.applyTransform(this.layout.actual); 30481 } 30482 else { 30483 copyBoxInto(this.target, this.layout.actual); 30484 } 30485 applyBoxDelta(this.target, this.targetDelta); 30486 } 30487 else { 30488 /** 30489 * If no target, use own layout as target 30490 */ 30491 copyBoxInto(this.target, this.layout.actual); 30492 } 30493 /** 30494 * If we've been told to attempt to resolve a relative target, do so. 30495 */ 30496 if (this.attemptToResolveRelativeTarget) { 30497 this.attemptToResolveRelativeTarget = false; 30498 this.relativeParent = this.getClosestProjectingParent(); 30499 if (this.relativeParent && 30500 Boolean(this.relativeParent.resumingFrom) === 30501 Boolean(this.resumingFrom) && 30502 !this.relativeParent.options.layoutScroll && 30503 this.relativeParent.target) { 30504 this.relativeTarget = createBox(); 30505 this.relativeTargetOrigin = createBox(); 30506 calcRelativePosition(this.relativeTargetOrigin, this.target, this.relativeParent.target); 30507 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 30508 } 30509 } 30510 }; 30511 ProjectionNode.prototype.getClosestProjectingParent = function () { 30512 if (!this.parent || hasTransform(this.parent.latestValues)) 30513 return undefined; 30514 if ((this.parent.relativeTarget || this.parent.targetDelta) && 30515 this.parent.layout) { 30516 return this.parent; 30517 } 30518 else { 30519 return this.parent.getClosestProjectingParent(); 30520 } 30521 }; 30522 ProjectionNode.prototype.calcProjection = function () { 30523 var _a; 30524 var _b = this.options, layout = _b.layout, layoutId = _b.layoutId; 30525 /** 30526 * If this section of the tree isn't animating we can 30527 * delete our target sources for the following frame. 30528 */ 30529 this.isTreeAnimating = Boolean(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimating) || 30530 this.currentAnimation || 30531 this.pendingAnimation); 30532 if (!this.isTreeAnimating) { 30533 this.targetDelta = this.relativeTarget = undefined; 30534 } 30535 if (!this.layout || !(layout || layoutId)) 30536 return; 30537 var lead = this.getLead(); 30538 /** 30539 * Reset the corrected box with the latest values from box, as we're then going 30540 * to perform mutative operations on it. 30541 */ 30542 copyBoxInto(this.layoutCorrected, this.layout.actual); 30543 /** 30544 * Apply all the parent deltas to this box to produce the corrected box. This 30545 * is the layout box, as it will appear on screen as a result of the transforms of its parents. 30546 */ 30547 applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, Boolean(this.resumingFrom) || this !== lead); 30548 var target = lead.target; 30549 if (!target) 30550 return; 30551 if (!this.projectionDelta) { 30552 this.projectionDelta = createDelta(); 30553 this.projectionDeltaWithTransform = createDelta(); 30554 } 30555 var prevTreeScaleX = this.treeScale.x; 30556 var prevTreeScaleY = this.treeScale.y; 30557 var prevProjectionTransform = this.projectionTransform; 30558 /** 30559 * Update the delta between the corrected box and the target box before user-set transforms were applied. 30560 * This will allow us to calculate the corrected borderRadius and boxShadow to compensate 30561 * for our layout reprojection, but still allow them to be scaled correctly by the user. 30562 * It might be that to simplify this we may want to accept that user-set scale is also corrected 30563 * and we wouldn't have to keep and calc both deltas, OR we could support a user setting 30564 * to allow people to choose whether these styles are corrected based on just the 30565 * layout reprojection or the final bounding box. 30566 */ 30567 calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); 30568 this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale); 30569 if (this.projectionTransform !== prevProjectionTransform || 30570 this.treeScale.x !== prevTreeScaleX || 30571 this.treeScale.y !== prevTreeScaleY) { 30572 this.hasProjected = true; 30573 this.scheduleRender(); 30574 this.notifyListeners("projectionUpdate", target); 30575 } 30576 }; 30577 ProjectionNode.prototype.hide = function () { 30578 this.isVisible = false; 30579 // TODO: Schedule render 30580 }; 30581 ProjectionNode.prototype.show = function () { 30582 this.isVisible = true; 30583 // TODO: Schedule render 30584 }; 30585 ProjectionNode.prototype.scheduleRender = function (notifyAll) { 30586 var _a, _b, _c; 30587 if (notifyAll === void 0) { notifyAll = true; } 30588 (_b = (_a = this.options).scheduleRender) === null || _b === void 0 ? void 0 : _b.call(_a); 30589 notifyAll && ((_c = this.getStack()) === null || _c === void 0 ? void 0 : _c.scheduleRender()); 30590 if (this.resumingFrom && !this.resumingFrom.instance) { 30591 this.resumingFrom = undefined; 30592 } 30593 }; 30594 ProjectionNode.prototype.setAnimationOrigin = function (delta, hasOnlyRelativeTargetChanged) { 30595 var _this = this; 30596 var _a; 30597 if (hasOnlyRelativeTargetChanged === void 0) { hasOnlyRelativeTargetChanged = false; } 30598 var snapshot = this.snapshot; 30599 var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {}; 30600 var mixedValues = __assign({}, this.latestValues); 30601 var targetDelta = createDelta(); 30602 this.relativeTarget = this.relativeTargetOrigin = undefined; 30603 this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; 30604 var relativeLayout = createBox(); 30605 var isSharedLayoutAnimation = snapshot === null || snapshot === void 0 ? void 0 : snapshot.isShared; 30606 var isOnlyMember = (((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.members.length) || 0) <= 1; 30607 var shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && 30608 !isOnlyMember && 30609 this.options.crossfade === true && 30610 !this.path.some(hasOpacityCrossfade)); 30611 this.animationProgress = 0; 30612 this.mixTargetDelta = function (latest) { 30613 var _a; 30614 var progress = latest / 1000; 30615 mixAxisDelta(targetDelta.x, delta.x, progress); 30616 mixAxisDelta(targetDelta.y, delta.y, progress); 30617 _this.setTargetDelta(targetDelta); 30618 if (_this.relativeTarget && 30619 _this.relativeTargetOrigin && 30620 _this.layout && 30621 ((_a = _this.relativeParent) === null || _a === void 0 ? void 0 : _a.layout)) { 30622 calcRelativePosition(relativeLayout, _this.layout.actual, _this.relativeParent.layout.actual); 30623 mixBox(_this.relativeTarget, _this.relativeTargetOrigin, relativeLayout, progress); 30624 } 30625 if (isSharedLayoutAnimation) { 30626 _this.animationValues = mixedValues; 30627 mixValues(mixedValues, snapshotLatestValues, _this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); 30628 } 30629 _this.root.scheduleUpdateProjection(); 30630 _this.scheduleRender(); 30631 _this.animationProgress = progress; 30632 }; 30633 this.mixTargetDelta(0); 30634 }; 30635 ProjectionNode.prototype.startAnimation = function (options) { 30636 var _this = this; 30637 var _a, _b; 30638 this.notifyListeners("animationStart"); 30639 (_a = this.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); 30640 if (this.resumingFrom) { 30641 (_b = this.resumingFrom.currentAnimation) === null || _b === void 0 ? void 0 : _b.stop(); 30642 } 30643 if (this.pendingAnimation) { 30644 cancelSync.update(this.pendingAnimation); 30645 this.pendingAnimation = undefined; 30646 } 30647 /** 30648 * Start the animation in the next frame to have a frame with progress 0, 30649 * where the target is the same as when the animation started, so we can 30650 * calculate the relative positions correctly for instant transitions. 30651 */ 30652 this.pendingAnimation = es.update(function () { 30653 globalProjectionState.hasAnimatedSinceResize = true; 30654 _this.currentAnimation = animate_animate(0, animationTarget, __assign(__assign({}, options), { onUpdate: function (latest) { 30655 var _a; 30656 _this.mixTargetDelta(latest); 30657 (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, latest); 30658 }, onComplete: function () { 30659 var _a; 30660 (_a = options.onComplete) === null || _a === void 0 ? void 0 : _a.call(options); 30661 _this.completeAnimation(); 30662 } })); 30663 if (_this.resumingFrom) { 30664 _this.resumingFrom.currentAnimation = _this.currentAnimation; 30665 } 30666 _this.pendingAnimation = undefined; 30667 }); 30668 }; 30669 ProjectionNode.prototype.completeAnimation = function () { 30670 var _a; 30671 if (this.resumingFrom) { 30672 this.resumingFrom.currentAnimation = undefined; 30673 this.resumingFrom.preserveOpacity = undefined; 30674 } 30675 (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.exitAnimationComplete(); 30676 this.resumingFrom = 30677 this.currentAnimation = 30678 this.animationValues = 30679 undefined; 30680 this.notifyListeners("animationComplete"); 30681 }; 30682 ProjectionNode.prototype.finishAnimation = function () { 30683 var _a; 30684 if (this.currentAnimation) { 30685 (_a = this.mixTargetDelta) === null || _a === void 0 ? void 0 : _a.call(this, animationTarget); 30686 this.currentAnimation.stop(); 30687 } 30688 this.completeAnimation(); 30689 }; 30690 ProjectionNode.prototype.applyTransformsToTarget = function () { 30691 var _a = this.getLead(), targetWithTransforms = _a.targetWithTransforms, target = _a.target, layout = _a.layout, latestValues = _a.latestValues; 30692 if (!targetWithTransforms || !target || !layout) 30693 return; 30694 copyBoxInto(targetWithTransforms, target); 30695 /** 30696 * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. 30697 * This is the final box that we will then project into by calculating a transform delta and 30698 * applying it to the corrected box. 30699 */ 30700 transformBox(targetWithTransforms, latestValues); 30701 /** 30702 * Update the delta between the corrected box and the final target box, after 30703 * user-set transforms are applied to it. This will be used by the renderer to 30704 * create a transform style that will reproject the element from its actual layout 30705 * into the desired bounding box. 30706 */ 30707 calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); 30708 }; 30709 ProjectionNode.prototype.registerSharedNode = function (layoutId, node) { 30710 var _a, _b, _c; 30711 if (!this.sharedNodes.has(layoutId)) { 30712 this.sharedNodes.set(layoutId, new NodeStack()); 30713 } 30714 var stack = this.sharedNodes.get(layoutId); 30715 stack.add(node); 30716 node.promote({ 30717 transition: (_a = node.options.initialPromotionConfig) === null || _a === void 0 ? void 0 : _a.transition, 30718 preserveFollowOpacity: (_c = (_b = node.options.initialPromotionConfig) === null || _b === void 0 ? void 0 : _b.shouldPreserveFollowOpacity) === null || _c === void 0 ? void 0 : _c.call(_b, node), 30719 }); 30720 }; 30721 ProjectionNode.prototype.isLead = function () { 30722 var stack = this.getStack(); 30723 return stack ? stack.lead === this : true; 30724 }; 30725 ProjectionNode.prototype.getLead = function () { 30726 var _a; 30727 var layoutId = this.options.layoutId; 30728 return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; 30729 }; 30730 ProjectionNode.prototype.getPrevLead = function () { 30731 var _a; 30732 var layoutId = this.options.layoutId; 30733 return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined; 30734 }; 30735 ProjectionNode.prototype.getStack = function () { 30736 var layoutId = this.options.layoutId; 30737 if (layoutId) 30738 return this.root.sharedNodes.get(layoutId); 30739 }; 30740 ProjectionNode.prototype.promote = function (_a) { 30741 var _b = _a === void 0 ? {} : _a, needsReset = _b.needsReset, transition = _b.transition, preserveFollowOpacity = _b.preserveFollowOpacity; 30742 var stack = this.getStack(); 30743 if (stack) 30744 stack.promote(this, preserveFollowOpacity); 30745 if (needsReset) { 30746 this.projectionDelta = undefined; 30747 this.needsReset = true; 30748 } 30749 if (transition) 30750 this.setOptions({ transition: transition }); 30751 }; 30752 ProjectionNode.prototype.relegate = function () { 30753 var stack = this.getStack(); 30754 if (stack) { 30755 return stack.relegate(this); 30756 } 30757 else { 30758 return false; 30759 } 30760 }; 30761 ProjectionNode.prototype.resetRotation = function () { 30762 var visualElement = this.options.visualElement; 30763 if (!visualElement) 30764 return; 30765 // If there's no detected rotation values, we can early return without a forced render. 30766 var hasRotate = false; 30767 // Keep a record of all the values we've reset 30768 var resetValues = {}; 30769 // Check the rotate value of all axes and reset to 0 30770 for (var i = 0; i < transformAxes.length; i++) { 30771 var axis = transformAxes[i]; 30772 var key = "rotate" + axis; 30773 // If this rotation doesn't exist as a motion value, then we don't 30774 // need to reset it 30775 if (!visualElement.getStaticValue(key)) { 30776 continue; 30777 } 30778 hasRotate = true; 30779 // Record the rotation and then temporarily set it to 0 30780 resetValues[key] = visualElement.getStaticValue(key); 30781 visualElement.setStaticValue(key, 0); 30782 } 30783 // If there's no rotation values, we don't need to do any more. 30784 if (!hasRotate) 30785 return; 30786 // Force a render of this element to apply the transform with all rotations 30787 // set to 0. 30788 visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); 30789 // Put back all the values we reset 30790 for (var key in resetValues) { 30791 visualElement.setStaticValue(key, resetValues[key]); 30792 } 30793 // Schedule a render for the next frame. This ensures we won't visually 30794 // see the element with the reset rotate value applied. 30795 visualElement.scheduleRender(); 30796 }; 30797 ProjectionNode.prototype.getProjectionStyles = function (styleProp) { 30798 var _a, _b, _c, _d, _e, _f; 30799 if (styleProp === void 0) { styleProp = {}; } 30800 // TODO: Return lifecycle-persistent object 30801 var styles = {}; 30802 if (!this.instance || this.isSVG) 30803 return styles; 30804 if (!this.isVisible) { 30805 return { visibility: "hidden" }; 30806 } 30807 else { 30808 styles.visibility = ""; 30809 } 30810 var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; 30811 if (this.needsReset) { 30812 this.needsReset = false; 30813 styles.opacity = ""; 30814 styles.pointerEvents = 30815 resolveMotionValue(styleProp.pointerEvents) || ""; 30816 styles.transform = transformTemplate 30817 ? transformTemplate(this.latestValues, "") 30818 : "none"; 30819 return styles; 30820 } 30821 var lead = this.getLead(); 30822 if (!this.projectionDelta || !this.layout || !lead.target) { 30823 var emptyStyles = {}; 30824 if (this.options.layoutId) { 30825 emptyStyles.opacity = (_b = this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1; 30826 emptyStyles.pointerEvents = 30827 resolveMotionValue(styleProp.pointerEvents) || ""; 30828 } 30829 if (this.hasProjected && !hasTransform(this.latestValues)) { 30830 emptyStyles.transform = transformTemplate 30831 ? transformTemplate({}, "") 30832 : "none"; 30833 this.hasProjected = false; 30834 } 30835 return emptyStyles; 30836 } 30837 var valuesToRender = lead.animationValues || lead.latestValues; 30838 this.applyTransformsToTarget(); 30839 styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); 30840 if (transformTemplate) { 30841 styles.transform = transformTemplate(valuesToRender, styles.transform); 30842 } 30843 var _g = this.projectionDelta, x = _g.x, y = _g.y; 30844 styles.transformOrigin = "".concat(x.origin * 100, "% ").concat(y.origin * 100, "% 0"); 30845 if (lead.animationValues) { 30846 /** 30847 * If the lead component is animating, assign this either the entering/leaving 30848 * opacity 30849 */ 30850 styles.opacity = 30851 lead === this 30852 ? (_d = (_c = valuesToRender.opacity) !== null && _c !== void 0 ? _c : this.latestValues.opacity) !== null && _d !== void 0 ? _d : 1 30853 : this.preserveOpacity 30854 ? this.latestValues.opacity 30855 : valuesToRender.opacityExit; 30856 } 30857 else { 30858 /** 30859 * Or we're not animating at all, set the lead component to its actual 30860 * opacity and other components to hidden. 30861 */ 30862 styles.opacity = 30863 lead === this 30864 ? (_e = valuesToRender.opacity) !== null && _e !== void 0 ? _e : "" 30865 : (_f = valuesToRender.opacityExit) !== null && _f !== void 0 ? _f : 0; 30866 } 30867 /** 30868 * Apply scale correction 30869 */ 30870 for (var key in scaleCorrectors) { 30871 if (valuesToRender[key] === undefined) 30872 continue; 30873 var _h = scaleCorrectors[key], correct = _h.correct, applyTo = _h.applyTo; 30874 var corrected = correct(valuesToRender[key], lead); 30875 if (applyTo) { 30876 var num = applyTo.length; 30877 for (var i = 0; i < num; i++) { 30878 styles[applyTo[i]] = corrected; 30879 } 30880 } 30881 else { 30882 styles[key] = corrected; 30883 } 30884 } 30885 /** 30886 * Disable pointer events on follow components. This is to ensure 30887 * that if a follow component covers a lead component it doesn't block 30888 * pointer events on the lead. 30889 */ 30890 if (this.options.layoutId) { 30891 styles.pointerEvents = 30892 lead === this 30893 ? resolveMotionValue(styleProp.pointerEvents) || "" 30894 : "none"; 30895 } 30896 return styles; 30897 }; 30898 ProjectionNode.prototype.clearSnapshot = function () { 30899 this.resumeFrom = this.snapshot = undefined; 30900 }; 30901 // Only run on root 30902 ProjectionNode.prototype.resetTree = function () { 30903 this.root.nodes.forEach(function (node) { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); }); 30904 this.root.nodes.forEach(clearMeasurements); 30905 this.root.sharedNodes.clear(); 30906 }; 30907 return ProjectionNode; 30908 }()); 30909 } 30910 function updateLayout(node) { 30911 node.updateLayout(); 30912 } 30913 function notifyLayoutUpdate(node) { 30914 var _a, _b, _c, _d; 30915 var snapshot = (_b = (_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : node.snapshot; 30916 if (node.isLead() && 30917 node.layout && 30918 snapshot && 30919 node.hasListeners("didUpdate")) { 30920 var _e = node.layout, layout_1 = _e.actual, measuredLayout = _e.measured; 30921 // TODO Maybe we want to also resize the layout snapshot so we don't trigger 30922 // animations for instance if layout="size" and an element has only changed position 30923 if (node.options.animationType === "size") { 30924 eachAxis(function (axis) { 30925 var axisSnapshot = snapshot.isShared 30926 ? snapshot.measured[axis] 30927 : snapshot.layout[axis]; 30928 var length = calcLength(axisSnapshot); 30929 axisSnapshot.min = layout_1[axis].min; 30930 axisSnapshot.max = axisSnapshot.min + length; 30931 }); 30932 } 30933 else if (node.options.animationType === "position") { 30934 eachAxis(function (axis) { 30935 var axisSnapshot = snapshot.isShared 30936 ? snapshot.measured[axis] 30937 : snapshot.layout[axis]; 30938 var length = calcLength(layout_1[axis]); 30939 axisSnapshot.max = axisSnapshot.min + length; 30940 }); 30941 } 30942 var layoutDelta = createDelta(); 30943 calcBoxDelta(layoutDelta, layout_1, snapshot.layout); 30944 var visualDelta = createDelta(); 30945 if (snapshot.isShared) { 30946 calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measured); 30947 } 30948 else { 30949 calcBoxDelta(visualDelta, layout_1, snapshot.layout); 30950 } 30951 var hasLayoutChanged = !isDeltaZero(layoutDelta); 30952 var hasRelativeTargetChanged = false; 30953 if (!node.resumeFrom) { 30954 node.relativeParent = node.getClosestProjectingParent(); 30955 /** 30956 * If the relativeParent is itself resuming from a different element then 30957 * the relative snapshot is not relavent 30958 */ 30959 if (node.relativeParent && !node.relativeParent.resumeFrom) { 30960 var _f = node.relativeParent, parentSnapshot = _f.snapshot, parentLayout = _f.layout; 30961 if (parentSnapshot && parentLayout) { 30962 var relativeSnapshot = createBox(); 30963 calcRelativePosition(relativeSnapshot, snapshot.layout, parentSnapshot.layout); 30964 var relativeLayout = createBox(); 30965 calcRelativePosition(relativeLayout, layout_1, parentLayout.actual); 30966 if (!boxEquals(relativeSnapshot, relativeLayout)) { 30967 hasRelativeTargetChanged = true; 30968 } 30969 } 30970 } 30971 } 30972 node.notifyListeners("didUpdate", { 30973 layout: layout_1, 30974 snapshot: snapshot, 30975 delta: visualDelta, 30976 layoutDelta: layoutDelta, 30977 hasLayoutChanged: hasLayoutChanged, 30978 hasRelativeTargetChanged: hasRelativeTargetChanged, 30979 }); 30980 } 30981 else if (node.isLead()) { 30982 (_d = (_c = node.options).onExitComplete) === null || _d === void 0 ? void 0 : _d.call(_c); 30983 } 30984 /** 30985 * Clearing transition 30986 * TODO: Investigate why this transition is being passed in as {type: false } from Framer 30987 * and why we need it at all 30988 */ 30989 node.options.transition = undefined; 30990 } 30991 function clearSnapshot(node) { 30992 node.clearSnapshot(); 30993 } 30994 function clearMeasurements(node) { 30995 node.clearMeasurements(); 30996 } 30997 function resetTransformStyle(node) { 30998 var visualElement = node.options.visualElement; 30999 if (visualElement === null || visualElement === void 0 ? void 0 : visualElement.getProps().onBeforeLayoutMeasure) { 31000 visualElement.notifyBeforeLayoutMeasure(); 31001 } 31002 node.resetTransform(); 31003 } 31004 function finishAnimation(node) { 31005 node.finishAnimation(); 31006 node.targetDelta = node.relativeTarget = node.target = undefined; 31007 } 31008 function resolveTargetDelta(node) { 31009 node.resolveTargetDelta(); 31010 } 31011 function calcProjection(node) { 31012 node.calcProjection(); 31013 } 31014 function resetRotation(node) { 31015 node.resetRotation(); 31016 } 31017 function removeLeadSnapshots(stack) { 31018 stack.removeLeadSnapshot(); 31019 } 31020 function mixAxisDelta(output, delta, p) { 31021 output.translate = mix(delta.translate, 0, p); 31022 output.scale = mix(delta.scale, 1, p); 31023 output.origin = delta.origin; 31024 output.originPoint = delta.originPoint; 31025 } 31026 function mixAxis(output, from, to, p) { 31027 output.min = mix(from.min, to.min, p); 31028 output.max = mix(from.max, to.max, p); 31029 } 31030 function mixBox(output, from, to, p) { 31031 mixAxis(output.x, from.x, to.x, p); 31032 mixAxis(output.y, from.y, to.y, p); 31033 } 31034 function hasOpacityCrossfade(node) { 31035 return (node.animationValues && node.animationValues.opacityExit !== undefined); 31036 } 31037 var defaultLayoutTransition = { 31038 duration: 0.45, 31039 ease: [0.4, 0, 0.1, 1], 31040 }; 31041 function mountNodeEarly(node, id) { 31042 /** 31043 * Rather than searching the DOM from document we can search the 31044 * path for the deepest mounted ancestor and search from there 31045 */ 31046 var searchNode = node.root; 31047 for (var i = node.path.length - 1; i >= 0; i--) { 31048 if (Boolean(node.path[i].instance)) { 31049 searchNode = node.path[i]; 31050 break; 31051 } 31052 } 31053 var searchElement = searchNode && searchNode !== node.root ? searchNode.instance : document; 31054 var element = searchElement.querySelector("[data-projection-id=\"".concat(id, "\"]")); 31055 if (element) 31056 node.mount(element, true); 31057 } 31058 function roundAxis(axis) { 31059 axis.min = Math.round(axis.min); 31060 axis.max = Math.round(axis.max); 31061 } 31062 function roundBox(box) { 31063 roundAxis(box.x); 31064 roundAxis(box.y); 31065 } 31066 31067 31068 31069 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/id.mjs 31070 31071 31072 31073 var id = 1; 31074 function useProjectionId() { 31075 return useConstant(function () { 31076 if (globalProjectionState.hasEverUpdated) { 31077 return id++; 31078 } 31079 }); 31080 } 31081 31082 31083 31084 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs 31085 31086 31087 /** 31088 * @internal 31089 */ 31090 var LayoutGroupContext = (0,external_React_.createContext)({}); 31091 31092 31093 31094 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs 31095 31096 31097 /** 31098 * @internal 31099 */ 31100 var SwitchLayoutGroupContext = (0,external_React_.createContext)({}); 31101 31102 31103 31104 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-projection.mjs 31105 31106 31107 31108 31109 function useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) { 31110 var _b; 31111 var layoutId = _a.layoutId, layout = _a.layout, drag = _a.drag, dragConstraints = _a.dragConstraints, layoutScroll = _a.layoutScroll; 31112 var initialPromotionConfig = (0,external_React_.useContext)(SwitchLayoutGroupContext); 31113 if (!ProjectionNodeConstructor || 31114 !visualElement || 31115 (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) { 31116 return; 31117 } 31118 visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection); 31119 visualElement.projection.setOptions({ 31120 layoutId: layoutId, 31121 layout: layout, 31122 alwaysMeasureLayout: Boolean(drag) || (dragConstraints && is_ref_object_isRefObject(dragConstraints)), 31123 visualElement: visualElement, 31124 scheduleRender: function () { return visualElement.scheduleRender(); }, 31125 /** 31126 * TODO: Update options in an effect. This could be tricky as it'll be too late 31127 * to update by the time layout animations run. 31128 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, 31129 * ensuring it gets called if there's no potential layout animations. 31130 * 31131 */ 31132 animationType: typeof layout === "string" ? layout : "both", 31133 initialPromotionConfig: initialPromotionConfig, 31134 layoutScroll: layoutScroll, 31135 }); 31136 } 31137 31138 31139 31140 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/VisualElementHandler.mjs 31141 31142 31143 31144 var VisualElementHandler = /** @class */ (function (_super) { 31145 __extends(VisualElementHandler, _super); 31146 function VisualElementHandler() { 31147 return _super !== null && _super.apply(this, arguments) || this; 31148 } 31149 /** 31150 * Update visual element props as soon as we know this update is going to be commited. 31151 */ 31152 VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () { 31153 this.updateProps(); 31154 return null; 31155 }; 31156 VisualElementHandler.prototype.componentDidUpdate = function () { }; 31157 VisualElementHandler.prototype.updateProps = function () { 31158 var _a = this.props, visualElement = _a.visualElement, props = _a.props; 31159 if (visualElement) 31160 visualElement.setProps(props); 31161 }; 31162 VisualElementHandler.prototype.render = function () { 31163 return this.props.children; 31164 }; 31165 return VisualElementHandler; 31166 }(external_React_.Component)); 31167 31168 31169 31170 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.mjs 31171 31172 31173 31174 31175 31176 31177 31178 31179 31180 31181 31182 31183 31184 31185 31186 31187 /** 31188 * Create a `motion` component. 31189 * 31190 * This function accepts a Component argument, which can be either a string (ie "div" 31191 * for `motion.div`), or an actual React component. 31192 * 31193 * Alongside this is a config option which provides a way of rendering the provided 31194 * component "offline", or outside the React render cycle. 31195 * 31196 * @internal 31197 */ 31198 function motion_createMotionComponent(_a) { 31199 var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component; 31200 preloadedFeatures && loadFeatures(preloadedFeatures); 31201 function MotionComponent(props, externalRef) { 31202 var layoutId = useLayoutId(props); 31203 props = __assign(__assign({}, props), { layoutId: layoutId }); 31204 /** 31205 * If we're rendering in a static environment, we only visually update the component 31206 * as a result of a React-rerender rather than interactions or animations. This 31207 * means we don't need to load additional memory structures like VisualElement, 31208 * or any gesture/animation features. 31209 */ 31210 var config = (0,external_React_.useContext)(MotionConfigContext); 31211 var features = null; 31212 var context = useCreateMotionContext(props); 31213 /** 31214 * Create a unique projection ID for this component. If a new component is added 31215 * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing 31216 * us to measure it as soon as any layout effect flushes pending layout animations. 31217 * 31218 * Performance note: It'd be better not to have to search the DOM for these elements. 31219 * For newly-entering components it could be enough to only correct treeScale, in which 31220 * case we could mount in a scale-correction mode. This wouldn't be enough for 31221 * shared element transitions however. Perhaps for those we could revert to a root node 31222 * that gets forceRendered and layout animations are triggered on its layout effect. 31223 */ 31224 var projectionId = config.isStatic ? undefined : useProjectionId(); 31225 /** 31226 * 31227 */ 31228 var visualState = useVisualState(props, config.isStatic); 31229 if (!config.isStatic && is_browser_isBrowser) { 31230 /** 31231 * Create a VisualElement for this component. A VisualElement provides a common 31232 * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as 31233 * providing a way of rendering to these APIs outside of the React render loop 31234 * for more performant animations and interactions 31235 */ 31236 context.visualElement = useVisualElement(Component, visualState, __assign(__assign({}, config), props), createVisualElement); 31237 useProjection(projectionId, props, context.visualElement, projectionNodeConstructor || 31238 featureDefinitions.projectionNodeConstructor); 31239 /** 31240 * Load Motion gesture and animation features. These are rendered as renderless 31241 * components so each feature can optionally make use of React lifecycle methods. 31242 */ 31243 features = useFeatures(props, context.visualElement, preloadedFeatures); 31244 } 31245 /** 31246 * The mount order and hierarchy is specific to ensure our element ref 31247 * is hydrated by the time features fire their effects. 31248 */ 31249 return (external_React_.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign(__assign({}, config), props) }, 31250 features, 31251 external_React_.createElement(MotionContext.Provider, { value: context }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement)))); 31252 } 31253 return (0,external_React_.forwardRef)(MotionComponent); 31254 } 31255 function useLayoutId(_a) { 31256 var _b; 31257 var layoutId = _a.layoutId; 31258 var layoutGroupId = (_b = (0,external_React_.useContext)(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id; 31259 return layoutGroupId && layoutId !== undefined 31260 ? layoutGroupId + "-" + layoutId 31261 : layoutId; 31262 } 31263 31264 31265 31266 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs 31267 31268 31269 /** 31270 * Convert any React component into a `motion` component. The provided component 31271 * **must** use `React.forwardRef` to the underlying DOM component you want to animate. 31272 * 31273 * ```jsx 31274 * const Component = React.forwardRef((props, ref) => { 31275 * return <div ref={ref} /> 31276 * }) 31277 * 31278 * const MotionComponent = motion(Component) 31279 * ``` 31280 * 31281 * @public 31282 */ 31283 function createMotionProxy(createConfig) { 31284 function custom(Component, customMotionComponentConfig) { 31285 if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; } 31286 return motion_createMotionComponent(createConfig(Component, customMotionComponentConfig)); 31287 } 31288 if (typeof Proxy === "undefined") { 31289 return custom; 31290 } 31291 /** 31292 * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. 31293 * Rather than generating them anew every render. 31294 */ 31295 var componentCache = new Map(); 31296 return new Proxy(custom, { 31297 /** 31298 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. 31299 * The prop name is passed through as `key` and we can use that to generate a `motion` 31300 * DOM component with that name. 31301 */ 31302 get: function (_target, key) { 31303 /** 31304 * If this element doesn't exist in the component cache, create it and cache. 31305 */ 31306 if (!componentCache.has(key)) { 31307 componentCache.set(key, custom(key)); 31308 } 31309 return componentCache.get(key); 31310 }, 31311 }); 31312 } 31313 31314 31315 31316 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs 31317 /** 31318 * We keep these listed seperately as we use the lowercase tag names as part 31319 * of the runtime bundle to detect SVG components 31320 */ 31321 var lowercaseSVGElements = [ 31322 "animate", 31323 "circle", 31324 "defs", 31325 "desc", 31326 "ellipse", 31327 "g", 31328 "image", 31329 "line", 31330 "filter", 31331 "marker", 31332 "mask", 31333 "metadata", 31334 "path", 31335 "pattern", 31336 "polygon", 31337 "polyline", 31338 "rect", 31339 "stop", 31340 "svg", 31341 "switch", 31342 "symbol", 31343 "text", 31344 "tspan", 31345 "use", 31346 "view", 31347 ]; 31348 31349 31350 31351 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs 31352 31353 31354 function isSVGComponent(Component) { 31355 if ( 31356 /** 31357 * If it's not a string, it's a custom React component. Currently we only support 31358 * HTML custom React components. 31359 */ 31360 typeof Component !== "string" || 31361 /** 31362 * If it contains a dash, the element is a custom HTML webcomponent. 31363 */ 31364 Component.includes("-")) { 31365 return false; 31366 } 31367 else if ( 31368 /** 31369 * If it's in our list of lowercase SVG tags, it's an SVG component 31370 */ 31371 lowercaseSVGElements.indexOf(Component) > -1 || 31372 /** 31373 * If it contains a capital letter, it's an SVG component 31374 */ 31375 /[A-Z]/.test(Component)) { 31376 return true; 31377 } 31378 return false; 31379 } 31380 31381 31382 31383 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs 31384 31385 31386 31387 function isForcedMotionValue(key, _a) { 31388 var layout = _a.layout, layoutId = _a.layoutId; 31389 return (isTransformProp(key) || 31390 isTransformOriginProp(key) || 31391 ((layout || layoutId !== undefined) && 31392 (!!scaleCorrectors[key] || key === "opacity"))); 31393 } 31394 31395 31396 31397 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs 31398 31399 31400 var translateAlias = { 31401 x: "translateX", 31402 y: "translateY", 31403 z: "translateZ", 31404 transformPerspective: "perspective", 31405 }; 31406 /** 31407 * Build a CSS transform style from individual x/y/scale etc properties. 31408 * 31409 * This outputs with a default order of transforms/scales/rotations, this can be customised by 31410 * providing a transformTemplate function. 31411 */ 31412 function buildTransform(_a, _b, transformIsDefault, transformTemplate) { 31413 var transform = _a.transform, transformKeys = _a.transformKeys; 31414 var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d; 31415 // The transform string we're going to build into. 31416 var transformString = ""; 31417 // Transform keys into their default order - this will determine the output order. 31418 transformKeys.sort(sortTransformProps); 31419 // Track whether the defined transform has a defined z so we don't add a 31420 // second to enable hardware acceleration 31421 var transformHasZ = false; 31422 // Loop over each transform and build them into transformString 31423 var numTransformKeys = transformKeys.length; 31424 for (var i = 0; i < numTransformKeys; i++) { 31425 var key = transformKeys[i]; 31426 transformString += "".concat(translateAlias[key] || key, "(").concat(transform[key], ") "); 31427 if (key === "z") 31428 transformHasZ = true; 31429 } 31430 if (!transformHasZ && enableHardwareAcceleration) { 31431 transformString += "translateZ(0)"; 31432 } 31433 else { 31434 transformString = transformString.trim(); 31435 } 31436 // If we have a custom `transform` template, pass our transform values and 31437 // generated transformString to that before returning 31438 if (transformTemplate) { 31439 transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); 31440 } 31441 else if (allowTransformNone && transformIsDefault) { 31442 transformString = "none"; 31443 } 31444 return transformString; 31445 } 31446 /** 31447 * Build a transformOrigin style. Uses the same defaults as the browser for 31448 * undefined origins. 31449 */ 31450 function buildTransformOrigin(_a) { 31451 var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d; 31452 return "".concat(originX, " ").concat(originY, " ").concat(originZ); 31453 } 31454 31455 31456 31457 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs 31458 /** 31459 * Returns true if the provided key is a CSS variable 31460 */ 31461 function isCSSVariable(key) { 31462 return key.startsWith("--"); 31463 } 31464 31465 31466 31467 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs 31468 /** 31469 * Provided a value and a ValueType, returns the value as that value type. 31470 */ 31471 var getValueAsType = function (value, type) { 31472 return type && typeof value === "number" 31473 ? type.transform(value) 31474 : value; 31475 }; 31476 31477 31478 31479 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs 31480 31481 31482 31483 31484 31485 31486 function buildHTMLStyles(state, latestValues, options, transformTemplate) { 31487 var _a; 31488 var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin; 31489 // Empty the transformKeys array. As we're throwing out refs to its items 31490 // this might not be as cheap as suspected. Maybe using the array as a buffer 31491 // with a manual incrementation would be better. 31492 transformKeys.length = 0; 31493 // Track whether we encounter any transform or transformOrigin values. 31494 var hasTransform = false; 31495 var hasTransformOrigin = false; 31496 // Does the calculated transform essentially equal "none"? 31497 var transformIsNone = true; 31498 /** 31499 * Loop over all our latest animated values and decide whether to handle them 31500 * as a style or CSS variable. 31501 * 31502 * Transforms and transform origins are kept seperately for further processing. 31503 */ 31504 for (var key in latestValues) { 31505 var value = latestValues[key]; 31506 /** 31507 * If this is a CSS variable we don't do any further processing. 31508 */ 31509 if (isCSSVariable(key)) { 31510 vars[key] = value; 31511 continue; 31512 } 31513 // Convert the value to its default value type, ie 0 -> "0px" 31514 var valueType = numberValueTypes[key]; 31515 var valueAsType = getValueAsType(value, valueType); 31516 if (isTransformProp(key)) { 31517 // If this is a transform, flag to enable further transform processing 31518 hasTransform = true; 31519 transform[key] = valueAsType; 31520 transformKeys.push(key); 31521 // If we already know we have a non-default transform, early return 31522 if (!transformIsNone) 31523 continue; 31524 // Otherwise check to see if this is a default transform 31525 if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) 31526 transformIsNone = false; 31527 } 31528 else if (isTransformOriginProp(key)) { 31529 transformOrigin[key] = valueAsType; 31530 // If this is a transform origin, flag and enable further transform-origin processing 31531 hasTransformOrigin = true; 31532 } 31533 else { 31534 style[key] = valueAsType; 31535 } 31536 } 31537 if (hasTransform) { 31538 style.transform = buildTransform(state, options, transformIsNone, transformTemplate); 31539 } 31540 else if (transformTemplate) { 31541 style.transform = transformTemplate({}, ""); 31542 } 31543 else if (!latestValues.transform && style.transform) { 31544 style.transform = "none"; 31545 } 31546 if (hasTransformOrigin) { 31547 style.transformOrigin = buildTransformOrigin(transformOrigin); 31548 } 31549 } 31550 31551 31552 31553 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs 31554 var createHtmlRenderState = function () { return ({ 31555 style: {}, 31556 transform: {}, 31557 transformKeys: [], 31558 transformOrigin: {}, 31559 vars: {}, 31560 }); }; 31561 31562 31563 31564 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.mjs 31565 31566 31567 31568 31569 31570 31571 31572 function copyRawValuesOnly(target, source, props) { 31573 for (var key in source) { 31574 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { 31575 target[key] = source[key]; 31576 } 31577 } 31578 } 31579 function useInitialMotionValues(_a, visualState, isStatic) { 31580 var transformTemplate = _a.transformTemplate; 31581 return (0,external_React_.useMemo)(function () { 31582 var state = createHtmlRenderState(); 31583 buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate); 31584 var vars = state.vars, style = state.style; 31585 return __assign(__assign({}, vars), style); 31586 }, [visualState]); 31587 } 31588 function useStyle(props, visualState, isStatic) { 31589 var styleProp = props.style || {}; 31590 var style = {}; 31591 /** 31592 * Copy non-Motion Values straight into style 31593 */ 31594 copyRawValuesOnly(style, styleProp, props); 31595 Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); 31596 if (props.transformValues) { 31597 style = props.transformValues(style); 31598 } 31599 return style; 31600 } 31601 function useHTMLProps(props, visualState, isStatic) { 31602 // The `any` isn't ideal but it is the type of createElement props argument 31603 var htmlProps = {}; 31604 var style = useStyle(props, visualState, isStatic); 31605 if (Boolean(props.drag) && props.dragListener !== false) { 31606 // Disable the ghost element when a user drags 31607 htmlProps.draggable = false; 31608 // Disable text selection 31609 style.userSelect = 31610 style.WebkitUserSelect = 31611 style.WebkitTouchCallout = 31612 "none"; 31613 // Disable scrolling on the draggable direction 31614 style.touchAction = 31615 props.drag === true 31616 ? "none" 31617 : "pan-".concat(props.drag === "x" ? "y" : "x"); 31618 } 31619 htmlProps.style = style; 31620 return htmlProps; 31621 } 31622 31623 31624 31625 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs 31626 /** 31627 * A list of all valid MotionProps. 31628 * 31629 * @internalremarks 31630 * This doesn't throw if a `MotionProp` name is missing - it should. 31631 */ 31632 var validMotionProps = new Set([ 31633 "initial", 31634 "animate", 31635 "exit", 31636 "style", 31637 "variants", 31638 "transition", 31639 "transformTemplate", 31640 "transformValues", 31641 "custom", 31642 "inherit", 31643 "layout", 31644 "layoutId", 31645 "layoutDependency", 31646 "onLayoutAnimationStart", 31647 "onLayoutAnimationComplete", 31648 "onLayoutMeasure", 31649 "onBeforeLayoutMeasure", 31650 "onAnimationStart", 31651 "onAnimationComplete", 31652 "onUpdate", 31653 "onDragStart", 31654 "onDrag", 31655 "onDragEnd", 31656 "onMeasureDragConstraints", 31657 "onDirectionLock", 31658 "onDragTransitionEnd", 31659 "drag", 31660 "dragControls", 31661 "dragListener", 31662 "dragConstraints", 31663 "dragDirectionLock", 31664 "dragSnapToOrigin", 31665 "_dragX", 31666 "_dragY", 31667 "dragElastic", 31668 "dragMomentum", 31669 "dragPropagation", 31670 "dragTransition", 31671 "whileDrag", 31672 "onPan", 31673 "onPanStart", 31674 "onPanEnd", 31675 "onPanSessionStart", 31676 "onTap", 31677 "onTapStart", 31678 "onTapCancel", 31679 "onHoverStart", 31680 "onHoverEnd", 31681 "whileFocus", 31682 "whileTap", 31683 "whileHover", 31684 "whileInView", 31685 "onViewportEnter", 31686 "onViewportLeave", 31687 "viewport", 31688 "layoutScroll", 31689 ]); 31690 /** 31691 * Check whether a prop name is a valid `MotionProp` key. 31692 * 31693 * @param key - Name of the property to check 31694 * @returns `true` is key is a valid `MotionProp`. 31695 * 31696 * @public 31697 */ 31698 function isValidMotionProp(key) { 31699 return validMotionProps.has(key); 31700 } 31701 31702 31703 31704 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs 31705 31706 31707 var shouldForward = function (key) { return !isValidMotionProp(key); }; 31708 function loadExternalIsValidProp(isValidProp) { 31709 if (!isValidProp) 31710 return; 31711 // Explicitly filter our events 31712 shouldForward = function (key) { 31713 return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); 31714 }; 31715 } 31716 /** 31717 * Emotion and Styled Components both allow users to pass through arbitrary props to their components 31718 * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which 31719 * of these should be passed to the underlying DOM node. 31720 * 31721 * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props 31722 * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props 31723 * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of 31724 * `@emotion/is-prop-valid`, however to fix this problem we need to use it. 31725 * 31726 * By making it an optionalDependency we can offer this functionality only in the situations where it's 31727 * actually required. 31728 */ 31729 try { 31730 /** 31731 * We attempt to import this package but require won't be defined in esm environments, in that case 31732 * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed 31733 * in favour of explicit injection. 31734 */ 31735 loadExternalIsValidProp(require("@emotion/is-prop-valid").default); 31736 } 31737 catch (_a) { 31738 // We don't need to actually do anything here - the fallback is the existing `isPropValid`. 31739 } 31740 function filterProps(props, isDom, forwardMotionProps) { 31741 var filteredProps = {}; 31742 for (var key in props) { 31743 if (shouldForward(key) || 31744 (forwardMotionProps === true && isValidMotionProp(key)) || 31745 (!isDom && !isValidMotionProp(key)) || 31746 // If trying to use native HTML drag events, forward drag listeners 31747 (props["draggable"] && key.startsWith("onDrag"))) { 31748 filteredProps[key] = props[key]; 31749 } 31750 } 31751 return filteredProps; 31752 } 31753 31754 31755 31756 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs 31757 31758 31759 function calcOrigin(origin, offset, size) { 31760 return typeof origin === "string" 31761 ? origin 31762 : px.transform(offset + size * origin); 31763 } 31764 /** 31765 * The SVG transform origin defaults are different to CSS and is less intuitive, 31766 * so we use the measured dimensions of the SVG to reconcile these. 31767 */ 31768 function calcSVGTransformOrigin(dimensions, originX, originY) { 31769 var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width); 31770 var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height); 31771 return "".concat(pxOriginX, " ").concat(pxOriginY); 31772 } 31773 31774 31775 31776 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.mjs 31777 31778 31779 var dashKeys = { 31780 offset: "stroke-dashoffset", 31781 array: "stroke-dasharray", 31782 }; 31783 var camelKeys = { 31784 offset: "strokeDashoffset", 31785 array: "strokeDasharray", 31786 }; 31787 /** 31788 * Build SVG path properties. Uses the path's measured length to convert 31789 * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset 31790 * and stroke-dasharray attributes. 31791 * 31792 * This function is mutative to reduce per-frame GC. 31793 */ 31794 function buildSVGPath(attrs, length, spacing, offset, useDashCase) { 31795 if (spacing === void 0) { spacing = 1; } 31796 if (offset === void 0) { offset = 0; } 31797 if (useDashCase === void 0) { useDashCase = true; } 31798 // Normalise path length by setting SVG attribute pathLength to 1 31799 attrs.pathLength = 1; 31800 // We use dash case when setting attributes directly to the DOM node and camel case 31801 // when defining props on a React component. 31802 var keys = useDashCase ? dashKeys : camelKeys; 31803 // Build the dash offset 31804 attrs[keys.offset] = px.transform(-offset); 31805 // Build the dash array 31806 var pathLength = px.transform(length); 31807 var pathSpacing = px.transform(spacing); 31808 attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing); 31809 } 31810 31811 31812 31813 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs 31814 31815 31816 31817 31818 31819 /** 31820 * Build SVG visual attrbutes, like cx and style.transform 31821 */ 31822 function buildSVGAttrs(state, _a, options, transformTemplate) { 31823 var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, 31824 // This is object creation, which we try to avoid per-frame. 31825 latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); 31826 buildHTMLStyles(state, latest, options, transformTemplate); 31827 state.attrs = state.style; 31828 state.style = {}; 31829 var attrs = state.attrs, style = state.style, dimensions = state.dimensions; 31830 /** 31831 * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs 31832 * and copy it into style. 31833 */ 31834 if (attrs.transform) { 31835 if (dimensions) 31836 style.transform = attrs.transform; 31837 delete attrs.transform; 31838 } 31839 // Parse transformOrigin 31840 if (dimensions && 31841 (originX !== undefined || originY !== undefined || style.transform)) { 31842 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); 31843 } 31844 // Treat x/y not as shortcuts but as actual attributes 31845 if (attrX !== undefined) 31846 attrs.x = attrX; 31847 if (attrY !== undefined) 31848 attrs.y = attrY; 31849 // Build SVG path if one has been defined 31850 if (pathLength !== undefined) { 31851 buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); 31852 } 31853 } 31854 31855 31856 31857 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs 31858 31859 31860 31861 var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); }; 31862 31863 31864 31865 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs 31866 31867 31868 31869 31870 31871 31872 function useSVGProps(props, visualState) { 31873 var visualProps = (0,external_React_.useMemo)(function () { 31874 var state = createSvgRenderState(); 31875 buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate); 31876 return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) }); 31877 }, [visualState]); 31878 if (props.style) { 31879 var rawStyles = {}; 31880 copyRawValuesOnly(rawStyles, props.style, props); 31881 visualProps.style = __assign(__assign({}, rawStyles), visualProps.style); 31882 } 31883 return visualProps; 31884 } 31885 31886 31887 31888 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs 31889 31890 31891 31892 31893 31894 31895 31896 function createUseRender(forwardMotionProps) { 31897 if (forwardMotionProps === void 0) { forwardMotionProps = false; } 31898 var useRender = function (Component, props, projectionId, ref, _a, isStatic) { 31899 var latestValues = _a.latestValues; 31900 var useVisualProps = isSVGComponent(Component) 31901 ? useSVGProps 31902 : useHTMLProps; 31903 var visualProps = useVisualProps(props, latestValues, isStatic); 31904 var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); 31905 var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref }); 31906 if (projectionId) { 31907 elementProps["data-projection-id"] = projectionId; 31908 } 31909 return (0,external_React_.createElement)(Component, elementProps); 31910 }; 31911 return useRender; 31912 } 31913 31914 31915 31916 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs 31917 var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; 31918 var REPLACE_TEMPLATE = "$1-$2"; 31919 /** 31920 * Convert camelCase to dash-case properties. 31921 */ 31922 var camelToDash = function (str) { 31923 return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); 31924 }; 31925 31926 31927 31928 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs 31929 function renderHTML(element, _a, styleProp, projection) { 31930 var style = _a.style, vars = _a.vars; 31931 Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); 31932 // Loop over any CSS variables and assign those. 31933 for (var key in vars) { 31934 element.style.setProperty(key, vars[key]); 31935 } 31936 } 31937 31938 31939 31940 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs 31941 /** 31942 * A set of attribute names that are always read/written as camel case. 31943 */ 31944 var camelCaseAttributes = new Set([ 31945 "baseFrequency", 31946 "diffuseConstant", 31947 "kernelMatrix", 31948 "kernelUnitLength", 31949 "keySplines", 31950 "keyTimes", 31951 "limitingConeAngle", 31952 "markerHeight", 31953 "markerWidth", 31954 "numOctaves", 31955 "targetX", 31956 "targetY", 31957 "surfaceScale", 31958 "specularConstant", 31959 "specularExponent", 31960 "stdDeviation", 31961 "tableValues", 31962 "viewBox", 31963 "gradientTransform", 31964 "pathLength", 31965 ]); 31966 31967 31968 31969 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs 31970 31971 31972 31973 31974 function renderSVG(element, renderState, _styleProp, projection) { 31975 renderHTML(element, renderState, undefined, projection); 31976 for (var key in renderState.attrs) { 31977 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); 31978 } 31979 } 31980 31981 31982 31983 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs 31984 31985 31986 31987 function scrapeMotionValuesFromProps(props) { 31988 var style = props.style; 31989 var newValues = {}; 31990 for (var key in style) { 31991 if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { 31992 newValues[key] = style[key]; 31993 } 31994 } 31995 return newValues; 31996 } 31997 31998 31999 32000 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs 32001 32002 32003 32004 function scrape_motion_values_scrapeMotionValuesFromProps(props) { 32005 var newValues = scrapeMotionValuesFromProps(props); 32006 for (var key in props) { 32007 if (isMotionValue(props[key])) { 32008 var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; 32009 newValues[targetKey] = props[key]; 32010 } 32011 } 32012 return newValues; 32013 } 32014 32015 32016 32017 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs 32018 function isAnimationControls(v) { 32019 return typeof v === "object" && typeof v.start === "function"; 32020 } 32021 32022 32023 32024 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs 32025 32026 32027 32028 32029 32030 32031 32032 32033 32034 function makeState(_a, props, context, presenceContext) { 32035 var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount; 32036 var state = { 32037 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), 32038 renderState: createRenderState(), 32039 }; 32040 if (onMount) { 32041 state.mount = function (instance) { return onMount(props, instance, state); }; 32042 } 32043 return state; 32044 } 32045 var makeUseVisualState = function (config) { 32046 return function (props, isStatic) { 32047 var context = (0,external_React_.useContext)(MotionContext); 32048 var presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext); 32049 return isStatic 32050 ? makeState(config, props, context, presenceContext) 32051 : useConstant(function () { 32052 return makeState(config, props, context, presenceContext); 32053 }); 32054 }; 32055 }; 32056 function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { 32057 var values = {}; 32058 var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; 32059 var motionValues = scrapeMotionValues(props); 32060 for (var key in motionValues) { 32061 values[key] = resolveMotionValue(motionValues[key]); 32062 } 32063 var initial = props.initial, animate = props.animate; 32064 var isControllingVariants = checkIfControllingVariants(props); 32065 var isVariantNode = checkIfVariantNode(props); 32066 if (context && 32067 isVariantNode && 32068 !isControllingVariants && 32069 props.inherit !== false) { 32070 initial !== null && initial !== void 0 ? initial : (initial = context.initial); 32071 animate !== null && animate !== void 0 ? animate : (animate = context.animate); 32072 } 32073 var initialAnimationIsBlocked = blockInitialAnimation || initial === false; 32074 var variantToSet = initialAnimationIsBlocked ? animate : initial; 32075 if (variantToSet && 32076 typeof variantToSet !== "boolean" && 32077 !isAnimationControls(variantToSet)) { 32078 var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; 32079 list.forEach(function (definition) { 32080 var resolved = resolveVariantFromProps(props, definition); 32081 if (!resolved) 32082 return; 32083 var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, ["transitionEnd", "transition"]); 32084 for (var key in target) { 32085 var valueTarget = target[key]; 32086 if (Array.isArray(valueTarget)) { 32087 /** 32088 * Take final keyframe if the initial animation is blocked because 32089 * we want to initialise at the end of that blocked animation. 32090 */ 32091 var index = initialAnimationIsBlocked 32092 ? valueTarget.length - 1 32093 : 0; 32094 valueTarget = valueTarget[index]; 32095 } 32096 if (valueTarget !== null) { 32097 values[key] = valueTarget; 32098 } 32099 } 32100 for (var key in transitionEnd) 32101 values[key] = transitionEnd[key]; 32102 }); 32103 } 32104 return values; 32105 } 32106 32107 32108 32109 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.mjs 32110 32111 32112 32113 32114 32115 32116 var svgMotionConfig = { 32117 useVisualState: makeUseVisualState({ 32118 scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, 32119 createRenderState: createSvgRenderState, 32120 onMount: function (props, instance, _a) { 32121 var renderState = _a.renderState, latestValues = _a.latestValues; 32122 try { 32123 renderState.dimensions = 32124 typeof instance.getBBox === 32125 "function" 32126 ? instance.getBBox() 32127 : instance.getBoundingClientRect(); 32128 } 32129 catch (e) { 32130 // Most likely trying to measure an unrendered element under Firefox 32131 renderState.dimensions = { 32132 x: 0, 32133 y: 0, 32134 width: 0, 32135 height: 0, 32136 }; 32137 } 32138 buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, props.transformTemplate); 32139 renderSVG(instance, renderState); 32140 }, 32141 }), 32142 }; 32143 32144 32145 32146 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.mjs 32147 32148 32149 32150 32151 var htmlMotionConfig = { 32152 useVisualState: makeUseVisualState({ 32153 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, 32154 createRenderState: createHtmlRenderState, 32155 }), 32156 }; 32157 32158 32159 32160 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs 32161 32162 32163 32164 32165 32166 32167 function create_config_createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) { 32168 var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b; 32169 var baseConfig = isSVGComponent(Component) 32170 ? svgMotionConfig 32171 : htmlMotionConfig; 32172 return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement, projectionNodeConstructor: projectionNodeConstructor, Component: Component }); 32173 } 32174 32175 32176 32177 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/types.mjs 32178 var AnimationType; 32179 (function (AnimationType) { 32180 AnimationType["Animate"] = "animate"; 32181 AnimationType["Hover"] = "whileHover"; 32182 AnimationType["Tap"] = "whileTap"; 32183 AnimationType["Drag"] = "whileDrag"; 32184 AnimationType["Focus"] = "whileFocus"; 32185 AnimationType["InView"] = "whileInView"; 32186 AnimationType["Exit"] = "exit"; 32187 })(AnimationType || (AnimationType = {})); 32188 32189 32190 32191 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-dom-event.mjs 32192 32193 32194 function addDomEvent(target, eventName, handler, options) { 32195 target.addEventListener(eventName, handler, options); 32196 return function () { return target.removeEventListener(eventName, handler, options); }; 32197 } 32198 /** 32199 * Attaches an event listener directly to the provided DOM element. 32200 * 32201 * Bypassing React's event system can be desirable, for instance when attaching non-passive 32202 * event handlers. 32203 * 32204 * ```jsx 32205 * const ref = useRef(null) 32206 * 32207 * useDomEvent(ref, 'wheel', onWheel, { passive: false }) 32208 * 32209 * return <div ref={ref} /> 32210 * ``` 32211 * 32212 * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. 32213 * @param eventName - Name of the event you want listen for. 32214 * @param handler - Function to fire when receiving the event. 32215 * @param options - Options to pass to `Event.addEventListener`. 32216 * 32217 * @public 32218 */ 32219 function useDomEvent(ref, eventName, handler, options) { 32220 (0,external_React_.useEffect)(function () { 32221 var element = ref.current; 32222 if (handler && element) { 32223 return addDomEvent(element, eventName, handler, options); 32224 } 32225 }, [ref, eventName, handler, options]); 32226 } 32227 32228 32229 32230 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.mjs 32231 32232 32233 32234 /** 32235 * 32236 * @param props 32237 * @param ref 32238 * @internal 32239 */ 32240 function useFocusGesture(_a) { 32241 var whileFocus = _a.whileFocus, visualElement = _a.visualElement; 32242 var onFocus = function () { 32243 var _a; 32244 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true); 32245 }; 32246 var onBlur = function () { 32247 var _a; 32248 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false); 32249 }; 32250 useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); 32251 useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); 32252 } 32253 32254 32255 32256 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/event-type.mjs 32257 function isMouseEvent(event) { 32258 // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. 32259 if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { 32260 return !!(event.pointerType === "mouse"); 32261 } 32262 return event instanceof MouseEvent; 32263 } 32264 function isTouchEvent(event) { 32265 var hasTouches = !!event.touches; 32266 return hasTouches; 32267 } 32268 32269 32270 32271 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.mjs 32272 32273 32274 /** 32275 * Filters out events not attached to the primary pointer (currently left mouse button) 32276 * @param eventHandler 32277 */ 32278 function filterPrimaryPointer(eventHandler) { 32279 return function (event) { 32280 var isMouseEvent = event instanceof MouseEvent; 32281 var isPrimaryPointer = !isMouseEvent || 32282 (isMouseEvent && event.button === 0); 32283 if (isPrimaryPointer) { 32284 eventHandler(event); 32285 } 32286 }; 32287 } 32288 var defaultPagePoint = { pageX: 0, pageY: 0 }; 32289 function pointFromTouch(e, pointType) { 32290 if (pointType === void 0) { pointType = "page"; } 32291 var primaryTouch = e.touches[0] || e.changedTouches[0]; 32292 var point = primaryTouch || defaultPagePoint; 32293 return { 32294 x: point[pointType + "X"], 32295 y: point[pointType + "Y"], 32296 }; 32297 } 32298 function pointFromMouse(point, pointType) { 32299 if (pointType === void 0) { pointType = "page"; } 32300 return { 32301 x: point[pointType + "X"], 32302 y: point[pointType + "Y"], 32303 }; 32304 } 32305 function extractEventInfo(event, pointType) { 32306 if (pointType === void 0) { pointType = "page"; } 32307 return { 32308 point: isTouchEvent(event) 32309 ? pointFromTouch(event, pointType) 32310 : pointFromMouse(event, pointType), 32311 }; 32312 } 32313 var wrapHandler = function (handler, shouldFilterPrimaryPointer) { 32314 if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; } 32315 var listener = function (event) { 32316 return handler(event, extractEventInfo(event)); 32317 }; 32318 return shouldFilterPrimaryPointer 32319 ? filterPrimaryPointer(listener) 32320 : listener; 32321 }; 32322 32323 32324 32325 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/utils.mjs 32326 32327 32328 // We check for event support via functions in case they've been mocked by a testing suite. 32329 var supportsPointerEvents = function () { 32330 return is_browser_isBrowser && window.onpointerdown === null; 32331 }; 32332 var supportsTouchEvents = function () { 32333 return is_browser_isBrowser && window.ontouchstart === null; 32334 }; 32335 var supportsMouseEvents = function () { 32336 return is_browser_isBrowser && window.onmousedown === null; 32337 }; 32338 32339 32340 32341 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-pointer-event.mjs 32342 32343 32344 32345 32346 var mouseEventNames = { 32347 pointerdown: "mousedown", 32348 pointermove: "mousemove", 32349 pointerup: "mouseup", 32350 pointercancel: "mousecancel", 32351 pointerover: "mouseover", 32352 pointerout: "mouseout", 32353 pointerenter: "mouseenter", 32354 pointerleave: "mouseleave", 32355 }; 32356 var touchEventNames = { 32357 pointerdown: "touchstart", 32358 pointermove: "touchmove", 32359 pointerup: "touchend", 32360 pointercancel: "touchcancel", 32361 }; 32362 function getPointerEventName(name) { 32363 if (supportsPointerEvents()) { 32364 return name; 32365 } 32366 else if (supportsTouchEvents()) { 32367 return touchEventNames[name]; 32368 } 32369 else if (supportsMouseEvents()) { 32370 return mouseEventNames[name]; 32371 } 32372 return name; 32373 } 32374 function addPointerEvent(target, eventName, handler, options) { 32375 return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); 32376 } 32377 function usePointerEvent(ref, eventName, handler, options) { 32378 return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); 32379 } 32380 32381 32382 32383 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs 32384 function createLock(name) { 32385 var lock = null; 32386 return function () { 32387 var openLock = function () { 32388 lock = null; 32389 }; 32390 if (lock === null) { 32391 lock = name; 32392 return openLock; 32393 } 32394 return false; 32395 }; 32396 } 32397 var globalHorizontalLock = createLock("dragHorizontal"); 32398 var globalVerticalLock = createLock("dragVertical"); 32399 function getGlobalLock(drag) { 32400 var lock = false; 32401 if (drag === "y") { 32402 lock = globalVerticalLock(); 32403 } 32404 else if (drag === "x") { 32405 lock = globalHorizontalLock(); 32406 } 32407 else { 32408 var openHorizontal_1 = globalHorizontalLock(); 32409 var openVertical_1 = globalVerticalLock(); 32410 if (openHorizontal_1 && openVertical_1) { 32411 lock = function () { 32412 openHorizontal_1(); 32413 openVertical_1(); 32414 }; 32415 } 32416 else { 32417 // Release the locks because we don't use them 32418 if (openHorizontal_1) 32419 openHorizontal_1(); 32420 if (openVertical_1) 32421 openVertical_1(); 32422 } 32423 } 32424 return lock; 32425 } 32426 function isDragActive() { 32427 // Check the gesture lock - if we get it, it means no drag gesture is active 32428 // and we can safely fire the tap gesture. 32429 var openGestureLock = getGlobalLock(true); 32430 if (!openGestureLock) 32431 return true; 32432 openGestureLock(); 32433 return false; 32434 } 32435 32436 32437 32438 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.mjs 32439 32440 32441 32442 32443 32444 function createHoverEvent(visualElement, isActive, callback) { 32445 return function (event, info) { 32446 var _a; 32447 if (!isMouseEvent(event) || isDragActive()) 32448 return; 32449 /** 32450 * Ensure we trigger animations before firing event callback 32451 */ 32452 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive); 32453 callback === null || callback === void 0 ? void 0 : callback(event, info); 32454 }; 32455 } 32456 function useHoverGesture(_a) { 32457 var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement; 32458 usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover 32459 ? createHoverEvent(visualElement, true, onHoverStart) 32460 : undefined); 32461 usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover 32462 ? createHoverEvent(visualElement, false, onHoverEnd) 32463 : undefined); 32464 } 32465 32466 32467 32468 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs 32469 /** 32470 * Recursively traverse up the tree to check whether the provided child node 32471 * is the parent or a descendant of it. 32472 * 32473 * @param parent - Element to find 32474 * @param child - Element to test against parent 32475 */ 32476 var isNodeOrChild = function (parent, child) { 32477 if (!child) { 32478 return false; 32479 } 32480 else if (parent === child) { 32481 return true; 32482 } 32483 else { 32484 return isNodeOrChild(parent, child.parentElement); 32485 } 32486 }; 32487 32488 32489 32490 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs 32491 32492 32493 function useUnmountEffect(callback) { 32494 return (0,external_React_.useEffect)(function () { return function () { return callback(); }; }, []); 32495 } 32496 32497 32498 32499 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.mjs 32500 32501 32502 32503 32504 32505 32506 32507 32508 /** 32509 * @param handlers - 32510 * @internal 32511 */ 32512 function useTapGesture(_a) { 32513 var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement; 32514 var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; 32515 var isPressing = (0,external_React_.useRef)(false); 32516 var cancelPointerEndListeners = (0,external_React_.useRef)(null); 32517 function removePointerEndListener() { 32518 var _a; 32519 (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); 32520 cancelPointerEndListeners.current = null; 32521 } 32522 function checkPointerEnd() { 32523 var _a; 32524 removePointerEndListener(); 32525 isPressing.current = false; 32526 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false); 32527 return !isDragActive(); 32528 } 32529 function onPointerUp(event, info) { 32530 if (!checkPointerEnd()) 32531 return; 32532 /** 32533 * We only count this as a tap gesture if the event.target is the same 32534 * as, or a child of, this component's element 32535 */ 32536 !isNodeOrChild(visualElement.getInstance(), event.target) 32537 ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) 32538 : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); 32539 } 32540 function onPointerCancel(event, info) { 32541 if (!checkPointerEnd()) 32542 return; 32543 onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); 32544 } 32545 function onPointerDown(event, info) { 32546 var _a; 32547 removePointerEndListener(); 32548 if (isPressing.current) 32549 return; 32550 isPressing.current = true; 32551 cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel)); 32552 /** 32553 * Ensure we trigger animations before firing event callback 32554 */ 32555 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true); 32556 onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); 32557 } 32558 usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined); 32559 useUnmountEffect(removePointerEndListener); 32560 } 32561 32562 32563 32564 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs 32565 32566 32567 /** 32568 * Map an IntersectionHandler callback to an element. We only ever make one handler for one 32569 * element, so even though these handlers might all be triggered by different 32570 * observers, we can keep them in the same map. 32571 */ 32572 var observerCallbacks = new WeakMap(); 32573 /** 32574 * Multiple observers can be created for multiple element/document roots. Each with 32575 * different settings. So here we store dictionaries of observers to each root, 32576 * using serialised settings (threshold/margin) as lookup keys. 32577 */ 32578 var observers = new WeakMap(); 32579 var fireObserverCallback = function (entry) { 32580 var _a; 32581 (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); 32582 }; 32583 var fireAllObserverCallbacks = function (entries) { 32584 entries.forEach(fireObserverCallback); 32585 }; 32586 function initIntersectionObserver(_a) { 32587 var root = _a.root, options = __rest(_a, ["root"]); 32588 var lookupRoot = root || document; 32589 /** 32590 * If we don't have an observer lookup map for this root, create one. 32591 */ 32592 if (!observers.has(lookupRoot)) { 32593 observers.set(lookupRoot, {}); 32594 } 32595 var rootObservers = observers.get(lookupRoot); 32596 var key = JSON.stringify(options); 32597 /** 32598 * If we don't have an observer for this combination of root and settings, 32599 * create one. 32600 */ 32601 if (!rootObservers[key]) { 32602 rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __assign({ root: root }, options)); 32603 } 32604 return rootObservers[key]; 32605 } 32606 function observeIntersection(element, options, callback) { 32607 var rootInteresectionObserver = initIntersectionObserver(options); 32608 observerCallbacks.set(element, callback); 32609 rootInteresectionObserver.observe(element); 32610 return function () { 32611 observerCallbacks.delete(element); 32612 rootInteresectionObserver.unobserve(element); 32613 }; 32614 } 32615 32616 32617 32618 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/use-viewport.mjs 32619 32620 32621 32622 32623 32624 32625 function useViewport(_a) { 32626 var visualElement = _a.visualElement, whileInView = _a.whileInView, onViewportEnter = _a.onViewportEnter, onViewportLeave = _a.onViewportLeave, _b = _a.viewport, viewport = _b === void 0 ? {} : _b; 32627 var state = (0,external_React_.useRef)({ 32628 hasEnteredView: false, 32629 isInView: false, 32630 }); 32631 var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave); 32632 if (viewport.once && state.current.hasEnteredView) 32633 shouldObserve = false; 32634 var useObserver = typeof IntersectionObserver === "undefined" 32635 ? useMissingIntersectionObserver 32636 : use_viewport_useIntersectionObserver; 32637 useObserver(shouldObserve, state.current, visualElement, viewport); 32638 } 32639 var thresholdNames = { 32640 some: 0, 32641 all: 1, 32642 }; 32643 function use_viewport_useIntersectionObserver(shouldObserve, state, visualElement, _a) { 32644 var root = _a.root, rootMargin = _a.margin, _b = _a.amount, amount = _b === void 0 ? "some" : _b, once = _a.once; 32645 (0,external_React_.useEffect)(function () { 32646 if (!shouldObserve) 32647 return; 32648 var options = { 32649 root: root === null || root === void 0 ? void 0 : root.current, 32650 rootMargin: rootMargin, 32651 threshold: typeof amount === "number" ? amount : thresholdNames[amount], 32652 }; 32653 var intersectionCallback = function (entry) { 32654 var _a; 32655 var isIntersecting = entry.isIntersecting; 32656 /** 32657 * If there's been no change in the viewport state, early return. 32658 */ 32659 if (state.isInView === isIntersecting) 32660 return; 32661 state.isInView = isIntersecting; 32662 /** 32663 * Handle hasEnteredView. If this is only meant to run once, and 32664 * element isn't visible, early return. Otherwise set hasEnteredView to true. 32665 */ 32666 if (once && !isIntersecting && state.hasEnteredView) { 32667 return; 32668 } 32669 else if (isIntersecting) { 32670 state.hasEnteredView = true; 32671 } 32672 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, isIntersecting); 32673 /** 32674 * Use the latest committed props rather than the ones in scope 32675 * when this observer is created 32676 */ 32677 var props = visualElement.getProps(); 32678 var callback = isIntersecting 32679 ? props.onViewportEnter 32680 : props.onViewportLeave; 32681 callback === null || callback === void 0 ? void 0 : callback(entry); 32682 }; 32683 return observeIntersection(visualElement.getInstance(), options, intersectionCallback); 32684 }, [shouldObserve, root, rootMargin, amount]); 32685 } 32686 /** 32687 * If IntersectionObserver is missing, we activate inView and fire onViewportEnter 32688 * on mount. This way, the page will be in the state the author expects users 32689 * to see it in for everyone. 32690 */ 32691 function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) { 32692 var _b = _a.fallback, fallback = _b === void 0 ? true : _b; 32693 (0,external_React_.useEffect)(function () { 32694 if (!shouldObserve || !fallback) 32695 return; 32696 if (false) {} 32697 /** 32698 * Fire this in an rAF because, at this point, the animation state 32699 * won't have flushed for the first time and there's certain logic in 32700 * there that behaves differently on the initial animation. 32701 * 32702 * This hook should be quite rarely called so setting this in an rAF 32703 * is preferred to changing the behaviour of the animation state. 32704 */ 32705 requestAnimationFrame(function () { 32706 var _a; 32707 state.hasEnteredView = true; 32708 var onViewportEnter = visualElement.getProps().onViewportEnter; 32709 onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null); 32710 (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, true); 32711 }); 32712 }, [shouldObserve]); 32713 } 32714 32715 32716 32717 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.mjs 32718 var makeRenderlessComponent = function (hook) { return function (props) { 32719 hook(props); 32720 return null; 32721 }; }; 32722 32723 32724 32725 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.mjs 32726 32727 32728 32729 32730 32731 32732 var gestureAnimations = { 32733 inView: makeRenderlessComponent(useViewport), 32734 tap: makeRenderlessComponent(useTapGesture), 32735 focus: makeRenderlessComponent(useFocusGesture), 32736 hover: makeRenderlessComponent(useHoverGesture), 32737 }; 32738 32739 32740 32741 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-id.mjs 32742 32743 32744 var counter = 0; 32745 var incrementId = function () { return counter++; }; 32746 var useId = function () { return useConstant(incrementId); }; 32747 /** 32748 * Ideally we'd use the following code to support React 18 optionally. 32749 * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all). 32750 * Need to come up with a different way of figuring this out. 32751 */ 32752 // export const useId = (React as any).useId 32753 // ? (React as any).useId 32754 // : () => useConstant(incrementId) 32755 32756 32757 32758 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs 32759 32760 32761 32762 32763 /** 32764 * When a component is the child of `AnimatePresence`, it can use `usePresence` 32765 * to access information about whether it's still present in the React tree. 32766 * 32767 * ```jsx 32768 * import { usePresence } from "framer-motion" 32769 * 32770 * export const Component = () => { 32771 * const [isPresent, safeToRemove] = usePresence() 32772 * 32773 * useEffect(() => { 32774 * !isPresent && setTimeout(safeToRemove, 1000) 32775 * }, [isPresent]) 32776 * 32777 * return <div /> 32778 * } 32779 * ``` 32780 * 32781 * If `isPresent` is `false`, it means that a component has been removed the tree, but 32782 * `AnimatePresence` won't really remove it until `safeToRemove` has been called. 32783 * 32784 * @public 32785 */ 32786 function usePresence() { 32787 var context = (0,external_React_.useContext)(PresenceContext_PresenceContext); 32788 if (context === null) 32789 return [true, null]; 32790 var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register; 32791 // It's safe to call the following hooks conditionally (after an early return) because the context will always 32792 // either be null or non-null for the lifespan of the component. 32793 // Replace with useId when released in React 32794 var id = useId(); 32795 (0,external_React_.useEffect)(function () { return register(id); }, []); 32796 var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); }; 32797 return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; 32798 } 32799 /** 32800 * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. 32801 * There is no `safeToRemove` function. 32802 * 32803 * ```jsx 32804 * import { useIsPresent } from "framer-motion" 32805 * 32806 * export const Component = () => { 32807 * const isPresent = useIsPresent() 32808 * 32809 * useEffect(() => { 32810 * !isPresent && console.log("I've been removed!") 32811 * }, [isPresent]) 32812 * 32813 * return <div /> 32814 * } 32815 * ``` 32816 * 32817 * @public 32818 */ 32819 function useIsPresent() { 32820 return isPresent(useContext(PresenceContext)); 32821 } 32822 function isPresent(context) { 32823 return context === null ? true : context.isPresent; 32824 } 32825 32826 32827 32828 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs 32829 function shallowCompare(next, prev) { 32830 if (!Array.isArray(prev)) 32831 return false; 32832 var prevLength = prev.length; 32833 if (prevLength !== next.length) 32834 return false; 32835 for (var i = 0; i < prevLength; i++) { 32836 if (prev[i] !== next[i]) 32837 return false; 32838 } 32839 return true; 32840 } 32841 32842 32843 32844 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs 32845 /** 32846 * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" 32847 */ 32848 var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); }; 32849 32850 32851 32852 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs 32853 /** 32854 * Check if the value is a zero value string like "0px" or "0%" 32855 */ 32856 var isZeroValueString = function (v) { return /^0[^.\s]+$/.test(v); }; 32857 32858 32859 32860 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs 32861 /** 32862 * Tests a provided value against a ValueType 32863 */ 32864 var testValueType = function (v) { return function (type) { return type.test(v); }; }; 32865 32866 32867 32868 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs 32869 /** 32870 * ValueType for "auto" 32871 */ 32872 var auto = { 32873 test: function (v) { return v === "auto"; }, 32874 parse: function (v) { return v; }, 32875 }; 32876 32877 32878 32879 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs 32880 32881 32882 32883 32884 /** 32885 * A list of value types commonly used for dimensions 32886 */ 32887 var dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; 32888 /** 32889 * Tests a dimensional value against the list of dimension ValueTypes 32890 */ 32891 var findDimensionValueType = function (v) { 32892 return dimensionValueTypes.find(testValueType(v)); 32893 }; 32894 32895 32896 32897 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs 32898 32899 32900 32901 32902 32903 /** 32904 * A list of all ValueTypes 32905 */ 32906 var valueTypes = tslib_es6_spreadArray(tslib_es6_spreadArray([], tslib_es6_read(dimensionValueTypes), false), [color, complex], false); 32907 /** 32908 * Tests a value against the list of ValueTypes 32909 */ 32910 var findValueType = function (v) { return valueTypes.find(testValueType(v)); }; 32911 32912 32913 32914 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.mjs 32915 32916 32917 32918 32919 32920 32921 32922 32923 32924 32925 /** 32926 * Set VisualElement's MotionValue, creating a new MotionValue for it if 32927 * it doesn't exist. 32928 */ 32929 function setMotionValue(visualElement, key, value) { 32930 if (visualElement.hasValue(key)) { 32931 visualElement.getValue(key).set(value); 32932 } 32933 else { 32934 visualElement.addValue(key, motionValue(value)); 32935 } 32936 } 32937 function setTarget(visualElement, definition) { 32938 var resolved = resolveVariant(visualElement, definition); 32939 var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]); 32940 target = __assign(__assign({}, target), transitionEnd); 32941 for (var key in target) { 32942 var value = resolveFinalValueInKeyframes(target[key]); 32943 setMotionValue(visualElement, key, value); 32944 } 32945 } 32946 function setVariants(visualElement, variantLabels) { 32947 var reversedLabels = __spreadArray([], __read(variantLabels), false).reverse(); 32948 reversedLabels.forEach(function (key) { 32949 var _a; 32950 var variant = visualElement.getVariant(key); 32951 variant && setTarget(visualElement, variant); 32952 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { 32953 setVariants(child, variantLabels); 32954 }); 32955 }); 32956 } 32957 function setValues(visualElement, definition) { 32958 if (Array.isArray(definition)) { 32959 return setVariants(visualElement, definition); 32960 } 32961 else if (typeof definition === "string") { 32962 return setVariants(visualElement, [definition]); 32963 } 32964 else { 32965 setTarget(visualElement, definition); 32966 } 32967 } 32968 function checkTargetForNewValues(visualElement, target, origin) { 32969 var _a, _b, _c; 32970 var _d; 32971 var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); }); 32972 var numNewValues = newValueKeys.length; 32973 if (!numNewValues) 32974 return; 32975 for (var i = 0; i < numNewValues; i++) { 32976 var key = newValueKeys[i]; 32977 var targetValue = target[key]; 32978 var value = null; 32979 /** 32980 * If the target is a series of keyframes, we can use the first value 32981 * in the array. If this first value is null, we'll still need to read from the DOM. 32982 */ 32983 if (Array.isArray(targetValue)) { 32984 value = targetValue[0]; 32985 } 32986 /** 32987 * If the target isn't keyframes, or the first keyframe was null, we need to 32988 * first check if an origin value was explicitly defined in the transition as "from", 32989 * if not read the value from the DOM. As an absolute fallback, take the defined target value. 32990 */ 32991 if (value === null) { 32992 value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; 32993 } 32994 /** 32995 * If value is still undefined or null, ignore it. Preferably this would throw, 32996 * but this was causing issues in Framer. 32997 */ 32998 if (value === undefined || value === null) 32999 continue; 33000 if (typeof value === "string" && 33001 (isNumericalString(value) || isZeroValueString(value))) { 33002 // If this is a number read as a string, ie "0" or "200", convert it to a number 33003 value = parseFloat(value); 33004 } 33005 else if (!findValueType(value) && complex.test(targetValue)) { 33006 value = animatable_none_getAnimatableNone(key, targetValue); 33007 } 33008 visualElement.addValue(key, motionValue(value)); 33009 (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value); 33010 visualElement.setBaseTarget(key, value); 33011 } 33012 } 33013 function getOriginFromTransition(key, transition) { 33014 if (!transition) 33015 return; 33016 var valueTransition = transition[key] || transition["default"] || transition; 33017 return valueTransition.from; 33018 } 33019 function getOrigin(target, transition, visualElement) { 33020 var _a, _b; 33021 var origin = {}; 33022 for (var key in target) { 33023 origin[key] = 33024 (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); 33025 } 33026 return origin; 33027 } 33028 33029 33030 33031 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation.mjs 33032 33033 33034 33035 33036 33037 33038 /** 33039 * @internal 33040 */ 33041 function animateVisualElement(visualElement, definition, options) { 33042 if (options === void 0) { options = {}; } 33043 visualElement.notifyAnimationStart(definition); 33044 var animation; 33045 if (Array.isArray(definition)) { 33046 var animations = definition.map(function (variant) { 33047 return animateVariant(visualElement, variant, options); 33048 }); 33049 animation = Promise.all(animations); 33050 } 33051 else if (typeof definition === "string") { 33052 animation = animateVariant(visualElement, definition, options); 33053 } 33054 else { 33055 var resolvedDefinition = typeof definition === "function" 33056 ? resolveVariant(visualElement, definition, options.custom) 33057 : definition; 33058 animation = animateTarget(visualElement, resolvedDefinition, options); 33059 } 33060 return animation.then(function () { 33061 return visualElement.notifyAnimationComplete(definition); 33062 }); 33063 } 33064 function animateVariant(visualElement, variant, options) { 33065 var _a; 33066 if (options === void 0) { options = {}; } 33067 var resolved = resolveVariant(visualElement, variant, options.custom); 33068 var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; 33069 if (options.transitionOverride) { 33070 transition = options.transitionOverride; 33071 } 33072 /** 33073 * If we have a variant, create a callback that runs it as an animation. 33074 * Otherwise, we resolve a Promise immediately for a composable no-op. 33075 */ 33076 var getAnimation = resolved 33077 ? function () { return animateTarget(visualElement, resolved, options); } 33078 : function () { return Promise.resolve(); }; 33079 /** 33080 * If we have children, create a callback that runs all their animations. 33081 * Otherwise, we resolve a Promise immediately for a composable no-op. 33082 */ 33083 var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) 33084 ? function (forwardDelay) { 33085 if (forwardDelay === void 0) { forwardDelay = 0; } 33086 var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection; 33087 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); 33088 } 33089 : function () { return Promise.resolve(); }; 33090 /** 33091 * If the transition explicitly defines a "when" option, we need to resolve either 33092 * this animation or all children animations before playing the other. 33093 */ 33094 var when = transition.when; 33095 if (when) { 33096 var _c = tslib_es6_read(when === "beforeChildren" 33097 ? [getAnimation, getChildAnimations] 33098 : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1]; 33099 return first().then(last); 33100 } 33101 else { 33102 return Promise.all([getAnimation(), getChildAnimations(options.delay)]); 33103 } 33104 } 33105 /** 33106 * @internal 33107 */ 33108 function animateTarget(visualElement, definition, _a) { 33109 var _b; 33110 var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type; 33111 var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, ["transition", "transitionEnd"]); 33112 if (transitionOverride) 33113 transition = transitionOverride; 33114 var animations = []; 33115 var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); 33116 for (var key in target) { 33117 var value = visualElement.getValue(key); 33118 var valueTarget = target[key]; 33119 if (!value || 33120 valueTarget === undefined || 33121 (animationTypeState && 33122 shouldBlockAnimation(animationTypeState, key))) { 33123 continue; 33124 } 33125 var valueTransition = __assign({ delay: delay }, transition); 33126 /** 33127 * Make animation instant if this is a transform prop and we should reduce motion. 33128 */ 33129 if (visualElement.shouldReduceMotion && isTransformProp(key)) { 33130 valueTransition = __assign(__assign({}, valueTransition), { type: false, delay: 0 }); 33131 } 33132 var animation = startAnimation(key, value, valueTarget, valueTransition); 33133 animations.push(animation); 33134 } 33135 return Promise.all(animations).then(function () { 33136 transitionEnd && setTarget(visualElement, transitionEnd); 33137 }); 33138 } 33139 function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { 33140 if (delayChildren === void 0) { delayChildren = 0; } 33141 if (staggerChildren === void 0) { staggerChildren = 0; } 33142 if (staggerDirection === void 0) { staggerDirection = 1; } 33143 var animations = []; 33144 var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; 33145 var generateStaggerDuration = staggerDirection === 1 33146 ? function (i) { 33147 if (i === void 0) { i = 0; } 33148 return i * staggerChildren; 33149 } 33150 : function (i) { 33151 if (i === void 0) { i = 0; } 33152 return maxStaggerDuration - i * staggerChildren; 33153 }; 33154 Array.from(visualElement.variantChildren) 33155 .sort(sortByTreeOrder) 33156 .forEach(function (child, i) { 33157 animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); })); 33158 }); 33159 return Promise.all(animations); 33160 } 33161 function stopAnimation(visualElement) { 33162 visualElement.forEachValue(function (value) { return value.stop(); }); 33163 } 33164 function sortByTreeOrder(a, b) { 33165 return a.sortNodePosition(b); 33166 } 33167 /** 33168 * Decide whether we should block this animation. Previously, we achieved this 33169 * just by checking whether the key was listed in protectedKeys, but this 33170 * posed problems if an animation was triggered by afterChildren and protectedKeys 33171 * had been set to true in the meantime. 33172 */ 33173 function shouldBlockAnimation(_a, key) { 33174 var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating; 33175 var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; 33176 needsAnimating[key] = false; 33177 return shouldBlock; 33178 } 33179 33180 33181 33182 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs 33183 33184 33185 33186 33187 33188 33189 33190 33191 var variantPriorityOrder = [ 33192 AnimationType.Animate, 33193 AnimationType.InView, 33194 AnimationType.Focus, 33195 AnimationType.Hover, 33196 AnimationType.Tap, 33197 AnimationType.Drag, 33198 AnimationType.Exit, 33199 ]; 33200 var reversePriorityOrder = tslib_es6_spreadArray([], tslib_es6_read(variantPriorityOrder), false).reverse(); 33201 var numAnimationTypes = variantPriorityOrder.length; 33202 function animateList(visualElement) { 33203 return function (animations) { 33204 return Promise.all(animations.map(function (_a) { 33205 var animation = _a.animation, options = _a.options; 33206 return animateVisualElement(visualElement, animation, options); 33207 })); 33208 }; 33209 } 33210 function createAnimationState(visualElement) { 33211 var animate = animateList(visualElement); 33212 var state = createState(); 33213 var allAnimatedKeys = {}; 33214 var isInitialRender = true; 33215 /** 33216 * This function will be used to reduce the animation definitions for 33217 * each active animation type into an object of resolved values for it. 33218 */ 33219 var buildResolvedTypeValues = function (acc, definition) { 33220 var resolved = resolveVariant(visualElement, definition); 33221 if (resolved) { 33222 resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]); 33223 acc = __assign(__assign(__assign({}, acc), target), transitionEnd); 33224 } 33225 return acc; 33226 }; 33227 function isAnimated(key) { 33228 return allAnimatedKeys[key] !== undefined; 33229 } 33230 /** 33231 * This just allows us to inject mocked animation functions 33232 * @internal 33233 */ 33234 function setAnimateFunction(makeAnimator) { 33235 animate = makeAnimator(visualElement); 33236 } 33237 /** 33238 * When we receive new props, we need to: 33239 * 1. Create a list of protected keys for each type. This is a directory of 33240 * value keys that are currently being "handled" by types of a higher priority 33241 * so that whenever an animation is played of a given type, these values are 33242 * protected from being animated. 33243 * 2. Determine if an animation type needs animating. 33244 * 3. Determine if any values have been removed from a type and figure out 33245 * what to animate those to. 33246 */ 33247 function animateChanges(options, changedActiveType) { 33248 var _a; 33249 var props = visualElement.getProps(); 33250 var context = visualElement.getVariantContext(true) || {}; 33251 /** 33252 * A list of animations that we'll build into as we iterate through the animation 33253 * types. This will get executed at the end of the function. 33254 */ 33255 var animations = []; 33256 /** 33257 * Keep track of which values have been removed. Then, as we hit lower priority 33258 * animation types, we can check if they contain removed values and animate to that. 33259 */ 33260 var removedKeys = new Set(); 33261 /** 33262 * A dictionary of all encountered keys. This is an object to let us build into and 33263 * copy it without iteration. Each time we hit an animation type we set its protected 33264 * keys - the keys its not allowed to animate - to the latest version of this object. 33265 */ 33266 var encounteredKeys = {}; 33267 /** 33268 * If a variant has been removed at a given index, and this component is controlling 33269 * variant animations, we want to ensure lower-priority variants are forced to animate. 33270 */ 33271 var removedVariantIndex = Infinity; 33272 var _loop_1 = function (i) { 33273 var type = reversePriorityOrder[i]; 33274 var typeState = state[type]; 33275 var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; 33276 var propIsVariant = isVariantLabel(prop); 33277 /** 33278 * If this type has *just* changed isActive status, set activeDelta 33279 * to that status. Otherwise set to null. 33280 */ 33281 var activeDelta = type === changedActiveType ? typeState.isActive : null; 33282 if (activeDelta === false) 33283 removedVariantIndex = i; 33284 /** 33285 * If this prop is an inherited variant, rather than been set directly on the 33286 * component itself, we want to make sure we allow the parent to trigger animations. 33287 * 33288 * TODO: Can probably change this to a !isControllingVariants check 33289 */ 33290 var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; 33291 /** 33292 * 33293 */ 33294 if (isInherited && 33295 isInitialRender && 33296 visualElement.manuallyAnimateOnMount) { 33297 isInherited = false; 33298 } 33299 /** 33300 * Set all encountered keys so far as the protected keys for this type. This will 33301 * be any key that has been animated or otherwise handled by active, higher-priortiy types. 33302 */ 33303 typeState.protectedKeys = __assign({}, encounteredKeys); 33304 // Check if we can skip analysing this prop early 33305 if ( 33306 // If it isn't active and hasn't *just* been set as inactive 33307 (!typeState.isActive && activeDelta === null) || 33308 // If we didn't and don't have any defined prop for this animation type 33309 (!prop && !typeState.prevProp) || 33310 // Or if the prop doesn't define an animation 33311 isAnimationControls(prop) || 33312 typeof prop === "boolean") { 33313 return "continue"; 33314 } 33315 /** 33316 * As we go look through the values defined on this type, if we detect 33317 * a changed value or a value that was removed in a higher priority, we set 33318 * this to true and add this prop to the animation list. 33319 */ 33320 var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); 33321 var shouldAnimateType = variantDidChange || 33322 // If we're making this variant active, we want to always make it active 33323 (type === changedActiveType && 33324 typeState.isActive && 33325 !isInherited && 33326 propIsVariant) || 33327 // If we removed a higher-priority variant (i is in reverse order) 33328 (i > removedVariantIndex && propIsVariant); 33329 /** 33330 * As animations can be set as variant lists, variants or target objects, we 33331 * coerce everything to an array if it isn't one already 33332 */ 33333 var definitionList = Array.isArray(prop) ? prop : [prop]; 33334 /** 33335 * Build an object of all the resolved values. We'll use this in the subsequent 33336 * animateChanges calls to determine whether a value has changed. 33337 */ 33338 var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); 33339 if (activeDelta === false) 33340 resolvedValues = {}; 33341 /** 33342 * Now we need to loop through all the keys in the prev prop and this prop, 33343 * and decide: 33344 * 1. If the value has changed, and needs animating 33345 * 2. If it has been removed, and needs adding to the removedKeys set 33346 * 3. If it has been removed in a higher priority type and needs animating 33347 * 4. If it hasn't been removed in a higher priority but hasn't changed, and 33348 * needs adding to the type's protectedKeys list. 33349 */ 33350 var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b; 33351 var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues); 33352 var markToAnimate = function (key) { 33353 shouldAnimateType = true; 33354 removedKeys.delete(key); 33355 typeState.needsAnimating[key] = true; 33356 }; 33357 for (var key in allKeys) { 33358 var next = resolvedValues[key]; 33359 var prev = prevResolvedValues[key]; 33360 // If we've already handled this we can just skip ahead 33361 if (encounteredKeys.hasOwnProperty(key)) 33362 continue; 33363 /** 33364 * If the value has changed, we probably want to animate it. 33365 */ 33366 if (next !== prev) { 33367 /** 33368 * If both values are keyframes, we need to shallow compare them to 33369 * detect whether any value has changed. If it has, we animate it. 33370 */ 33371 if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { 33372 if (!shallowCompare(next, prev) || variantDidChange) { 33373 markToAnimate(key); 33374 } 33375 else { 33376 /** 33377 * If it hasn't changed, we want to ensure it doesn't animate by 33378 * adding it to the list of protected keys. 33379 */ 33380 typeState.protectedKeys[key] = true; 33381 } 33382 } 33383 else if (next !== undefined) { 33384 // If next is defined and doesn't equal prev, it needs animating 33385 markToAnimate(key); 33386 } 33387 else { 33388 // If it's undefined, it's been removed. 33389 removedKeys.add(key); 33390 } 33391 } 33392 else if (next !== undefined && removedKeys.has(key)) { 33393 /** 33394 * If next hasn't changed and it isn't undefined, we want to check if it's 33395 * been removed by a higher priority 33396 */ 33397 markToAnimate(key); 33398 } 33399 else { 33400 /** 33401 * If it hasn't changed, we add it to the list of protected values 33402 * to ensure it doesn't get animated. 33403 */ 33404 typeState.protectedKeys[key] = true; 33405 } 33406 } 33407 /** 33408 * Update the typeState so next time animateChanges is called we can compare the 33409 * latest prop and resolvedValues to these. 33410 */ 33411 typeState.prevProp = prop; 33412 typeState.prevResolvedValues = resolvedValues; 33413 /** 33414 * 33415 */ 33416 if (typeState.isActive) { 33417 encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues); 33418 } 33419 if (isInitialRender && visualElement.blockInitialAnimation) { 33420 shouldAnimateType = false; 33421 } 33422 /** 33423 * If this is an inherited prop we want to hard-block animations 33424 * TODO: Test as this should probably still handle animations triggered 33425 * by removed values? 33426 */ 33427 if (shouldAnimateType && !isInherited) { 33428 animations.push.apply(animations, tslib_es6_spreadArray([], tslib_es6_read(definitionList.map(function (animation) { return ({ 33429 animation: animation, 33430 options: __assign({ type: type }, options), 33431 }); })), false)); 33432 } 33433 }; 33434 /** 33435 * Iterate through all animation types in reverse priority order. For each, we want to 33436 * detect which values it's handling and whether or not they've changed (and therefore 33437 * need to be animated). If any values have been removed, we want to detect those in 33438 * lower priority props and flag for animation. 33439 */ 33440 for (var i = 0; i < numAnimationTypes; i++) { 33441 _loop_1(i); 33442 } 33443 allAnimatedKeys = __assign({}, encounteredKeys); 33444 /** 33445 * If there are some removed value that haven't been dealt with, 33446 * we need to create a new animation that falls back either to the value 33447 * defined in the style prop, or the last read value. 33448 */ 33449 if (removedKeys.size) { 33450 var fallbackAnimation_1 = {}; 33451 removedKeys.forEach(function (key) { 33452 var fallbackTarget = visualElement.getBaseTarget(key); 33453 if (fallbackTarget !== undefined) { 33454 fallbackAnimation_1[key] = fallbackTarget; 33455 } 33456 }); 33457 animations.push({ animation: fallbackAnimation_1 }); 33458 } 33459 var shouldAnimate = Boolean(animations.length); 33460 if (isInitialRender && 33461 props.initial === false && 33462 !visualElement.manuallyAnimateOnMount) { 33463 shouldAnimate = false; 33464 } 33465 isInitialRender = false; 33466 return shouldAnimate ? animate(animations) : Promise.resolve(); 33467 } 33468 /** 33469 * Change whether a certain animation type is active. 33470 */ 33471 function setActive(type, isActive, options) { 33472 var _a; 33473 // If the active state hasn't changed, we can safely do nothing here 33474 if (state[type].isActive === isActive) 33475 return Promise.resolve(); 33476 // Propagate active change to children 33477 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); }); 33478 state[type].isActive = isActive; 33479 var animations = animateChanges(options, type); 33480 for (var key in state) { 33481 state[key].protectedKeys = {}; 33482 } 33483 return animations; 33484 } 33485 return { 33486 isAnimated: isAnimated, 33487 animateChanges: animateChanges, 33488 setActive: setActive, 33489 setAnimateFunction: setAnimateFunction, 33490 getState: function () { return state; }, 33491 }; 33492 } 33493 function checkVariantsDidChange(prev, next) { 33494 if (typeof next === "string") { 33495 return next !== prev; 33496 } 33497 else if (isVariantLabels(next)) { 33498 return !shallowCompare(next, prev); 33499 } 33500 return false; 33501 } 33502 function createTypeState(isActive) { 33503 if (isActive === void 0) { isActive = false; } 33504 return { 33505 isActive: isActive, 33506 protectedKeys: {}, 33507 needsAnimating: {}, 33508 prevResolvedValues: {}, 33509 }; 33510 } 33511 function createState() { 33512 var _a; 33513 return _a = {}, 33514 _a[AnimationType.Animate] = createTypeState(true), 33515 _a[AnimationType.InView] = createTypeState(), 33516 _a[AnimationType.Hover] = createTypeState(), 33517 _a[AnimationType.Tap] = createTypeState(), 33518 _a[AnimationType.Drag] = createTypeState(), 33519 _a[AnimationType.Focus] = createTypeState(), 33520 _a[AnimationType.Exit] = createTypeState(), 33521 _a; 33522 } 33523 33524 33525 33526 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.mjs 33527 33528 33529 33530 33531 33532 33533 33534 33535 33536 var animations = { 33537 animation: makeRenderlessComponent(function (_a) { 33538 var visualElement = _a.visualElement, animate = _a.animate; 33539 /** 33540 * We dynamically generate the AnimationState manager as it contains a reference 33541 * to the underlying animation library. We only want to load that if we load this, 33542 * so people can optionally code split it out using the `m` component. 33543 */ 33544 visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); 33545 /** 33546 * Subscribe any provided AnimationControls to the component's VisualElement 33547 */ 33548 if (isAnimationControls(animate)) { 33549 (0,external_React_.useEffect)(function () { return animate.subscribe(visualElement); }, [animate]); 33550 } 33551 }), 33552 exit: makeRenderlessComponent(function (props) { 33553 var custom = props.custom, visualElement = props.visualElement; 33554 var _a = tslib_es6_read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1]; 33555 var presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext); 33556 (0,external_React_.useEffect)(function () { 33557 var _a, _b; 33558 visualElement.isPresent = isPresent; 33559 var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom }); 33560 !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove)); 33561 }, [isPresent]); 33562 }), 33563 }; 33564 33565 33566 33567 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/PanSession.mjs 33568 33569 33570 33571 33572 33573 33574 33575 33576 /** 33577 * @internal 33578 */ 33579 var PanSession = /** @class */ (function () { 33580 function PanSession(event, handlers, _a) { 33581 var _this = this; 33582 var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint; 33583 /** 33584 * @internal 33585 */ 33586 this.startEvent = null; 33587 /** 33588 * @internal 33589 */ 33590 this.lastMoveEvent = null; 33591 /** 33592 * @internal 33593 */ 33594 this.lastMoveEventInfo = null; 33595 /** 33596 * @internal 33597 */ 33598 this.handlers = {}; 33599 this.updatePoint = function () { 33600 if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) 33601 return; 33602 var info = getPanInfo(_this.lastMoveEventInfo, _this.history); 33603 var isPanStarted = _this.startEvent !== null; 33604 // Only start panning if the offset is larger than 3 pixels. If we make it 33605 // any larger than this we'll want to reset the pointer history 33606 // on the first update to avoid visual snapping to the cursoe. 33607 var isDistancePastThreshold = distance(info.offset, { x: 0, y: 0 }) >= 3; 33608 if (!isPanStarted && !isDistancePastThreshold) 33609 return; 33610 var point = info.point; 33611 var timestamp = getFrameData().timestamp; 33612 _this.history.push(__assign(__assign({}, point), { timestamp: timestamp })); 33613 var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove; 33614 if (!isPanStarted) { 33615 onStart && onStart(_this.lastMoveEvent, info); 33616 _this.startEvent = _this.lastMoveEvent; 33617 } 33618 onMove && onMove(_this.lastMoveEvent, info); 33619 }; 33620 this.handlePointerMove = function (event, info) { 33621 _this.lastMoveEvent = event; 33622 _this.lastMoveEventInfo = transformPoint(info, _this.transformPagePoint); 33623 // Because Safari doesn't trigger mouseup events when it's above a `<select>` 33624 if (isMouseEvent(event) && event.buttons === 0) { 33625 _this.handlePointerUp(event, info); 33626 return; 33627 } 33628 // Throttle mouse move event to once per frame 33629 es.update(_this.updatePoint, true); 33630 }; 33631 this.handlePointerUp = function (event, info) { 33632 _this.end(); 33633 var _a = _this.handlers, onEnd = _a.onEnd, onSessionEnd = _a.onSessionEnd; 33634 var panInfo = getPanInfo(transformPoint(info, _this.transformPagePoint), _this.history); 33635 if (_this.startEvent && onEnd) { 33636 onEnd(event, panInfo); 33637 } 33638 onSessionEnd && onSessionEnd(event, panInfo); 33639 }; 33640 // If we have more than one touch, don't start detecting this gesture 33641 if (isTouchEvent(event) && event.touches.length > 1) 33642 return; 33643 this.handlers = handlers; 33644 this.transformPagePoint = transformPagePoint; 33645 var info = extractEventInfo(event); 33646 var initialInfo = transformPoint(info, this.transformPagePoint); 33647 var point = initialInfo.point; 33648 var timestamp = getFrameData().timestamp; 33649 this.history = [__assign(__assign({}, point), { timestamp: timestamp })]; 33650 var onSessionStart = handlers.onSessionStart; 33651 onSessionStart && 33652 onSessionStart(event, getPanInfo(initialInfo, this.history)); 33653 this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp)); 33654 } 33655 PanSession.prototype.updateHandlers = function (handlers) { 33656 this.handlers = handlers; 33657 }; 33658 PanSession.prototype.end = function () { 33659 this.removeListeners && this.removeListeners(); 33660 cancelSync.update(this.updatePoint); 33661 }; 33662 return PanSession; 33663 }()); 33664 function transformPoint(info, transformPagePoint) { 33665 return transformPagePoint ? { point: transformPagePoint(info.point) } : info; 33666 } 33667 function subtractPoint(a, b) { 33668 return { x: a.x - b.x, y: a.y - b.y }; 33669 } 33670 function getPanInfo(_a, history) { 33671 var point = _a.point; 33672 return { 33673 point: point, 33674 delta: subtractPoint(point, lastDevicePoint(history)), 33675 offset: subtractPoint(point, startDevicePoint(history)), 33676 velocity: PanSession_getVelocity(history, 0.1), 33677 }; 33678 } 33679 function startDevicePoint(history) { 33680 return history[0]; 33681 } 33682 function lastDevicePoint(history) { 33683 return history[history.length - 1]; 33684 } 33685 function PanSession_getVelocity(history, timeDelta) { 33686 if (history.length < 2) { 33687 return { x: 0, y: 0 }; 33688 } 33689 var i = history.length - 1; 33690 var timestampedPoint = null; 33691 var lastPoint = lastDevicePoint(history); 33692 while (i >= 0) { 33693 timestampedPoint = history[i]; 33694 if (lastPoint.timestamp - timestampedPoint.timestamp > 33695 secondsToMilliseconds(timeDelta)) { 33696 break; 33697 } 33698 i--; 33699 } 33700 if (!timestampedPoint) { 33701 return { x: 0, y: 0 }; 33702 } 33703 var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000; 33704 if (time === 0) { 33705 return { x: 0, y: 0 }; 33706 } 33707 var currentVelocity = { 33708 x: (lastPoint.x - timestampedPoint.x) / time, 33709 y: (lastPoint.y - timestampedPoint.y) / time, 33710 }; 33711 if (currentVelocity.x === Infinity) { 33712 currentVelocity.x = 0; 33713 } 33714 if (currentVelocity.y === Infinity) { 33715 currentVelocity.y = 0; 33716 } 33717 return currentVelocity; 33718 } 33719 33720 33721 33722 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs 33723 33724 33725 33726 33727 /** 33728 * Apply constraints to a point. These constraints are both physical along an 33729 * axis, and an elastic factor that determines how much to constrain the point 33730 * by if it does lie outside the defined parameters. 33731 */ 33732 function applyConstraints(point, _a, elastic) { 33733 var min = _a.min, max = _a.max; 33734 if (min !== undefined && point < min) { 33735 // If we have a min point defined, and this is outside of that, constrain 33736 point = elastic ? mix(min, point, elastic.min) : Math.max(point, min); 33737 } 33738 else if (max !== undefined && point > max) { 33739 // If we have a max point defined, and this is outside of that, constrain 33740 point = elastic ? mix(max, point, elastic.max) : Math.min(point, max); 33741 } 33742 return point; 33743 } 33744 /** 33745 * Calculate constraints in terms of the viewport when defined relatively to the 33746 * measured axis. This is measured from the nearest edge, so a max constraint of 200 33747 * on an axis with a max value of 300 would return a constraint of 500 - axis length 33748 */ 33749 function calcRelativeAxisConstraints(axis, min, max) { 33750 return { 33751 min: min !== undefined ? axis.min + min : undefined, 33752 max: max !== undefined 33753 ? axis.max + max - (axis.max - axis.min) 33754 : undefined, 33755 }; 33756 } 33757 /** 33758 * Calculate constraints in terms of the viewport when 33759 * defined relatively to the measured bounding box. 33760 */ 33761 function calcRelativeConstraints(layoutBox, _a) { 33762 var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right; 33763 return { 33764 x: calcRelativeAxisConstraints(layoutBox.x, left, right), 33765 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), 33766 }; 33767 } 33768 /** 33769 * Calculate viewport constraints when defined as another viewport-relative axis 33770 */ 33771 function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { 33772 var _a; 33773 var min = constraintsAxis.min - layoutAxis.min; 33774 var max = constraintsAxis.max - layoutAxis.max; 33775 // If the constraints axis is actually smaller than the layout axis then we can 33776 // flip the constraints 33777 if (constraintsAxis.max - constraintsAxis.min < 33778 layoutAxis.max - layoutAxis.min) { 33779 _a = tslib_es6_read([max, min], 2), min = _a[0], max = _a[1]; 33780 } 33781 return { min: min, max: max }; 33782 } 33783 /** 33784 * Calculate viewport constraints when defined as another viewport-relative box 33785 */ 33786 function calcViewportConstraints(layoutBox, constraintsBox) { 33787 return { 33788 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), 33789 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), 33790 }; 33791 } 33792 /** 33793 * Calculate a transform origin relative to the source axis, between 0-1, that results 33794 * in an asthetically pleasing scale/transform needed to project from source to target. 33795 */ 33796 function constraints_calcOrigin(source, target) { 33797 var origin = 0.5; 33798 var sourceLength = calcLength(source); 33799 var targetLength = calcLength(target); 33800 if (targetLength > sourceLength) { 33801 origin = progress(target.min, target.max - sourceLength, source.min); 33802 } 33803 else if (sourceLength > targetLength) { 33804 origin = progress(source.min, source.max - targetLength, target.min); 33805 } 33806 return clamp(0, 1, origin); 33807 } 33808 /** 33809 * Rebase the calculated viewport constraints relative to the layout.min point. 33810 */ 33811 function rebaseAxisConstraints(layout, constraints) { 33812 var relativeConstraints = {}; 33813 if (constraints.min !== undefined) { 33814 relativeConstraints.min = constraints.min - layout.min; 33815 } 33816 if (constraints.max !== undefined) { 33817 relativeConstraints.max = constraints.max - layout.min; 33818 } 33819 return relativeConstraints; 33820 } 33821 var defaultElastic = 0.35; 33822 /** 33823 * Accepts a dragElastic prop and returns resolved elastic values for each axis. 33824 */ 33825 function resolveDragElastic(dragElastic) { 33826 if (dragElastic === void 0) { dragElastic = defaultElastic; } 33827 if (dragElastic === false) { 33828 dragElastic = 0; 33829 } 33830 else if (dragElastic === true) { 33831 dragElastic = defaultElastic; 33832 } 33833 return { 33834 x: resolveAxisElastic(dragElastic, "left", "right"), 33835 y: resolveAxisElastic(dragElastic, "top", "bottom"), 33836 }; 33837 } 33838 function resolveAxisElastic(dragElastic, minLabel, maxLabel) { 33839 return { 33840 min: resolvePointElastic(dragElastic, minLabel), 33841 max: resolvePointElastic(dragElastic, maxLabel), 33842 }; 33843 } 33844 function resolvePointElastic(dragElastic, label) { 33845 var _a; 33846 return typeof dragElastic === "number" 33847 ? dragElastic 33848 : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0; 33849 } 33850 33851 33852 33853 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs 33854 /** 33855 * Bounding boxes tend to be defined as top, left, right, bottom. For various operations 33856 * it's easier to consider each axis individually. This function returns a bounding box 33857 * as a map of single-axis min/max values. 33858 */ 33859 function convertBoundingBoxToBox(_a) { 33860 var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom; 33861 return { 33862 x: { min: left, max: right }, 33863 y: { min: top, max: bottom }, 33864 }; 33865 } 33866 function convertBoxToBoundingBox(_a) { 33867 var x = _a.x, y = _a.y; 33868 return { top: y.min, right: x.max, bottom: y.max, left: x.min }; 33869 } 33870 /** 33871 * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function 33872 * provided by Framer to allow measured points to be corrected for device scaling. This is used 33873 * when measuring DOM elements and DOM event points. 33874 */ 33875 function transformBoxPoints(point, transformPoint) { 33876 if (!transformPoint) 33877 return point; 33878 var topLeft = transformPoint({ x: point.left, y: point.top }); 33879 var bottomRight = transformPoint({ x: point.right, y: point.bottom }); 33880 return { 33881 top: topLeft.y, 33882 left: topLeft.x, 33883 bottom: bottomRight.y, 33884 right: bottomRight.x, 33885 }; 33886 } 33887 33888 33889 33890 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/measure.mjs 33891 33892 33893 33894 function measureViewportBox(instance, transformPoint) { 33895 return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); 33896 } 33897 function measurePageBox(element, rootProjectionNode, transformPagePoint) { 33898 var viewportBox = measureViewportBox(element, transformPagePoint); 33899 var scroll = rootProjectionNode.scroll; 33900 if (scroll) { 33901 translateAxis(viewportBox.x, scroll.x); 33902 translateAxis(viewportBox.y, scroll.y); 33903 } 33904 return viewportBox; 33905 } 33906 33907 33908 33909 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs 33910 33911 33912 33913 33914 33915 33916 33917 33918 33919 33920 33921 33922 33923 33924 33925 33926 33927 33928 33929 var elementDragControls = new WeakMap(); 33930 /** 33931 * 33932 */ 33933 // let latestPointerEvent: AnyPointerEvent 33934 var VisualElementDragControls = /** @class */ (function () { 33935 function VisualElementDragControls(visualElement) { 33936 // This is a reference to the global drag gesture lock, ensuring only one component 33937 // can "capture" the drag of one or both axes. 33938 // TODO: Look into moving this into pansession? 33939 this.openGlobalLock = null; 33940 this.isDragging = false; 33941 this.currentDirection = null; 33942 this.originPoint = { x: 0, y: 0 }; 33943 /** 33944 * The permitted boundaries of travel, in pixels. 33945 */ 33946 this.constraints = false; 33947 this.hasMutatedConstraints = false; 33948 /** 33949 * The per-axis resolved elastic values. 33950 */ 33951 this.elastic = createBox(); 33952 this.visualElement = visualElement; 33953 } 33954 VisualElementDragControls.prototype.start = function (originEvent, _a) { 33955 var _this = this; 33956 var _b = _a === void 0 ? {} : _a, _c = _b.snapToCursor, snapToCursor = _c === void 0 ? false : _c; 33957 /** 33958 * Don't start dragging if this component is exiting 33959 */ 33960 if (this.visualElement.isPresent === false) 33961 return; 33962 var onSessionStart = function (event) { 33963 // Stop any animations on both axis values immediately. This allows the user to throw and catch 33964 // the component. 33965 _this.stopAnimation(); 33966 if (snapToCursor) { 33967 _this.snapToCursor(extractEventInfo(event, "page").point); 33968 } 33969 }; 33970 var onStart = function (event, info) { 33971 var _a; 33972 // Attempt to grab the global drag gesture lock - maybe make this part of PanSession 33973 var _b = _this.getProps(), drag = _b.drag, dragPropagation = _b.dragPropagation, onDragStart = _b.onDragStart; 33974 if (drag && !dragPropagation) { 33975 if (_this.openGlobalLock) 33976 _this.openGlobalLock(); 33977 _this.openGlobalLock = getGlobalLock(drag); 33978 // If we don 't have the lock, don't start dragging 33979 if (!_this.openGlobalLock) 33980 return; 33981 } 33982 _this.isDragging = true; 33983 _this.currentDirection = null; 33984 _this.resolveConstraints(); 33985 if (_this.visualElement.projection) { 33986 _this.visualElement.projection.isAnimationBlocked = true; 33987 _this.visualElement.projection.target = undefined; 33988 } 33989 /** 33990 * Record gesture origin 33991 */ 33992 eachAxis(function (axis) { 33993 var _a, _b; 33994 var current = _this.getAxisMotionValue(axis).get() || 0; 33995 /** 33996 * If the MotionValue is a percentage value convert to px 33997 */ 33998 if (percent.test(current)) { 33999 var measuredAxis = (_b = (_a = _this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.actual[axis]; 34000 if (measuredAxis) { 34001 var length_1 = calcLength(measuredAxis); 34002 current = length_1 * (parseFloat(current) / 100); 34003 } 34004 } 34005 _this.originPoint[axis] = current; 34006 }); 34007 // Fire onDragStart event 34008 onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event, info); 34009 (_a = _this.visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Drag, true); 34010 }; 34011 var onMove = function (event, info) { 34012 // latestPointerEvent = event 34013 var _a = _this.getProps(), dragPropagation = _a.dragPropagation, dragDirectionLock = _a.dragDirectionLock, onDirectionLock = _a.onDirectionLock, onDrag = _a.onDrag; 34014 // If we didn't successfully receive the gesture lock, early return. 34015 if (!dragPropagation && !_this.openGlobalLock) 34016 return; 34017 var offset = info.offset; 34018 // Attempt to detect drag direction if directionLock is true 34019 if (dragDirectionLock && _this.currentDirection === null) { 34020 _this.currentDirection = getCurrentDirection(offset); 34021 // If we've successfully set a direction, notify listener 34022 if (_this.currentDirection !== null) { 34023 onDirectionLock === null || onDirectionLock === void 0 ? void 0 : onDirectionLock(_this.currentDirection); 34024 } 34025 return; 34026 } 34027 // Update each point with the latest position 34028 _this.updateAxis("x", info.point, offset); 34029 _this.updateAxis("y", info.point, offset); 34030 /** 34031 * Ideally we would leave the renderer to fire naturally at the end of 34032 * this frame but if the element is about to change layout as the result 34033 * of a re-render we want to ensure the browser can read the latest 34034 * bounding box to ensure the pointer and element don't fall out of sync. 34035 */ 34036 _this.visualElement.syncRender(); 34037 /** 34038 * This must fire after the syncRender call as it might trigger a state 34039 * change which itself might trigger a layout update. 34040 */ 34041 onDrag === null || onDrag === void 0 ? void 0 : onDrag(event, info); 34042 }; 34043 var onSessionEnd = function (event, info) { 34044 return _this.stop(event, info); 34045 }; 34046 this.panSession = new PanSession(originEvent, { 34047 onSessionStart: onSessionStart, 34048 onStart: onStart, 34049 onMove: onMove, 34050 onSessionEnd: onSessionEnd, 34051 }, { transformPagePoint: this.visualElement.getTransformPagePoint() }); 34052 }; 34053 VisualElementDragControls.prototype.stop = function (event, info) { 34054 var isDragging = this.isDragging; 34055 this.cancel(); 34056 if (!isDragging) 34057 return; 34058 var velocity = info.velocity; 34059 this.startAnimation(velocity); 34060 var onDragEnd = this.getProps().onDragEnd; 34061 onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event, info); 34062 }; 34063 VisualElementDragControls.prototype.cancel = function () { 34064 var _a, _b; 34065 this.isDragging = false; 34066 if (this.visualElement.projection) { 34067 this.visualElement.projection.isAnimationBlocked = false; 34068 } 34069 (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end(); 34070 this.panSession = undefined; 34071 var dragPropagation = this.getProps().dragPropagation; 34072 if (!dragPropagation && this.openGlobalLock) { 34073 this.openGlobalLock(); 34074 this.openGlobalLock = null; 34075 } 34076 (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(AnimationType.Drag, false); 34077 }; 34078 VisualElementDragControls.prototype.updateAxis = function (axis, _point, offset) { 34079 var drag = this.getProps().drag; 34080 // If we're not dragging this axis, do an early return. 34081 if (!offset || !shouldDrag(axis, drag, this.currentDirection)) 34082 return; 34083 var axisValue = this.getAxisMotionValue(axis); 34084 var next = this.originPoint[axis] + offset[axis]; 34085 // Apply constraints 34086 if (this.constraints && this.constraints[axis]) { 34087 next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); 34088 } 34089 axisValue.set(next); 34090 }; 34091 VisualElementDragControls.prototype.resolveConstraints = function () { 34092 var _this = this; 34093 var _a = this.getProps(), dragConstraints = _a.dragConstraints, dragElastic = _a.dragElastic; 34094 var layout = (this.visualElement.projection || {}).layout; 34095 var prevConstraints = this.constraints; 34096 if (dragConstraints && is_ref_object_isRefObject(dragConstraints)) { 34097 if (!this.constraints) { 34098 this.constraints = this.resolveRefConstraints(); 34099 } 34100 } 34101 else { 34102 if (dragConstraints && layout) { 34103 this.constraints = calcRelativeConstraints(layout.actual, dragConstraints); 34104 } 34105 else { 34106 this.constraints = false; 34107 } 34108 } 34109 this.elastic = resolveDragElastic(dragElastic); 34110 /** 34111 * If we're outputting to external MotionValues, we want to rebase the measured constraints 34112 * from viewport-relative to component-relative. 34113 */ 34114 if (prevConstraints !== this.constraints && 34115 layout && 34116 this.constraints && 34117 !this.hasMutatedConstraints) { 34118 eachAxis(function (axis) { 34119 if (_this.getAxisMotionValue(axis)) { 34120 _this.constraints[axis] = rebaseAxisConstraints(layout.actual[axis], _this.constraints[axis]); 34121 } 34122 }); 34123 } 34124 }; 34125 VisualElementDragControls.prototype.resolveRefConstraints = function () { 34126 var _a = this.getProps(), constraints = _a.dragConstraints, onMeasureDragConstraints = _a.onMeasureDragConstraints; 34127 if (!constraints || !is_ref_object_isRefObject(constraints)) 34128 return false; 34129 var constraintsElement = constraints.current; 34130 invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); 34131 var projection = this.visualElement.projection; 34132 // TODO 34133 if (!projection || !projection.layout) 34134 return false; 34135 var constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); 34136 var measuredConstraints = calcViewportConstraints(projection.layout.actual, constraintsBox); 34137 /** 34138 * If there's an onMeasureDragConstraints listener we call it and 34139 * if different constraints are returned, set constraints to that 34140 */ 34141 if (onMeasureDragConstraints) { 34142 var userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); 34143 this.hasMutatedConstraints = !!userConstraints; 34144 if (userConstraints) { 34145 measuredConstraints = convertBoundingBoxToBox(userConstraints); 34146 } 34147 } 34148 return measuredConstraints; 34149 }; 34150 VisualElementDragControls.prototype.startAnimation = function (velocity) { 34151 var _this = this; 34152 var _a = this.getProps(), drag = _a.drag, dragMomentum = _a.dragMomentum, dragElastic = _a.dragElastic, dragTransition = _a.dragTransition, dragSnapToOrigin = _a.dragSnapToOrigin, onDragTransitionEnd = _a.onDragTransitionEnd; 34153 var constraints = this.constraints || {}; 34154 var momentumAnimations = eachAxis(function (axis) { 34155 var _a; 34156 if (!shouldDrag(axis, drag, _this.currentDirection)) { 34157 return; 34158 } 34159 var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {}; 34160 if (dragSnapToOrigin) 34161 transition = { min: 0, max: 0 }; 34162 /** 34163 * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame 34164 * of spring animations so we should look into adding a disable spring option to `inertia`. 34165 * We could do something here where we affect the `bounceStiffness` and `bounceDamping` 34166 * using the value of `dragElastic`. 34167 */ 34168 var bounceStiffness = dragElastic ? 200 : 1000000; 34169 var bounceDamping = dragElastic ? 40 : 10000000; 34170 var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness, bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition); 34171 // If we're not animating on an externally-provided `MotionValue` we can use the 34172 // component's animation controls which will handle interactions with whileHover (etc), 34173 // otherwise we just have to animate the `MotionValue` itself. 34174 return _this.startAxisValueAnimation(axis, inertia); 34175 }); 34176 // Run all animations and then resolve the new drag constraints. 34177 return Promise.all(momentumAnimations).then(onDragTransitionEnd); 34178 }; 34179 VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) { 34180 var axisValue = this.getAxisMotionValue(axis); 34181 return startAnimation(axis, axisValue, 0, transition); 34182 }; 34183 VisualElementDragControls.prototype.stopAnimation = function () { 34184 var _this = this; 34185 eachAxis(function (axis) { return _this.getAxisMotionValue(axis).stop(); }); 34186 }; 34187 /** 34188 * Drag works differently depending on which props are provided. 34189 * 34190 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. 34191 * - Otherwise, we apply the delta to the x/y motion values. 34192 */ 34193 VisualElementDragControls.prototype.getAxisMotionValue = function (axis) { 34194 var _a, _b; 34195 var dragKey = "_drag" + axis.toUpperCase(); 34196 var externalMotionValue = this.visualElement.getProps()[dragKey]; 34197 return externalMotionValue 34198 ? externalMotionValue 34199 : this.visualElement.getValue(axis, (_b = (_a = this.visualElement.getProps().initial) === null || _a === void 0 ? void 0 : _a[axis]) !== null && _b !== void 0 ? _b : 0); 34200 }; 34201 VisualElementDragControls.prototype.snapToCursor = function (point) { 34202 var _this = this; 34203 eachAxis(function (axis) { 34204 var drag = _this.getProps().drag; 34205 // If we're not dragging this axis, do an early return. 34206 if (!shouldDrag(axis, drag, _this.currentDirection)) 34207 return; 34208 var projection = _this.visualElement.projection; 34209 var axisValue = _this.getAxisMotionValue(axis); 34210 if (projection && projection.layout) { 34211 var _a = projection.layout.actual[axis], min = _a.min, max = _a.max; 34212 axisValue.set(point[axis] - mix(min, max, 0.5)); 34213 } 34214 }); 34215 }; 34216 /** 34217 * When the viewport resizes we want to check if the measured constraints 34218 * have changed and, if so, reposition the element within those new constraints 34219 * relative to where it was before the resize. 34220 */ 34221 VisualElementDragControls.prototype.scalePositionWithinConstraints = function () { 34222 var _this = this; 34223 var _a; 34224 var _b = this.getProps(), drag = _b.drag, dragConstraints = _b.dragConstraints; 34225 var projection = this.visualElement.projection; 34226 if (!is_ref_object_isRefObject(dragConstraints) || !projection || !this.constraints) 34227 return; 34228 /** 34229 * Stop current animations as there can be visual glitching if we try to do 34230 * this mid-animation 34231 */ 34232 this.stopAnimation(); 34233 /** 34234 * Record the relative position of the dragged element relative to the 34235 * constraints box and save as a progress value. 34236 */ 34237 var boxProgress = { x: 0, y: 0 }; 34238 eachAxis(function (axis) { 34239 var axisValue = _this.getAxisMotionValue(axis); 34240 if (axisValue) { 34241 var latest = axisValue.get(); 34242 boxProgress[axis] = constraints_calcOrigin({ min: latest, max: latest }, _this.constraints[axis]); 34243 } 34244 }); 34245 /** 34246 * Update the layout of this element and resolve the latest drag constraints 34247 */ 34248 var transformTemplate = this.visualElement.getProps().transformTemplate; 34249 this.visualElement.getInstance().style.transform = transformTemplate 34250 ? transformTemplate({}, "") 34251 : "none"; 34252 (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); 34253 projection.updateLayout(); 34254 this.resolveConstraints(); 34255 /** 34256 * For each axis, calculate the current progress of the layout axis 34257 * within the new constraints. 34258 */ 34259 eachAxis(function (axis) { 34260 if (!shouldDrag(axis, drag, null)) 34261 return; 34262 /** 34263 * Calculate a new transform based on the previous box progress 34264 */ 34265 var axisValue = _this.getAxisMotionValue(axis); 34266 var _a = _this.constraints[axis], min = _a.min, max = _a.max; 34267 axisValue.set(mix(min, max, boxProgress[axis])); 34268 }); 34269 }; 34270 VisualElementDragControls.prototype.addListeners = function () { 34271 var _this = this; 34272 var _a; 34273 elementDragControls.set(this.visualElement, this); 34274 var element = this.visualElement.getInstance(); 34275 /** 34276 * Attach a pointerdown event listener on this DOM element to initiate drag tracking. 34277 */ 34278 var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) { 34279 var _a = _this.getProps(), drag = _a.drag, _b = _a.dragListener, dragListener = _b === void 0 ? true : _b; 34280 drag && dragListener && _this.start(event); 34281 }); 34282 var measureDragConstraints = function () { 34283 var dragConstraints = _this.getProps().dragConstraints; 34284 if (is_ref_object_isRefObject(dragConstraints)) { 34285 _this.constraints = _this.resolveRefConstraints(); 34286 } 34287 }; 34288 var projection = this.visualElement.projection; 34289 var stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); 34290 if (projection && !projection.layout) { 34291 (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); 34292 projection.updateLayout(); 34293 } 34294 measureDragConstraints(); 34295 /** 34296 * Attach a window resize listener to scale the draggable target within its defined 34297 * constraints as the window resizes. 34298 */ 34299 var stopResizeListener = addDomEvent(window, "resize", function () { 34300 _this.scalePositionWithinConstraints(); 34301 }); 34302 /** 34303 * If the element's layout changes, calculate the delta and apply that to 34304 * the drag gesture's origin point. 34305 */ 34306 projection.addEventListener("didUpdate", (function (_a) { 34307 var delta = _a.delta, hasLayoutChanged = _a.hasLayoutChanged; 34308 if (_this.isDragging && hasLayoutChanged) { 34309 eachAxis(function (axis) { 34310 var motionValue = _this.getAxisMotionValue(axis); 34311 if (!motionValue) 34312 return; 34313 _this.originPoint[axis] += delta[axis].translate; 34314 motionValue.set(motionValue.get() + delta[axis].translate); 34315 }); 34316 _this.visualElement.syncRender(); 34317 } 34318 })); 34319 return function () { 34320 stopResizeListener(); 34321 stopPointerListener(); 34322 stopMeasureLayoutListener(); 34323 }; 34324 }; 34325 VisualElementDragControls.prototype.getProps = function () { 34326 var props = this.visualElement.getProps(); 34327 var _a = props.drag, drag = _a === void 0 ? false : _a, _b = props.dragDirectionLock, dragDirectionLock = _b === void 0 ? false : _b, _c = props.dragPropagation, dragPropagation = _c === void 0 ? false : _c, _d = props.dragConstraints, dragConstraints = _d === void 0 ? false : _d, _e = props.dragElastic, dragElastic = _e === void 0 ? defaultElastic : _e, _f = props.dragMomentum, dragMomentum = _f === void 0 ? true : _f; 34328 return __assign(__assign({}, props), { drag: drag, dragDirectionLock: dragDirectionLock, dragPropagation: dragPropagation, dragConstraints: dragConstraints, dragElastic: dragElastic, dragMomentum: dragMomentum }); 34329 }; 34330 return VisualElementDragControls; 34331 }()); 34332 function shouldDrag(direction, drag, currentDirection) { 34333 return ((drag === true || drag === direction) && 34334 (currentDirection === null || currentDirection === direction)); 34335 } 34336 /** 34337 * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower 34338 * than the provided threshold, return `null`. 34339 * 34340 * @param offset - The x/y offset from origin. 34341 * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. 34342 */ 34343 function getCurrentDirection(offset, lockThreshold) { 34344 if (lockThreshold === void 0) { lockThreshold = 10; } 34345 var direction = null; 34346 if (Math.abs(offset.y) > lockThreshold) { 34347 direction = "y"; 34348 } 34349 else if (Math.abs(offset.x) > lockThreshold) { 34350 direction = "x"; 34351 } 34352 return direction; 34353 } 34354 34355 34356 34357 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/use-drag.mjs 34358 34359 34360 34361 34362 /** 34363 * A hook that allows an element to be dragged. 34364 * 34365 * @internal 34366 */ 34367 function useDrag(props) { 34368 var groupDragControls = props.dragControls, visualElement = props.visualElement; 34369 var dragControls = useConstant(function () { return new VisualElementDragControls(visualElement); }); 34370 // If we've been provided a DragControls for manual control over the drag gesture, 34371 // subscribe this component to it on mount. 34372 (0,external_React_.useEffect)(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls, groupDragControls]); 34373 // Apply the event listeners to the element 34374 (0,external_React_.useEffect)(function () { return dragControls.addListeners(); }, [dragControls]); 34375 } 34376 34377 34378 34379 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-pan-gesture.mjs 34380 34381 34382 34383 34384 34385 34386 /** 34387 * 34388 * @param handlers - 34389 * @param ref - 34390 * 34391 * @internalremarks 34392 * Currently this sets new pan gesture functions every render. The memo route has been explored 34393 * in the past but ultimately we're still creating new functions every render. An optimisation 34394 * to explore is creating the pan gestures and loading them into a `ref`. 34395 * 34396 * @internal 34397 */ 34398 function usePanGesture(_a) { 34399 var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart, visualElement = _a.visualElement; 34400 var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart; 34401 var panSession = (0,external_React_.useRef)(null); 34402 var transformPagePoint = (0,external_React_.useContext)(MotionConfigContext).transformPagePoint; 34403 var handlers = { 34404 onSessionStart: onPanSessionStart, 34405 onStart: onPanStart, 34406 onMove: onPan, 34407 onEnd: function (event, info) { 34408 panSession.current = null; 34409 onPanEnd && onPanEnd(event, info); 34410 }, 34411 }; 34412 (0,external_React_.useEffect)(function () { 34413 if (panSession.current !== null) { 34414 panSession.current.updateHandlers(handlers); 34415 } 34416 }); 34417 function onPointerDown(event) { 34418 panSession.current = new PanSession(event, handlers, { 34419 transformPagePoint: transformPagePoint, 34420 }); 34421 } 34422 usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown); 34423 useUnmountEffect(function () { return panSession.current && panSession.current.end(); }); 34424 } 34425 34426 34427 34428 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.mjs 34429 34430 34431 34432 34433 var drag = { 34434 pan: makeRenderlessComponent(usePanGesture), 34435 drag: makeRenderlessComponent(useDrag), 34436 }; 34437 34438 34439 34440 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/lifecycles.mjs 34441 34442 34443 34444 var lifecycles_names = [ 34445 "LayoutMeasure", 34446 "BeforeLayoutMeasure", 34447 "LayoutUpdate", 34448 "ViewportBoxUpdate", 34449 "Update", 34450 "Render", 34451 "AnimationComplete", 34452 "LayoutAnimationComplete", 34453 "AnimationStart", 34454 "LayoutAnimationStart", 34455 "SetAxisTarget", 34456 "Unmount", 34457 ]; 34458 function createLifecycles() { 34459 var managers = lifecycles_names.map(function () { return new SubscriptionManager(); }); 34460 var propSubscriptions = {}; 34461 var lifecycles = { 34462 clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); }, 34463 updatePropListeners: function (props) { 34464 lifecycles_names.forEach(function (name) { 34465 var _a; 34466 var on = "on" + name; 34467 var propListener = props[on]; 34468 // Unsubscribe existing subscription 34469 (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions); 34470 // Add new subscription 34471 if (propListener) { 34472 propSubscriptions[name] = lifecycles[on](propListener); 34473 } 34474 }); 34475 }, 34476 }; 34477 managers.forEach(function (manager, i) { 34478 lifecycles["on" + lifecycles_names[i]] = function (handler) { return manager.add(handler); }; 34479 lifecycles["notify" + lifecycles_names[i]] = function () { 34480 var args = []; 34481 for (var _i = 0; _i < arguments.length; _i++) { 34482 args[_i] = arguments[_i]; 34483 } 34484 return manager.notify.apply(manager, tslib_es6_spreadArray([], tslib_es6_read(args), false)); 34485 }; 34486 }); 34487 return lifecycles; 34488 } 34489 34490 34491 34492 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs 34493 34494 34495 34496 function updateMotionValuesFromProps(element, next, prev) { 34497 var _a; 34498 for (var key in next) { 34499 var nextValue = next[key]; 34500 var prevValue = prev[key]; 34501 if (isMotionValue(nextValue)) { 34502 /** 34503 * If this is a motion value found in props or style, we want to add it 34504 * to our visual element's motion value map. 34505 */ 34506 element.addValue(key, nextValue); 34507 } 34508 else if (isMotionValue(prevValue)) { 34509 /** 34510 * If we're swapping to a new motion value, create a new motion value 34511 * from that 34512 */ 34513 element.addValue(key, motionValue(nextValue)); 34514 } 34515 else if (prevValue !== nextValue) { 34516 /** 34517 * If this is a flat value that has changed, update the motion value 34518 * or create one if it doesn't exist. We only want to do this if we're 34519 * not handling the value with our animation state. 34520 */ 34521 if (element.hasValue(key)) { 34522 var existingValue = element.getValue(key); 34523 // TODO: Only update values that aren't being animated or even looked at 34524 !existingValue.hasAnimated && existingValue.set(nextValue); 34525 } 34526 else { 34527 element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue)); 34528 } 34529 } 34530 } 34531 // Handle removed values 34532 for (var key in prev) { 34533 if (next[key] === undefined) 34534 element.removeValue(key); 34535 } 34536 return next; 34537 } 34538 34539 34540 34541 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/index.mjs 34542 34543 34544 34545 34546 34547 34548 34549 34550 34551 var visualElement = function (_a) { 34552 var _b = _a.treeType, treeType = _b === void 0 ? "" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps; 34553 return function (_a, options) { 34554 var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState, shouldReduceMotion = _a.shouldReduceMotion; 34555 if (options === void 0) { options = {}; } 34556 var isMounted = false; 34557 var latestValues = visualState.latestValues, renderState = visualState.renderState; 34558 /** 34559 * The instance of the render-specific node that will be hydrated by the 34560 * exposed React ref. So for example, this visual element can host a 34561 * HTMLElement, plain object, or Three.js object. The functions provided 34562 * in VisualElementConfig allow us to interface with this instance. 34563 */ 34564 var instance; 34565 /** 34566 * Manages the subscriptions for a visual element's lifecycle, for instance 34567 * onRender 34568 */ 34569 var lifecycles = createLifecycles(); 34570 /** 34571 * A map of all motion values attached to this visual element. Motion 34572 * values are source of truth for any given animated value. A motion 34573 * value might be provided externally by the component via props. 34574 */ 34575 var values = new Map(); 34576 /** 34577 * A map of every subscription that binds the provided or generated 34578 * motion values onChange listeners to this visual element. 34579 */ 34580 var valueSubscriptions = new Map(); 34581 /** 34582 * A reference to the previously-provided motion values as returned 34583 * from scrapeMotionValuesFromProps. We use the keys in here to determine 34584 * if any motion values need to be removed after props are updated. 34585 */ 34586 var prevMotionValues = {}; 34587 /** 34588 * When values are removed from all animation props we need to search 34589 * for a fallback value to animate to. These values are tracked in baseTarget. 34590 */ 34591 var baseTarget = __assign({}, latestValues); 34592 // Internal methods ======================== 34593 /** 34594 * On mount, this will be hydrated with a callback to disconnect 34595 * this visual element from its parent on unmount. 34596 */ 34597 var removeFromVariantTree; 34598 /** 34599 * Render the element with the latest styles outside of the React 34600 * render lifecycle 34601 */ 34602 function render() { 34603 if (!instance || !isMounted) 34604 return; 34605 triggerBuild(); 34606 renderInstance(instance, renderState, props.style, element.projection); 34607 } 34608 function triggerBuild() { 34609 build(element, renderState, latestValues, options, props); 34610 } 34611 function update() { 34612 lifecycles.notifyUpdate(latestValues); 34613 } 34614 /** 34615 * 34616 */ 34617 function bindToMotionValue(key, value) { 34618 var removeOnChange = value.onChange(function (latestValue) { 34619 latestValues[key] = latestValue; 34620 props.onUpdate && es.update(update, false, true); 34621 }); 34622 var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender); 34623 valueSubscriptions.set(key, function () { 34624 removeOnChange(); 34625 removeOnRenderRequest(); 34626 }); 34627 } 34628 /** 34629 * Any motion values that are provided to the element when created 34630 * aren't yet bound to the element, as this would technically be impure. 34631 * However, we iterate through the motion values and set them to the 34632 * initial values for this component. 34633 * 34634 * TODO: This is impure and we should look at changing this to run on mount. 34635 * Doing so will break some tests but this isn't neccessarily a breaking change, 34636 * more a reflection of the test. 34637 */ 34638 var initialMotionValues = scrapeMotionValuesFromProps(props); 34639 for (var key in initialMotionValues) { 34640 var value = initialMotionValues[key]; 34641 if (latestValues[key] !== undefined && isMotionValue(value)) { 34642 value.set(latestValues[key], false); 34643 } 34644 } 34645 /** 34646 * Determine what role this visual element should take in the variant tree. 34647 */ 34648 var isControllingVariants = checkIfControllingVariants(props); 34649 var isVariantNode = checkIfVariantNode(props); 34650 var element = __assign(__assign({ treeType: treeType, 34651 /** 34652 * This is a mirror of the internal instance prop, which keeps 34653 * VisualElement type-compatible with React's RefObject. 34654 */ 34655 current: null, 34656 /** 34657 * The depth of this visual element within the visual element tree. 34658 */ 34659 depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(), 34660 /** 34661 * 34662 */ 34663 presenceId: presenceId, shouldReduceMotion: shouldReduceMotion, 34664 /** 34665 * If this component is part of the variant tree, it should track 34666 * any children that are also part of the tree. This is essentially 34667 * a shadow tree to simplify logic around how to stagger over children. 34668 */ 34669 variantChildren: isVariantNode ? new Set() : undefined, 34670 /** 34671 * Whether this instance is visible. This can be changed imperatively 34672 * by the projection tree, is analogous to CSS's visibility in that 34673 * hidden elements should take up layout, and needs enacting by the configured 34674 * render function. 34675 */ 34676 isVisible: undefined, 34677 /** 34678 * Normally, if a component is controlled by a parent's variants, it can 34679 * rely on that ancestor to trigger animations further down the tree. 34680 * However, if a component is created after its parent is mounted, the parent 34681 * won't trigger that mount animation so the child needs to. 34682 * 34683 * TODO: This might be better replaced with a method isParentMounted 34684 */ 34685 manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), 34686 /** 34687 * This can be set by AnimatePresence to force components that mount 34688 * at the same time as it to mount as if they have initial={false} set. 34689 */ 34690 blockInitialAnimation: blockInitialAnimation, 34691 /** 34692 * Determine whether this component has mounted yet. This is mostly used 34693 * by variant children to determine whether they need to trigger their 34694 * own animations on mount. 34695 */ 34696 isMounted: function () { return Boolean(instance); }, mount: function (newInstance) { 34697 isMounted = true; 34698 instance = element.current = newInstance; 34699 if (element.projection) { 34700 element.projection.mount(newInstance); 34701 } 34702 if (isVariantNode && parent && !isControllingVariants) { 34703 removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element); 34704 } 34705 values.forEach(function (value, key) { return bindToMotionValue(key, value); }); 34706 parent === null || parent === void 0 ? void 0 : parent.children.add(element); 34707 element.setProps(props); 34708 }, 34709 /** 34710 * 34711 */ 34712 unmount: function () { 34713 var _a; 34714 (_a = element.projection) === null || _a === void 0 ? void 0 : _a.unmount(); 34715 cancelSync.update(update); 34716 cancelSync.render(render); 34717 valueSubscriptions.forEach(function (remove) { return remove(); }); 34718 removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree(); 34719 parent === null || parent === void 0 ? void 0 : parent.children.delete(element); 34720 lifecycles.clearAllListeners(); 34721 instance = undefined; 34722 isMounted = false; 34723 }, 34724 /** 34725 * Add a child visual element to our set of children. 34726 */ 34727 addVariantChild: function (child) { 34728 var _a; 34729 var closestVariantNode = element.getClosestVariantNode(); 34730 if (closestVariantNode) { 34731 (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child); 34732 return function () { 34733 return closestVariantNode.variantChildren.delete(child); 34734 }; 34735 } 34736 }, sortNodePosition: function (other) { 34737 /** 34738 * If these nodes aren't even of the same type we can't compare their depth. 34739 */ 34740 if (!sortNodePosition || treeType !== other.treeType) 34741 return 0; 34742 return sortNodePosition(element.getInstance(), other.getInstance()); 34743 }, 34744 /** 34745 * Returns the closest variant node in the tree starting from 34746 * this visual element. 34747 */ 34748 getClosestVariantNode: function () { 34749 return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode(); 34750 }, 34751 /** 34752 * Expose the latest layoutId prop. 34753 */ 34754 getLayoutId: function () { return props.layoutId; }, 34755 /** 34756 * Returns the current instance. 34757 */ 34758 getInstance: function () { return instance; }, 34759 /** 34760 * Get/set the latest static values. 34761 */ 34762 getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); }, 34763 /** 34764 * Returns the latest motion value state. Currently only used to take 34765 * a snapshot of the visual element - perhaps this can return the whole 34766 * visual state 34767 */ 34768 getLatestValues: function () { return latestValues; }, 34769 /** 34770 * Set the visiblity of the visual element. If it's changed, schedule 34771 * a render to reflect these changes. 34772 */ 34773 setVisibility: function (visibility) { 34774 if (element.isVisible === visibility) 34775 return; 34776 element.isVisible = visibility; 34777 element.scheduleRender(); 34778 }, 34779 /** 34780 * Make a target animatable by Popmotion. For instance, if we're 34781 * trying to animate width from 100px to 100vw we need to measure 100vw 34782 * in pixels to determine what we really need to animate to. This is also 34783 * pluggable to support Framer's custom value types like Color, 34784 * and CSS variables. 34785 */ 34786 makeTargetAnimatable: function (target, canMutate) { 34787 if (canMutate === void 0) { canMutate = true; } 34788 return makeTargetAnimatable(element, target, props, canMutate); 34789 }, 34790 /** 34791 * Measure the current viewport box with or without transforms. 34792 * Only measures axis-aligned boxes, rotate and skew must be manually 34793 * removed with a re-render to work. 34794 */ 34795 measureViewportBox: function () { 34796 return measureViewportBox(instance, props); 34797 }, 34798 // Motion values ======================== 34799 /** 34800 * Add a motion value and bind it to this visual element. 34801 */ 34802 addValue: function (key, value) { 34803 // Remove existing value if it exists 34804 if (element.hasValue(key)) 34805 element.removeValue(key); 34806 values.set(key, value); 34807 latestValues[key] = value.get(); 34808 bindToMotionValue(key, value); 34809 }, 34810 /** 34811 * Remove a motion value and unbind any active subscriptions. 34812 */ 34813 removeValue: function (key) { 34814 var _a; 34815 values.delete(key); 34816 (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a(); 34817 valueSubscriptions.delete(key); 34818 delete latestValues[key]; 34819 removeValueFromRenderState(key, renderState); 34820 }, 34821 /** 34822 * Check whether we have a motion value for this key 34823 */ 34824 hasValue: function (key) { return values.has(key); }, 34825 /** 34826 * Get a motion value for this key. If called with a default 34827 * value, we'll create one if none exists. 34828 */ 34829 getValue: function (key, defaultValue) { 34830 var value = values.get(key); 34831 if (value === undefined && defaultValue !== undefined) { 34832 value = motionValue(defaultValue); 34833 element.addValue(key, value); 34834 } 34835 return value; 34836 }, 34837 /** 34838 * Iterate over our motion values. 34839 */ 34840 forEachValue: function (callback) { return values.forEach(callback); }, 34841 /** 34842 * If we're trying to animate to a previously unencountered value, 34843 * we need to check for it in our state and as a last resort read it 34844 * directly from the instance (which might have performance implications). 34845 */ 34846 readValue: function (key) { 34847 var _a; 34848 return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options); 34849 }, 34850 /** 34851 * Set the base target to later animate back to. This is currently 34852 * only hydrated on creation and when we first read a value. 34853 */ 34854 setBaseTarget: function (key, value) { 34855 baseTarget[key] = value; 34856 }, 34857 /** 34858 * Find the base target for a value thats been removed from all animation 34859 * props. 34860 */ 34861 getBaseTarget: function (key) { 34862 if (getBaseTarget) { 34863 var target = getBaseTarget(props, key); 34864 if (target !== undefined && !isMotionValue(target)) 34865 return target; 34866 } 34867 return baseTarget[key]; 34868 } }, lifecycles), { 34869 /** 34870 * Build the renderer state based on the latest visual state. 34871 */ 34872 build: function () { 34873 triggerBuild(); 34874 return renderState; 34875 }, 34876 /** 34877 * Schedule a render on the next animation frame. 34878 */ 34879 scheduleRender: function () { 34880 es.render(render, false, true); 34881 }, 34882 /** 34883 * Synchronously fire render. It's prefered that we batch renders but 34884 * in many circumstances, like layout measurement, we need to run this 34885 * synchronously. However in those instances other measures should be taken 34886 * to batch reads/writes. 34887 */ 34888 syncRender: render, 34889 /** 34890 * Update the provided props. Ensure any newly-added motion values are 34891 * added to our map, old ones removed, and listeners updated. 34892 */ 34893 setProps: function (newProps) { 34894 if (newProps.transformTemplate || props.transformTemplate) { 34895 element.scheduleRender(); 34896 } 34897 props = newProps; 34898 lifecycles.updatePropListeners(newProps); 34899 prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues); 34900 }, getProps: function () { return props; }, 34901 // Variants ============================== 34902 /** 34903 * Returns the variant definition with a given name. 34904 */ 34905 getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; }, 34906 /** 34907 * Returns the defined default transition on this component. 34908 */ 34909 getDefaultTransition: function () { return props.transition; }, getTransformPagePoint: function () { 34910 return props.transformPagePoint; 34911 }, 34912 /** 34913 * Used by child variant nodes to get the closest ancestor variant props. 34914 */ 34915 getVariantContext: function (startAtParent) { 34916 if (startAtParent === void 0) { startAtParent = false; } 34917 if (startAtParent) 34918 return parent === null || parent === void 0 ? void 0 : parent.getVariantContext(); 34919 if (!isControllingVariants) { 34920 var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {}; 34921 if (props.initial !== undefined) { 34922 context_1.initial = props.initial; 34923 } 34924 return context_1; 34925 } 34926 var context = {}; 34927 for (var i = 0; i < numVariantProps; i++) { 34928 var name_1 = variantProps[i]; 34929 var prop = props[name_1]; 34930 if (isVariantLabel(prop) || prop === false) { 34931 context[name_1] = prop; 34932 } 34933 } 34934 return context; 34935 } }); 34936 return element; 34937 }; 34938 }; 34939 var variantProps = tslib_es6_spreadArray(["initial"], tslib_es6_read(variantPriorityOrder), false); 34940 var numVariantProps = variantProps.length; 34941 34942 34943 34944 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs 34945 34946 34947 34948 function css_variables_conversion_isCSSVariable(value) { 34949 return typeof value === "string" && value.startsWith("var(--"); 34950 } 34951 /** 34952 * Parse Framer's special CSS variable format into a CSS token and a fallback. 34953 * 34954 * ``` 34955 * `var(--foo, #fff)` => [`--foo`, '#fff'] 34956 * ``` 34957 * 34958 * @param current 34959 */ 34960 var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; 34961 function parseCSSVariable(current) { 34962 var match = cssVariableRegex.exec(current); 34963 if (!match) 34964 return [,]; 34965 var _a = tslib_es6_read(match, 3), token = _a[1], fallback = _a[2]; 34966 return [token, fallback]; 34967 } 34968 var maxDepth = 4; 34969 function getVariableValue(current, element, depth) { 34970 if (depth === void 0) { depth = 1; } 34971 invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"".concat(current, "\". This may indicate a circular fallback dependency.")); 34972 var _a = tslib_es6_read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1]; 34973 // No CSS variable detected 34974 if (!token) 34975 return; 34976 // Attempt to read this CSS variable off the element 34977 var resolved = window.getComputedStyle(element).getPropertyValue(token); 34978 if (resolved) { 34979 return resolved.trim(); 34980 } 34981 else if (css_variables_conversion_isCSSVariable(fallback)) { 34982 // The fallback might itself be a CSS variable, in which case we attempt to resolve it too. 34983 return getVariableValue(fallback, element, depth + 1); 34984 } 34985 else { 34986 return fallback; 34987 } 34988 } 34989 /** 34990 * Resolve CSS variables from 34991 * 34992 * @internal 34993 */ 34994 function resolveCSSVariables(visualElement, _a, transitionEnd) { 34995 var _b; 34996 var target = __rest(_a, []); 34997 var element = visualElement.getInstance(); 34998 if (!(element instanceof Element)) 34999 return { target: target, transitionEnd: transitionEnd }; 35000 // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd` 35001 // only if they change but I think this reads clearer and this isn't a performance-critical path. 35002 if (transitionEnd) { 35003 transitionEnd = __assign({}, transitionEnd); 35004 } 35005 // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved 35006 visualElement.forEachValue(function (value) { 35007 var current = value.get(); 35008 if (!css_variables_conversion_isCSSVariable(current)) 35009 return; 35010 var resolved = getVariableValue(current, element); 35011 if (resolved) 35012 value.set(resolved); 35013 }); 35014 // Cycle through every target property and resolve CSS variables. Currently 35015 // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)` 35016 for (var key in target) { 35017 var current = target[key]; 35018 if (!css_variables_conversion_isCSSVariable(current)) 35019 continue; 35020 var resolved = getVariableValue(current, element); 35021 if (!resolved) 35022 continue; 35023 // Clone target if it hasn't already been 35024 target[key] = resolved; 35025 // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved 35026 // CSS variable. This will ensure that after the animation the component will reflect 35027 // changes in the value of the CSS variable. 35028 if (transitionEnd) 35029 (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current); 35030 } 35031 return { target: target, transitionEnd: transitionEnd }; 35032 } 35033 35034 35035 35036 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs 35037 35038 35039 35040 35041 35042 35043 35044 var positionalKeys = new Set([ 35045 "width", 35046 "height", 35047 "top", 35048 "left", 35049 "right", 35050 "bottom", 35051 "x", 35052 "y", 35053 ]); 35054 var isPositionalKey = function (key) { return positionalKeys.has(key); }; 35055 var hasPositionalKey = function (target) { 35056 return Object.keys(target).some(isPositionalKey); 35057 }; 35058 var setAndResetVelocity = function (value, to) { 35059 // Looks odd but setting it twice doesn't render, it'll just 35060 // set both prev and current to the latest value 35061 value.set(to, false); 35062 value.set(to); 35063 }; 35064 var isNumOrPxType = function (v) { 35065 return v === number || v === px; 35066 }; 35067 var BoundingBoxDimension; 35068 (function (BoundingBoxDimension) { 35069 BoundingBoxDimension["width"] = "width"; 35070 BoundingBoxDimension["height"] = "height"; 35071 BoundingBoxDimension["left"] = "left"; 35072 BoundingBoxDimension["right"] = "right"; 35073 BoundingBoxDimension["top"] = "top"; 35074 BoundingBoxDimension["bottom"] = "bottom"; 35075 })(BoundingBoxDimension || (BoundingBoxDimension = {})); 35076 var getPosFromMatrix = function (matrix, pos) { 35077 return parseFloat(matrix.split(", ")[pos]); 35078 }; 35079 var getTranslateFromMatrix = function (pos2, pos3) { 35080 return function (_bbox, _a) { 35081 var transform = _a.transform; 35082 if (transform === "none" || !transform) 35083 return 0; 35084 var matrix3d = transform.match(/^matrix3d\((.+)\)$/); 35085 if (matrix3d) { 35086 return getPosFromMatrix(matrix3d[1], pos3); 35087 } 35088 else { 35089 var matrix = transform.match(/^matrix\((.+)\)$/); 35090 if (matrix) { 35091 return getPosFromMatrix(matrix[1], pos2); 35092 } 35093 else { 35094 return 0; 35095 } 35096 } 35097 }; 35098 }; 35099 var transformKeys = new Set(["x", "y", "z"]); 35100 var nonTranslationalTransformKeys = transformProps.filter(function (key) { return !transformKeys.has(key); }); 35101 function removeNonTranslationalTransform(visualElement) { 35102 var removedTransforms = []; 35103 nonTranslationalTransformKeys.forEach(function (key) { 35104 var value = visualElement.getValue(key); 35105 if (value !== undefined) { 35106 removedTransforms.push([key, value.get()]); 35107 value.set(key.startsWith("scale") ? 1 : 0); 35108 } 35109 }); 35110 // Apply changes to element before measurement 35111 if (removedTransforms.length) 35112 visualElement.syncRender(); 35113 return removedTransforms; 35114 } 35115 var positionalValues = { 35116 // Dimensions 35117 width: function (_a, _b) { 35118 var x = _a.x; 35119 var _c = _b.paddingLeft, paddingLeft = _c === void 0 ? "0" : _c, _d = _b.paddingRight, paddingRight = _d === void 0 ? "0" : _d; 35120 return x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight); 35121 }, 35122 height: function (_a, _b) { 35123 var y = _a.y; 35124 var _c = _b.paddingTop, paddingTop = _c === void 0 ? "0" : _c, _d = _b.paddingBottom, paddingBottom = _d === void 0 ? "0" : _d; 35125 return y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom); 35126 }, 35127 top: function (_bbox, _a) { 35128 var top = _a.top; 35129 return parseFloat(top); 35130 }, 35131 left: function (_bbox, _a) { 35132 var left = _a.left; 35133 return parseFloat(left); 35134 }, 35135 bottom: function (_a, _b) { 35136 var y = _a.y; 35137 var top = _b.top; 35138 return parseFloat(top) + (y.max - y.min); 35139 }, 35140 right: function (_a, _b) { 35141 var x = _a.x; 35142 var left = _b.left; 35143 return parseFloat(left) + (x.max - x.min); 35144 }, 35145 // Transform 35146 x: getTranslateFromMatrix(4, 13), 35147 y: getTranslateFromMatrix(5, 14), 35148 }; 35149 var convertChangedValueTypes = function (target, visualElement, changedKeys) { 35150 var originBbox = visualElement.measureViewportBox(); 35151 var element = visualElement.getInstance(); 35152 var elementComputedStyle = getComputedStyle(element); 35153 var display = elementComputedStyle.display; 35154 var origin = {}; 35155 // If the element is currently set to display: "none", make it visible before 35156 // measuring the target bounding box 35157 if (display === "none") { 35158 visualElement.setStaticValue("display", target.display || "block"); 35159 } 35160 /** 35161 * Record origins before we render and update styles 35162 */ 35163 changedKeys.forEach(function (key) { 35164 origin[key] = positionalValues[key](originBbox, elementComputedStyle); 35165 }); 35166 // Apply the latest values (as set in checkAndConvertChangedValueTypes) 35167 visualElement.syncRender(); 35168 var targetBbox = visualElement.measureViewportBox(); 35169 changedKeys.forEach(function (key) { 35170 // Restore styles to their **calculated computed style**, not their actual 35171 // originally set style. This allows us to animate between equivalent pixel units. 35172 var value = visualElement.getValue(key); 35173 setAndResetVelocity(value, origin[key]); 35174 target[key] = positionalValues[key](targetBbox, elementComputedStyle); 35175 }); 35176 return target; 35177 }; 35178 var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) { 35179 if (origin === void 0) { origin = {}; } 35180 if (transitionEnd === void 0) { transitionEnd = {}; } 35181 target = __assign({}, target); 35182 transitionEnd = __assign({}, transitionEnd); 35183 var targetPositionalKeys = Object.keys(target).filter(isPositionalKey); 35184 // We want to remove any transform values that could affect the element's bounding box before 35185 // it's measured. We'll reapply these later. 35186 var removedTransformValues = []; 35187 var hasAttemptedToRemoveTransformValues = false; 35188 var changedValueTypeKeys = []; 35189 targetPositionalKeys.forEach(function (key) { 35190 var value = visualElement.getValue(key); 35191 if (!visualElement.hasValue(key)) 35192 return; 35193 var from = origin[key]; 35194 var fromType = findDimensionValueType(from); 35195 var to = target[key]; 35196 var toType; 35197 // TODO: The current implementation of this basically throws an error 35198 // if you try and do value conversion via keyframes. There's probably 35199 // a way of doing this but the performance implications would need greater scrutiny, 35200 // as it'd be doing multiple resize-remeasure operations. 35201 if (isKeyframesTarget(to)) { 35202 var numKeyframes = to.length; 35203 var fromIndex = to[0] === null ? 1 : 0; 35204 from = to[fromIndex]; 35205 fromType = findDimensionValueType(from); 35206 for (var i = fromIndex; i < numKeyframes; i++) { 35207 if (!toType) { 35208 toType = findDimensionValueType(to[i]); 35209 invariant(toType === fromType || 35210 (isNumOrPxType(fromType) && isNumOrPxType(toType)), "Keyframes must be of the same dimension as the current value"); 35211 } 35212 else { 35213 invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type"); 35214 } 35215 } 35216 } 35217 else { 35218 toType = findDimensionValueType(to); 35219 } 35220 if (fromType !== toType) { 35221 // If they're both just number or px, convert them both to numbers rather than 35222 // relying on resize/remeasure to convert (which is wasteful in this situation) 35223 if (isNumOrPxType(fromType) && isNumOrPxType(toType)) { 35224 var current = value.get(); 35225 if (typeof current === "string") { 35226 value.set(parseFloat(current)); 35227 } 35228 if (typeof to === "string") { 35229 target[key] = parseFloat(to); 35230 } 35231 else if (Array.isArray(to) && toType === px) { 35232 target[key] = to.map(parseFloat); 35233 } 35234 } 35235 else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) && 35236 (toType === null || toType === void 0 ? void 0 : toType.transform) && 35237 (from === 0 || to === 0)) { 35238 // If one or the other value is 0, it's safe to coerce it to the 35239 // type of the other without measurement 35240 if (from === 0) { 35241 value.set(toType.transform(from)); 35242 } 35243 else { 35244 target[key] = fromType.transform(to); 35245 } 35246 } 35247 else { 35248 // If we're going to do value conversion via DOM measurements, we first 35249 // need to remove non-positional transform values that could affect the bbox measurements. 35250 if (!hasAttemptedToRemoveTransformValues) { 35251 removedTransformValues = 35252 removeNonTranslationalTransform(visualElement); 35253 hasAttemptedToRemoveTransformValues = true; 35254 } 35255 changedValueTypeKeys.push(key); 35256 transitionEnd[key] = 35257 transitionEnd[key] !== undefined 35258 ? transitionEnd[key] 35259 : target[key]; 35260 setAndResetVelocity(value, to); 35261 } 35262 } 35263 }); 35264 if (changedValueTypeKeys.length) { 35265 var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys); 35266 // If we removed transform values, reapply them before the next render 35267 if (removedTransformValues.length) { 35268 removedTransformValues.forEach(function (_a) { 35269 var _b = tslib_es6_read(_a, 2), key = _b[0], value = _b[1]; 35270 visualElement.getValue(key).set(value); 35271 }); 35272 } 35273 // Reapply original values 35274 visualElement.syncRender(); 35275 return { target: convertedTarget, transitionEnd: transitionEnd }; 35276 } 35277 else { 35278 return { target: target, transitionEnd: transitionEnd }; 35279 } 35280 }; 35281 /** 35282 * Convert value types for x/y/width/height/top/left/bottom/right 35283 * 35284 * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'` 35285 * 35286 * @internal 35287 */ 35288 function unitConversion(visualElement, target, origin, transitionEnd) { 35289 return hasPositionalKey(target) 35290 ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) 35291 : { target: target, transitionEnd: transitionEnd }; 35292 } 35293 35294 35295 35296 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs 35297 35298 35299 35300 /** 35301 * Parse a DOM variant to make it animatable. This involves resolving CSS variables 35302 * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels. 35303 */ 35304 var parseDomVariant = function (visualElement, target, origin, transitionEnd) { 35305 var resolved = resolveCSSVariables(visualElement, target, transitionEnd); 35306 target = resolved.target; 35307 transitionEnd = resolved.transitionEnd; 35308 return unitConversion(visualElement, target, origin, transitionEnd); 35309 }; 35310 35311 35312 35313 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/visual-element.mjs 35314 35315 35316 35317 35318 35319 35320 35321 35322 35323 35324 35325 35326 function visual_element_getComputedStyle(element) { 35327 return window.getComputedStyle(element); 35328 } 35329 var htmlConfig = { 35330 treeType: "dom", 35331 readValueFromInstance: function (domElement, key) { 35332 if (isTransformProp(key)) { 35333 var defaultType = getDefaultValueType(key); 35334 return defaultType ? defaultType.default || 0 : 0; 35335 } 35336 else { 35337 var computedStyle = visual_element_getComputedStyle(domElement); 35338 return ((isCSSVariable(key) 35339 ? computedStyle.getPropertyValue(key) 35340 : computedStyle[key]) || 0); 35341 } 35342 }, 35343 sortNodePosition: function (a, b) { 35344 /** 35345 * compareDocumentPosition returns a bitmask, by using the bitwise & 35346 * we're returning true if 2 in that bitmask is set to true. 2 is set 35347 * to true if b preceeds a. 35348 */ 35349 return a.compareDocumentPosition(b) & 2 ? 1 : -1; 35350 }, 35351 getBaseTarget: function (props, key) { 35352 var _a; 35353 return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key]; 35354 }, 35355 measureViewportBox: function (element, _a) { 35356 var transformPagePoint = _a.transformPagePoint; 35357 return measureViewportBox(element, transformPagePoint); 35358 }, 35359 /** 35360 * Reset the transform on the current Element. This is called as part 35361 * of a batched process across the entire layout tree. To remove this write 35362 * cycle it'd be interesting to see if it's possible to "undo" all the current 35363 * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms 35364 * works 35365 */ 35366 resetTransform: function (element, domElement, props) { 35367 var transformTemplate = props.transformTemplate; 35368 domElement.style.transform = transformTemplate 35369 ? transformTemplate({}, "") 35370 : "none"; 35371 // Ensure that whatever happens next, we restore our transform on the next frame 35372 element.scheduleRender(); 35373 }, 35374 restoreTransform: function (instance, mutableState) { 35375 instance.style.transform = mutableState.style.transform; 35376 }, 35377 removeValueFromRenderState: function (key, _a) { 35378 var vars = _a.vars, style = _a.style; 35379 delete vars[key]; 35380 delete style[key]; 35381 }, 35382 /** 35383 * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color` 35384 * can be animated by Motion. 35385 */ 35386 makeTargetAnimatable: function (element, _a, _b, isMounted) { 35387 var transformValues = _b.transformValues; 35388 if (isMounted === void 0) { isMounted = true; } 35389 var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]); 35390 var origin = getOrigin(target, transition || {}, element); 35391 /** 35392 * If Framer has provided a function to convert `Color` etc value types, convert them 35393 */ 35394 if (transformValues) { 35395 if (transitionEnd) 35396 transitionEnd = transformValues(transitionEnd); 35397 if (target) 35398 target = transformValues(target); 35399 if (origin) 35400 origin = transformValues(origin); 35401 } 35402 if (isMounted) { 35403 checkTargetForNewValues(element, target, origin); 35404 var parsed = parseDomVariant(element, target, origin, transitionEnd); 35405 transitionEnd = parsed.transitionEnd; 35406 target = parsed.target; 35407 } 35408 return __assign({ transition: transition, transitionEnd: transitionEnd }, target); 35409 }, 35410 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, 35411 build: function (element, renderState, latestValues, options, props) { 35412 if (element.isVisible !== undefined) { 35413 renderState.style.visibility = element.isVisible 35414 ? "visible" 35415 : "hidden"; 35416 } 35417 buildHTMLStyles(renderState, latestValues, options, props.transformTemplate); 35418 }, 35419 render: renderHTML, 35420 }; 35421 var htmlVisualElement = visualElement(htmlConfig); 35422 35423 35424 35425 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/visual-element.mjs 35426 35427 35428 35429 35430 35431 35432 35433 35434 35435 35436 35437 var svgVisualElement = visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) { 35438 return props[key]; 35439 }, readValueFromInstance: function (domElement, key) { 35440 var _a; 35441 if (isTransformProp(key)) { 35442 return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0; 35443 } 35444 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; 35445 return domElement.getAttribute(key); 35446 }, scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, build: function (_element, renderState, latestValues, options, props) { 35447 buildSVGAttrs(renderState, latestValues, options, props.transformTemplate); 35448 }, render: renderSVG })); 35449 35450 35451 35452 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs 35453 35454 35455 35456 35457 var create_visual_element_createDomVisualElement = function (Component, options) { 35458 return isSVGComponent(Component) 35459 ? svgVisualElement(options, { enableHardwareAcceleration: false }) 35460 : htmlVisualElement(options, { enableHardwareAcceleration: true }); 35461 }; 35462 35463 35464 35465 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs 35466 35467 35468 function pixelsToPercent(pixels, axis) { 35469 if (axis.max === axis.min) 35470 return 0; 35471 return (pixels / (axis.max - axis.min)) * 100; 35472 } 35473 /** 35474 * We always correct borderRadius as a percentage rather than pixels to reduce paints. 35475 * For example, if you are projecting a box that is 100px wide with a 10px borderRadius 35476 * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% 35477 * borderRadius in both states. If we animate between the two in pixels that will trigger 35478 * a paint each time. If we animate between the two in percentage we'll avoid a paint. 35479 */ 35480 var correctBorderRadius = { 35481 correct: function (latest, node) { 35482 if (!node.target) 35483 return latest; 35484 /** 35485 * If latest is a string, if it's a percentage we can return immediately as it's 35486 * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. 35487 */ 35488 if (typeof latest === "string") { 35489 if (px.test(latest)) { 35490 latest = parseFloat(latest); 35491 } 35492 else { 35493 return latest; 35494 } 35495 } 35496 /** 35497 * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that 35498 * pixel value as a percentage of each axis 35499 */ 35500 var x = pixelsToPercent(latest, node.target.x); 35501 var y = pixelsToPercent(latest, node.target.y); 35502 return "".concat(x, "% ").concat(y, "%"); 35503 }, 35504 }; 35505 35506 35507 35508 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs 35509 35510 35511 35512 35513 var varToken = "_$css"; 35514 var correctBoxShadow = { 35515 correct: function (latest, _a) { 35516 var treeScale = _a.treeScale, projectionDelta = _a.projectionDelta; 35517 var original = latest; 35518 /** 35519 * We need to first strip and store CSS variables from the string. 35520 */ 35521 var containsCSSVariables = latest.includes("var("); 35522 var cssVariables = []; 35523 if (containsCSSVariables) { 35524 latest = latest.replace(cssVariableRegex, function (match) { 35525 cssVariables.push(match); 35526 return varToken; 35527 }); 35528 } 35529 var shadow = complex.parse(latest); 35530 // TODO: Doesn't support multiple shadows 35531 if (shadow.length > 5) 35532 return original; 35533 var template = complex.createTransformer(latest); 35534 var offset = typeof shadow[0] !== "number" ? 1 : 0; 35535 // Calculate the overall context scale 35536 var xScale = projectionDelta.x.scale * treeScale.x; 35537 var yScale = projectionDelta.y.scale * treeScale.y; 35538 shadow[0 + offset] /= xScale; 35539 shadow[1 + offset] /= yScale; 35540 /** 35541 * Ideally we'd correct x and y scales individually, but because blur and 35542 * spread apply to both we have to take a scale average and apply that instead. 35543 * We could potentially improve the outcome of this by incorporating the ratio between 35544 * the two scales. 35545 */ 35546 var averageScale = mix(xScale, yScale, 0.5); 35547 // Blur 35548 if (typeof shadow[2 + offset] === "number") 35549 shadow[2 + offset] /= averageScale; 35550 // Spread 35551 if (typeof shadow[3 + offset] === "number") 35552 shadow[3 + offset] /= averageScale; 35553 var output = template(shadow); 35554 if (containsCSSVariables) { 35555 var i_1 = 0; 35556 output = output.replace(varToken, function () { 35557 var cssVariable = cssVariables[i_1]; 35558 i_1++; 35559 return cssVariable; 35560 }); 35561 } 35562 return output; 35563 }, 35564 }; 35565 35566 35567 35568 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs 35569 35570 35571 35572 35573 35574 35575 35576 35577 35578 35579 35580 var MeasureLayoutWithContext = /** @class */ (function (_super) { 35581 __extends(MeasureLayoutWithContext, _super); 35582 function MeasureLayoutWithContext() { 35583 return _super !== null && _super.apply(this, arguments) || this; 35584 } 35585 /** 35586 * This only mounts projection nodes for components that 35587 * need measuring, we might want to do it for all components 35588 * in order to incorporate transforms 35589 */ 35590 MeasureLayoutWithContext.prototype.componentDidMount = function () { 35591 var _this = this; 35592 var _a = this.props, visualElement = _a.visualElement, layoutGroup = _a.layoutGroup, switchLayoutGroup = _a.switchLayoutGroup, layoutId = _a.layoutId; 35593 var projection = visualElement.projection; 35594 addScaleCorrector(defaultScaleCorrectors); 35595 if (projection) { 35596 if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) 35597 layoutGroup.group.add(projection); 35598 if ((switchLayoutGroup === null || switchLayoutGroup === void 0 ? void 0 : switchLayoutGroup.register) && layoutId) { 35599 switchLayoutGroup.register(projection); 35600 } 35601 projection.root.didUpdate(); 35602 projection.addEventListener("animationComplete", function () { 35603 _this.safeToRemove(); 35604 }); 35605 projection.setOptions(__assign(__assign({}, projection.options), { onExitComplete: function () { return _this.safeToRemove(); } })); 35606 } 35607 globalProjectionState.hasEverUpdated = true; 35608 }; 35609 MeasureLayoutWithContext.prototype.getSnapshotBeforeUpdate = function (prevProps) { 35610 var _this = this; 35611 var _a = this.props, layoutDependency = _a.layoutDependency, visualElement = _a.visualElement, drag = _a.drag, isPresent = _a.isPresent; 35612 var projection = visualElement.projection; 35613 if (!projection) 35614 return null; 35615 /** 35616 * TODO: We use this data in relegate to determine whether to 35617 * promote a previous element. There's no guarantee its presence data 35618 * will have updated by this point - if a bug like this arises it will 35619 * have to be that we markForRelegation and then find a new lead some other way, 35620 * perhaps in didUpdate 35621 */ 35622 projection.isPresent = isPresent; 35623 if (drag || 35624 prevProps.layoutDependency !== layoutDependency || 35625 layoutDependency === undefined) { 35626 projection.willUpdate(); 35627 } 35628 else { 35629 this.safeToRemove(); 35630 } 35631 if (prevProps.isPresent !== isPresent) { 35632 if (isPresent) { 35633 projection.promote(); 35634 } 35635 else if (!projection.relegate()) { 35636 /** 35637 * If there's another stack member taking over from this one, 35638 * it's in charge of the exit animation and therefore should 35639 * be in charge of the safe to remove. Otherwise we call it here. 35640 */ 35641 es.postRender(function () { 35642 var _a; 35643 if (!((_a = projection.getStack()) === null || _a === void 0 ? void 0 : _a.members.length)) { 35644 _this.safeToRemove(); 35645 } 35646 }); 35647 } 35648 } 35649 return null; 35650 }; 35651 MeasureLayoutWithContext.prototype.componentDidUpdate = function () { 35652 var projection = this.props.visualElement.projection; 35653 if (projection) { 35654 projection.root.didUpdate(); 35655 if (!projection.currentAnimation && projection.isLead()) { 35656 this.safeToRemove(); 35657 } 35658 } 35659 }; 35660 MeasureLayoutWithContext.prototype.componentWillUnmount = function () { 35661 var _a = this.props, visualElement = _a.visualElement, layoutGroup = _a.layoutGroup, promoteContext = _a.switchLayoutGroup; 35662 var projection = visualElement.projection; 35663 if (projection) { 35664 projection.scheduleCheckAfterUnmount(); 35665 if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) 35666 layoutGroup.group.remove(projection); 35667 if (promoteContext === null || promoteContext === void 0 ? void 0 : promoteContext.deregister) 35668 promoteContext.deregister(projection); 35669 } 35670 }; 35671 MeasureLayoutWithContext.prototype.safeToRemove = function () { 35672 var safeToRemove = this.props.safeToRemove; 35673 safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove(); 35674 }; 35675 MeasureLayoutWithContext.prototype.render = function () { 35676 return null; 35677 }; 35678 return MeasureLayoutWithContext; 35679 }(external_React_.Component)); 35680 function MeasureLayout(props) { 35681 var _a = tslib_es6_read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1]; 35682 var layoutGroup = (0,external_React_.useContext)(LayoutGroupContext); 35683 return (external_React_.createElement(MeasureLayoutWithContext, __assign({}, props, { layoutGroup: layoutGroup, switchLayoutGroup: (0,external_React_.useContext)(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }))); 35684 } 35685 var defaultScaleCorrectors = { 35686 borderRadius: __assign(__assign({}, correctBorderRadius), { applyTo: [ 35687 "borderTopLeftRadius", 35688 "borderTopRightRadius", 35689 "borderBottomLeftRadius", 35690 "borderBottomRightRadius", 35691 ] }), 35692 borderTopLeftRadius: correctBorderRadius, 35693 borderTopRightRadius: correctBorderRadius, 35694 borderBottomLeftRadius: correctBorderRadius, 35695 borderBottomRightRadius: correctBorderRadius, 35696 boxShadow: correctBoxShadow, 35697 }; 35698 35699 35700 35701 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/index.mjs 35702 35703 35704 var layoutFeatures = { 35705 measureLayout: MeasureLayout, 35706 }; 35707 35708 35709 35710 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs 35711 35712 35713 var DocumentProjectionNode = createProjectionNode({ 35714 attachResizeListener: function (ref, notify) { 35715 ref.addEventListener("resize", notify, { passive: true }); 35716 return function () { return ref.removeEventListener("resize", notify); }; 35717 }, 35718 measureScroll: function () { return ({ 35719 x: document.documentElement.scrollLeft || document.body.scrollLeft, 35720 y: document.documentElement.scrollTop || document.body.scrollTop, 35721 }); }, 35722 }); 35723 35724 35725 35726 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs 35727 35728 35729 35730 var rootProjectionNode = { 35731 current: undefined, 35732 }; 35733 var HTMLProjectionNode_HTMLProjectionNode = createProjectionNode({ 35734 measureScroll: function (instance) { return ({ 35735 x: instance.scrollLeft, 35736 y: instance.scrollTop, 35737 }); }, 35738 defaultParent: function () { 35739 if (!rootProjectionNode.current) { 35740 var documentNode = new DocumentProjectionNode(0, {}); 35741 documentNode.mount(window); 35742 documentNode.setOptions({ layoutScroll: true }); 35743 rootProjectionNode.current = documentNode; 35744 } 35745 return rootProjectionNode.current; 35746 }, 35747 resetTransform: function (instance, value) { 35748 instance.style.transform = value !== null && value !== void 0 ? value : "none"; 35749 }, 35750 }); 35751 35752 35753 35754 ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion.mjs 35755 35756 35757 35758 35759 35760 35761 35762 35763 35764 35765 35766 var featureBundle = __assign(__assign(__assign(__assign({}, animations), gestureAnimations), drag), layoutFeatures); 35767 /** 35768 * HTML & SVG components, optimised for use with gestures and animation. These can be used as 35769 * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported. 35770 * 35771 * @public 35772 */ 35773 var motion = /*@__PURE__*/ createMotionProxy(function (Component, config) { 35774 return create_config_createDomMotionConfig(Component, config, featureBundle, create_visual_element_createDomVisualElement, HTMLProjectionNode_HTMLProjectionNode); 35775 }); 35776 /** 35777 * Create a DOM `motion` component with the provided string. This is primarily intended 35778 * as a full alternative to `motion` for consumers who have to support environments that don't 35779 * support `Proxy`. 35780 * 35781 * ```javascript 35782 * import { createDomMotionComponent } from "framer-motion" 35783 * 35784 * const motion = { 35785 * div: createDomMotionComponent('div') 35786 * } 35787 * ``` 35788 * 35789 * @public 35790 */ 35791 function createDomMotionComponent(key) { 35792 return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, featureBundle, createDomVisualElement, HTMLProjectionNode)); 35793 } 35794 35795 35796 35797 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js 35798 /** 35799 * WordPress dependencies 35800 */ 35801 35802 const FlexContext = (0,external_wp_element_namespaceObject.createContext)({ 35803 flexItemDisplay: undefined 35804 }); 35805 const useFlexContext = () => (0,external_wp_element_namespaceObject.useContext)(FlexContext); 35806 35807 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles.js 35808 function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 35809 35810 /** 35811 * External dependencies 35812 */ 35813 35814 const Flex = true ? { 35815 name: "zjik7", 35816 styles: "display:flex" 35817 } : 0; 35818 const Item = true ? { 35819 name: "qgaee5", 35820 styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0" 35821 } : 0; 35822 const block = true ? { 35823 name: "82a6rk", 35824 styles: "flex:1" 35825 } : 0; 35826 /** 35827 * Workaround to optimize DOM rendering. 35828 * We'll enhance alignment with naive parent flex assumptions. 35829 * 35830 * Trade-off: 35831 * Far less DOM less. However, UI rendering is not as reliable. 35832 */ 35833 35834 /** 35835 * Improves stability of width/height rendering. 35836 * https://github.com/ItsJonQ/g2/pull/149 35837 */ 35838 35839 const ItemsColumn = true ? { 35840 name: "13nosa1", 35841 styles: ">*{min-height:0;}" 35842 } : 0; 35843 const ItemsRow = true ? { 35844 name: "1pwxzk4", 35845 styles: ">*{min-width:0;}" 35846 } : 0; 35847 35848 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js 35849 /** 35850 * External dependencies 35851 */ 35852 35853 /** 35854 * Internal dependencies 35855 */ 35856 35857 35858 35859 35860 35861 /** 35862 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props 35863 */ 35864 35865 function useFlexItem(props) { 35866 const { 35867 className, 35868 display: displayProp, 35869 isBlock = false, 35870 ...otherProps 35871 } = useContextSystem(props, 'FlexItem'); 35872 const sx = {}; 35873 const contextDisplay = useFlexContext().flexItemDisplay; 35874 sx.Base = /*#__PURE__*/emotion_react_browser_esm_css({ 35875 display: displayProp || contextDisplay 35876 }, true ? "" : 0, true ? "" : 0); 35877 const cx = useCx(); 35878 const classes = cx(Item, sx.Base, isBlock && block, className); 35879 return { ...otherProps, 35880 className: classes 35881 }; 35882 } 35883 35884 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js 35885 /** 35886 * Internal dependencies 35887 */ 35888 35889 35890 /** 35891 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props 35892 */ 35893 35894 function useFlexBlock(props) { 35895 const otherProps = useContextSystem(props, 'FlexBlock'); 35896 const flexItemProps = useFlexItem({ 35897 isBlock: true, 35898 ...otherProps 35899 }); 35900 return flexItemProps; 35901 } 35902 35903 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js 35904 35905 35906 35907 /** 35908 * Internal dependencies 35909 */ 35910 35911 35912 35913 /** 35914 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props 35915 * @param {import('react').ForwardedRef<any>} forwardedRef 35916 */ 35917 35918 function FlexBlock(props, forwardedRef) { 35919 const flexBlockProps = useFlexBlock(props); 35920 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, flexBlockProps, { 35921 ref: forwardedRef 35922 })); 35923 } 35924 /** 35925 * `FlexBlock` is a primitive layout component that adaptively resizes content within layout containers like `Flex`. 35926 * 35927 * @example 35928 * ```jsx 35929 * <Flex> 35930 * <FlexBlock>...</FlexBlock> 35931 * </Flex> 35932 * ``` 35933 */ 35934 35935 35936 const ConnectedFlexBlock = contextConnect(FlexBlock, 'FlexBlock'); 35937 /* harmony default export */ var flex_block_component = (ConnectedFlexBlock); 35938 35939 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js 35940 35941 35942 35943 /** 35944 * Internal dependencies 35945 */ 35946 35947 35948 35949 /** 35950 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props 35951 * @param {import('react').ForwardedRef<any>} forwardedRef 35952 */ 35953 35954 function FlexItem(props, forwardedRef) { 35955 const flexItemProps = useFlexItem(props); 35956 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, flexItemProps, { 35957 ref: forwardedRef 35958 })); 35959 } 35960 /** 35961 * `FlexItem` is a primitive layout component that aligns content within layout containers like `Flex`. 35962 * 35963 * @example 35964 * ```jsx 35965 * <Flex> 35966 * <FlexItem>...</FlexItem> 35967 * </Flex> 35968 * ``` 35969 */ 35970 35971 35972 const ConnectedFlexItem = contextConnect(FlexItem, 'FlexItem'); 35973 /* harmony default export */ var flex_item_component = (ConnectedFlexItem); 35974 35975 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-responsive-value.js 35976 /** 35977 * WordPress dependencies 35978 */ 35979 35980 const breakpoints = ['40em', '52em', '64em']; 35981 const useBreakpointIndex = function () { 35982 let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 35983 const { 35984 defaultIndex = 0 35985 } = options; 35986 35987 if (typeof defaultIndex !== 'number') { 35988 throw new TypeError(`Default breakpoint index should be a number. Got: $defaultIndex}, $typeof defaultIndex}`); 35989 } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) { 35990 throw new RangeError(`Default breakpoint index out of range. Theme has $breakpoints.length} breakpoints, got index $defaultIndex}`); 35991 } 35992 35993 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(defaultIndex); 35994 (0,external_wp_element_namespaceObject.useEffect)(() => { 35995 const getIndex = () => breakpoints.filter(bp => { 35996 return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: $bp})`).matches : false; 35997 }).length; 35998 35999 const onResize = () => { 36000 const newValue = getIndex(); 36001 36002 if (value !== newValue) { 36003 setValue(newValue); 36004 } 36005 }; 36006 36007 onResize(); 36008 36009 if (typeof window !== 'undefined') { 36010 window.addEventListener('resize', onResize); 36011 } 36012 36013 return () => { 36014 if (typeof window !== 'undefined') { 36015 window.removeEventListener('resize', onResize); 36016 } 36017 }; 36018 }, [value]); 36019 return value; 36020 }; 36021 function useResponsiveValue(values) { 36022 let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 36023 const index = useBreakpointIndex(options); // Allow calling the function with a "normal" value without having to check on the outside. 36024 36025 if (!Array.isArray(values) && typeof values !== 'function') return values; 36026 const array = values || []; 36027 /* eslint-disable jsdoc/no-undefined-types */ 36028 36029 return ( 36030 /** @type {T[]} */ 36031 array[ 36032 /* eslint-enable jsdoc/no-undefined-types */ 36033 index >= array.length ? array.length - 1 : index] 36034 ); 36035 } 36036 36037 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/space.js 36038 /** 36039 * A real number or something parsable as a number 36040 */ 36041 const GRID_BASE = '4px'; 36042 /** 36043 * A function that handles numbers, numeric strings, and unit values. 36044 * 36045 * When given a number or a numeric string, it will return the grid-based 36046 * value as a factor of GRID_BASE, defined above. 36047 * 36048 * When given a unit value or one of the named CSS values like `auto`, 36049 * it will simply return the value back. 36050 * 36051 * @param value A number, numeric string, or a unit value. 36052 */ 36053 36054 function space(value) { 36055 var _window$CSS, _window$CSS$supports; 36056 36057 if (typeof value === 'undefined') { 36058 return undefined; 36059 } // Handle empty strings, if it's the number 0 this still works. 36060 36061 36062 if (!value) { 36063 return '0'; 36064 } 36065 36066 const asInt = typeof value === 'number' ? value : Number(value); // Test if the input has a unit, was NaN, or was one of the named CSS values (like `auto`), in which case just use that value. 36067 36068 if (typeof window !== 'undefined' && (_window$CSS = window.CSS) !== null && _window$CSS !== void 0 && (_window$CSS$supports = _window$CSS.supports) !== null && _window$CSS$supports !== void 0 && _window$CSS$supports.call(_window$CSS, 'margin', value.toString()) || Number.isNaN(asInt)) { 36069 return value.toString(); 36070 } 36071 36072 return `calc($GRID_BASE} * $value})`; 36073 } 36074 36075 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js 36076 /** 36077 * External dependencies 36078 */ 36079 36080 36081 /** 36082 * WordPress dependencies 36083 */ 36084 36085 36086 const LOWER_LEFT_REGEXP = new RegExp(/-left/g); 36087 const LOWER_RIGHT_REGEXP = new RegExp(/-right/g); 36088 const UPPER_LEFT_REGEXP = new RegExp(/Left/g); 36089 const UPPER_RIGHT_REGEXP = new RegExp(/Right/g); 36090 /** 36091 * Flips a CSS property from left <-> right. 36092 * 36093 * @param {string} key The CSS property name. 36094 * 36095 * @return {string} The flipped CSS property name, if applicable. 36096 */ 36097 36098 function getConvertedKey(key) { 36099 if (key === 'left') { 36100 return 'right'; 36101 } 36102 36103 if (key === 'right') { 36104 return 'left'; 36105 } 36106 36107 if (LOWER_LEFT_REGEXP.test(key)) { 36108 return key.replace(LOWER_LEFT_REGEXP, '-right'); 36109 } 36110 36111 if (LOWER_RIGHT_REGEXP.test(key)) { 36112 return key.replace(LOWER_RIGHT_REGEXP, '-left'); 36113 } 36114 36115 if (UPPER_LEFT_REGEXP.test(key)) { 36116 return key.replace(UPPER_LEFT_REGEXP, 'Right'); 36117 } 36118 36119 if (UPPER_RIGHT_REGEXP.test(key)) { 36120 return key.replace(UPPER_RIGHT_REGEXP, 'Left'); 36121 } 36122 36123 return key; 36124 } 36125 /** 36126 * An incredibly basic ltr -> rtl converter for style properties 36127 * 36128 * @param {import('react').CSSProperties} ltrStyles 36129 * 36130 * @return {import('react').CSSProperties} Converted ltr -> rtl styles 36131 */ 36132 36133 36134 const convertLTRToRTL = function () { 36135 let ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 36136 return (0,external_lodash_namespaceObject.mapKeys)(ltrStyles, (_value, key) => getConvertedKey(key)); 36137 }; 36138 /** 36139 * A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects. 36140 * 36141 * @param {import('react').CSSProperties} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable. 36142 * @param {import('react').CSSProperties} [rtlStyles] Rtl styles. Renders if provided. 36143 * 36144 * @return {() => import('@emotion/react').SerializedStyles} A function to output CSS styles for Emotion's renderer 36145 */ 36146 36147 function rtl() { 36148 let ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 36149 let rtlStyles = arguments.length > 1 ? arguments[1] : undefined; 36150 return () => { 36151 if (rtlStyles) { 36152 // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css 36153 return (0,external_wp_i18n_namespaceObject.isRTL)() ? /*#__PURE__*/emotion_react_browser_esm_css(rtlStyles, true ? "" : 0) : /*#__PURE__*/emotion_react_browser_esm_css(ltrStyles, true ? "" : 0); 36154 } // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css 36155 36156 36157 return (0,external_wp_i18n_namespaceObject.isRTL)() ? /*#__PURE__*/emotion_react_browser_esm_css(convertLTRToRTL(ltrStyles), true ? "" : 0) : /*#__PURE__*/emotion_react_browser_esm_css(ltrStyles, true ? "" : 0); 36158 }; 36159 } 36160 /** 36161 * Call this in the `useMemo` dependency array to ensure that subsequent renders will 36162 * cause rtl styles to update based on the `isRTL` return value even if all other dependencies 36163 * remain the same. 36164 * 36165 * @example 36166 * const styles = useMemo( () => { 36167 * return css` 36168 * ${ rtl( { marginRight: '10px' } ) } 36169 * `; 36170 * }, [ rtl.watch() ] ); 36171 */ 36172 36173 rtl.watch = () => (0,external_wp_i18n_namespaceObject.isRTL)(); 36174 36175 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/hook.js 36176 /** 36177 * External dependencies 36178 */ 36179 36180 /** 36181 * WordPress dependencies 36182 */ 36183 36184 36185 36186 /** 36187 * Internal dependencies 36188 */ 36189 36190 36191 36192 36193 36194 36195 /** 36196 * 36197 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexProps, 'div'>} props 36198 * @return {import('../../ui/context').WordPressComponentProps<import('../types').FlexProps, 'div'>} Props with the deprecated props removed. 36199 */ 36200 36201 function hook_useDeprecatedProps(_ref) { 36202 let { 36203 isReversed, 36204 ...otherProps 36205 } = _ref; 36206 36207 if (typeof isReversed !== 'undefined') { 36208 external_wp_deprecated_default()('Flex isReversed', { 36209 alternative: 'Flex direction="row-reverse" or "column-reverse"', 36210 since: '5.9' 36211 }); 36212 return { ...otherProps, 36213 direction: isReversed ? 'row-reverse' : 'row' 36214 }; 36215 } 36216 36217 return otherProps; 36218 } 36219 /** 36220 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexProps, 'div'>} props 36221 */ 36222 36223 36224 function useFlex(props) { 36225 const { 36226 align = 'center', 36227 className, 36228 direction: directionProp = 'row', 36229 expanded = true, 36230 gap = 2, 36231 justify = 'space-between', 36232 wrap = false, 36233 ...otherProps 36234 } = useContextSystem(hook_useDeprecatedProps(props), 'Flex'); 36235 const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp]; 36236 const direction = useResponsiveValue(directionAsArray); 36237 const isColumn = typeof direction === 'string' && !!direction.includes('column'); 36238 const isReverse = typeof direction === 'string' && direction.includes('reverse'); 36239 const cx = useCx(); 36240 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 36241 const sx = {}; 36242 sx.Base = /*#__PURE__*/emotion_react_browser_esm_css({ 36243 alignItems: isColumn ? 'normal' : align, 36244 flexDirection: direction, 36245 flexWrap: wrap ? 'wrap' : undefined, 36246 justifyContent: justify, 36247 height: isColumn && expanded ? '100%' : undefined, 36248 width: !isColumn && expanded ? '100%' : undefined, 36249 marginBottom: wrap ? `calc($space(gap)} * -1)` : undefined 36250 }, true ? "" : 0, true ? "" : 0); 36251 /** 36252 * Workaround to optimize DOM rendering. 36253 * We'll enhance alignment with naive parent flex assumptions. 36254 * 36255 * Trade-off: 36256 * Far less DOM less. However, UI rendering is not as reliable. 36257 */ 36258 36259 sx.Items = /*#__PURE__*/emotion_react_browser_esm_css(">*+*:not( marquee ){margin-top:", isColumn ? space(gap) : undefined, ";", rtl({ 36260 marginLeft: !isColumn && !isReverse ? space(gap) : undefined, 36261 marginRight: !isColumn && isReverse ? space(gap) : undefined 36262 })(), ";}" + ( true ? "" : 0), true ? "" : 0); 36263 sx.WrapItems = /*#__PURE__*/emotion_react_browser_esm_css(">*:not( marquee ){margin-bottom:", space(gap), ";", rtl({ 36264 marginLeft: !isColumn && isReverse ? space(gap) : undefined, 36265 marginRight: !isColumn && !isReverse ? space(gap) : undefined 36266 })(), ";}>*:last-child:not( marquee ){", rtl({ 36267 marginLeft: !isColumn && isReverse ? 0 : undefined, 36268 marginRight: !isColumn && !isReverse ? 0 : undefined 36269 })(), ";}" + ( true ? "" : 0), true ? "" : 0); 36270 return cx(Flex, sx.Base, wrap ? sx.WrapItems : sx.Items, isColumn ? ItemsColumn : ItemsRow, className); 36271 }, [align, className, cx, direction, expanded, gap, isColumn, isReverse, justify, wrap, rtl.watch()]); 36272 return { ...otherProps, 36273 className: classes, 36274 isColumn 36275 }; 36276 } 36277 36278 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/component.js 36279 36280 36281 36282 /** 36283 * Internal dependencies 36284 */ 36285 36286 36287 36288 36289 /** 36290 * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexProps, 'div'>} props 36291 * @param {import('react').ForwardedRef<any>} forwardedRef 36292 */ 36293 36294 function component_Flex(props, forwardedRef) { 36295 const { 36296 children, 36297 isColumn, 36298 ...otherProps 36299 } = useFlex(props); 36300 return (0,external_wp_element_namespaceObject.createElement)(FlexContext.Provider, { 36301 value: { 36302 flexItemDisplay: isColumn ? 'block' : undefined 36303 } 36304 }, (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, otherProps, { 36305 ref: forwardedRef 36306 }), children)); 36307 } 36308 /** 36309 * `Flex` is a primitive layout component that adaptively aligns child content 36310 * horizontally or vertically. `Flex` powers components like `HStack` and 36311 * `VStack`. 36312 * 36313 * `Flex` is used with any of it's two sub-components, `FlexItem` and `FlexBlock`. 36314 * 36315 * @example 36316 * ```jsx 36317 * import { 36318 * __experimentalFlex as Flex, 36319 * __experimentalFlexBlock as FlexBlock, 36320 * __experimentalFlexItem as FlexItem, 36321 * __experimentalText as Text 36322 * } from `@wordpress/components`; 36323 * 36324 * function Example() { 36325 * return ( 36326 * <Flex> 36327 * <FlexItem> 36328 * <Text>Code</Text> 36329 * </FlexItem> 36330 * <FlexBlock> 36331 * <Text>Poetry</Text> 36332 * </FlexBlock> 36333 * </Flex> 36334 * ); 36335 * } 36336 * ``` 36337 * 36338 */ 36339 36340 36341 const ConnectedFlex = contextConnect(component_Flex, 'Flex'); 36342 /* harmony default export */ var flex_component = (ConnectedFlex); 36343 36344 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/styles.js 36345 function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 36346 36347 /** 36348 * External dependencies 36349 */ 36350 36351 const Truncate = true ? { 36352 name: "hdknak", 36353 styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap" 36354 } : 0; 36355 36356 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/utils.js 36357 /** 36358 * External dependencies 36359 */ 36360 36361 const TRUNCATE_ELLIPSIS = '…'; 36362 const TRUNCATE_TYPE = { 36363 auto: 'auto', 36364 head: 'head', 36365 middle: 'middle', 36366 tail: 'tail', 36367 none: 'none' 36368 }; 36369 const TRUNCATE_DEFAULT_PROPS = { 36370 ellipsis: TRUNCATE_ELLIPSIS, 36371 ellipsizeMode: TRUNCATE_TYPE.auto, 36372 limit: 0, 36373 numberOfLines: 0 36374 }; // Source 36375 // https://github.com/kahwee/truncate-middle 36376 36377 /** 36378 * @param {string} word 36379 * @param {number} headLength 36380 * @param {number} tailLength 36381 * @param {string} ellipsis 36382 */ 36383 36384 function truncateMiddle(word, headLength, tailLength, ellipsis) { 36385 if (typeof word !== 'string') { 36386 return ''; 36387 } 36388 36389 const wordLength = word.length; // Setting default values 36390 // eslint-disable-next-line no-bitwise 36391 36392 const frontLength = ~~headLength; // Will cast to integer 36393 // eslint-disable-next-line no-bitwise 36394 36395 const backLength = ~~tailLength; 36396 /* istanbul ignore next */ 36397 36398 const truncateStr = !(0,external_lodash_namespaceObject.isNil)(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS; 36399 36400 if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) { 36401 return word; 36402 } else if (backLength === 0) { 36403 return word.slice(0, frontLength) + truncateStr; 36404 } 36405 36406 return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength); 36407 } 36408 /** 36409 * 36410 * @param {string} words 36411 * @param {typeof TRUNCATE_DEFAULT_PROPS} props 36412 */ 36413 36414 function truncateContent() { 36415 let words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 36416 let props = arguments.length > 1 ? arguments[1] : undefined; 36417 const mergedProps = { ...TRUNCATE_DEFAULT_PROPS, 36418 ...props 36419 }; 36420 const { 36421 ellipsis, 36422 ellipsizeMode, 36423 limit 36424 } = mergedProps; 36425 36426 if (ellipsizeMode === TRUNCATE_TYPE.none) { 36427 return words; 36428 } 36429 36430 let truncateHead; 36431 let truncateTail; 36432 36433 switch (ellipsizeMode) { 36434 case TRUNCATE_TYPE.head: 36435 truncateHead = 0; 36436 truncateTail = limit; 36437 break; 36438 36439 case TRUNCATE_TYPE.middle: 36440 truncateHead = Math.floor(limit / 2); 36441 truncateTail = Math.floor(limit / 2); 36442 break; 36443 36444 default: 36445 truncateHead = limit; 36446 truncateTail = 0; 36447 } 36448 36449 const truncatedContent = ellipsizeMode !== TRUNCATE_TYPE.auto ? truncateMiddle(words, truncateHead, truncateTail, ellipsis) : words; 36450 return truncatedContent; 36451 } 36452 36453 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/hook.js 36454 /** 36455 * External dependencies 36456 */ 36457 36458 /** 36459 * WordPress dependencies 36460 */ 36461 36462 36463 /** 36464 * Internal dependencies 36465 */ 36466 36467 36468 36469 36470 36471 /** 36472 * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props 36473 */ 36474 36475 function useTruncate(props) { 36476 const { 36477 className, 36478 children, 36479 ellipsis = TRUNCATE_ELLIPSIS, 36480 ellipsizeMode = TRUNCATE_TYPE.auto, 36481 limit = 0, 36482 numberOfLines = 0, 36483 ...otherProps 36484 } = useContextSystem(props, 'Truncate'); 36485 const cx = useCx(); 36486 const truncatedContent = truncateContent(typeof children === 'string' ? 36487 /** @type {string} */ 36488 children : '', { 36489 ellipsis, 36490 ellipsizeMode, 36491 limit, 36492 numberOfLines 36493 }); 36494 const shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto; 36495 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 36496 const sx = {}; 36497 sx.numberOfLines = /*#__PURE__*/emotion_react_browser_esm_css("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : 0), true ? "" : 0); 36498 return cx(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && sx.numberOfLines, className); 36499 }, [className, cx, numberOfLines, shouldTruncate]); 36500 return { ...otherProps, 36501 className: classes, 36502 children: truncatedContent 36503 }; 36504 } 36505 36506 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/colors.js 36507 /** 36508 * External dependencies 36509 */ 36510 36511 36512 36513 /** @type {HTMLDivElement} */ 36514 36515 let colorComputationNode; 36516 k([names]); 36517 /** 36518 * @return {HTMLDivElement | undefined} The HTML element for color computation. 36519 */ 36520 36521 function getColorComputationNode() { 36522 if (typeof document === 'undefined') return; 36523 36524 if (!colorComputationNode) { 36525 // Create a temporary element for style computation. 36526 const el = document.createElement('div'); 36527 el.setAttribute('data-g2-color-computation-node', ''); // Inject for window computed style. 36528 36529 document.body.appendChild(el); 36530 colorComputationNode = el; 36531 } 36532 36533 return colorComputationNode; 36534 } 36535 /** 36536 * @param {string | unknown} value 36537 * 36538 * @return {boolean} Whether the value is a valid color. 36539 */ 36540 36541 36542 function isColor(value) { 36543 if (typeof value !== 'string') return false; 36544 const test = w(value); 36545 return test.isValid(); 36546 } 36547 /** 36548 * Retrieves the computed background color. This is useful for getting the 36549 * value of a CSS variable color. 36550 * 36551 * @param {string | unknown} backgroundColor The background color to compute. 36552 * 36553 * @return {string} The computed background color. 36554 */ 36555 36556 36557 function _getComputedBackgroundColor(backgroundColor) { 36558 var _window; 36559 36560 if (typeof backgroundColor !== 'string') return ''; 36561 if (isColor(backgroundColor)) return backgroundColor; 36562 if (!backgroundColor.includes('var(')) return ''; 36563 if (typeof document === 'undefined') return ''; // Attempts to gracefully handle CSS variables color values. 36564 36565 const el = getColorComputationNode(); 36566 if (!el) return ''; 36567 el.style.background = backgroundColor; // Grab the style. 36568 36569 const computedColor = (_window = window) === null || _window === void 0 ? void 0 : _window.getComputedStyle(el).background; // Reset. 36570 36571 el.style.background = ''; 36572 return computedColor || ''; 36573 } 36574 36575 const getComputedBackgroundColor = memize_default()(_getComputedBackgroundColor); 36576 /** 36577 * Get the text shade optimized for readability, based on a background color. 36578 * 36579 * @param {string | unknown} backgroundColor The background color. 36580 * 36581 * @return {string} The optimized text color (black or white). 36582 */ 36583 36584 function getOptimalTextColor(backgroundColor) { 36585 const background = getComputedBackgroundColor(backgroundColor); 36586 return w(background).isLight() ? '#000000' : '#ffffff'; 36587 } 36588 /** 36589 * Get the text shade optimized for readability, based on a background color. 36590 * 36591 * @param {string | unknown} backgroundColor The background color. 36592 * 36593 * @return {string} The optimized text shade (dark or light). 36594 */ 36595 36596 function getOptimalTextShade(backgroundColor) { 36597 const result = getOptimalTextColor(backgroundColor); 36598 return result === '#000000' ? 'dark' : 'light'; 36599 } 36600 36601 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/config-values.js 36602 /** 36603 * Internal dependencies 36604 */ 36605 36606 36607 const CONTROL_HEIGHT = '36px'; 36608 const CONTROL_PADDING_X = '12px'; 36609 const CONTROL_PROPS = { 36610 controlSurfaceColor: COLORS.white, 36611 controlTextActiveColor: COLORS.ui.theme, 36612 controlPaddingX: CONTROL_PADDING_X, 36613 controlPaddingXLarge: `calc($CONTROL_PADDING_X} * 1.3334)`, 36614 controlPaddingXSmall: `calc($CONTROL_PADDING_X} / 1.3334)`, 36615 controlBackgroundColor: COLORS.white, 36616 controlBorderRadius: '2px', 36617 controlBorderColor: COLORS.gray[700], 36618 controlBoxShadow: 'transparent', 36619 controlBorderColorHover: COLORS.gray[700], 36620 controlBoxShadowFocus: `0 0 0 0.5px $COLORS.admin.theme}`, 36621 controlDestructiveBorderColor: COLORS.alert.red, 36622 controlHeight: CONTROL_HEIGHT, 36623 controlHeightXSmall: `calc( $CONTROL_HEIGHT} * 0.6 )`, 36624 controlHeightSmall: `calc( $CONTROL_HEIGHT} * 0.8 )`, 36625 controlHeightLarge: `calc( $CONTROL_HEIGHT} * 1.2 )`, 36626 controlHeightXLarge: `calc( $CONTROL_HEIGHT} * 1.4 )` 36627 }; 36628 const TOGGLE_GROUP_CONTROL_PROPS = { 36629 toggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor, 36630 toggleGroupControlBorderColor: COLORS.ui.border, 36631 toggleGroupControlBackdropBackgroundColor: CONTROL_PROPS.controlSurfaceColor, 36632 toggleGroupControlBackdropBorderColor: COLORS.ui.border, 36633 toggleGroupControlBackdropBoxShadow: 'transparent', 36634 toggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor 36635 }; // Using Object.assign to avoid creating circular references when emitting 36636 // TypeScript type declarations. 36637 36638 /* harmony default export */ var config_values = (Object.assign({}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, { 36639 colorDivider: 'rgba(0, 0, 0, 0.1)', 36640 colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)', 36641 colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)', 36642 colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)', 36643 elevationIntensity: 1, 36644 radiusBlockUi: '2px', 36645 borderWidth: '1px', 36646 borderWidthFocus: '1.5px', 36647 borderWidthTab: '4px', 36648 spinnerSize: 16, 36649 fontSize: '13px', 36650 fontSizeH1: 'calc(2.44 * 13px)', 36651 fontSizeH2: 'calc(1.95 * 13px)', 36652 fontSizeH3: 'calc(1.56 * 13px)', 36653 fontSizeH4: 'calc(1.25 * 13px)', 36654 fontSizeH5: '13px', 36655 fontSizeH6: 'calc(0.8 * 13px)', 36656 fontSizeInputMobile: '16px', 36657 fontSizeMobile: '15px', 36658 fontSizeSmall: 'calc(0.92 * 13px)', 36659 fontSizeXSmall: 'calc(0.75 * 13px)', 36660 fontLineHeightBase: '1.2', 36661 fontWeight: 'normal', 36662 fontWeightHeading: '600', 36663 gridBase: '4px', 36664 cardBorderRadius: '2px', 36665 cardPaddingXSmall: `$space(2)}`, 36666 cardPaddingSmall: `$space(4)}`, 36667 cardPaddingMedium: `$space(4)} $space(6)}`, 36668 cardPaddingLarge: `$space(6)} $space(8)}`, 36669 surfaceBackgroundColor: COLORS.white, 36670 surfaceBackgroundSubtleColor: '#F3F3F3', 36671 surfaceBackgroundTintColor: '#F5F5F5', 36672 surfaceBorderColor: 'rgba(0, 0, 0, 0.1)', 36673 surfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)', 36674 surfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)', 36675 surfaceBackgroundTertiaryColor: COLORS.white, 36676 surfaceColor: COLORS.white, 36677 transitionDuration: '200ms', 36678 transitionDurationFast: '160ms', 36679 transitionDurationFaster: '120ms', 36680 transitionDurationFastest: '100ms', 36681 transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)', 36682 transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)' 36683 })); 36684 36685 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles.js 36686 function text_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 36687 36688 /** 36689 * External dependencies 36690 */ 36691 36692 /** 36693 * Internal dependencies 36694 */ 36695 36696 36697 const Text = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.darkGray.primary, ";line-height:", config_values.fontLineHeightBase, ";margin:0;" + ( true ? "" : 0), true ? "" : 0); 36698 const styles_block = true ? { 36699 name: "4zleql", 36700 styles: "display:block" 36701 } : 0; 36702 const positive = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.alert.green, ";" + ( true ? "" : 0), true ? "" : 0); 36703 const destructive = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.alert.red, ";" + ( true ? "" : 0), true ? "" : 0); 36704 const muted = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.mediumGray.text, ";" + ( true ? "" : 0), true ? "" : 0); 36705 const highlighterText = /*#__PURE__*/emotion_react_browser_esm_css("mark{background:", COLORS.alert.yellow, ";border-radius:2px;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}" + ( true ? "" : 0), true ? "" : 0); 36706 const upperCase = true ? { 36707 name: "50zrmy", 36708 styles: "text-transform:uppercase" 36709 } : 0; 36710 36711 // EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js 36712 var dist = __webpack_require__(3138); 36713 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/utils.js 36714 /** 36715 * External dependencies 36716 */ 36717 36718 36719 /** 36720 * WordPress dependencies 36721 */ 36722 36723 36724 /** 36725 * Source: 36726 * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js 36727 */ 36728 36729 /* eslint-disable jsdoc/valid-types */ 36730 36731 /** 36732 * @typedef Options 36733 * @property {string} [activeClassName=''] Classname for active highlighted areas. 36734 * @property {number} [activeIndex=-1] The index of the active highlighted area. 36735 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area. 36736 * @property {boolean} [autoEscape] Whether to automatically escape text. 36737 * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner. 36738 * @property {string} children Children to highlight. 36739 * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`. 36740 * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key). 36741 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text. 36742 * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text. 36743 * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`. 36744 * @property {string[]} [searchWords=[]] Words to search for and highlight. 36745 * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text. 36746 * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text. 36747 */ 36748 36749 /** 36750 * Maps props to lowercase names. 36751 * 36752 * @template {Record<string, unknown>} T 36753 * @param {T} object Props to map. 36754 * @return {{[K in keyof T as Lowercase<string & K>]: T[K]}} The mapped props. 36755 */ 36756 36757 /* eslint-enable jsdoc/valid-types */ 36758 36759 const lowercaseProps = object => { 36760 /** @type {any} */ 36761 const mapped = {}; 36762 36763 for (const key in object) { 36764 mapped[key.toLowerCase()] = object[key]; 36765 } 36766 36767 return mapped; 36768 }; 36769 36770 const memoizedLowercaseProps = memize_default()(lowercaseProps); 36771 /** 36772 * 36773 * @param {Options} options 36774 */ 36775 36776 function createHighlighterText(_ref) { 36777 let { 36778 activeClassName = '', 36779 activeIndex = -1, 36780 activeStyle, 36781 autoEscape, 36782 caseSensitive = false, 36783 children, 36784 findChunks, 36785 highlightClassName = '', 36786 highlightStyle = {}, 36787 highlightTag = 'mark', 36788 sanitize, 36789 searchWords = [], 36790 unhighlightClassName = '', 36791 unhighlightStyle 36792 } = _ref; 36793 if (!children) return null; 36794 if (typeof children !== 'string') return children; 36795 const textToHighlight = children; 36796 const chunks = (0,dist.findAll)({ 36797 autoEscape, 36798 caseSensitive, 36799 findChunks, 36800 sanitize, 36801 searchWords, 36802 textToHighlight 36803 }); 36804 const HighlightTag = highlightTag; 36805 let highlightIndex = -1; 36806 let highlightClassNames = ''; 36807 let highlightStyles; 36808 const textContent = chunks.map((chunk, index) => { 36809 const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start); 36810 36811 if (chunk.highlight) { 36812 highlightIndex++; 36813 let highlightClass; 36814 36815 if (typeof highlightClassName === 'object') { 36816 if (!caseSensitive) { 36817 highlightClassName = memoizedLowercaseProps(highlightClassName); 36818 highlightClass = highlightClassName[text.toLowerCase()]; 36819 } else { 36820 highlightClass = highlightClassName[text]; 36821 } 36822 } else { 36823 highlightClass = highlightClassName; 36824 } 36825 36826 const isActive = highlightIndex === +activeIndex; 36827 highlightClassNames = `$highlightClass} $isActive ? activeClassName : ''}`; 36828 highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle; 36829 /** @type {Record<string, any>} */ 36830 36831 const props = { 36832 children: text, 36833 className: highlightClassNames, 36834 key: index, 36835 style: highlightStyles 36836 }; // Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop) 36837 // Only pass through the highlightIndex attribute for custom components. 36838 36839 if (typeof HighlightTag !== 'string') { 36840 props.highlightIndex = highlightIndex; 36841 } 36842 36843 return (0,external_wp_element_namespaceObject.createElement)(HighlightTag, props); 36844 } 36845 36846 return (0,external_wp_element_namespaceObject.createElement)('span', { 36847 children: text, 36848 className: unhighlightClassName, 36849 key: index, 36850 style: unhighlightStyle 36851 }); 36852 }); 36853 return textContent; 36854 } 36855 36856 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/font-size.js 36857 /** 36858 * External dependencies 36859 */ 36860 36861 /** 36862 * Internal dependencies 36863 */ 36864 36865 const BASE_FONT_SIZE = 13; 36866 const PRESET_FONT_SIZES = { 36867 body: BASE_FONT_SIZE, 36868 caption: 10, 36869 footnote: 11, 36870 largeTitle: 28, 36871 subheadline: 12, 36872 title: 20 36873 }; 36874 const HEADING_FONT_SIZES = [1, 2, 3, 4, 5, 6].flatMap(n => [n, n.toString()]); 36875 function getFontSize() { 36876 let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : BASE_FONT_SIZE; 36877 36878 if (size in PRESET_FONT_SIZES) { 36879 return getFontSize(PRESET_FONT_SIZES[size]); 36880 } 36881 36882 if (typeof size !== 'number') { 36883 const parsed = parseFloat(size); 36884 if (Number.isNaN(parsed)) return size; 36885 size = parsed; 36886 } 36887 36888 const ratio = `($size} / $BASE_FONT_SIZE})`; 36889 return `calc($ratio} * $config_values.fontSize})`; 36890 } 36891 function getHeadingFontSize() { 36892 let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3; 36893 36894 if (!HEADING_FONT_SIZES.includes(size)) { 36895 return getFontSize(size); 36896 } 36897 36898 const headingSize = `fontSizeH$size}`; 36899 return config_values[headingSize]; 36900 } 36901 36902 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/get-line-height.js 36903 /** 36904 * External dependencies 36905 */ 36906 36907 /** 36908 * Internal dependencies 36909 */ 36910 36911 36912 function getLineHeight(adjustLineHeightForInnerControls, lineHeight) { 36913 if (lineHeight) return lineHeight; 36914 if (!adjustLineHeightForInnerControls) return; 36915 let value = `calc($config_values.controlHeight} + $space(2)})`; 36916 36917 switch (adjustLineHeightForInnerControls) { 36918 case 'large': 36919 value = `calc($config_values.controlHeightLarge} + $space(2)})`; 36920 break; 36921 36922 case 'small': 36923 value = `calc($config_values.controlHeightSmall} + $space(2)})`; 36924 break; 36925 36926 case 'xSmall': 36927 value = `calc($config_values.controlHeightXSmall} + $space(2)})`; 36928 break; 36929 36930 default: 36931 break; 36932 } 36933 36934 return value; 36935 } 36936 36937 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/hook.js 36938 function hook_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 36939 36940 /** 36941 * External dependencies 36942 */ 36943 36944 36945 /** 36946 * WordPress dependencies 36947 */ 36948 36949 36950 /** 36951 * Internal dependencies 36952 */ 36953 36954 36955 36956 36957 36958 36959 36960 36961 36962 36963 /** 36964 * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props 36965 */ 36966 36967 var hook_ref = true ? { 36968 name: "50zrmy", 36969 styles: "text-transform:uppercase" 36970 } : 0; 36971 36972 function useText(props) { 36973 const { 36974 adjustLineHeightForInnerControls, 36975 align, 36976 children, 36977 className, 36978 color, 36979 ellipsizeMode, 36980 isDestructive = false, 36981 display, 36982 highlightEscape = false, 36983 highlightCaseSensitive = false, 36984 highlightWords, 36985 highlightSanitize, 36986 isBlock = false, 36987 letterSpacing, 36988 lineHeight: lineHeightProp, 36989 optimizeReadabilityFor, 36990 size, 36991 truncate = false, 36992 upperCase = false, 36993 variant, 36994 weight = config_values.fontWeight, 36995 ...otherProps 36996 } = useContextSystem(props, 'Text'); 36997 /** @type {import('react').ReactNode} */ 36998 36999 let content = children; 37000 const isHighlighter = Array.isArray(highlightWords); 37001 const isCaption = size === 'caption'; 37002 37003 if (isHighlighter) { 37004 if (typeof children !== 'string') { 37005 throw new TypeError('`children` of `Text` must only be `string` types when `highlightWords` is defined'); 37006 } 37007 37008 content = createHighlighterText({ 37009 autoEscape: highlightEscape, 37010 // Disable reason: We need to disable this otherwise it erases the cast 37011 // eslint-disable-next-line object-shorthand 37012 children: 37013 /** @type {string} */ 37014 children, 37015 caseSensitive: highlightCaseSensitive, 37016 searchWords: highlightWords, 37017 sanitize: highlightSanitize 37018 }); 37019 } 37020 37021 const cx = useCx(); 37022 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 37023 const sx = {}; 37024 const lineHeight = getLineHeight(adjustLineHeightForInnerControls, lineHeightProp); 37025 sx.Base = /*#__PURE__*/emotion_react_browser_esm_css({ 37026 color, 37027 display, 37028 fontSize: getFontSize(size), 37029 37030 /* eslint-disable jsdoc/valid-types */ 37031 fontWeight: 37032 /** @type {import('react').CSSProperties['fontWeight']} */ 37033 weight, 37034 37035 /* eslint-enable jsdoc/valid-types */ 37036 lineHeight, 37037 letterSpacing, 37038 textAlign: align 37039 }, true ? "" : 0, true ? "" : 0); 37040 sx.upperCase = hook_ref; 37041 sx.optimalTextColor = null; 37042 37043 if (optimizeReadabilityFor) { 37044 const isOptimalTextColorDark = getOptimalTextShade(optimizeReadabilityFor) === 'dark'; 37045 sx.optimalTextColor = isOptimalTextColorDark ? /*#__PURE__*/emotion_react_browser_esm_css({ 37046 color: COLORS.black 37047 }, true ? "" : 0, true ? "" : 0) : /*#__PURE__*/emotion_react_browser_esm_css({ 37048 color: COLORS.white 37049 }, true ? "" : 0, true ? "" : 0); 37050 } 37051 37052 return cx(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className); 37053 }, [adjustLineHeightForInnerControls, align, className, color, cx, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]); 37054 /** @type {undefined | 'auto' | 'none'} */ 37055 37056 let finalEllipsizeMode; 37057 37058 if (truncate === true) { 37059 finalEllipsizeMode = 'auto'; 37060 } 37061 37062 if (truncate === false) { 37063 finalEllipsizeMode = 'none'; 37064 } 37065 37066 const finalComponentProps = { ...otherProps, 37067 className: classes, 37068 children, 37069 ellipsizeMode: ellipsizeMode || finalEllipsizeMode 37070 }; 37071 const truncateProps = useTruncate(finalComponentProps); 37072 /** 37073 * Enhance child `<Link />` components to inherit font size. 37074 */ 37075 37076 if (!truncate && Array.isArray(children)) { 37077 content = external_wp_element_namespaceObject.Children.map(children, child => { 37078 // @ts-ignore 37079 if (!(0,external_lodash_namespaceObject.isPlainObject)(child) || !('props' in child)) { 37080 return child; 37081 } 37082 37083 const isLink = hasConnectNamespace(child, ['Link']); 37084 37085 if (isLink) { 37086 return (0,external_wp_element_namespaceObject.cloneElement)(child, { 37087 size: child.props.size || 'inherit' 37088 }); 37089 } 37090 37091 return child; 37092 }); 37093 } 37094 37095 return { ...truncateProps, 37096 children: truncate ? truncateProps.children : content 37097 }; 37098 } 37099 37100 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/component.js 37101 37102 37103 37104 /** 37105 * Internal dependencies 37106 */ 37107 37108 37109 37110 /** 37111 * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props 37112 * @param {import('react').ForwardedRef<any>} forwardedRef 37113 */ 37114 37115 function component_Text(props, forwardedRef) { 37116 const textProps = useText(props); 37117 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({ 37118 as: "span" 37119 }, textProps, { 37120 ref: forwardedRef 37121 })); 37122 } 37123 /** 37124 * `Text` is a core component that renders text in the library, using the 37125 * library's typography system. 37126 * 37127 * `Text` can be used to render any text-content, like an HTML `p` or `span`. 37128 * 37129 * @example 37130 * 37131 * ```jsx 37132 * import { __experimentalText as Text } from `@wordpress/components`; 37133 * 37134 * function Example() { 37135 * return <Text>Code is Poetry</Text>; 37136 * } 37137 * ``` 37138 */ 37139 37140 37141 const ConnectedText = contextConnect(component_Text, 'Text'); 37142 /* harmony default export */ var text_component = (ConnectedText); 37143 37144 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js 37145 37146 37147 37148 37149 function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 37150 37151 /** 37152 * External dependencies 37153 */ 37154 37155 37156 37157 37158 37159 var _ref6 = true ? { 37160 name: "1739oy8", 37161 styles: "z-index:1" 37162 } : 0; 37163 37164 const rootFocusedStyles = _ref7 => { 37165 let { 37166 isFocused 37167 } = _ref7; 37168 if (!isFocused) return ''; 37169 return _ref6; 37170 }; 37171 37172 var _ref3 = true ? { 37173 name: "2o6p8u", 37174 styles: "justify-content:space-between" 37175 } : 0; 37176 37177 var _ref4 = true ? { 37178 name: "14qk3ip", 37179 styles: "align-items:flex-start;flex-direction:column-reverse" 37180 } : 0; 37181 37182 var _ref5 = true ? { 37183 name: "hbng6e", 37184 styles: "align-items:flex-start;flex-direction:column" 37185 } : 0; 37186 37187 const rootLabelPositionStyles = _ref8 => { 37188 let { 37189 labelPosition 37190 } = _ref8; 37191 37192 switch (labelPosition) { 37193 case 'top': 37194 return _ref5; 37195 37196 case 'bottom': 37197 return _ref4; 37198 37199 case 'edge': 37200 return _ref3; 37201 37202 default: 37203 return ''; 37204 } 37205 }; 37206 37207 const input_control_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { 37208 target: "em5sgkm7" 37209 } : 0)("position:relative;border-radius:2px;padding-top:0;", rootFocusedStyles, " ", rootLabelPositionStyles, ";" + ( true ? "" : 0)); 37210 37211 const containerDisabledStyles = _ref9 => { 37212 let { 37213 disabled 37214 } = _ref9; 37215 const backgroundColor = disabled ? COLORS.ui.backgroundDisabled : COLORS.ui.background; 37216 return /*#__PURE__*/emotion_react_browser_esm_css({ 37217 backgroundColor 37218 }, true ? "" : 0, true ? "" : 0); 37219 }; // Normalizes the margins from the <Flex /> (components/ui/flex/) container. 37220 37221 37222 var _ref2 = true ? { 37223 name: "wyxldh", 37224 styles: "margin:0 !important" 37225 } : 0; 37226 37227 const containerMarginStyles = _ref10 => { 37228 let { 37229 hideLabel 37230 } = _ref10; 37231 return hideLabel ? _ref2 : null; 37232 }; 37233 37234 var input_control_styles_ref = true ? { 37235 name: "1d3w5wq", 37236 styles: "width:100%" 37237 } : 0; 37238 37239 const containerWidthStyles = _ref11 => { 37240 let { 37241 __unstableInputWidth, 37242 labelPosition 37243 } = _ref11; 37244 if (!__unstableInputWidth) return input_control_styles_ref; 37245 if (labelPosition === 'side') return ''; 37246 37247 if (labelPosition === 'edge') { 37248 return /*#__PURE__*/emotion_react_browser_esm_css({ 37249 flex: `0 0 $__unstableInputWidth}` 37250 }, true ? "" : 0, true ? "" : 0); 37251 } 37252 37253 return /*#__PURE__*/emotion_react_browser_esm_css({ 37254 width: __unstableInputWidth 37255 }, true ? "" : 0, true ? "" : 0); 37256 }; 37257 37258 const Container = emotion_styled_base_browser_esm("div", true ? { 37259 target: "em5sgkm6" 37260 } : 0)("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerMarginStyles, " ", containerWidthStyles, ";" + ( true ? "" : 0)); 37261 37262 const disabledStyles = _ref12 => { 37263 let { 37264 disabled 37265 } = _ref12; 37266 if (!disabled) return ''; 37267 return /*#__PURE__*/emotion_react_browser_esm_css({ 37268 color: COLORS.ui.textDisabled 37269 }, true ? "" : 0, true ? "" : 0); 37270 }; 37271 37272 const fontSizeStyles = _ref13 => { 37273 let { 37274 inputSize: size 37275 } = _ref13; 37276 const sizes = { 37277 default: '13px', 37278 small: '11px', 37279 '__unstable-large': '13px' 37280 }; 37281 const fontSize = sizes[size] || sizes.default; 37282 const fontSizeMobile = '16px'; 37283 if (!fontSize) return ''; 37284 return /*#__PURE__*/emotion_react_browser_esm_css("font-size:", fontSizeMobile, ";@media ( min-width: 600px ){font-size:", fontSize, ";}" + ( true ? "" : 0), true ? "" : 0); 37285 }; 37286 37287 const sizeStyles = _ref14 => { 37288 let { 37289 inputSize: size 37290 } = _ref14; 37291 const sizes = { 37292 default: { 37293 height: 30, 37294 lineHeight: 1, 37295 minHeight: 30, 37296 paddingLeft: 8, 37297 paddingRight: 8 37298 }, 37299 small: { 37300 height: 24, 37301 lineHeight: 1, 37302 minHeight: 24, 37303 paddingLeft: 8, 37304 paddingRight: 8 37305 }, 37306 '__unstable-large': { 37307 height: 40, 37308 lineHeight: 1, 37309 minHeight: 40, 37310 paddingLeft: 16, 37311 paddingRight: 16 37312 } 37313 }; 37314 const style = sizes[size] || sizes.default; 37315 return /*#__PURE__*/emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0); 37316 }; 37317 37318 const dragStyles = _ref15 => { 37319 let { 37320 isDragging, 37321 dragCursor 37322 } = _ref15; 37323 let defaultArrowStyles; 37324 let activeDragCursorStyles; 37325 37326 if (isDragging) { 37327 defaultArrowStyles = /*#__PURE__*/emotion_react_browser_esm_css("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}" + ( true ? "" : 0), true ? "" : 0); 37328 } 37329 37330 if (isDragging && dragCursor) { 37331 activeDragCursorStyles = /*#__PURE__*/emotion_react_browser_esm_css("&:active{cursor:", dragCursor, ";}" + ( true ? "" : 0), true ? "" : 0); 37332 } 37333 37334 return /*#__PURE__*/emotion_react_browser_esm_css(defaultArrowStyles, " ", activeDragCursorStyles, ";" + ( true ? "" : 0), true ? "" : 0); 37335 }; // TODO: Resolve need to use &&& to increase specificity 37336 // https://github.com/WordPress/gutenberg/issues/18483 37337 37338 37339 const Input = emotion_styled_base_browser_esm("input", true ? { 37340 target: "em5sgkm5" 37341 } : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.black, ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " &::-webkit-input-placeholder{line-height:normal;}}" + ( true ? "" : 0)); 37342 37343 const labelMargin = _ref16 => { 37344 let { 37345 labelPosition 37346 } = _ref16; 37347 let marginBottom = 8; 37348 37349 if (labelPosition === 'edge' || labelPosition === 'side') { 37350 marginBottom = 0; 37351 } 37352 37353 return /*#__PURE__*/emotion_react_browser_esm_css({ 37354 marginTop: 0, 37355 marginRight: 0, 37356 marginBottom, 37357 marginLeft: 0 37358 }, true ? "" : 0, true ? "" : 0); 37359 }; 37360 37361 const BaseLabel = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { 37362 target: "em5sgkm4" 37363 } : 0)("&&&{box-sizing:border-box;color:currentColor;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;", labelMargin, " overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}" + ( true ? "" : 0)); 37364 37365 const Label = props => (0,external_wp_element_namespaceObject.createElement)(BaseLabel, extends_extends({}, props, { 37366 as: "label" 37367 })); 37368 const LabelWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_item_component, true ? { 37369 target: "em5sgkm3" 37370 } : 0)( true ? { 37371 name: "1b6uupn", 37372 styles: "max-width:calc( 100% - 10px )" 37373 } : 0); 37374 37375 const backdropFocusedStyles = _ref17 => { 37376 let { 37377 disabled, 37378 isFocused 37379 } = _ref17; 37380 let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border; 37381 let boxShadow; 37382 37383 if (isFocused) { 37384 boxShadow = `0 0 0 1px $COLORS.ui.borderFocus} inset`; 37385 } 37386 37387 if (disabled) { 37388 borderColor = COLORS.ui.borderDisabled; 37389 } 37390 37391 return /*#__PURE__*/emotion_react_browser_esm_css({ 37392 boxShadow, 37393 borderColor, 37394 borderStyle: 'solid', 37395 borderWidth: 1 37396 }, true ? "" : 0, true ? "" : 0); 37397 }; 37398 37399 const BackdropUI = emotion_styled_base_browser_esm("div", true ? { 37400 target: "em5sgkm2" 37401 } : 0)("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", backdropFocusedStyles, " ", rtl({ 37402 paddingLeft: 2 37403 }), ";}" + ( true ? "" : 0)); 37404 const Prefix = emotion_styled_base_browser_esm("span", true ? { 37405 target: "em5sgkm1" 37406 } : 0)( true ? { 37407 name: "pvvbxf", 37408 styles: "box-sizing:border-box;display:block" 37409 } : 0); 37410 const Suffix = emotion_styled_base_browser_esm("span", true ? { 37411 target: "em5sgkm0" 37412 } : 0)( true ? { 37413 name: "jgf79h", 37414 styles: "align-items:center;align-self:stretch;box-sizing:border-box;display:flex" 37415 } : 0); 37416 37417 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/backdrop.js 37418 37419 37420 /** 37421 * WordPress dependencies 37422 */ 37423 37424 /** 37425 * Internal dependencies 37426 */ 37427 37428 37429 37430 function Backdrop(_ref) { 37431 let { 37432 disabled = false, 37433 isFocused = false 37434 } = _ref; 37435 return (0,external_wp_element_namespaceObject.createElement)(BackdropUI, { 37436 "aria-hidden": "true", 37437 className: "components-input-control__backdrop", 37438 disabled: disabled, 37439 isFocused: isFocused 37440 }); 37441 } 37442 37443 const MemoizedBackdrop = (0,external_wp_element_namespaceObject.memo)(Backdrop); 37444 /* harmony default export */ var backdrop = (MemoizedBackdrop); 37445 37446 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/label.js 37447 37448 37449 37450 /** 37451 * Internal dependencies 37452 */ 37453 37454 37455 function label_Label(_ref) { 37456 let { 37457 children, 37458 hideLabelFromVision, 37459 htmlFor, 37460 ...props 37461 } = _ref; 37462 if (!children) return null; 37463 37464 if (hideLabelFromVision) { 37465 return (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { 37466 as: "label", 37467 htmlFor: htmlFor 37468 }, children); 37469 } 37470 37471 return (0,external_wp_element_namespaceObject.createElement)(Label, extends_extends({ 37472 htmlFor: htmlFor 37473 }, props), children); 37474 } 37475 37476 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-base.js 37477 37478 37479 37480 /** 37481 * External dependencies 37482 */ 37483 37484 /** 37485 * WordPress dependencies 37486 */ 37487 37488 37489 /** 37490 * Internal dependencies 37491 */ 37492 37493 37494 37495 37496 37497 function useUniqueId(idProp) { 37498 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputBase); 37499 const id = `input-base-control-$instanceId}`; 37500 return idProp || id; 37501 } // Adapter to map props for the new ui/flex compopnent. 37502 37503 37504 function getUIFlexProps(labelPosition) { 37505 const props = {}; 37506 37507 switch (labelPosition) { 37508 case 'top': 37509 props.direction = 'column'; 37510 props.gap = 0; 37511 break; 37512 37513 case 'bottom': 37514 props.direction = 'column-reverse'; 37515 props.gap = 0; 37516 break; 37517 37518 case 'edge': 37519 props.justify = 'space-between'; 37520 break; 37521 } 37522 37523 return props; 37524 } 37525 37526 function InputBase(_ref, ref) { 37527 let { 37528 __unstableInputWidth, 37529 children, 37530 className, 37531 disabled = false, 37532 hideLabelFromVision = false, 37533 labelPosition, 37534 id: idProp, 37535 isFocused = false, 37536 label, 37537 prefix, 37538 size = 'default', 37539 suffix, 37540 ...props 37541 } = _ref; 37542 const id = useUniqueId(idProp); 37543 const hideLabel = hideLabelFromVision || !label; 37544 return (// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions. 37545 (0,external_wp_element_namespaceObject.createElement)(input_control_styles_Root, extends_extends({}, props, getUIFlexProps(labelPosition), { 37546 className: className, 37547 isFocused: isFocused, 37548 labelPosition: labelPosition, 37549 ref: ref 37550 }), (0,external_wp_element_namespaceObject.createElement)(LabelWrapper, null, (0,external_wp_element_namespaceObject.createElement)(label_Label, { 37551 className: "components-input-control__label", 37552 hideLabelFromVision: hideLabelFromVision, 37553 labelPosition: labelPosition, 37554 htmlFor: id, 37555 size: size 37556 }, label)), (0,external_wp_element_namespaceObject.createElement)(Container, { 37557 __unstableInputWidth: __unstableInputWidth, 37558 className: "components-input-control__container", 37559 disabled: disabled, 37560 hideLabel: hideLabel, 37561 labelPosition: labelPosition 37562 }, prefix && (0,external_wp_element_namespaceObject.createElement)(Prefix, { 37563 className: "components-input-control__prefix" 37564 }, prefix), children, suffix && (0,external_wp_element_namespaceObject.createElement)(Suffix, { 37565 className: "components-input-control__suffix" 37566 }, suffix), (0,external_wp_element_namespaceObject.createElement)(backdrop, { 37567 disabled: disabled, 37568 isFocused: isFocused 37569 }))) 37570 ); 37571 } 37572 /* harmony default export */ var input_base = ((0,external_wp_element_namespaceObject.forwardRef)(InputBase)); 37573 37574 ;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/maths-b2a210f4.esm.js 37575 function maths_b2a210f4_esm_clamp(v, min, max) { 37576 return Math.max(min, Math.min(v, max)); 37577 } 37578 const V = { 37579 toVector(v, fallback) { 37580 if (v === undefined) v = fallback; 37581 return Array.isArray(v) ? v : [v, v]; 37582 }, 37583 37584 add(v1, v2) { 37585 return [v1[0] + v2[0], v1[1] + v2[1]]; 37586 }, 37587 37588 sub(v1, v2) { 37589 return [v1[0] - v2[0], v1[1] - v2[1]]; 37590 }, 37591 37592 addTo(v1, v2) { 37593 v1[0] += v2[0]; 37594 v1[1] += v2[1]; 37595 }, 37596 37597 subTo(v1, v2) { 37598 v1[0] -= v2[0]; 37599 v1[1] -= v2[1]; 37600 } 37601 37602 }; 37603 37604 function rubberband(distance, dimension, constant) { 37605 if (dimension === 0 || Math.abs(dimension) === Infinity) return Math.pow(distance, constant * 5); 37606 return distance * dimension * constant / (dimension + constant * distance); 37607 } 37608 37609 function rubberbandIfOutOfBounds(position, min, max, constant = 0.15) { 37610 if (constant === 0) return maths_b2a210f4_esm_clamp(position, min, max); 37611 if (position < min) return -rubberband(min - position, max - min, constant) + min; 37612 if (position > max) return +rubberband(position - max, max - min, constant) + max; 37613 return position; 37614 } 37615 function computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) { 37616 const [[X0, X1], [Y0, Y1]] = bounds; 37617 return [rubberbandIfOutOfBounds(Vx, X0, X1, Rx), rubberbandIfOutOfBounds(Vy, Y0, Y1, Ry)]; 37618 } 37619 37620 37621 37622 ;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/actions-8e12537b.esm.js 37623 37624 37625 function actions_8e12537b_esm_defineProperty(obj, key, value) { 37626 if (key in obj) { 37627 Object.defineProperty(obj, key, { 37628 value: value, 37629 enumerable: true, 37630 configurable: true, 37631 writable: true 37632 }); 37633 } else { 37634 obj[key] = value; 37635 } 37636 37637 return obj; 37638 } 37639 37640 function actions_8e12537b_esm_ownKeys(object, enumerableOnly) { 37641 var keys = Object.keys(object); 37642 37643 if (Object.getOwnPropertySymbols) { 37644 var symbols = Object.getOwnPropertySymbols(object); 37645 enumerableOnly && (symbols = symbols.filter(function (sym) { 37646 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 37647 })), keys.push.apply(keys, symbols); 37648 } 37649 37650 return keys; 37651 } 37652 37653 function actions_8e12537b_esm_objectSpread2(target) { 37654 for (var i = 1; i < arguments.length; i++) { 37655 var source = null != arguments[i] ? arguments[i] : {}; 37656 i % 2 ? actions_8e12537b_esm_ownKeys(Object(source), !0).forEach(function (key) { 37657 actions_8e12537b_esm_defineProperty(target, key, source[key]); 37658 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_8e12537b_esm_ownKeys(Object(source)).forEach(function (key) { 37659 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 37660 }); 37661 } 37662 37663 return target; 37664 } 37665 37666 const EVENT_TYPE_MAP = { 37667 pointer: { 37668 start: 'down', 37669 change: 'move', 37670 end: 'up' 37671 }, 37672 mouse: { 37673 start: 'down', 37674 change: 'move', 37675 end: 'up' 37676 }, 37677 touch: { 37678 start: 'start', 37679 change: 'move', 37680 end: 'end' 37681 }, 37682 gesture: { 37683 start: 'start', 37684 change: 'change', 37685 end: 'end' 37686 } 37687 }; 37688 37689 function capitalize(string) { 37690 if (!string) return ''; 37691 return string[0].toUpperCase() + string.slice(1); 37692 } 37693 37694 function toHandlerProp(device, action = '', capture = false) { 37695 const deviceProps = EVENT_TYPE_MAP[device]; 37696 const actionKey = deviceProps ? deviceProps[action] || action : action; 37697 return 'on' + capitalize(device) + capitalize(actionKey) + (capture ? 'Capture' : ''); 37698 } 37699 const pointerCaptureEvents = ['gotpointercapture', 'lostpointercapture']; 37700 function parseProp(prop) { 37701 let eventKey = prop.substring(2).toLowerCase(); 37702 const passive = !!~eventKey.indexOf('passive'); 37703 if (passive) eventKey = eventKey.replace('passive', ''); 37704 const captureKey = pointerCaptureEvents.includes(eventKey) ? 'capturecapture' : 'capture'; 37705 const capture = !!~eventKey.indexOf(captureKey); 37706 if (capture) eventKey = eventKey.replace('capture', ''); 37707 return { 37708 device: eventKey, 37709 capture, 37710 passive 37711 }; 37712 } 37713 function toDomEventType(device, action = '') { 37714 const deviceProps = EVENT_TYPE_MAP[device]; 37715 const actionKey = deviceProps ? deviceProps[action] || action : action; 37716 return device + actionKey; 37717 } 37718 function isTouch(event) { 37719 return 'touches' in event; 37720 } 37721 function getPointerType(event) { 37722 if (isTouch(event)) return 'touch'; 37723 if ('pointerType' in event) return event.pointerType; 37724 return 'mouse'; 37725 } 37726 37727 function getCurrentTargetTouchList(event) { 37728 return Array.from(event.touches).filter(e => { 37729 var _event$currentTarget, _event$currentTarget$; 37730 37731 return e.target === event.currentTarget || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : (_event$currentTarget$ = _event$currentTarget.contains) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.call(_event$currentTarget, e.target)); 37732 }); 37733 } 37734 37735 function getTouchList(event) { 37736 return event.type === 'touchend' || event.type === 'touchcancel' ? event.changedTouches : event.targetTouches; 37737 } 37738 37739 function getValueEvent(event) { 37740 return isTouch(event) ? getTouchList(event)[0] : event; 37741 } 37742 37743 function distanceAngle(P1, P2) { 37744 const dx = P2.clientX - P1.clientX; 37745 const dy = P2.clientY - P1.clientY; 37746 const cx = (P2.clientX + P1.clientX) / 2; 37747 const cy = (P2.clientY + P1.clientY) / 2; 37748 const distance = Math.hypot(dx, dy); 37749 const angle = -(Math.atan2(dx, dy) * 180) / Math.PI; 37750 const origin = [cx, cy]; 37751 return { 37752 angle, 37753 distance, 37754 origin 37755 }; 37756 } 37757 function touchIds(event) { 37758 return getCurrentTargetTouchList(event).map(touch => touch.identifier); 37759 } 37760 function touchDistanceAngle(event, ids) { 37761 const [P1, P2] = Array.from(event.touches).filter(touch => ids.includes(touch.identifier)); 37762 return distanceAngle(P1, P2); 37763 } 37764 function pointerId(event) { 37765 const valueEvent = getValueEvent(event); 37766 return isTouch(event) ? valueEvent.identifier : valueEvent.pointerId; 37767 } 37768 function pointerValues(event) { 37769 const valueEvent = getValueEvent(event); 37770 return [valueEvent.clientX, valueEvent.clientY]; 37771 } 37772 const LINE_HEIGHT = 40; 37773 const PAGE_HEIGHT = 800; 37774 function wheelValues(event) { 37775 let { 37776 deltaX, 37777 deltaY, 37778 deltaMode 37779 } = event; 37780 37781 if (deltaMode === 1) { 37782 deltaX *= LINE_HEIGHT; 37783 deltaY *= LINE_HEIGHT; 37784 } else if (deltaMode === 2) { 37785 deltaX *= PAGE_HEIGHT; 37786 deltaY *= PAGE_HEIGHT; 37787 } 37788 37789 return [deltaX, deltaY]; 37790 } 37791 function scrollValues(event) { 37792 var _ref, _ref2; 37793 37794 const { 37795 scrollX, 37796 scrollY, 37797 scrollLeft, 37798 scrollTop 37799 } = event.currentTarget; 37800 return [(_ref = scrollX !== null && scrollX !== void 0 ? scrollX : scrollLeft) !== null && _ref !== void 0 ? _ref : 0, (_ref2 = scrollY !== null && scrollY !== void 0 ? scrollY : scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0]; 37801 } 37802 function getEventDetails(event) { 37803 const payload = {}; 37804 if ('buttons' in event) payload.buttons = event.buttons; 37805 37806 if ('shiftKey' in event) { 37807 const { 37808 shiftKey, 37809 altKey, 37810 metaKey, 37811 ctrlKey 37812 } = event; 37813 Object.assign(payload, { 37814 shiftKey, 37815 altKey, 37816 metaKey, 37817 ctrlKey 37818 }); 37819 } 37820 37821 return payload; 37822 } 37823 37824 function call(v, ...args) { 37825 if (typeof v === 'function') { 37826 return v(...args); 37827 } else { 37828 return v; 37829 } 37830 } 37831 function noop() {} 37832 function chain(...fns) { 37833 if (fns.length === 0) return noop; 37834 if (fns.length === 1) return fns[0]; 37835 return function () { 37836 let result; 37837 37838 for (const fn of fns) { 37839 result = fn.apply(this, arguments) || result; 37840 } 37841 37842 return result; 37843 }; 37844 } 37845 function assignDefault(value, fallback) { 37846 return Object.assign({}, fallback, value || {}); 37847 } 37848 37849 const BEFORE_LAST_KINEMATICS_DELAY = 32; 37850 class Engine { 37851 constructor(ctrl, args, key) { 37852 this.ctrl = ctrl; 37853 this.args = args; 37854 this.key = key; 37855 37856 if (!this.state) { 37857 this.state = {}; 37858 this.computeValues([0, 0]); 37859 this.computeInitial(); 37860 if (this.init) this.init(); 37861 this.reset(); 37862 } 37863 } 37864 37865 get state() { 37866 return this.ctrl.state[this.key]; 37867 } 37868 37869 set state(state) { 37870 this.ctrl.state[this.key] = state; 37871 } 37872 37873 get shared() { 37874 return this.ctrl.state.shared; 37875 } 37876 37877 get eventStore() { 37878 return this.ctrl.gestureEventStores[this.key]; 37879 } 37880 37881 get timeoutStore() { 37882 return this.ctrl.gestureTimeoutStores[this.key]; 37883 } 37884 37885 get config() { 37886 return this.ctrl.config[this.key]; 37887 } 37888 37889 get sharedConfig() { 37890 return this.ctrl.config.shared; 37891 } 37892 37893 get handler() { 37894 return this.ctrl.handlers[this.key]; 37895 } 37896 37897 reset() { 37898 const { 37899 state, 37900 shared, 37901 ingKey, 37902 args 37903 } = this; 37904 shared[ingKey] = state._active = state.active = state._blocked = state._force = false; 37905 state._step = [false, false]; 37906 state.intentional = false; 37907 state._movement = [0, 0]; 37908 state._distance = [0, 0]; 37909 state._direction = [0, 0]; 37910 state._delta = [0, 0]; 37911 state._bounds = [[-Infinity, Infinity], [-Infinity, Infinity]]; 37912 state.args = args; 37913 state.axis = undefined; 37914 state.memo = undefined; 37915 state.elapsedTime = 0; 37916 state.direction = [0, 0]; 37917 state.distance = [0, 0]; 37918 state.overflow = [0, 0]; 37919 state._movementBound = [false, false]; 37920 state.velocity = [0, 0]; 37921 state.movement = [0, 0]; 37922 state.delta = [0, 0]; 37923 state.timeStamp = 0; 37924 } 37925 37926 start(event) { 37927 const state = this.state; 37928 const config = this.config; 37929 37930 if (!state._active) { 37931 this.reset(); 37932 this.computeInitial(); 37933 state._active = true; 37934 state.target = event.target; 37935 state.currentTarget = event.currentTarget; 37936 state.lastOffset = config.from ? call(config.from, state) : state.offset; 37937 state.offset = state.lastOffset; 37938 } 37939 37940 state.startTime = state.timeStamp = event.timeStamp; 37941 } 37942 37943 computeValues(values) { 37944 const state = this.state; 37945 state._values = values; 37946 state.values = this.config.transform(values); 37947 } 37948 37949 computeInitial() { 37950 const state = this.state; 37951 state._initial = state._values; 37952 state.initial = state.values; 37953 } 37954 37955 compute(event) { 37956 const { 37957 state, 37958 config, 37959 shared 37960 } = this; 37961 state.args = this.args; 37962 let dt = 0; 37963 37964 if (event) { 37965 state.event = event; 37966 if (config.preventDefault && event.cancelable) state.event.preventDefault(); 37967 state.type = event.type; 37968 shared.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size; 37969 shared.locked = !!document.pointerLockElement; 37970 Object.assign(shared, getEventDetails(event)); 37971 shared.down = shared.pressed = shared.buttons % 2 === 1 || shared.touches > 0; 37972 dt = event.timeStamp - state.timeStamp; 37973 state.timeStamp = event.timeStamp; 37974 state.elapsedTime = state.timeStamp - state.startTime; 37975 } 37976 37977 if (state._active) { 37978 const _absoluteDelta = state._delta.map(Math.abs); 37979 37980 V.addTo(state._distance, _absoluteDelta); 37981 } 37982 37983 if (this.axisIntent) this.axisIntent(event); 37984 const [_m0, _m1] = state._movement; 37985 const [t0, t1] = config.threshold; 37986 const { 37987 _step, 37988 values 37989 } = state; 37990 37991 if (config.hasCustomTransform) { 37992 if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && values[0]; 37993 if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && values[1]; 37994 } else { 37995 if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && Math.sign(_m0) * t0; 37996 if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && Math.sign(_m1) * t1; 37997 } 37998 37999 state.intentional = _step[0] !== false || _step[1] !== false; 38000 if (!state.intentional) return; 38001 const movement = [0, 0]; 38002 38003 if (config.hasCustomTransform) { 38004 const [v0, v1] = values; 38005 movement[0] = _step[0] !== false ? v0 - _step[0] : 0; 38006 movement[1] = _step[1] !== false ? v1 - _step[1] : 0; 38007 } else { 38008 movement[0] = _step[0] !== false ? _m0 - _step[0] : 0; 38009 movement[1] = _step[1] !== false ? _m1 - _step[1] : 0; 38010 } 38011 38012 if (this.restrictToAxis && !state._blocked) this.restrictToAxis(movement); 38013 const previousOffset = state.offset; 38014 const gestureIsActive = state._active && !state._blocked || state.active; 38015 38016 if (gestureIsActive) { 38017 state.first = state._active && !state.active; 38018 state.last = !state._active && state.active; 38019 state.active = shared[this.ingKey] = state._active; 38020 38021 if (event) { 38022 if (state.first) { 38023 if ('bounds' in config) state._bounds = call(config.bounds, state); 38024 if (this.setup) this.setup(); 38025 } 38026 38027 state.movement = movement; 38028 this.computeOffset(); 38029 } 38030 } 38031 38032 const [ox, oy] = state.offset; 38033 const [[x0, x1], [y0, y1]] = state._bounds; 38034 state.overflow = [ox < x0 ? -1 : ox > x1 ? 1 : 0, oy < y0 ? -1 : oy > y1 ? 1 : 0]; 38035 state._movementBound[0] = state.overflow[0] ? state._movementBound[0] === false ? state._movement[0] : state._movementBound[0] : false; 38036 state._movementBound[1] = state.overflow[1] ? state._movementBound[1] === false ? state._movement[1] : state._movementBound[1] : false; 38037 const rubberband = state._active ? config.rubberband || [0, 0] : [0, 0]; 38038 state.offset = computeRubberband(state._bounds, state.offset, rubberband); 38039 state.delta = V.sub(state.offset, previousOffset); 38040 this.computeMovement(); 38041 38042 if (gestureIsActive && (!state.last || dt > BEFORE_LAST_KINEMATICS_DELAY)) { 38043 state.delta = V.sub(state.offset, previousOffset); 38044 const absoluteDelta = state.delta.map(Math.abs); 38045 V.addTo(state.distance, absoluteDelta); 38046 state.direction = state.delta.map(Math.sign); 38047 state._direction = state._delta.map(Math.sign); 38048 38049 if (!state.first && dt > 0) { 38050 state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt]; 38051 } 38052 } 38053 } 38054 38055 emit() { 38056 const state = this.state; 38057 const shared = this.shared; 38058 const config = this.config; 38059 if (!state._active) this.clean(); 38060 if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return; 38061 const memo = this.handler(actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, shared), state), {}, { 38062 [this.aliasKey]: state.values 38063 })); 38064 if (memo !== undefined) state.memo = memo; 38065 } 38066 38067 clean() { 38068 this.eventStore.clean(); 38069 this.timeoutStore.clean(); 38070 } 38071 38072 } 38073 38074 function selectAxis([dx, dy], threshold) { 38075 const absDx = Math.abs(dx); 38076 const absDy = Math.abs(dy); 38077 38078 if (absDx > absDy && absDx > threshold) { 38079 return 'x'; 38080 } 38081 38082 if (absDy > absDx && absDy > threshold) { 38083 return 'y'; 38084 } 38085 38086 return undefined; 38087 } 38088 38089 class CoordinatesEngine extends Engine { 38090 constructor(...args) { 38091 super(...args); 38092 38093 actions_8e12537b_esm_defineProperty(this, "aliasKey", 'xy'); 38094 } 38095 38096 reset() { 38097 super.reset(); 38098 this.state.axis = undefined; 38099 } 38100 38101 init() { 38102 this.state.offset = [0, 0]; 38103 this.state.lastOffset = [0, 0]; 38104 } 38105 38106 computeOffset() { 38107 this.state.offset = V.add(this.state.lastOffset, this.state.movement); 38108 } 38109 38110 computeMovement() { 38111 this.state.movement = V.sub(this.state.offset, this.state.lastOffset); 38112 } 38113 38114 axisIntent(event) { 38115 const state = this.state; 38116 const config = this.config; 38117 38118 if (!state.axis && event) { 38119 const threshold = typeof config.axisThreshold === 'object' ? config.axisThreshold[getPointerType(event)] : config.axisThreshold; 38120 state.axis = selectAxis(state._movement, threshold); 38121 } 38122 38123 state._blocked = (config.lockDirection || !!config.axis) && !state.axis || !!config.axis && config.axis !== state.axis; 38124 } 38125 38126 restrictToAxis(v) { 38127 if (this.config.axis || this.config.lockDirection) { 38128 switch (this.state.axis) { 38129 case 'x': 38130 v[1] = 0; 38131 break; 38132 38133 case 'y': 38134 v[0] = 0; 38135 break; 38136 } 38137 } 38138 } 38139 38140 } 38141 38142 const identity = v => v; 38143 const DEFAULT_RUBBERBAND = 0.15; 38144 const commonConfigResolver = { 38145 enabled(value = true) { 38146 return value; 38147 }, 38148 38149 preventDefault(value = false) { 38150 return value; 38151 }, 38152 38153 triggerAllEvents(value = false) { 38154 return value; 38155 }, 38156 38157 rubberband(value = 0) { 38158 switch (value) { 38159 case true: 38160 return [DEFAULT_RUBBERBAND, DEFAULT_RUBBERBAND]; 38161 38162 case false: 38163 return [0, 0]; 38164 38165 default: 38166 return V.toVector(value); 38167 } 38168 }, 38169 38170 from(value) { 38171 if (typeof value === 'function') return value; 38172 if (value != null) return V.toVector(value); 38173 }, 38174 38175 transform(value, _k, config) { 38176 const transform = value || config.shared.transform; 38177 this.hasCustomTransform = !!transform; 38178 38179 if (false) {} 38180 38181 return transform || identity; 38182 }, 38183 38184 threshold(value) { 38185 return V.toVector(value, 0); 38186 } 38187 38188 }; 38189 38190 if (false) {} 38191 38192 const DEFAULT_AXIS_THRESHOLD = 0; 38193 const coordinatesConfigResolver = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, commonConfigResolver), {}, { 38194 axis(_v, _k, { 38195 axis 38196 }) { 38197 this.lockDirection = axis === 'lock'; 38198 if (!this.lockDirection) return axis; 38199 }, 38200 38201 axisThreshold(value = DEFAULT_AXIS_THRESHOLD) { 38202 return value; 38203 }, 38204 38205 bounds(value = {}) { 38206 if (typeof value === 'function') { 38207 return state => coordinatesConfigResolver.bounds(value(state)); 38208 } 38209 38210 if ('current' in value) { 38211 return () => value.current; 38212 } 38213 38214 if (typeof HTMLElement === 'function' && value instanceof HTMLElement) { 38215 return value; 38216 } 38217 38218 const { 38219 left = -Infinity, 38220 right = Infinity, 38221 top = -Infinity, 38222 bottom = Infinity 38223 } = value; 38224 return [[left, right], [top, bottom]]; 38225 } 38226 38227 }); 38228 38229 const DISPLACEMENT = 10; 38230 const KEYS_DELTA_MAP = { 38231 ArrowRight: (factor = 1) => [DISPLACEMENT * factor, 0], 38232 ArrowLeft: (factor = 1) => [-DISPLACEMENT * factor, 0], 38233 ArrowUp: (factor = 1) => [0, -DISPLACEMENT * factor], 38234 ArrowDown: (factor = 1) => [0, DISPLACEMENT * factor] 38235 }; 38236 class DragEngine extends CoordinatesEngine { 38237 constructor(...args) { 38238 super(...args); 38239 38240 actions_8e12537b_esm_defineProperty(this, "ingKey", 'dragging'); 38241 } 38242 38243 reset() { 38244 super.reset(); 38245 const state = this.state; 38246 state._pointerId = undefined; 38247 state._pointerActive = false; 38248 state._keyboardActive = false; 38249 state._preventScroll = false; 38250 state._delayed = false; 38251 state.swipe = [0, 0]; 38252 state.tap = false; 38253 state.canceled = false; 38254 state.cancel = this.cancel.bind(this); 38255 } 38256 38257 setup() { 38258 const state = this.state; 38259 38260 if (state._bounds instanceof HTMLElement) { 38261 const boundRect = state._bounds.getBoundingClientRect(); 38262 38263 const targetRect = state.currentTarget.getBoundingClientRect(); 38264 const _bounds = { 38265 left: boundRect.left - targetRect.left + state.offset[0], 38266 right: boundRect.right - targetRect.right + state.offset[0], 38267 top: boundRect.top - targetRect.top + state.offset[1], 38268 bottom: boundRect.bottom - targetRect.bottom + state.offset[1] 38269 }; 38270 state._bounds = coordinatesConfigResolver.bounds(_bounds); 38271 } 38272 } 38273 38274 cancel() { 38275 const state = this.state; 38276 if (state.canceled) return; 38277 state.canceled = true; 38278 state._active = false; 38279 setTimeout(() => { 38280 this.compute(); 38281 this.emit(); 38282 }, 0); 38283 } 38284 38285 setActive() { 38286 this.state._active = this.state._pointerActive || this.state._keyboardActive; 38287 } 38288 38289 clean() { 38290 this.pointerClean(); 38291 this.state._pointerActive = false; 38292 this.state._keyboardActive = false; 38293 super.clean(); 38294 } 38295 38296 pointerDown(event) { 38297 const config = this.config; 38298 const state = this.state; 38299 if (event.buttons != null && (Array.isArray(config.pointerButtons) ? !config.pointerButtons.includes(event.buttons) : config.pointerButtons !== -1 && config.pointerButtons !== event.buttons)) return; 38300 this.ctrl.setEventIds(event); 38301 38302 if (config.pointerCapture) { 38303 event.target.setPointerCapture(event.pointerId); 38304 } 38305 38306 if (state._pointerActive) return; 38307 this.start(event); 38308 this.setupPointer(event); 38309 state._pointerId = pointerId(event); 38310 state._pointerActive = true; 38311 this.computeValues(pointerValues(event)); 38312 this.computeInitial(); 38313 38314 if (config.preventScrollAxis && getPointerType(event) !== 'mouse') { 38315 state._active = false; 38316 this.setupScrollPrevention(event); 38317 } else if (config.delay > 0) { 38318 this.setupDelayTrigger(event); 38319 38320 if (config.triggerAllEvents) { 38321 this.compute(event); 38322 this.emit(); 38323 } 38324 } else { 38325 this.startPointerDrag(event); 38326 } 38327 } 38328 38329 startPointerDrag(event) { 38330 const state = this.state; 38331 state._active = true; 38332 state._preventScroll = true; 38333 state._delayed = false; 38334 this.compute(event); 38335 this.emit(); 38336 } 38337 38338 pointerMove(event) { 38339 const state = this.state; 38340 const config = this.config; 38341 if (!state._pointerActive) return; 38342 if (state.type === event.type && event.timeStamp === state.timeStamp) return; 38343 const id = pointerId(event); 38344 if (state._pointerId !== undefined && id !== state._pointerId) return; 38345 38346 const _values = pointerValues(event); 38347 38348 if (document.pointerLockElement === event.target) { 38349 state._delta = [event.movementX, event.movementY]; 38350 } else { 38351 state._delta = V.sub(_values, state._values); 38352 this.computeValues(_values); 38353 } 38354 38355 V.addTo(state._movement, state._delta); 38356 this.compute(event); 38357 38358 if (state._delayed && state.intentional) { 38359 this.timeoutStore.remove('dragDelay'); 38360 state.active = false; 38361 this.startPointerDrag(event); 38362 return; 38363 } 38364 38365 if (config.preventScrollAxis && !state._preventScroll) { 38366 if (state.axis) { 38367 if (state.axis === config.preventScrollAxis || config.preventScrollAxis === 'xy') { 38368 state._active = false; 38369 this.clean(); 38370 return; 38371 } else { 38372 this.timeoutStore.remove('startPointerDrag'); 38373 this.startPointerDrag(event); 38374 return; 38375 } 38376 } else { 38377 return; 38378 } 38379 } 38380 38381 this.emit(); 38382 } 38383 38384 pointerUp(event) { 38385 this.ctrl.setEventIds(event); 38386 38387 try { 38388 if (this.config.pointerCapture && event.target.hasPointerCapture(event.pointerId)) { 38389 ; 38390 event.target.releasePointerCapture(event.pointerId); 38391 } 38392 } catch (_unused) { 38393 if (false) {} 38394 } 38395 38396 const state = this.state; 38397 const config = this.config; 38398 if (!state._active || !state._pointerActive) return; 38399 const id = pointerId(event); 38400 if (state._pointerId !== undefined && id !== state._pointerId) return; 38401 this.state._pointerActive = false; 38402 this.setActive(); 38403 this.compute(event); 38404 const [dx, dy] = state._distance; 38405 state.tap = dx <= config.tapsThreshold && dy <= config.tapsThreshold; 38406 38407 if (state.tap && config.filterTaps) { 38408 state._force = true; 38409 } else { 38410 const [dirx, diry] = state.direction; 38411 const [vx, vy] = state.velocity; 38412 const [mx, my] = state.movement; 38413 const [svx, svy] = config.swipe.velocity; 38414 const [sx, sy] = config.swipe.distance; 38415 const sdt = config.swipe.duration; 38416 38417 if (state.elapsedTime < sdt) { 38418 if (Math.abs(vx) > svx && Math.abs(mx) > sx) state.swipe[0] = dirx; 38419 if (Math.abs(vy) > svy && Math.abs(my) > sy) state.swipe[1] = diry; 38420 } 38421 } 38422 38423 this.emit(); 38424 } 38425 38426 pointerClick(event) { 38427 if (!this.state.tap) { 38428 event.preventDefault(); 38429 event.stopPropagation(); 38430 } 38431 } 38432 38433 setupPointer(event) { 38434 const config = this.config; 38435 const device = config.device; 38436 38437 if (false) {} 38438 38439 if (config.pointerLock) { 38440 event.currentTarget.requestPointerLock(); 38441 } 38442 38443 if (!config.pointerCapture) { 38444 this.eventStore.add(this.sharedConfig.window, device, 'change', this.pointerMove.bind(this)); 38445 this.eventStore.add(this.sharedConfig.window, device, 'end', this.pointerUp.bind(this)); 38446 this.eventStore.add(this.sharedConfig.window, device, 'cancel', this.pointerUp.bind(this)); 38447 } 38448 } 38449 38450 pointerClean() { 38451 if (this.config.pointerLock && document.pointerLockElement === this.state.currentTarget) { 38452 document.exitPointerLock(); 38453 } 38454 } 38455 38456 preventScroll(event) { 38457 if (this.state._preventScroll && event.cancelable) { 38458 event.preventDefault(); 38459 } 38460 } 38461 38462 setupScrollPrevention(event) { 38463 persistEvent(event); 38464 this.eventStore.add(this.sharedConfig.window, 'touch', 'change', this.preventScroll.bind(this), { 38465 passive: false 38466 }); 38467 this.eventStore.add(this.sharedConfig.window, 'touch', 'end', this.clean.bind(this)); 38468 this.eventStore.add(this.sharedConfig.window, 'touch', 'cancel', this.clean.bind(this)); 38469 this.timeoutStore.add('startPointerDrag', this.startPointerDrag.bind(this), this.config.preventScrollDelay, event); 38470 } 38471 38472 setupDelayTrigger(event) { 38473 this.state._delayed = true; 38474 this.timeoutStore.add('dragDelay', () => { 38475 this.state._step = [0, 0]; 38476 this.startPointerDrag(event); 38477 }, this.config.delay); 38478 } 38479 38480 keyDown(event) { 38481 const deltaFn = KEYS_DELTA_MAP[event.key]; 38482 38483 if (deltaFn) { 38484 const state = this.state; 38485 const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1; 38486 state._delta = deltaFn(factor); 38487 this.start(event); 38488 state._keyboardActive = true; 38489 V.addTo(state._movement, state._delta); 38490 this.compute(event); 38491 this.emit(); 38492 } 38493 } 38494 38495 keyUp(event) { 38496 if (!(event.key in KEYS_DELTA_MAP)) return; 38497 this.state._keyboardActive = false; 38498 this.setActive(); 38499 this.compute(event); 38500 this.emit(); 38501 } 38502 38503 bind(bindFunction) { 38504 const device = this.config.device; 38505 bindFunction(device, 'start', this.pointerDown.bind(this)); 38506 38507 if (this.config.pointerCapture) { 38508 bindFunction(device, 'change', this.pointerMove.bind(this)); 38509 bindFunction(device, 'end', this.pointerUp.bind(this)); 38510 bindFunction(device, 'cancel', this.pointerUp.bind(this)); 38511 bindFunction('lostPointerCapture', '', this.pointerUp.bind(this)); 38512 } 38513 38514 bindFunction('key', 'down', this.keyDown.bind(this)); 38515 bindFunction('key', 'up', this.keyUp.bind(this)); 38516 38517 if (this.config.filterTaps) { 38518 bindFunction('click', '', this.pointerClick.bind(this), { 38519 capture: true, 38520 passive: false 38521 }); 38522 } 38523 } 38524 38525 } 38526 38527 function persistEvent(event) { 38528 'persist' in event && typeof event.persist === 'function' && event.persist(); 38529 } 38530 38531 const actions_8e12537b_esm_isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement; 38532 38533 function actions_8e12537b_esm_supportsTouchEvents() { 38534 return actions_8e12537b_esm_isBrowser && 'ontouchstart' in window; 38535 } 38536 38537 function isTouchScreen() { 38538 return actions_8e12537b_esm_supportsTouchEvents() || actions_8e12537b_esm_isBrowser && window.navigator.maxTouchPoints > 1; 38539 } 38540 38541 function actions_8e12537b_esm_supportsPointerEvents() { 38542 return actions_8e12537b_esm_isBrowser && 'onpointerdown' in window; 38543 } 38544 38545 function supportsPointerLock() { 38546 return actions_8e12537b_esm_isBrowser && 'exitPointerLock' in window.document; 38547 } 38548 38549 function supportsGestureEvents() { 38550 try { 38551 return 'constructor' in GestureEvent; 38552 } catch (e) { 38553 return false; 38554 } 38555 } 38556 38557 const SUPPORT = { 38558 isBrowser: actions_8e12537b_esm_isBrowser, 38559 gesture: supportsGestureEvents(), 38560 touch: isTouchScreen(), 38561 touchscreen: isTouchScreen(), 38562 pointer: actions_8e12537b_esm_supportsPointerEvents(), 38563 pointerLock: supportsPointerLock() 38564 }; 38565 38566 const DEFAULT_PREVENT_SCROLL_DELAY = 250; 38567 const DEFAULT_DRAG_DELAY = 180; 38568 const DEFAULT_SWIPE_VELOCITY = 0.5; 38569 const DEFAULT_SWIPE_DISTANCE = 50; 38570 const DEFAULT_SWIPE_DURATION = 250; 38571 const DEFAULT_DRAG_AXIS_THRESHOLD = { 38572 mouse: 0, 38573 touch: 0, 38574 pen: 8 38575 }; 38576 const dragConfigResolver = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, coordinatesConfigResolver), {}, { 38577 device(_v, _k, { 38578 pointer: { 38579 touch = false, 38580 lock = false, 38581 mouse = false 38582 } = {} 38583 }) { 38584 this.pointerLock = lock && SUPPORT.pointerLock; 38585 if (SUPPORT.touch && touch) return 'touch'; 38586 if (this.pointerLock) return 'mouse'; 38587 if (SUPPORT.pointer && !mouse) return 'pointer'; 38588 if (SUPPORT.touch) return 'touch'; 38589 return 'mouse'; 38590 }, 38591 38592 preventScrollAxis(value, _k, { 38593 preventScroll 38594 }) { 38595 this.preventScrollDelay = typeof preventScroll === 'number' ? preventScroll : preventScroll || preventScroll === undefined && value ? DEFAULT_PREVENT_SCROLL_DELAY : undefined; 38596 if (!SUPPORT.touchscreen || preventScroll === false) return undefined; 38597 return value ? value : preventScroll !== undefined ? 'y' : undefined; 38598 }, 38599 38600 pointerCapture(_v, _k, { 38601 pointer: { 38602 capture = true, 38603 buttons = 1 38604 } = {} 38605 }) { 38606 this.pointerButtons = buttons; 38607 return !this.pointerLock && this.device === 'pointer' && capture; 38608 }, 38609 38610 threshold(value, _k, { 38611 filterTaps = false, 38612 tapsThreshold = 3, 38613 axis = undefined 38614 }) { 38615 const threshold = V.toVector(value, filterTaps ? tapsThreshold : axis ? 1 : 0); 38616 this.filterTaps = filterTaps; 38617 this.tapsThreshold = tapsThreshold; 38618 return threshold; 38619 }, 38620 38621 swipe({ 38622 velocity = DEFAULT_SWIPE_VELOCITY, 38623 distance = DEFAULT_SWIPE_DISTANCE, 38624 duration = DEFAULT_SWIPE_DURATION 38625 } = {}) { 38626 return { 38627 velocity: this.transform(V.toVector(velocity)), 38628 distance: this.transform(V.toVector(distance)), 38629 duration 38630 }; 38631 }, 38632 38633 delay(value = 0) { 38634 switch (value) { 38635 case true: 38636 return DEFAULT_DRAG_DELAY; 38637 38638 case false: 38639 return 0; 38640 38641 default: 38642 return value; 38643 } 38644 }, 38645 38646 axisThreshold(value) { 38647 if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD; 38648 return actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value); 38649 } 38650 38651 }); 38652 38653 if (false) {} 38654 38655 const SCALE_ANGLE_RATIO_INTENT_DEG = 30; 38656 const PINCH_WHEEL_RATIO = 100; 38657 class PinchEngine extends Engine { 38658 constructor(...args) { 38659 super(...args); 38660 38661 actions_8e12537b_esm_defineProperty(this, "ingKey", 'pinching'); 38662 38663 actions_8e12537b_esm_defineProperty(this, "aliasKey", 'da'); 38664 } 38665 38666 init() { 38667 this.state.offset = [1, 0]; 38668 this.state.lastOffset = [1, 0]; 38669 this.state._pointerEvents = new Map(); 38670 } 38671 38672 reset() { 38673 super.reset(); 38674 const state = this.state; 38675 state._touchIds = []; 38676 state.canceled = false; 38677 state.cancel = this.cancel.bind(this); 38678 state.turns = 0; 38679 } 38680 38681 computeOffset() { 38682 const { 38683 type, 38684 movement, 38685 lastOffset 38686 } = this.state; 38687 38688 if (type === 'wheel') { 38689 this.state.offset = V.add(movement, lastOffset); 38690 } else { 38691 this.state.offset = [(1 + movement[0]) * lastOffset[0], movement[1] + lastOffset[1]]; 38692 } 38693 } 38694 38695 computeMovement() { 38696 const { 38697 offset, 38698 lastOffset 38699 } = this.state; 38700 this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]]; 38701 } 38702 38703 axisIntent() { 38704 const state = this.state; 38705 const [_m0, _m1] = state._movement; 38706 38707 if (!state.axis) { 38708 const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1); 38709 if (axisMovementDifference < 0) state.axis = 'angle';else if (axisMovementDifference > 0) state.axis = 'scale'; 38710 } 38711 } 38712 38713 restrictToAxis(v) { 38714 if (this.config.lockDirection) { 38715 if (this.state.axis === 'scale') v[1] = 0;else if (this.state.axis === 'angle') v[0] = 0; 38716 } 38717 } 38718 38719 cancel() { 38720 const state = this.state; 38721 if (state.canceled) return; 38722 setTimeout(() => { 38723 state.canceled = true; 38724 state._active = false; 38725 this.compute(); 38726 this.emit(); 38727 }, 0); 38728 } 38729 38730 touchStart(event) { 38731 this.ctrl.setEventIds(event); 38732 const state = this.state; 38733 const ctrlTouchIds = this.ctrl.touchIds; 38734 38735 if (state._active) { 38736 if (state._touchIds.every(id => ctrlTouchIds.has(id))) return; 38737 } 38738 38739 if (ctrlTouchIds.size < 2) return; 38740 this.start(event); 38741 state._touchIds = Array.from(ctrlTouchIds).slice(0, 2); 38742 const payload = touchDistanceAngle(event, state._touchIds); 38743 this.pinchStart(event, payload); 38744 } 38745 38746 pointerStart(event) { 38747 if (event.buttons != null && event.buttons % 2 !== 1) return; 38748 this.ctrl.setEventIds(event); 38749 event.target.setPointerCapture(event.pointerId); 38750 const state = this.state; 38751 const _pointerEvents = state._pointerEvents; 38752 const ctrlPointerIds = this.ctrl.pointerIds; 38753 38754 if (state._active) { 38755 if (Array.from(_pointerEvents.keys()).every(id => ctrlPointerIds.has(id))) return; 38756 } 38757 38758 if (_pointerEvents.size < 2) { 38759 _pointerEvents.set(event.pointerId, event); 38760 } 38761 38762 if (state._pointerEvents.size < 2) return; 38763 this.start(event); 38764 const payload = distanceAngle(...Array.from(_pointerEvents.values())); 38765 this.pinchStart(event, payload); 38766 } 38767 38768 pinchStart(event, payload) { 38769 const state = this.state; 38770 state.origin = payload.origin; 38771 this.computeValues([payload.distance, payload.angle]); 38772 this.computeInitial(); 38773 this.compute(event); 38774 this.emit(); 38775 } 38776 38777 touchMove(event) { 38778 if (!this.state._active) return; 38779 const payload = touchDistanceAngle(event, this.state._touchIds); 38780 this.pinchMove(event, payload); 38781 } 38782 38783 pointerMove(event) { 38784 const _pointerEvents = this.state._pointerEvents; 38785 38786 if (_pointerEvents.has(event.pointerId)) { 38787 _pointerEvents.set(event.pointerId, event); 38788 } 38789 38790 if (!this.state._active) return; 38791 const payload = distanceAngle(...Array.from(_pointerEvents.values())); 38792 this.pinchMove(event, payload); 38793 } 38794 38795 pinchMove(event, payload) { 38796 const state = this.state; 38797 const prev_a = state._values[1]; 38798 const delta_a = payload.angle - prev_a; 38799 let delta_turns = 0; 38800 if (Math.abs(delta_a) > 270) delta_turns += Math.sign(delta_a); 38801 this.computeValues([payload.distance, payload.angle - 360 * delta_turns]); 38802 state.origin = payload.origin; 38803 state.turns = delta_turns; 38804 state._movement = [state._values[0] / state._initial[0] - 1, state._values[1] - state._initial[1]]; 38805 this.compute(event); 38806 this.emit(); 38807 } 38808 38809 touchEnd(event) { 38810 this.ctrl.setEventIds(event); 38811 if (!this.state._active) return; 38812 38813 if (this.state._touchIds.some(id => !this.ctrl.touchIds.has(id))) { 38814 this.state._active = false; 38815 this.compute(event); 38816 this.emit(); 38817 } 38818 } 38819 38820 pointerEnd(event) { 38821 const state = this.state; 38822 this.ctrl.setEventIds(event); 38823 38824 try { 38825 event.target.releasePointerCapture(event.pointerId); 38826 } catch (_unused) {} 38827 38828 if (state._pointerEvents.has(event.pointerId)) { 38829 state._pointerEvents.delete(event.pointerId); 38830 } 38831 38832 if (!state._active) return; 38833 38834 if (state._pointerEvents.size < 2) { 38835 state._active = false; 38836 this.compute(event); 38837 this.emit(); 38838 } 38839 } 38840 38841 gestureStart(event) { 38842 if (event.cancelable) event.preventDefault(); 38843 const state = this.state; 38844 if (state._active) return; 38845 this.start(event); 38846 this.computeValues([event.scale, event.rotation]); 38847 state.origin = [event.clientX, event.clientY]; 38848 this.compute(event); 38849 this.emit(); 38850 } 38851 38852 gestureMove(event) { 38853 if (event.cancelable) event.preventDefault(); 38854 if (!this.state._active) return; 38855 const state = this.state; 38856 this.computeValues([event.scale, event.rotation]); 38857 state.origin = [event.clientX, event.clientY]; 38858 const _previousMovement = state._movement; 38859 state._movement = [event.scale - 1, event.rotation]; 38860 state._delta = V.sub(state._movement, _previousMovement); 38861 this.compute(event); 38862 this.emit(); 38863 } 38864 38865 gestureEnd(event) { 38866 if (!this.state._active) return; 38867 this.state._active = false; 38868 this.compute(event); 38869 this.emit(); 38870 } 38871 38872 wheel(event) { 38873 const modifierKey = this.config.modifierKey; 38874 if (modifierKey && !event[modifierKey]) return; 38875 if (!this.state._active) this.wheelStart(event);else this.wheelChange(event); 38876 this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this)); 38877 } 38878 38879 wheelStart(event) { 38880 this.start(event); 38881 this.wheelChange(event); 38882 } 38883 38884 wheelChange(event) { 38885 const isR3f = ('uv' in event); 38886 38887 if (!isR3f) { 38888 if (event.cancelable) { 38889 event.preventDefault(); 38890 } 38891 38892 if (false) {} 38893 } 38894 38895 const state = this.state; 38896 state._delta = [-wheelValues(event)[1] / PINCH_WHEEL_RATIO * state.offset[0], 0]; 38897 V.addTo(state._movement, state._delta); 38898 this.state.origin = [event.clientX, event.clientY]; 38899 this.compute(event); 38900 this.emit(); 38901 } 38902 38903 wheelEnd() { 38904 if (!this.state._active) return; 38905 this.state._active = false; 38906 this.compute(); 38907 this.emit(); 38908 } 38909 38910 bind(bindFunction) { 38911 const device = this.config.device; 38912 38913 if (!!device) { 38914 bindFunction(device, 'start', this[device + 'Start'].bind(this)); 38915 bindFunction(device, 'change', this[device + 'Move'].bind(this)); 38916 bindFunction(device, 'end', this[device + 'End'].bind(this)); 38917 bindFunction(device, 'cancel', this[device + 'End'].bind(this)); 38918 } else { 38919 bindFunction('wheel', '', this.wheel.bind(this), { 38920 passive: false 38921 }); 38922 } 38923 } 38924 38925 } 38926 38927 const pinchConfigResolver = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, commonConfigResolver), {}, { 38928 device(_v, _k, { 38929 shared, 38930 pointer: { 38931 touch = false 38932 } = {} 38933 }) { 38934 const sharedConfig = shared; 38935 if (sharedConfig.target && !SUPPORT.touch && SUPPORT.gesture) return 'gesture'; 38936 if (SUPPORT.touch && touch) return 'touch'; 38937 38938 if (SUPPORT.touchscreen) { 38939 if (SUPPORT.pointer) return 'pointer'; 38940 if (SUPPORT.touch) return 'touch'; 38941 } 38942 }, 38943 38944 bounds(_v, _k, { 38945 scaleBounds = {}, 38946 angleBounds = {} 38947 }) { 38948 const _scaleBounds = state => { 38949 const D = assignDefault(call(scaleBounds, state), { 38950 min: -Infinity, 38951 max: Infinity 38952 }); 38953 return [D.min, D.max]; 38954 }; 38955 38956 const _angleBounds = state => { 38957 const A = assignDefault(call(angleBounds, state), { 38958 min: -Infinity, 38959 max: Infinity 38960 }); 38961 return [A.min, A.max]; 38962 }; 38963 38964 if (typeof scaleBounds !== 'function' && typeof angleBounds !== 'function') return [_scaleBounds(), _angleBounds()]; 38965 return state => [_scaleBounds(state), _angleBounds(state)]; 38966 }, 38967 38968 threshold(value, _k, config) { 38969 this.lockDirection = config.axis === 'lock'; 38970 const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0); 38971 return threshold; 38972 }, 38973 38974 modifierKey(value) { 38975 if (value === undefined) return 'ctrlKey'; 38976 return value; 38977 } 38978 38979 }); 38980 38981 class MoveEngine extends CoordinatesEngine { 38982 constructor(...args) { 38983 super(...args); 38984 38985 actions_8e12537b_esm_defineProperty(this, "ingKey", 'moving'); 38986 } 38987 38988 move(event) { 38989 if (this.config.mouseOnly && event.pointerType !== 'mouse') return; 38990 if (!this.state._active) this.moveStart(event);else this.moveChange(event); 38991 this.timeoutStore.add('moveEnd', this.moveEnd.bind(this)); 38992 } 38993 38994 moveStart(event) { 38995 this.start(event); 38996 this.computeValues(pointerValues(event)); 38997 this.compute(event); 38998 this.computeInitial(); 38999 this.emit(); 39000 } 39001 39002 moveChange(event) { 39003 if (!this.state._active) return; 39004 const values = pointerValues(event); 39005 const state = this.state; 39006 state._delta = V.sub(values, state._values); 39007 V.addTo(state._movement, state._delta); 39008 this.computeValues(values); 39009 this.compute(event); 39010 this.emit(); 39011 } 39012 39013 moveEnd(event) { 39014 if (!this.state._active) return; 39015 this.state._active = false; 39016 this.compute(event); 39017 this.emit(); 39018 } 39019 39020 bind(bindFunction) { 39021 bindFunction('pointer', 'change', this.move.bind(this)); 39022 bindFunction('pointer', 'leave', this.moveEnd.bind(this)); 39023 } 39024 39025 } 39026 39027 const moveConfigResolver = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, coordinatesConfigResolver), {}, { 39028 mouseOnly: (value = true) => value 39029 }); 39030 39031 class ScrollEngine extends CoordinatesEngine { 39032 constructor(...args) { 39033 super(...args); 39034 39035 actions_8e12537b_esm_defineProperty(this, "ingKey", 'scrolling'); 39036 } 39037 39038 scroll(event) { 39039 if (!this.state._active) this.start(event); 39040 this.scrollChange(event); 39041 this.timeoutStore.add('scrollEnd', this.scrollEnd.bind(this)); 39042 } 39043 39044 scrollChange(event) { 39045 if (event.cancelable) event.preventDefault(); 39046 const state = this.state; 39047 const values = scrollValues(event); 39048 state._delta = V.sub(values, state._values); 39049 V.addTo(state._movement, state._delta); 39050 this.computeValues(values); 39051 this.compute(event); 39052 this.emit(); 39053 } 39054 39055 scrollEnd() { 39056 if (!this.state._active) return; 39057 this.state._active = false; 39058 this.compute(); 39059 this.emit(); 39060 } 39061 39062 bind(bindFunction) { 39063 bindFunction('scroll', '', this.scroll.bind(this)); 39064 } 39065 39066 } 39067 39068 const scrollConfigResolver = coordinatesConfigResolver; 39069 39070 class WheelEngine extends CoordinatesEngine { 39071 constructor(...args) { 39072 super(...args); 39073 39074 actions_8e12537b_esm_defineProperty(this, "ingKey", 'wheeling'); 39075 } 39076 39077 wheel(event) { 39078 if (!this.state._active) this.start(event); 39079 this.wheelChange(event); 39080 this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this)); 39081 } 39082 39083 wheelChange(event) { 39084 const state = this.state; 39085 state._delta = wheelValues(event); 39086 V.addTo(state._movement, state._delta); 39087 const [ox, oy] = state.overflow; 39088 const [dx, dy] = state._delta; 39089 const [dirx, diry] = state._direction; 39090 39091 if (ox < 0 && dx > 0 && dirx < 0 || ox > 0 && dx < 0 && dirx > 0) { 39092 state._movement[0] = state._movementBound[0]; 39093 } 39094 39095 if (oy < 0 && dy > 0 && diry < 0 || oy > 0 && dy < 0 && diry > 0) { 39096 state._movement[1] = state._movementBound[1]; 39097 } 39098 39099 this.compute(event); 39100 this.emit(); 39101 } 39102 39103 wheelEnd() { 39104 if (!this.state._active) return; 39105 this.state._active = false; 39106 this.compute(); 39107 this.emit(); 39108 } 39109 39110 bind(bindFunction) { 39111 bindFunction('wheel', '', this.wheel.bind(this)); 39112 } 39113 39114 } 39115 39116 const wheelConfigResolver = coordinatesConfigResolver; 39117 39118 class HoverEngine extends CoordinatesEngine { 39119 constructor(...args) { 39120 super(...args); 39121 39122 actions_8e12537b_esm_defineProperty(this, "ingKey", 'hovering'); 39123 } 39124 39125 enter(event) { 39126 if (this.config.mouseOnly && event.pointerType !== 'mouse') return; 39127 this.start(event); 39128 this.computeValues(pointerValues(event)); 39129 this.compute(event); 39130 this.emit(); 39131 } 39132 39133 leave(event) { 39134 if (this.config.mouseOnly && event.pointerType !== 'mouse') return; 39135 const state = this.state; 39136 if (!state._active) return; 39137 state._active = false; 39138 const values = pointerValues(event); 39139 state._movement = state._delta = V.sub(values, state._values); 39140 this.computeValues(values); 39141 this.compute(event); 39142 state.delta = state.movement; 39143 this.emit(); 39144 } 39145 39146 bind(bindFunction) { 39147 bindFunction('pointer', 'enter', this.enter.bind(this)); 39148 bindFunction('pointer', 'leave', this.leave.bind(this)); 39149 } 39150 39151 } 39152 39153 const hoverConfigResolver = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, coordinatesConfigResolver), {}, { 39154 mouseOnly: (value = true) => value 39155 }); 39156 39157 const actions_8e12537b_esm_EngineMap = new Map(); 39158 const ConfigResolverMap = new Map(); 39159 function actions_8e12537b_esm_registerAction(action) { 39160 actions_8e12537b_esm_EngineMap.set(action.key, action.engine); 39161 ConfigResolverMap.set(action.key, action.resolver); 39162 } 39163 const actions_8e12537b_esm_dragAction = { 39164 key: 'drag', 39165 engine: DragEngine, 39166 resolver: dragConfigResolver 39167 }; 39168 const actions_8e12537b_esm_hoverAction = { 39169 key: 'hover', 39170 engine: HoverEngine, 39171 resolver: hoverConfigResolver 39172 }; 39173 const actions_8e12537b_esm_moveAction = { 39174 key: 'move', 39175 engine: MoveEngine, 39176 resolver: moveConfigResolver 39177 }; 39178 const actions_8e12537b_esm_pinchAction = { 39179 key: 'pinch', 39180 engine: PinchEngine, 39181 resolver: pinchConfigResolver 39182 }; 39183 const actions_8e12537b_esm_scrollAction = { 39184 key: 'scroll', 39185 engine: ScrollEngine, 39186 resolver: scrollConfigResolver 39187 }; 39188 const actions_8e12537b_esm_wheelAction = { 39189 key: 'wheel', 39190 engine: WheelEngine, 39191 resolver: wheelConfigResolver 39192 }; 39193 39194 39195 39196 ;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/use-gesture-core.esm.js 39197 39198 39199 39200 function use_gesture_core_esm_objectWithoutPropertiesLoose(source, excluded) { 39201 if (source == null) return {}; 39202 var target = {}; 39203 var sourceKeys = Object.keys(source); 39204 var key, i; 39205 39206 for (i = 0; i < sourceKeys.length; i++) { 39207 key = sourceKeys[i]; 39208 if (excluded.indexOf(key) >= 0) continue; 39209 target[key] = source[key]; 39210 } 39211 39212 return target; 39213 } 39214 39215 function _objectWithoutProperties(source, excluded) { 39216 if (source == null) return {}; 39217 var target = use_gesture_core_esm_objectWithoutPropertiesLoose(source, excluded); 39218 var key, i; 39219 39220 if (Object.getOwnPropertySymbols) { 39221 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 39222 39223 for (i = 0; i < sourceSymbolKeys.length; i++) { 39224 key = sourceSymbolKeys[i]; 39225 if (excluded.indexOf(key) >= 0) continue; 39226 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 39227 target[key] = source[key]; 39228 } 39229 } 39230 39231 return target; 39232 } 39233 39234 const sharedConfigResolver = { 39235 target(value) { 39236 if (value) { 39237 return () => 'current' in value ? value.current : value; 39238 } 39239 39240 return undefined; 39241 }, 39242 39243 enabled(value = true) { 39244 return value; 39245 }, 39246 39247 window(value = SUPPORT.isBrowser ? window : undefined) { 39248 return value; 39249 }, 39250 39251 eventOptions({ 39252 passive = true, 39253 capture = false 39254 } = {}) { 39255 return { 39256 passive, 39257 capture 39258 }; 39259 }, 39260 39261 transform(value) { 39262 return value; 39263 } 39264 39265 }; 39266 39267 const _excluded = ["target", "eventOptions", "window", "enabled", "transform"]; 39268 function resolveWith(config = {}, resolvers) { 39269 const result = {}; 39270 39271 for (const [key, resolver] of Object.entries(resolvers)) { 39272 switch (typeof resolver) { 39273 case 'function': 39274 if (false) {} else { 39275 result[key] = resolver.call(result, config[key], key, config); 39276 } 39277 39278 break; 39279 39280 case 'object': 39281 result[key] = resolveWith(config[key], resolver); 39282 break; 39283 39284 case 'boolean': 39285 if (resolver) result[key] = config[key]; 39286 break; 39287 } 39288 } 39289 39290 return result; 39291 } 39292 function use_gesture_core_esm_parse(config, gestureKey) { 39293 const _ref = config, 39294 { 39295 target, 39296 eventOptions, 39297 window, 39298 enabled, 39299 transform 39300 } = _ref, 39301 rest = _objectWithoutProperties(_ref, _excluded); 39302 39303 const _config = { 39304 shared: resolveWith({ 39305 target, 39306 eventOptions, 39307 window, 39308 enabled, 39309 transform 39310 }, sharedConfigResolver) 39311 }; 39312 39313 if (gestureKey) { 39314 const resolver = ConfigResolverMap.get(gestureKey); 39315 _config[gestureKey] = resolveWith(actions_8e12537b_esm_objectSpread2({ 39316 shared: _config.shared 39317 }, rest), resolver); 39318 } else { 39319 for (const key in rest) { 39320 const resolver = ConfigResolverMap.get(key); 39321 39322 if (resolver) { 39323 _config[key] = resolveWith(actions_8e12537b_esm_objectSpread2({ 39324 shared: _config.shared 39325 }, rest[key]), resolver); 39326 } else if (false) {} 39327 } 39328 } 39329 39330 return _config; 39331 } 39332 39333 class EventStore { 39334 constructor(ctrl) { 39335 actions_8e12537b_esm_defineProperty(this, "_listeners", []); 39336 39337 this._ctrl = ctrl; 39338 } 39339 39340 add(element, device, action, handler, options) { 39341 const type = toDomEventType(device, action); 39342 39343 const eventOptions = actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, this._ctrl.config.shared.eventOptions), options); 39344 39345 element.addEventListener(type, handler, eventOptions); 39346 39347 this._listeners.push(() => element.removeEventListener(type, handler, eventOptions)); 39348 } 39349 39350 clean() { 39351 this._listeners.forEach(remove => remove()); 39352 39353 this._listeners = []; 39354 } 39355 39356 } 39357 39358 class TimeoutStore { 39359 constructor() { 39360 actions_8e12537b_esm_defineProperty(this, "_timeouts", new Map()); 39361 } 39362 39363 add(key, callback, ms = 140, ...args) { 39364 this.remove(key); 39365 39366 this._timeouts.set(key, window.setTimeout(callback, ms, ...args)); 39367 } 39368 39369 remove(key) { 39370 const timeout = this._timeouts.get(key); 39371 39372 if (timeout) window.clearTimeout(timeout); 39373 } 39374 39375 clean() { 39376 this._timeouts.forEach(timeout => void window.clearTimeout(timeout)); 39377 39378 this._timeouts.clear(); 39379 } 39380 39381 } 39382 39383 class Controller { 39384 constructor(handlers) { 39385 actions_8e12537b_esm_defineProperty(this, "gestures", new Set()); 39386 39387 actions_8e12537b_esm_defineProperty(this, "_targetEventStore", new EventStore(this)); 39388 39389 actions_8e12537b_esm_defineProperty(this, "gestureEventStores", {}); 39390 39391 actions_8e12537b_esm_defineProperty(this, "gestureTimeoutStores", {}); 39392 39393 actions_8e12537b_esm_defineProperty(this, "handlers", {}); 39394 39395 actions_8e12537b_esm_defineProperty(this, "config", {}); 39396 39397 actions_8e12537b_esm_defineProperty(this, "pointerIds", new Set()); 39398 39399 actions_8e12537b_esm_defineProperty(this, "touchIds", new Set()); 39400 39401 actions_8e12537b_esm_defineProperty(this, "state", { 39402 shared: { 39403 shiftKey: false, 39404 metaKey: false, 39405 ctrlKey: false, 39406 altKey: false 39407 } 39408 }); 39409 39410 resolveGestures(this, handlers); 39411 } 39412 39413 setEventIds(event) { 39414 if (isTouch(event)) { 39415 this.touchIds = new Set(touchIds(event)); 39416 } else if ('pointerId' in event) { 39417 if (event.type === 'pointerup' || event.type === 'pointercancel') this.pointerIds.delete(event.pointerId);else if (event.type === 'pointerdown') this.pointerIds.add(event.pointerId); 39418 } 39419 } 39420 39421 applyHandlers(handlers, nativeHandlers) { 39422 this.handlers = handlers; 39423 this.nativeHandlers = nativeHandlers; 39424 } 39425 39426 applyConfig(config, gestureKey) { 39427 this.config = use_gesture_core_esm_parse(config, gestureKey); 39428 } 39429 39430 clean() { 39431 this._targetEventStore.clean(); 39432 39433 for (const key of this.gestures) { 39434 this.gestureEventStores[key].clean(); 39435 this.gestureTimeoutStores[key].clean(); 39436 } 39437 } 39438 39439 effect() { 39440 if (this.config.shared.target) this.bind(); 39441 return () => this._targetEventStore.clean(); 39442 } 39443 39444 bind(...args) { 39445 const sharedConfig = this.config.shared; 39446 const eventOptions = sharedConfig.eventOptions; 39447 const props = {}; 39448 let target; 39449 39450 if (sharedConfig.target) { 39451 target = sharedConfig.target(); 39452 if (!target) return; 39453 } 39454 39455 const bindFunction = bindToProps(props, eventOptions, !!target); 39456 39457 if (sharedConfig.enabled) { 39458 for (const gestureKey of this.gestures) { 39459 if (this.config[gestureKey].enabled) { 39460 const Engine = actions_8e12537b_esm_EngineMap.get(gestureKey); 39461 new Engine(this, args, gestureKey).bind(bindFunction); 39462 } 39463 } 39464 39465 for (const eventKey in this.nativeHandlers) { 39466 bindFunction(eventKey, '', event => this.nativeHandlers[eventKey](actions_8e12537b_esm_objectSpread2(actions_8e12537b_esm_objectSpread2({}, this.state.shared), {}, { 39467 event, 39468 args 39469 })), undefined, true); 39470 } 39471 } 39472 39473 for (const handlerProp in props) { 39474 props[handlerProp] = chain(...props[handlerProp]); 39475 } 39476 39477 if (!target) return props; 39478 39479 for (const handlerProp in props) { 39480 const { 39481 device, 39482 capture, 39483 passive 39484 } = parseProp(handlerProp); 39485 39486 this._targetEventStore.add(target, device, '', props[handlerProp], { 39487 capture, 39488 passive 39489 }); 39490 } 39491 } 39492 39493 } 39494 39495 function setupGesture(ctrl, gestureKey) { 39496 ctrl.gestures.add(gestureKey); 39497 ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl); 39498 ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore(); 39499 } 39500 39501 function resolveGestures(ctrl, internalHandlers) { 39502 if (internalHandlers.drag) setupGesture(ctrl, 'drag'); 39503 if (internalHandlers.wheel) setupGesture(ctrl, 'wheel'); 39504 if (internalHandlers.scroll) setupGesture(ctrl, 'scroll'); 39505 if (internalHandlers.move) setupGesture(ctrl, 'move'); 39506 if (internalHandlers.pinch) setupGesture(ctrl, 'pinch'); 39507 if (internalHandlers.hover) setupGesture(ctrl, 'hover'); 39508 } 39509 39510 const bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => { 39511 var _options$capture, _options$passive; 39512 39513 const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture; 39514 const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive; 39515 let handlerProp = isNative ? device : toHandlerProp(device, action, capture); 39516 if (withPassiveOption && passive) handlerProp += 'Passive'; 39517 props[handlerProp] = props[handlerProp] || []; 39518 props[handlerProp].push(handler); 39519 }; 39520 39521 const RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/; 39522 39523 function sortHandlers(_handlers) { 39524 const native = {}; 39525 const handlers = {}; 39526 const actions = new Set(); 39527 39528 for (let key in _handlers) { 39529 if (RE_NOT_NATIVE.test(key)) { 39530 actions.add(RegExp.lastMatch); 39531 handlers[key] = _handlers[key]; 39532 } else { 39533 native[key] = _handlers[key]; 39534 } 39535 } 39536 39537 return [handlers, native, actions]; 39538 } 39539 39540 function registerGesture(actions, handlers, handlerKey, key, internalHandlers, config) { 39541 if (!actions.has(handlerKey)) return; 39542 39543 if (!EngineMap.has(key)) { 39544 if (false) {} 39545 39546 return; 39547 } 39548 39549 const startKey = handlerKey + 'Start'; 39550 const endKey = handlerKey + 'End'; 39551 39552 const fn = state => { 39553 let memo = undefined; 39554 if (state.first && startKey in handlers) handlers[startKey](state); 39555 if (handlerKey in handlers) memo = handlers[handlerKey](state); 39556 if (state.last && endKey in handlers) handlers[endKey](state); 39557 return memo; 39558 }; 39559 39560 internalHandlers[key] = fn; 39561 config[key] = config[key] || {}; 39562 } 39563 39564 function use_gesture_core_esm_parseMergedHandlers(mergedHandlers, mergedConfig) { 39565 const [handlers, nativeHandlers, actions] = sortHandlers(mergedHandlers); 39566 const internalHandlers = {}; 39567 registerGesture(actions, handlers, 'onDrag', 'drag', internalHandlers, mergedConfig); 39568 registerGesture(actions, handlers, 'onWheel', 'wheel', internalHandlers, mergedConfig); 39569 registerGesture(actions, handlers, 'onScroll', 'scroll', internalHandlers, mergedConfig); 39570 registerGesture(actions, handlers, 'onPinch', 'pinch', internalHandlers, mergedConfig); 39571 registerGesture(actions, handlers, 'onMove', 'move', internalHandlers, mergedConfig); 39572 registerGesture(actions, handlers, 'onHover', 'hover', internalHandlers, mergedConfig); 39573 return { 39574 handlers: internalHandlers, 39575 config: mergedConfig, 39576 nativeHandlers 39577 }; 39578 } 39579 39580 39581 39582 ;// CONCATENATED MODULE: ./node_modules/@use-gesture/react/dist/use-gesture-react.esm.js 39583 39584 39585 39586 39587 39588 39589 39590 function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) { 39591 const ctrl = external_React_default().useMemo(() => new Controller(handlers), []); 39592 ctrl.applyHandlers(handlers, nativeHandlers); 39593 ctrl.applyConfig(config, gestureKey); 39594 external_React_default().useEffect(ctrl.effect.bind(ctrl)); 39595 external_React_default().useEffect(() => { 39596 return ctrl.clean.bind(ctrl); 39597 }, []); 39598 39599 if (config.target === undefined) { 39600 return ctrl.bind.bind(ctrl); 39601 } 39602 39603 return undefined; 39604 } 39605 39606 function use_gesture_react_esm_useDrag(handler, config) { 39607 actions_8e12537b_esm_registerAction(actions_8e12537b_esm_dragAction); 39608 return useRecognizers({ 39609 drag: handler 39610 }, config || {}, 'drag'); 39611 } 39612 39613 function usePinch(handler, config) { 39614 registerAction(pinchAction); 39615 return useRecognizers({ 39616 pinch: handler 39617 }, config || {}, 'pinch'); 39618 } 39619 39620 function useWheel(handler, config) { 39621 registerAction(wheelAction); 39622 return useRecognizers({ 39623 wheel: handler 39624 }, config || {}, 'wheel'); 39625 } 39626 39627 function useScroll(handler, config) { 39628 registerAction(scrollAction); 39629 return useRecognizers({ 39630 scroll: handler 39631 }, config || {}, 'scroll'); 39632 } 39633 39634 function useMove(handler, config) { 39635 registerAction(moveAction); 39636 return useRecognizers({ 39637 move: handler 39638 }, config || {}, 'move'); 39639 } 39640 39641 function useHover(handler, config) { 39642 actions_8e12537b_esm_registerAction(actions_8e12537b_esm_hoverAction); 39643 return useRecognizers({ 39644 hover: handler 39645 }, config || {}, 'hover'); 39646 } 39647 39648 function createUseGesture(actions) { 39649 actions.forEach(registerAction); 39650 return function useGesture(_handlers, _config) { 39651 const { 39652 handlers, 39653 nativeHandlers, 39654 config 39655 } = parseMergedHandlers(_handlers, _config || {}); 39656 return useRecognizers(handlers, config, undefined, nativeHandlers); 39657 }; 39658 } 39659 39660 function useGesture(handlers, config) { 39661 const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]); 39662 return hook(handlers, config || {}); 39663 } 39664 39665 39666 39667 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js 39668 /** 39669 * WordPress dependencies 39670 */ 39671 39672 /** 39673 * Gets a CSS cursor value based on a drag direction. 39674 * 39675 * @param dragDirection The drag direction. 39676 * @return The CSS cursor value. 39677 */ 39678 39679 function getDragCursor(dragDirection) { 39680 let dragCursor = 'ns-resize'; 39681 39682 switch (dragDirection) { 39683 case 'n': 39684 case 's': 39685 dragCursor = 'ns-resize'; 39686 break; 39687 39688 case 'e': 39689 case 'w': 39690 dragCursor = 'ew-resize'; 39691 break; 39692 } 39693 39694 return dragCursor; 39695 } 39696 /** 39697 * Custom hook that renders a drag cursor when dragging. 39698 * 39699 * @param {boolean} isDragging The dragging state. 39700 * @param {string} dragDirection The drag direction. 39701 * 39702 * @return {string} The CSS cursor value. 39703 */ 39704 39705 function useDragCursor(isDragging, dragDirection) { 39706 const dragCursor = getDragCursor(dragDirection); 39707 (0,external_wp_element_namespaceObject.useEffect)(() => { 39708 if (isDragging) { 39709 document.documentElement.style.cursor = dragCursor; 39710 } else { 39711 // @ts-expect-error 39712 document.documentElement.style.cursor = null; 39713 } 39714 }, [isDragging]); 39715 return dragCursor; 39716 } 39717 39718 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/state.js 39719 /** 39720 * External dependencies 39721 */ 39722 39723 /** 39724 * Internal dependencies 39725 */ 39726 const initialStateReducer = state => state; 39727 const initialInputControlState = { 39728 _event: {}, 39729 error: null, 39730 initialValue: '', 39731 isDirty: false, 39732 isDragEnabled: false, 39733 isDragging: false, 39734 isPressEnterToChange: false, 39735 value: '' 39736 }; 39737 39738 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/actions.js 39739 /** 39740 * External dependencies 39741 */ 39742 39743 /** 39744 * Internal dependencies 39745 */ 39746 const CHANGE = 'CHANGE'; 39747 const COMMIT = 'COMMIT'; 39748 const DRAG_END = 'DRAG_END'; 39749 const DRAG_START = 'DRAG_START'; 39750 const DRAG = 'DRAG'; 39751 const INVALIDATE = 'INVALIDATE'; 39752 const PRESS_DOWN = 'PRESS_DOWN'; 39753 const PRESS_ENTER = 'PRESS_ENTER'; 39754 const PRESS_UP = 'PRESS_UP'; 39755 const RESET = 'RESET'; 39756 39757 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/reducer/reducer.js 39758 /** 39759 * External dependencies 39760 */ 39761 39762 /** 39763 * WordPress dependencies 39764 */ 39765 39766 /** 39767 * Internal dependencies 39768 */ 39769 39770 39771 39772 /** 39773 * Prepares initialState for the reducer. 39774 * 39775 * @param initialState The initial state. 39776 * @return Prepared initialState for the reducer 39777 */ 39778 39779 function mergeInitialState() { 39780 let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialInputControlState; 39781 const { 39782 value 39783 } = initialState; 39784 return { ...initialInputControlState, 39785 ...initialState, 39786 initialValue: value 39787 }; 39788 } 39789 /** 39790 * Creates a reducer that opens the channel for external state subscription 39791 * and modification. 39792 * 39793 * This technique uses the "stateReducer" design pattern: 39794 * https://kentcdodds.com/blog/the-state-reducer-pattern/ 39795 * 39796 * @param composedStateReducers A custom reducer that can subscribe and modify state. 39797 * @return The reducer. 39798 */ 39799 39800 39801 function inputControlStateReducer(composedStateReducers) { 39802 return (state, action) => { 39803 const nextState = { ...state 39804 }; 39805 39806 switch (action.type) { 39807 /** 39808 * Keyboard events 39809 */ 39810 case PRESS_UP: 39811 nextState.isDirty = false; 39812 break; 39813 39814 case PRESS_DOWN: 39815 nextState.isDirty = false; 39816 break; 39817 39818 /** 39819 * Drag events 39820 */ 39821 39822 case DRAG_START: 39823 nextState.isDragging = true; 39824 break; 39825 39826 case DRAG_END: 39827 nextState.isDragging = false; 39828 break; 39829 39830 /** 39831 * Input events 39832 */ 39833 39834 case CHANGE: 39835 nextState.error = null; 39836 nextState.value = action.payload.value; 39837 39838 if (state.isPressEnterToChange) { 39839 nextState.isDirty = true; 39840 } 39841 39842 break; 39843 39844 case COMMIT: 39845 nextState.value = action.payload.value; 39846 nextState.isDirty = false; 39847 break; 39848 39849 case RESET: 39850 nextState.error = null; 39851 nextState.isDirty = false; 39852 nextState.value = action.payload.value || state.initialValue; 39853 break; 39854 39855 /** 39856 * Validation 39857 */ 39858 39859 case INVALIDATE: 39860 nextState.error = action.payload.error; 39861 break; 39862 } 39863 39864 if (action.payload.event) { 39865 nextState._event = action.payload.event; 39866 } 39867 /** 39868 * Send the nextState + action to the composedReducers via 39869 * this "bridge" mechanism. This allows external stateReducers 39870 * to hook into actions, and modify state if needed. 39871 */ 39872 39873 39874 return composedStateReducers(nextState, action); 39875 }; 39876 } 39877 /** 39878 * A custom hook that connects and external stateReducer with an internal 39879 * reducer. This hook manages the internal state of InputControl. 39880 * However, by connecting an external stateReducer function, other 39881 * components can react to actions as well as modify state before it is 39882 * applied. 39883 * 39884 * This technique uses the "stateReducer" design pattern: 39885 * https://kentcdodds.com/blog/the-state-reducer-pattern/ 39886 * 39887 * @param stateReducer An external state reducer. 39888 * @param initialState The initial state for the reducer. 39889 * @return State, dispatch, and a collection of actions. 39890 */ 39891 39892 39893 function useInputControlStateReducer() { 39894 let stateReducer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialStateReducer; 39895 let initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : initialInputControlState; 39896 const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(inputControlStateReducer(stateReducer), mergeInitialState(initialState)); 39897 39898 const createChangeEvent = type => (nextValue, event) => { 39899 /** 39900 * Persist allows for the (Synthetic) event to be used outside of 39901 * this function call. 39902 * https://reactjs.org/docs/events.html#event-pooling 39903 */ 39904 if (event && event.persist) { 39905 event.persist(); 39906 } 39907 39908 dispatch({ 39909 type, 39910 payload: { 39911 value: nextValue, 39912 event 39913 } 39914 }); 39915 }; 39916 39917 const createKeyEvent = type => event => { 39918 /** 39919 * Persist allows for the (Synthetic) event to be used outside of 39920 * this function call. 39921 * https://reactjs.org/docs/events.html#event-pooling 39922 */ 39923 if (event && event.persist) { 39924 event.persist(); 39925 } 39926 39927 dispatch({ 39928 type, 39929 payload: { 39930 event 39931 } 39932 }); 39933 }; 39934 39935 const createDragEvent = type => payload => { 39936 dispatch({ 39937 type, 39938 payload 39939 }); 39940 }; 39941 /** 39942 * Actions for the reducer 39943 */ 39944 39945 39946 const change = createChangeEvent(CHANGE); 39947 39948 const invalidate = (error, event) => dispatch({ 39949 type: INVALIDATE, 39950 payload: { 39951 error, 39952 event 39953 } 39954 }); 39955 39956 const reset = createChangeEvent(RESET); 39957 const commit = createChangeEvent(COMMIT); 39958 const dragStart = createDragEvent(DRAG_START); 39959 const drag = createDragEvent(DRAG); 39960 const dragEnd = createDragEvent(DRAG_END); 39961 const pressUp = createKeyEvent(PRESS_UP); 39962 const pressDown = createKeyEvent(PRESS_DOWN); 39963 const pressEnter = createKeyEvent(PRESS_ENTER); 39964 return { 39965 change, 39966 commit, 39967 dispatch, 39968 drag, 39969 dragEnd, 39970 dragStart, 39971 invalidate, 39972 pressDown, 39973 pressEnter, 39974 pressUp, 39975 reset, 39976 state 39977 }; 39978 } 39979 39980 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js 39981 /** 39982 * WordPress dependencies 39983 */ 39984 39985 /** 39986 * A `React.useEffect` that will not run on the first render. 39987 * Source: 39988 * https://github.com/reakit/reakit/blob/HEAD/packages/reakit-utils/src/useUpdateEffect.ts 39989 * 39990 * @param {import('react').EffectCallback} effect 39991 * @param {import('react').DependencyList} deps 39992 */ 39993 39994 function use_update_effect_useUpdateEffect(effect, deps) { 39995 const mounted = (0,external_wp_element_namespaceObject.useRef)(false); 39996 (0,external_wp_element_namespaceObject.useEffect)(() => { 39997 if (mounted.current) { 39998 return effect(); 39999 } 40000 40001 mounted.current = true; 40002 return undefined; 40003 }, deps); 40004 } 40005 40006 /* harmony default export */ var use_update_effect = (use_update_effect_useUpdateEffect); 40007 40008 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-field.js 40009 40010 40011 40012 /** 40013 * External dependencies 40014 */ 40015 40016 40017 40018 /** 40019 * WordPress dependencies 40020 */ 40021 40022 /** 40023 * Internal dependencies 40024 */ 40025 40026 40027 40028 40029 40030 40031 function InputField(_ref, ref) { 40032 let { 40033 disabled = false, 40034 dragDirection = 'n', 40035 dragThreshold = 10, 40036 id, 40037 isDragEnabled = false, 40038 isFocused, 40039 isPressEnterToChange = false, 40040 onBlur = external_lodash_namespaceObject.noop, 40041 onChange = external_lodash_namespaceObject.noop, 40042 onDrag = external_lodash_namespaceObject.noop, 40043 onDragEnd = external_lodash_namespaceObject.noop, 40044 onDragStart = external_lodash_namespaceObject.noop, 40045 onFocus = external_lodash_namespaceObject.noop, 40046 onKeyDown = external_lodash_namespaceObject.noop, 40047 onValidate = external_lodash_namespaceObject.noop, 40048 size = 'default', 40049 setIsFocused, 40050 stateReducer = state => state, 40051 value: valueProp, 40052 type, 40053 ...props 40054 } = _ref; 40055 const { 40056 // State. 40057 state, 40058 // Actions. 40059 change, 40060 commit, 40061 drag, 40062 dragEnd, 40063 dragStart, 40064 invalidate, 40065 pressDown, 40066 pressEnter, 40067 pressUp, 40068 reset 40069 } = useInputControlStateReducer(stateReducer, { 40070 isDragEnabled, 40071 value: valueProp, 40072 isPressEnterToChange 40073 }); 40074 const { 40075 _event, 40076 value, 40077 isDragging, 40078 isDirty 40079 } = state; 40080 const wasDirtyOnBlur = (0,external_wp_element_namespaceObject.useRef)(false); 40081 const dragCursor = useDragCursor(isDragging, dragDirection); 40082 /* 40083 * Handles synchronization of external and internal value state. 40084 * If not focused and did not hold a dirty value[1] on blur 40085 * updates the value from the props. Otherwise if not holding 40086 * a dirty value[1] propagates the value and event through onChange. 40087 * [1] value is only made dirty if isPressEnterToChange is true 40088 */ 40089 40090 use_update_effect(() => { 40091 if (valueProp === value) { 40092 return; 40093 } 40094 40095 if (!isFocused && !wasDirtyOnBlur.current) { 40096 commit(valueProp, _event); 40097 } else if (!isDirty) { 40098 onChange(value, { 40099 event: _event 40100 }); 40101 wasDirtyOnBlur.current = false; 40102 } 40103 }, [value, isDirty, isFocused, valueProp]); 40104 40105 const handleOnBlur = event => { 40106 onBlur(event); 40107 setIsFocused === null || setIsFocused === void 0 ? void 0 : setIsFocused(false); 40108 /** 40109 * If isPressEnterToChange is set, this commits the value to 40110 * the onChange callback. 40111 */ 40112 40113 if (isDirty || !event.target.validity.valid) { 40114 wasDirtyOnBlur.current = true; 40115 handleOnCommit(event); 40116 } 40117 }; 40118 40119 const handleOnFocus = event => { 40120 onFocus(event); 40121 setIsFocused === null || setIsFocused === void 0 ? void 0 : setIsFocused(true); 40122 }; 40123 40124 const handleOnChange = event => { 40125 const nextValue = event.target.value; 40126 change(nextValue, event); 40127 }; 40128 40129 const handleOnCommit = event => { 40130 const nextValue = event.currentTarget.value; 40131 40132 try { 40133 onValidate(nextValue); 40134 commit(nextValue, event); 40135 } catch (err) { 40136 invalidate(err, event); 40137 } 40138 }; 40139 40140 const handleOnKeyDown = event => { 40141 const { 40142 key 40143 } = event; 40144 onKeyDown(event); 40145 40146 switch (key) { 40147 case 'ArrowUp': 40148 pressUp(event); 40149 break; 40150 40151 case 'ArrowDown': 40152 pressDown(event); 40153 break; 40154 40155 case 'Enter': 40156 pressEnter(event); 40157 40158 if (isPressEnterToChange) { 40159 event.preventDefault(); 40160 handleOnCommit(event); 40161 } 40162 40163 break; 40164 40165 case 'Escape': 40166 if (isPressEnterToChange && isDirty) { 40167 event.preventDefault(); 40168 reset(valueProp, event); 40169 } 40170 40171 break; 40172 } 40173 }; 40174 40175 const dragGestureProps = use_gesture_react_esm_useDrag(dragProps => { 40176 const { 40177 distance, 40178 dragging, 40179 event, 40180 target 40181 } = dragProps; // The `target` prop always references the `input` element while, by 40182 // default, the `dragProps.event.target` property would reference the real 40183 // event target (i.e. any DOM element that the pointer is hovering while 40184 // dragging). Ensuring that the `target` is always the `input` element 40185 // allows consumers of `InputControl` (or any higher-level control) to 40186 // check the input's validity by accessing `event.target.validity.valid`. 40187 40188 dragProps.event = { ...dragProps.event, 40189 target 40190 }; 40191 if (!distance) return; 40192 event.stopPropagation(); 40193 /** 40194 * Quick return if no longer dragging. 40195 * This prevents unnecessary value calculations. 40196 */ 40197 40198 if (!dragging) { 40199 onDragEnd(dragProps); 40200 dragEnd(dragProps); 40201 return; 40202 } 40203 40204 onDrag(dragProps); 40205 drag(dragProps); 40206 40207 if (!isDragging) { 40208 onDragStart(dragProps); 40209 dragStart(dragProps); 40210 } 40211 }, { 40212 axis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y', 40213 threshold: dragThreshold, 40214 enabled: isDragEnabled, 40215 pointer: { 40216 capture: false 40217 } 40218 }); 40219 const dragProps = isDragEnabled ? dragGestureProps() : {}; 40220 /* 40221 * Works around the odd UA (e.g. Firefox) that does not focus inputs of 40222 * type=number when their spinner arrows are pressed. 40223 */ 40224 40225 let handleOnMouseDown; 40226 40227 if (type === 'number') { 40228 handleOnMouseDown = event => { 40229 var _props$onMouseDown; 40230 40231 (_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 ? void 0 : _props$onMouseDown.call(props, event); 40232 40233 if (event.currentTarget !== event.currentTarget.ownerDocument.activeElement) { 40234 event.currentTarget.focus(); 40235 } 40236 }; 40237 } 40238 40239 return (0,external_wp_element_namespaceObject.createElement)(Input, extends_extends({}, props, dragProps, { 40240 className: "components-input-control__input", 40241 disabled: disabled, 40242 dragCursor: dragCursor, 40243 isDragging: isDragging, 40244 id: id, 40245 onBlur: handleOnBlur, 40246 onChange: handleOnChange, 40247 onFocus: handleOnFocus, 40248 onKeyDown: handleOnKeyDown, 40249 onMouseDown: handleOnMouseDown, 40250 ref: ref, 40251 inputSize: size, 40252 value: value, 40253 type: type 40254 })); 40255 } 40256 40257 const ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(InputField); 40258 /* harmony default export */ var input_field = (ForwardedComponent); 40259 40260 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js 40261 40262 40263 40264 /** 40265 * External dependencies 40266 */ 40267 40268 40269 40270 /** 40271 * WordPress dependencies 40272 */ 40273 40274 40275 /** 40276 * Internal dependencies 40277 */ 40278 40279 40280 40281 40282 function input_control_useUniqueId(idProp) { 40283 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputControl); 40284 const id = `inspector-input-control-$instanceId}`; 40285 return idProp || id; 40286 } 40287 40288 function InputControl(_ref, ref) { 40289 let { 40290 __unstableStateReducer: stateReducer = state => state, 40291 __unstableInputWidth, 40292 className, 40293 disabled = false, 40294 hideLabelFromVision = false, 40295 id: idProp, 40296 isPressEnterToChange = false, 40297 label, 40298 labelPosition = 'top', 40299 onChange = external_lodash_namespaceObject.noop, 40300 onValidate = external_lodash_namespaceObject.noop, 40301 onKeyDown = external_lodash_namespaceObject.noop, 40302 prefix, 40303 size = 'default', 40304 suffix, 40305 value, 40306 ...props 40307 } = _ref; 40308 const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); 40309 const id = input_control_useUniqueId(idProp); 40310 const classes = classnames_default()('components-input-control', className); 40311 return (0,external_wp_element_namespaceObject.createElement)(input_base, { 40312 __unstableInputWidth: __unstableInputWidth, 40313 className: classes, 40314 disabled: disabled, 40315 gap: 3, 40316 hideLabelFromVision: hideLabelFromVision, 40317 id: id, 40318 isFocused: isFocused, 40319 justify: "left", 40320 label: label, 40321 labelPosition: labelPosition, 40322 prefix: prefix, 40323 size: size, 40324 suffix: suffix 40325 }, (0,external_wp_element_namespaceObject.createElement)(input_field, extends_extends({}, props, { 40326 className: "components-input-control__input", 40327 disabled: disabled, 40328 id: id, 40329 isFocused: isFocused, 40330 isPressEnterToChange: isPressEnterToChange, 40331 onChange: onChange, 40332 onKeyDown: onKeyDown, 40333 onValidate: onValidate, 40334 ref: ref, 40335 setIsFocused: setIsFocused, 40336 size: size, 40337 stateReducer: stateReducer, 40338 value: value 40339 }))); 40340 } 40341 const input_control_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(InputControl); 40342 /* harmony default export */ var input_control = (input_control_ForwardedComponent); 40343 40344 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js 40345 40346 40347 function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 40348 40349 /** 40350 * External dependencies 40351 */ 40352 40353 /** 40354 * Internal dependencies 40355 */ 40356 40357 40358 40359 40360 const CIRCLE_SIZE = 32; 40361 const INNER_CIRCLE_SIZE = 3; 40362 const angle_picker_control_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { 40363 target: "e65ony43" 40364 } : 0)("margin-bottom:", space(2), ";" + ( true ? "" : 0)); 40365 const CircleRoot = emotion_styled_base_browser_esm("div", true ? { 40366 target: "e65ony42" 40367 } : 0)("border-radius:50%;border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;" + ( true ? "" : 0)); 40368 const CircleIndicatorWrapper = emotion_styled_base_browser_esm("div", true ? { 40369 target: "e65ony41" 40370 } : 0)( true ? { 40371 name: "1bhd2sw", 40372 styles: "box-sizing:border-box;position:relative;width:100%;height:100%" 40373 } : 0); 40374 const CircleIndicator = emotion_styled_base_browser_esm("div", true ? { 40375 target: "e65ony40" 40376 } : 0)("background:", COLORS.admin.theme, ";border-radius:50%;border:", INNER_CIRCLE_SIZE, "px solid ", COLORS.admin.theme, ";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-", CIRCLE_SIZE / 2, "px;width:0px;" + ( true ? "" : 0)); 40377 40378 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js 40379 40380 40381 40382 /** 40383 * WordPress dependencies 40384 */ 40385 40386 40387 /** 40388 * Internal dependencies 40389 */ 40390 40391 40392 40393 function AngleCircle(_ref) { 40394 let { 40395 value, 40396 onChange, 40397 ...props 40398 } = _ref; 40399 const angleCircleRef = (0,external_wp_element_namespaceObject.useRef)(); 40400 const angleCircleCenter = (0,external_wp_element_namespaceObject.useRef)(); 40401 const previousCursorValue = (0,external_wp_element_namespaceObject.useRef)(); 40402 40403 const setAngleCircleCenter = () => { 40404 const rect = angleCircleRef.current.getBoundingClientRect(); 40405 angleCircleCenter.current = { 40406 x: rect.x + rect.width / 2, 40407 y: rect.y + rect.height / 2 40408 }; 40409 }; 40410 40411 const changeAngleToPosition = event => { 40412 const { 40413 x: centerX, 40414 y: centerY 40415 } = angleCircleCenter.current; // Prevent (drag) mouse events from selecting and accidentally 40416 // triggering actions from other elements. 40417 40418 event.preventDefault(); // Input control needs to lose focus and by preventDefault above, it doesn't. 40419 40420 event.target.focus(); 40421 onChange(getAngle(centerX, centerY, event.clientX, event.clientY)); 40422 }; 40423 40424 const { 40425 startDrag, 40426 isDragging 40427 } = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({ 40428 onDragStart: event => { 40429 setAngleCircleCenter(); 40430 changeAngleToPosition(event); 40431 }, 40432 onDragMove: changeAngleToPosition, 40433 onDragEnd: changeAngleToPosition 40434 }); 40435 (0,external_wp_element_namespaceObject.useEffect)(() => { 40436 if (isDragging) { 40437 if (previousCursorValue.current === undefined) { 40438 previousCursorValue.current = document.body.style.cursor; 40439 } 40440 40441 document.body.style.cursor = 'grabbing'; 40442 } else { 40443 document.body.style.cursor = previousCursorValue.current || null; 40444 previousCursorValue.current = undefined; 40445 } 40446 }, [isDragging]); 40447 return ( 40448 /* eslint-disable jsx-a11y/no-static-element-interactions */ 40449 (0,external_wp_element_namespaceObject.createElement)(CircleRoot, extends_extends({ 40450 ref: angleCircleRef, 40451 onMouseDown: startDrag, 40452 className: "components-angle-picker-control__angle-circle", 40453 style: isDragging ? { 40454 cursor: 'grabbing' 40455 } : undefined 40456 }, props), (0,external_wp_element_namespaceObject.createElement)(CircleIndicatorWrapper, { 40457 style: value ? { 40458 transform: `rotate($value}deg)` 40459 } : undefined, 40460 className: "components-angle-picker-control__angle-circle-indicator-wrapper", 40461 tabIndex: -1 40462 }, (0,external_wp_element_namespaceObject.createElement)(CircleIndicator, { 40463 className: "components-angle-picker-control__angle-circle-indicator" 40464 }))) 40465 /* eslint-enable jsx-a11y/no-static-element-interactions */ 40466 40467 ); 40468 } 40469 40470 function getAngle(centerX, centerY, pointX, pointY) { 40471 const y = pointY - centerY; 40472 const x = pointX - centerX; 40473 const angleInRadians = Math.atan2(y, x); 40474 const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90; 40475 40476 if (angleInDeg < 0) { 40477 return 360 + angleInDeg; 40478 } 40479 40480 return angleInDeg; 40481 } 40482 40483 /* harmony default export */ var angle_circle = (AngleCircle); 40484 40485 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/hook.js 40486 /** 40487 * External dependencies 40488 */ 40489 40490 /** 40491 * Internal dependencies 40492 */ 40493 40494 40495 40496 40497 40498 const isDefined = o => typeof o !== 'undefined' && o !== null; 40499 40500 function useSpacer(props) { 40501 const { 40502 className, 40503 margin, 40504 marginBottom = 2, 40505 marginLeft, 40506 marginRight, 40507 marginTop, 40508 marginX, 40509 marginY, 40510 padding, 40511 paddingBottom, 40512 paddingLeft, 40513 paddingRight, 40514 paddingTop, 40515 paddingX, 40516 paddingY, 40517 ...otherProps 40518 } = useContextSystem(props, 'Spacer'); 40519 const cx = useCx(); 40520 const classes = cx(isDefined(margin) && /*#__PURE__*/emotion_react_browser_esm_css("margin:", space(margin), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginY) && /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(marginY), ";margin-top:", space(marginY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginX) && /*#__PURE__*/emotion_react_browser_esm_css("margin-left:", space(marginX), ";margin-right:", space(marginX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginTop) && /*#__PURE__*/emotion_react_browser_esm_css("margin-top:", space(marginTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginBottom) && /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(marginBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginLeft) && /*#__PURE__*/emotion_react_browser_esm_css("margin-left:", space(marginLeft), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginRight) && /*#__PURE__*/emotion_react_browser_esm_css("margin-right:", space(marginRight), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(padding) && /*#__PURE__*/emotion_react_browser_esm_css("padding:", space(padding), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingY) && /*#__PURE__*/emotion_react_browser_esm_css("padding-bottom:", space(paddingY), ";padding-top:", space(paddingY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingX) && /*#__PURE__*/emotion_react_browser_esm_css("padding-left:", space(paddingX), ";padding-right:", space(paddingX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingTop) && /*#__PURE__*/emotion_react_browser_esm_css("padding-top:", space(paddingTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingBottom) && /*#__PURE__*/emotion_react_browser_esm_css("padding-bottom:", space(paddingBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingLeft) && /*#__PURE__*/emotion_react_browser_esm_css("padding-left:", space(paddingLeft), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingRight) && /*#__PURE__*/emotion_react_browser_esm_css("padding-right:", space(paddingRight), ";" + ( true ? "" : 0), true ? "" : 0), className); 40521 return { ...otherProps, 40522 className: classes 40523 }; 40524 } 40525 40526 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/component.js 40527 40528 40529 40530 /** 40531 * External dependencies 40532 */ 40533 40534 /** 40535 * Internal dependencies 40536 */ 40537 40538 40539 40540 40541 function Spacer(props, forwardedRef) { 40542 const spacerProps = useSpacer(props); 40543 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, spacerProps, { 40544 ref: forwardedRef 40545 })); 40546 } 40547 /** 40548 * `Spacer` is a primitive layout component that providers inner (`padding`) or outer (`margin`) space in-between components. It can also be used to adaptively provide space within an `HStack` or `VStack`. 40549 * 40550 * `Spacer` comes with a bunch of shorthand props to adjust `margin` and `padding`. The values of these props work as a multiplier to the library's grid system (base of `4px`). 40551 * 40552 * @example 40553 * ```jsx 40554 * import { Spacer } from `@wordpress/components` 40555 * 40556 * function Example() { 40557 * return ( 40558 * <View> 40559 * <Spacer> 40560 * <Heading>WordPress.org</Heading> 40561 * </Spacer> 40562 * <Text> 40563 * Code is Poetry 40564 * </Text> 40565 * </View> 40566 * ); 40567 * } 40568 * ``` 40569 */ 40570 40571 40572 const ConnectedSpacer = contextConnect(Spacer, 'Spacer'); 40573 /* harmony default export */ var spacer_component = (ConnectedSpacer); 40574 40575 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js 40576 40577 40578 /** 40579 * External dependencies 40580 */ 40581 40582 /** 40583 * WordPress dependencies 40584 */ 40585 40586 40587 /** 40588 * Internal dependencies 40589 */ 40590 40591 40592 40593 40594 40595 40596 40597 40598 function AnglePickerControl(_ref) { 40599 let { 40600 className, 40601 label = (0,external_wp_i18n_namespaceObject.__)('Angle'), 40602 onChange, 40603 value 40604 } = _ref; 40605 40606 const handleOnNumberChange = unprocessedValue => { 40607 const inputValue = unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0; 40608 onChange(inputValue); 40609 }; 40610 40611 const classes = classnames_default()('components-angle-picker-control', className); 40612 return (0,external_wp_element_namespaceObject.createElement)(angle_picker_control_styles_Root, { 40613 className: classes 40614 }, (0,external_wp_element_namespaceObject.createElement)(flex_block_component, null, (0,external_wp_element_namespaceObject.createElement)(input_control, { 40615 label: label, 40616 className: "components-angle-picker-control__input-field", 40617 max: 360, 40618 min: 0, 40619 onChange: handleOnNumberChange, 40620 size: "__unstable-large", 40621 step: "1", 40622 value: value, 40623 hideHTMLArrows: true, 40624 suffix: (0,external_wp_element_namespaceObject.createElement)(spacer_component, { 40625 as: text_component, 40626 marginBottom: 0, 40627 marginRight: space(3), 40628 style: { 40629 color: 'var( --wp-admin-theme-color )' 40630 } 40631 }, "\xB0") 40632 })), (0,external_wp_element_namespaceObject.createElement)(flex_item_component, { 40633 style: { 40634 marginLeft: space(4), 40635 marginBottom: space(1), 40636 marginTop: 'auto' 40637 } 40638 }, (0,external_wp_element_namespaceObject.createElement)(angle_circle, { 40639 "aria-hidden": "true", 40640 value: value, 40641 onChange: onChange 40642 }))); 40643 } 40644 40645 ;// CONCATENATED MODULE: external ["wp","keycodes"] 40646 var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; 40647 ;// CONCATENATED MODULE: external ["wp","richText"] 40648 var external_wp_richText_namespaceObject = window["wp"]["richText"]; 40649 ;// CONCATENATED MODULE: external ["wp","a11y"] 40650 var external_wp_a11y_namespaceObject = window["wp"]["a11y"]; 40651 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/get-default-use-items.js 40652 /** 40653 * External dependencies 40654 */ 40655 40656 /** 40657 * WordPress dependencies 40658 */ 40659 40660 40661 40662 function filterOptions(search) { 40663 let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 40664 let maxResults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; 40665 const filtered = []; 40666 40667 for (let i = 0; i < options.length; i++) { 40668 const option = options[i]; // Merge label into keywords. 40669 40670 let { 40671 keywords = [] 40672 } = option; 40673 40674 if ('string' === typeof option.label) { 40675 keywords = [...keywords, option.label]; 40676 } 40677 40678 const isMatch = keywords.some(keyword => search.test((0,external_lodash_namespaceObject.deburr)(keyword))); 40679 40680 if (!isMatch) { 40681 continue; 40682 } 40683 40684 filtered.push(option); // Abort early if max reached. 40685 40686 if (filtered.length === maxResults) { 40687 break; 40688 } 40689 } 40690 40691 return filtered; 40692 } 40693 40694 function getDefaultUseItems(autocompleter) { 40695 return filterValue => { 40696 const [items, setItems] = (0,external_wp_element_namespaceObject.useState)([]); 40697 /* 40698 * We support both synchronous and asynchronous retrieval of completer options 40699 * but internally treat all as async so we maintain a single, consistent code path. 40700 * 40701 * Because networks can be slow, and the internet is wonderfully unpredictable, 40702 * we don't want two promises updating the state at once. This ensures that only 40703 * the most recent promise will act on `optionsData`. This doesn't use the state 40704 * because `setState` is batched, and so there's no guarantee that setting 40705 * `activePromise` in the state would result in it actually being in `this.state` 40706 * before the promise resolves and we check to see if this is the active promise or not. 40707 */ 40708 40709 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 40710 const { 40711 options, 40712 isDebounced 40713 } = autocompleter; 40714 const loadOptions = (0,external_lodash_namespaceObject.debounce)(() => { 40715 const promise = Promise.resolve(typeof options === 'function' ? options(filterValue) : options).then(optionsData => { 40716 if (promise.canceled) { 40717 return; 40718 } 40719 40720 const keyedOptions = optionsData.map((optionData, optionIndex) => ({ 40721 key: `$autocompleter.name}-$optionIndex}`, 40722 value: optionData, 40723 label: autocompleter.getOptionLabel(optionData), 40724 keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [], 40725 isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false 40726 })); // Create a regular expression to filter the options. 40727 40728 const search = new RegExp('(?:\\b|\\s|^)' + (0,external_lodash_namespaceObject.escapeRegExp)(filterValue), 'i'); 40729 setItems(filterOptions(search, keyedOptions)); 40730 }); 40731 return promise; 40732 }, isDebounced ? 250 : 0); 40733 const promise = loadOptions(); 40734 return () => { 40735 loadOptions.cancel(); 40736 40737 if (promise) { 40738 promise.canceled = true; 40739 } 40740 }; 40741 }, [filterValue]); 40742 return [items]; 40743 }; 40744 } 40745 40746 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/autocompleter-ui.js 40747 40748 40749 /** 40750 * External dependencies 40751 */ 40752 40753 40754 /** 40755 * WordPress dependencies 40756 */ 40757 40758 40759 40760 /** 40761 * Internal dependencies 40762 */ 40763 40764 40765 40766 40767 function getAutoCompleterUI(autocompleter) { 40768 const useItems = autocompleter.useItems ? autocompleter.useItems : getDefaultUseItems(autocompleter); 40769 40770 function AutocompleterUI(_ref) { 40771 let { 40772 filterValue, 40773 instanceId, 40774 listBoxId, 40775 className, 40776 selectedIndex, 40777 onChangeOptions, 40778 onSelect, 40779 onReset, 40780 value, 40781 contentRef 40782 } = _ref; 40783 const [items] = useItems(filterValue); 40784 const anchorRef = (0,external_wp_richText_namespaceObject.useAnchorRef)({ 40785 ref: contentRef, 40786 value 40787 }); 40788 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 40789 onChangeOptions(items); 40790 }, [items]); 40791 40792 if (!items.length > 0) { 40793 return null; 40794 } 40795 40796 return (0,external_wp_element_namespaceObject.createElement)(popover, { 40797 focusOnMount: false, 40798 onClose: onReset, 40799 position: "top right", 40800 className: "components-autocomplete__popover", 40801 anchorRef: anchorRef 40802 }, (0,external_wp_element_namespaceObject.createElement)("div", { 40803 id: listBoxId, 40804 role: "listbox", 40805 className: "components-autocomplete__results" 40806 }, (0,external_lodash_namespaceObject.map)(items, (option, index) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { 40807 key: option.key, 40808 id: `components-autocomplete-item-$instanceId}-$option.key}`, 40809 role: "option", 40810 "aria-selected": index === selectedIndex, 40811 disabled: option.isDisabled, 40812 className: classnames_default()('components-autocomplete__result', className, { 40813 'is-selected': index === selectedIndex 40814 }), 40815 onClick: () => onSelect(option) 40816 }, option.label)))); 40817 } 40818 40819 return AutocompleterUI; 40820 } 40821 40822 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/index.js 40823 40824 40825 /** 40826 * External dependencies 40827 */ 40828 40829 /** 40830 * WordPress dependencies 40831 */ 40832 40833 40834 40835 40836 40837 40838 40839 /** 40840 * Internal dependencies 40841 */ 40842 40843 40844 /** 40845 * A raw completer option. 40846 * 40847 * @typedef {*} CompleterOption 40848 */ 40849 40850 /** 40851 * @callback FnGetOptions 40852 * 40853 * @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them. 40854 */ 40855 40856 /** 40857 * @callback FnGetOptionKeywords 40858 * @param {CompleterOption} option a completer option. 40859 * 40860 * @return {string[]} list of key words to search. 40861 */ 40862 40863 /** 40864 * @callback FnIsOptionDisabled 40865 * @param {CompleterOption} option a completer option. 40866 * 40867 * @return {string[]} whether or not the given option is disabled. 40868 */ 40869 40870 /** 40871 * @callback FnGetOptionLabel 40872 * @param {CompleterOption} option a completer option. 40873 * 40874 * @return {(string|Array.<(string|WPElement)>)} list of react components to render. 40875 */ 40876 40877 /** 40878 * @callback FnAllowContext 40879 * @param {string} before the string before the auto complete trigger and query. 40880 * @param {string} after the string after the autocomplete trigger and query. 40881 * 40882 * @return {boolean} true if the completer can handle. 40883 */ 40884 40885 /** 40886 * @typedef {Object} OptionCompletion 40887 * @property {'insert-at-caret'|'replace'} action the intended placement of the completion. 40888 * @property {OptionCompletionValue} value the completion value. 40889 */ 40890 40891 /** 40892 * A completion value. 40893 * 40894 * @typedef {(string|WPElement|Object)} OptionCompletionValue 40895 */ 40896 40897 /** 40898 * @callback FnGetOptionCompletion 40899 * @param {CompleterOption} value the value of the completer option. 40900 * @param {string} query the text value of the autocomplete query. 40901 * 40902 * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an 40903 * OptionCompletionValue is returned, the 40904 * completion action defaults to `insert-at-caret`. 40905 */ 40906 40907 /** 40908 * @typedef {Object} WPCompleter 40909 * @property {string} name a way to identify a completer, useful for selective overriding. 40910 * @property {?string} className A class to apply to the popup menu. 40911 * @property {string} triggerPrefix the prefix that will display the menu. 40912 * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them. 40913 * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option. 40914 * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled. 40915 * @property {FnGetOptionLabel} getOptionLabel get the label for a given option. 40916 * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates. 40917 * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option. 40918 */ 40919 40920 function useAutocomplete(_ref) { 40921 let { 40922 record, 40923 onChange, 40924 onReplace, 40925 completers, 40926 contentRef 40927 } = _ref; 40928 const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); 40929 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(useAutocomplete); 40930 const [selectedIndex, setSelectedIndex] = (0,external_wp_element_namespaceObject.useState)(0); 40931 const [filteredOptions, setFilteredOptions] = (0,external_wp_element_namespaceObject.useState)([]); 40932 const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); 40933 const [autocompleter, setAutocompleter] = (0,external_wp_element_namespaceObject.useState)(null); 40934 const [AutocompleterUI, setAutocompleterUI] = (0,external_wp_element_namespaceObject.useState)(null); 40935 const [backspacing, setBackspacing] = (0,external_wp_element_namespaceObject.useState)(false); 40936 40937 function insertCompletion(replacement) { 40938 const end = record.start; 40939 const start = end - autocompleter.triggerPrefix.length - filterValue.length; 40940 const toInsert = (0,external_wp_richText_namespaceObject.create)({ 40941 html: (0,external_wp_element_namespaceObject.renderToString)(replacement) 40942 }); 40943 onChange((0,external_wp_richText_namespaceObject.insert)(record, toInsert, start, end)); 40944 } 40945 40946 function select(option) { 40947 const { 40948 getOptionCompletion 40949 } = autocompleter || {}; 40950 40951 if (option.isDisabled) { 40952 return; 40953 } 40954 40955 if (getOptionCompletion) { 40956 const completion = getOptionCompletion(option.value, filterValue); 40957 const { 40958 action, 40959 value 40960 } = undefined === completion.action || undefined === completion.value ? { 40961 action: 'insert-at-caret', 40962 value: completion 40963 } : completion; 40964 40965 if ('replace' === action) { 40966 onReplace([value]); // When replacing, the component will unmount, so don't reset 40967 // state (below) on an unmounted component. 40968 40969 return; 40970 } else if ('insert-at-caret' === action) { 40971 insertCompletion(value); 40972 } 40973 } // Reset autocomplete state after insertion rather than before 40974 // so insertion events don't cause the completion menu to redisplay. 40975 40976 40977 reset(); 40978 } 40979 40980 function reset() { 40981 setSelectedIndex(0); 40982 setFilteredOptions([]); 40983 setFilterValue(''); 40984 setAutocompleter(null); 40985 setAutocompleterUI(null); 40986 } 40987 40988 function announce(options) { 40989 if (!debouncedSpeak) { 40990 return; 40991 } 40992 40993 if (!!options.length) { 40994 debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)( 40995 /* translators: %d: number of results. */ 40996 (0,external_wp_i18n_namespaceObject._n)('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', options.length), options.length), 'assertive'); 40997 } else { 40998 debouncedSpeak((0,external_wp_i18n_namespaceObject.__)('No results.'), 'assertive'); 40999 } 41000 } 41001 /** 41002 * Load options for an autocompleter. 41003 * 41004 * @param {Array} options 41005 */ 41006 41007 41008 function onChangeOptions(options) { 41009 setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0); 41010 setFilteredOptions(options); 41011 announce(options); 41012 } 41013 41014 function handleKeyDown(event) { 41015 setBackspacing(event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE); 41016 41017 if (!autocompleter) { 41018 return; 41019 } 41020 41021 if (filteredOptions.length === 0) { 41022 return; 41023 } 41024 41025 if (event.defaultPrevented) { 41026 return; 41027 } 41028 41029 switch (event.keyCode) { 41030 case external_wp_keycodes_namespaceObject.UP: 41031 setSelectedIndex((selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1); 41032 break; 41033 41034 case external_wp_keycodes_namespaceObject.DOWN: 41035 setSelectedIndex((selectedIndex + 1) % filteredOptions.length); 41036 break; 41037 41038 case external_wp_keycodes_namespaceObject.ESCAPE: 41039 setAutocompleter(null); 41040 setAutocompleterUI(null); 41041 event.preventDefault(); 41042 break; 41043 41044 case external_wp_keycodes_namespaceObject.ENTER: 41045 select(filteredOptions[selectedIndex]); 41046 break; 41047 41048 case external_wp_keycodes_namespaceObject.LEFT: 41049 case external_wp_keycodes_namespaceObject.RIGHT: 41050 reset(); 41051 return; 41052 41053 default: 41054 return; 41055 } // Any handled keycode should prevent original behavior. This relies on 41056 // the early return in the default case. 41057 41058 41059 event.preventDefault(); 41060 } 41061 41062 let textContent; 41063 41064 if ((0,external_wp_richText_namespaceObject.isCollapsed)(record)) { 41065 textContent = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, 0)); 41066 } 41067 41068 (0,external_wp_element_namespaceObject.useEffect)(() => { 41069 if (!textContent) { 41070 reset(); 41071 return; 41072 } 41073 41074 const text = (0,external_lodash_namespaceObject.deburr)(textContent); 41075 const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, undefined, (0,external_wp_richText_namespaceObject.getTextContent)(record).length)); 41076 const completer = (0,external_lodash_namespaceObject.find)(completers, _ref2 => { 41077 let { 41078 triggerPrefix, 41079 allowContext 41080 } = _ref2; 41081 const index = text.lastIndexOf(triggerPrefix); 41082 41083 if (index === -1) { 41084 return false; 41085 } 41086 41087 const textWithoutTrigger = text.slice(index + triggerPrefix.length); 41088 const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit. 41089 // This is a final barrier to prevent the effect from completing with 41090 // an extremely long string, which causes the editor to slow-down 41091 // significantly. This could happen, for example, if `matchingWhileBackspacing` 41092 // is true and one of the "words" end up being too long. If that's the case, 41093 // it will be caught by this guard. 41094 41095 if (tooDistantFromTrigger) return false; 41096 const mismatch = filteredOptions.length === 0; 41097 const wordsFromTrigger = textWithoutTrigger.split(/\s/); // We need to allow the effect to run when not backspacing and if there 41098 // was a mismatch. i.e when typing a trigger + the match string or when 41099 // clicking in an existing trigger word on the page. We do that if we 41100 // detect that we have one word from trigger in the current textual context. 41101 // 41102 // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and 41103 // allow the effect to run. It will run until there's a mismatch. 41104 41105 const hasOneTriggerWord = wordsFromTrigger.length === 1; // This is used to allow the effect to run when backspacing and if 41106 // "touching" a word that "belongs" to a trigger. We consider a "trigger 41107 // word" any word up to the limit of 3 from the trigger character. 41108 // Anything beyond that is ignored if there's a mismatch. This allows 41109 // us to "escape" a mismatch when backspacing, but still imposing some 41110 // sane limits. 41111 // 41112 // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but 41113 // if the user presses backspace here, it will show the completion popup again. 41114 41115 const matchingWhileBackspacing = backspacing && textWithoutTrigger.split(/\s/).length <= 3; 41116 41117 if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) { 41118 return false; 41119 } 41120 41121 if (allowContext && !allowContext(text.slice(0, index), textAfterSelection)) { 41122 return false; 41123 } 41124 41125 if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) { 41126 return false; 41127 } 41128 41129 return /[\u0000-\uFFFF]*$/.test(textWithoutTrigger); 41130 }); 41131 41132 if (!completer) { 41133 reset(); 41134 return; 41135 } 41136 41137 const safeTrigger = (0,external_lodash_namespaceObject.escapeRegExp)(completer.triggerPrefix); 41138 const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`$safeTrigger}([\u0000-\uFFFF]*)$`)); 41139 const query = match && match[1]; 41140 setAutocompleter(completer); 41141 setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI); 41142 setFilterValue(query); 41143 }, [textContent]); 41144 const { 41145 key: selectedKey = '' 41146 } = filteredOptions[selectedIndex] || {}; 41147 const { 41148 className 41149 } = autocompleter || {}; 41150 const isExpanded = !!autocompleter && filteredOptions.length > 0; 41151 const listBoxId = isExpanded ? `components-autocomplete-listbox-$instanceId}` : null; 41152 const activeId = isExpanded ? `components-autocomplete-item-$instanceId}-$selectedKey}` : null; 41153 const hasSelection = record.start !== undefined; 41154 return { 41155 listBoxId, 41156 activeId, 41157 onKeyDown: handleKeyDown, 41158 popover: hasSelection && AutocompleterUI && (0,external_wp_element_namespaceObject.createElement)(AutocompleterUI, { 41159 className: className, 41160 filterValue: filterValue, 41161 instanceId: instanceId, 41162 listBoxId: listBoxId, 41163 selectedIndex: selectedIndex, 41164 onChangeOptions: onChangeOptions, 41165 onSelect: select, 41166 value: record, 41167 contentRef: contentRef, 41168 reset: reset 41169 }) 41170 }; 41171 } 41172 41173 function useAutocompleteProps(options) { 41174 const ref = (0,external_wp_element_namespaceObject.useRef)(); 41175 const onKeyDownRef = (0,external_wp_element_namespaceObject.useRef)(); 41176 const { 41177 popover, 41178 listBoxId, 41179 activeId, 41180 onKeyDown 41181 } = useAutocomplete({ ...options, 41182 contentRef: ref 41183 }); 41184 onKeyDownRef.current = onKeyDown; 41185 return { 41186 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 41187 function _onKeyDown(event) { 41188 onKeyDownRef.current(event); 41189 } 41190 41191 element.addEventListener('keydown', _onKeyDown); 41192 return () => { 41193 element.removeEventListener('keydown', _onKeyDown); 41194 }; 41195 }, [])]), 41196 children: popover, 41197 'aria-autocomplete': listBoxId ? 'list' : undefined, 41198 'aria-owns': listBoxId, 41199 'aria-activedescendant': activeId 41200 }; 41201 } 41202 function Autocomplete(_ref3) { 41203 let { 41204 children, 41205 isSelected, 41206 ...options 41207 } = _ref3; 41208 const { 41209 popover, 41210 ...props 41211 } = useAutocomplete(options); 41212 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, children(props), isSelected && popover); 41213 } 41214 41215 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-values.js 41216 /* harmony default export */ var font_values = ({ 41217 'default.fontFamily': "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", 41218 'default.fontSize': '13px', 41219 'helpText.fontSize': '12px', 41220 mobileTextMinFontSize: '16px' 41221 }); 41222 41223 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font.js 41224 /** 41225 * External dependencies 41226 */ 41227 41228 /** 41229 * Internal dependencies 41230 */ 41231 41232 41233 /** 41234 * 41235 * @param {keyof FONT} value Path of value from `FONT` 41236 * @return {string} Font rule value 41237 */ 41238 41239 function font(value) { 41240 return (0,external_lodash_namespaceObject.get)(font_values, value, ''); 41241 } 41242 41243 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js 41244 41245 41246 function base_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 41247 41248 /** 41249 * External dependencies 41250 */ 41251 41252 /** 41253 * Internal dependencies 41254 */ 41255 41256 41257 41258 const base_control_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { 41259 target: "ej5x27r4" 41260 } : 0)("font-family:", font('default.fontFamily'), ";font-size:", font('default.fontSize'), ";" + ( true ? "" : 0)); 41261 41262 const deprecatedMarginField = _ref2 => { 41263 let { 41264 __nextHasNoMarginBottom = false 41265 } = _ref2; 41266 return !__nextHasNoMarginBottom && /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0); 41267 }; 41268 41269 const StyledField = emotion_styled_base_browser_esm("div", true ? { 41270 target: "ej5x27r3" 41271 } : 0)(deprecatedMarginField, " .components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : 0)); 41272 const labelStyles = /*#__PURE__*/emotion_react_browser_esm_css("display:inline-block;margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0); 41273 const StyledLabel = emotion_styled_base_browser_esm("label", true ? { 41274 target: "ej5x27r2" 41275 } : 0)(labelStyles, ";" + ( true ? "" : 0)); 41276 41277 var base_control_styles_ref = true ? { 41278 name: "11yad0w", 41279 styles: "margin-bottom:revert" 41280 } : 0; 41281 41282 const deprecatedMarginHelp = _ref3 => { 41283 let { 41284 __nextHasNoMarginBottom = false 41285 } = _ref3; 41286 return !__nextHasNoMarginBottom && base_control_styles_ref; 41287 }; 41288 41289 const StyledHelp = emotion_styled_base_browser_esm("p", true ? { 41290 target: "ej5x27r1" 41291 } : 0)("margin-top:", space(2), ";margin-bottom:0;font-size:", font('helpText.fontSize'), ";font-style:normal;color:", COLORS.mediumGray.text, ";", deprecatedMarginHelp, ";" + ( true ? "" : 0)); 41292 const StyledVisualLabel = emotion_styled_base_browser_esm("span", true ? { 41293 target: "ej5x27r0" 41294 } : 0)(labelStyles, ";" + ( true ? "" : 0)); 41295 41296 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/index.js 41297 41298 41299 /** 41300 * External dependencies 41301 */ 41302 41303 41304 /** 41305 * Internal dependencies 41306 */ 41307 41308 41309 /** 41310 * `BaseControl` is a component used to generate labels and help text for components handling user inputs. 41311 * 41312 * @example 41313 * // Render a `BaseControl` for a textarea input 41314 * import { BaseControl } from '@wordpress/components'; 41315 * 41316 * // The `id` prop is necessary to accessibly associate the label with the textarea 41317 * const MyBaseControl = () => ( 41318 * <BaseControl id="textarea-1" label="Text" help="Enter some text" __nextHasNoMarginBottom={ true }> 41319 * <textarea id="textarea-1" /> 41320 * </BaseControl> 41321 * ); 41322 */ 41323 41324 const BaseControl = _ref => { 41325 let { 41326 __nextHasNoMarginBottom = false, 41327 id, 41328 label, 41329 hideLabelFromVision = false, 41330 help, 41331 className, 41332 children 41333 } = _ref; 41334 return (0,external_wp_element_namespaceObject.createElement)(base_control_styles_Wrapper, { 41335 className: classnames_default()('components-base-control', className) 41336 }, (0,external_wp_element_namespaceObject.createElement)(StyledField, { 41337 className: "components-base-control__field" // TODO: Official deprecation for this should start after all internal usages have been migrated 41338 , 41339 __nextHasNoMarginBottom: __nextHasNoMarginBottom 41340 }, label && id && (hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { 41341 as: "label", 41342 htmlFor: id 41343 }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, { 41344 className: "components-base-control__label", 41345 htmlFor: id 41346 }, label)), label && !id && (hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { 41347 as: "label" 41348 }, label) : (0,external_wp_element_namespaceObject.createElement)(BaseControl.VisualLabel, null, label)), children), !!help && (0,external_wp_element_namespaceObject.createElement)(StyledHelp, { 41349 id: id ? id + '__help' : undefined, 41350 className: "components-base-control__help", 41351 __nextHasNoMarginBottom: __nextHasNoMarginBottom 41352 }, help)); 41353 }; 41354 /** 41355 * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component. 41356 * 41357 * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled, 41358 * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would 41359 * otherwise use if the `label` prop was passed. 41360 * 41361 * @example 41362 * import { BaseControl } from '@wordpress/components'; 41363 * 41364 * const MyBaseControl = () => ( 41365 * <BaseControl help="This button is already accessibly labeled."> 41366 * <BaseControl.VisualLabel>Author</BaseControl.VisualLabel> 41367 * <Button>Select an author</Button> 41368 * </BaseControl> 41369 * ); 41370 */ 41371 41372 const VisualLabel = _ref2 => { 41373 let { 41374 className, 41375 children 41376 } = _ref2; 41377 return (0,external_wp_element_namespaceObject.createElement)(StyledVisualLabel, { 41378 className: classnames_default()('components-base-control__label', className) 41379 }, children); 41380 }; 41381 BaseControl.VisualLabel = VisualLabel; 41382 /* harmony default export */ var base_control = (BaseControl); 41383 41384 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js 41385 41386 41387 /** 41388 * WordPress dependencies 41389 */ 41390 41391 const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41392 xmlns: "http://www.w3.org/2000/svg", 41393 viewBox: "0 0 24 24" 41394 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41395 d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" 41396 })); 41397 /* harmony default export */ var library_link = (link_link); 41398 41399 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js 41400 41401 41402 /** 41403 * WordPress dependencies 41404 */ 41405 41406 const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41407 xmlns: "http://www.w3.org/2000/svg", 41408 viewBox: "0 0 24 24" 41409 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41410 d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" 41411 })); 41412 /* harmony default export */ var link_off = (linkOff); 41413 41414 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/styles.js 41415 function border_box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 41416 41417 /** 41418 * External dependencies 41419 */ 41420 41421 /** 41422 * Internal dependencies 41423 */ 41424 41425 41426 41427 const BorderBoxControl = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); 41428 const LinkedBorderControl = true ? { 41429 name: "82a6rk", 41430 styles: "flex:1" 41431 } : 0; 41432 const BorderBoxControlLinkedButton = true ? { 41433 name: "3gg0za", 41434 styles: "flex:0;flex-basis:36px;margin-top:7px" 41435 } : 0; 41436 41437 const BorderBoxStyleWithFallback = border => { 41438 const { 41439 color = COLORS.gray[200], 41440 style = 'solid', 41441 width = config_values.borderWidth 41442 } = border || {}; 41443 const clampedWidth = width !== config_values.borderWidth ? `clamp(1px, $width}, 10px)` : width; 41444 const hasVisibleBorder = !!width && width !== '0' || !!color; 41445 const borderStyle = hasVisibleBorder ? style || 'solid' : style; 41446 return `$color} $borderStyle} $clampedWidth}`; 41447 }; 41448 41449 const BorderBoxControlVisualizer = borders => { 41450 return /*#__PURE__*/emotion_react_browser_esm_css("position:absolute;top:20px;right:30px;bottom:20px;left:30px;border-top:", BorderBoxStyleWithFallback(borders === null || borders === void 0 ? void 0 : borders.top), ";border-bottom:", BorderBoxStyleWithFallback(borders === null || borders === void 0 ? void 0 : borders.bottom), ";", rtl({ 41451 borderLeft: BorderBoxStyleWithFallback(borders === null || borders === void 0 ? void 0 : borders.left) 41452 })(), " ", rtl({ 41453 borderRight: BorderBoxStyleWithFallback(borders === null || borders === void 0 ? void 0 : borders.right) 41454 })(), ";" + ( true ? "" : 0), true ? "" : 0); 41455 }; 41456 const BorderBoxControlSplitControls = /*#__PURE__*/emotion_react_browser_esm_css("position:relative;flex:1;", rtl({ 41457 marginRight: space(3) 41458 }, { 41459 marginLeft: space(3) 41460 })(), ";" + ( true ? "" : 0), true ? "" : 0); 41461 const CenteredBorderControl = true ? { 41462 name: "1nwbfnf", 41463 styles: "grid-column:span 2;margin:0 auto" 41464 } : 0; 41465 41466 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/hook.js 41467 /** 41468 * WordPress dependencies 41469 */ 41470 41471 /** 41472 * Internal dependencies 41473 */ 41474 41475 41476 41477 41478 function useBorderBoxControlLinkedButton(props) { 41479 const { 41480 className, 41481 ...otherProps 41482 } = useContextSystem(props, 'BorderBoxControlLinkedButton'); // Generate class names. 41483 41484 const cx = useCx(); 41485 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 41486 return cx(BorderBoxControlLinkedButton, className); 41487 }, [className]); 41488 return { ...otherProps, 41489 className: classes 41490 }; 41491 } 41492 41493 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/component.js 41494 41495 41496 41497 /** 41498 * WordPress dependencies 41499 */ 41500 41501 41502 /** 41503 * Internal dependencies 41504 */ 41505 41506 41507 41508 41509 41510 41511 41512 const component_BorderBoxControlLinkedButton = (props, forwardedRef) => { 41513 const { 41514 className, 41515 isLinked, 41516 ...buttonProps 41517 } = useBorderBoxControlLinkedButton(props); 41518 const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides'); 41519 return (0,external_wp_element_namespaceObject.createElement)(tooltip, { 41520 text: label 41521 }, (0,external_wp_element_namespaceObject.createElement)(component, { 41522 className: className 41523 }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, extends_extends({}, buttonProps, { 41524 variant: isLinked ? 'primary' : 'secondary', 41525 isSmall: true, 41526 icon: isLinked ? library_link : link_off, 41527 iconSize: 16, 41528 "aria-label": label, 41529 ref: forwardedRef 41530 })))); 41531 }; 41532 41533 const ConnectedBorderBoxControlLinkedButton = contextConnect(component_BorderBoxControlLinkedButton, 'BorderBoxControlLinkedButton'); 41534 /* harmony default export */ var border_box_control_linked_button_component = (ConnectedBorderBoxControlLinkedButton); 41535 41536 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/hook.js 41537 /** 41538 * WordPress dependencies 41539 */ 41540 41541 /** 41542 * Internal dependencies 41543 */ 41544 41545 41546 41547 41548 function useBorderBoxControlVisualizer(props) { 41549 const { 41550 className, 41551 value, 41552 ...otherProps 41553 } = useContextSystem(props, 'BorderBoxControlVisualizer'); // Generate class names. 41554 41555 const cx = useCx(); 41556 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 41557 return cx(BorderBoxControlVisualizer(value), className); 41558 }, [className, value, rtl.watch()]); 41559 return { ...otherProps, 41560 className: classes, 41561 value 41562 }; 41563 } 41564 41565 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/component.js 41566 41567 41568 41569 /** 41570 * WordPress dependencies 41571 */ 41572 41573 /** 41574 * Internal dependencies 41575 */ 41576 41577 41578 41579 41580 const component_BorderBoxControlVisualizer = (props, forwardedRef) => { 41581 const { 41582 value, 41583 ...otherProps 41584 } = useBorderBoxControlVisualizer(props); 41585 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, otherProps, { 41586 ref: forwardedRef 41587 })); 41588 }; 41589 41590 const ConnectedBorderBoxControlVisualizer = contextConnect(component_BorderBoxControlVisualizer, 'BorderBoxControlVisualizer'); 41591 /* harmony default export */ var border_box_control_visualizer_component = (ConnectedBorderBoxControlVisualizer); 41592 41593 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js 41594 41595 41596 /** 41597 * WordPress dependencies 41598 */ 41599 41600 const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41601 xmlns: "http://www.w3.org/2000/svg", 41602 viewBox: "0 0 24 24" 41603 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41604 d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" 41605 })); 41606 /* harmony default export */ var close_small = (closeSmall); 41607 41608 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js 41609 41610 41611 /** 41612 * WordPress dependencies 41613 */ 41614 41615 const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41616 xmlns: "http://www.w3.org/2000/svg", 41617 width: "24", 41618 height: "24", 41619 fill: "none" 41620 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41621 d: "M5 11.25h14v1.5H5z" 41622 })); 41623 /* harmony default export */ var line_solid = (lineSolid); 41624 41625 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js 41626 41627 41628 /** 41629 * WordPress dependencies 41630 */ 41631 41632 const lineDashed = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41633 xmlns: "http://www.w3.org/2000/svg", 41634 width: "24", 41635 height: "24", 41636 fill: "none" 41637 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41638 fillRule: "evenodd", 41639 d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z", 41640 clipRule: "evenodd" 41641 })); 41642 /* harmony default export */ var line_dashed = (lineDashed); 41643 41644 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js 41645 41646 41647 /** 41648 * WordPress dependencies 41649 */ 41650 41651 const lineDotted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41652 xmlns: "http://www.w3.org/2000/svg", 41653 width: "24", 41654 height: "24", 41655 fill: "none" 41656 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41657 fillRule: "evenodd", 41658 d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z", 41659 clipRule: "evenodd" 41660 })); 41661 /* harmony default export */ var line_dotted = (lineDotted); 41662 41663 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js 41664 41665 41666 function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 41667 41668 // @ts-nocheck 41669 41670 /** 41671 * External dependencies 41672 */ 41673 41674 41675 /** 41676 * Internal dependencies 41677 */ 41678 41679 41680 var number_control_styles_ref = true ? { 41681 name: "euqsgg", 41682 styles: "input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}" 41683 } : 0; 41684 41685 const htmlArrowStyles = _ref2 => { 41686 let { 41687 hideHTMLArrows 41688 } = _ref2; 41689 if (!hideHTMLArrows) return ``; 41690 return number_control_styles_ref; 41691 }; 41692 41693 const number_control_styles_Input = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { 41694 target: "ep48uk90" 41695 } : 0)(htmlArrowStyles, ";" + ( true ? "" : 0)); 41696 41697 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js 41698 /** 41699 * External dependencies 41700 */ 41701 41702 /** 41703 * Parses and retrieves a number value. 41704 * 41705 * @param {unknown} value The incoming value. 41706 * 41707 * @return {number} The parsed number value. 41708 */ 41709 41710 function getNumber(value) { 41711 const number = Number(value); 41712 return isNaN(number) ? 0 : number; 41713 } 41714 /** 41715 * Safely adds 2 values. 41716 * 41717 * @param {Array<number|string>} args Values to add together. 41718 * 41719 * @return {number} The sum of values. 41720 */ 41721 41722 function add() { 41723 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 41724 args[_key] = arguments[_key]; 41725 } 41726 41727 return args.reduce( 41728 /** @type {(sum:number, arg: number|string) => number} */ 41729 (sum, arg) => sum + getNumber(arg), 0); 41730 } 41731 /** 41732 * Safely subtracts 2 values. 41733 * 41734 * @param {Array<number|string>} args Values to subtract together. 41735 * 41736 * @return {number} The difference of the values. 41737 */ 41738 41739 function subtract() { 41740 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 41741 args[_key2] = arguments[_key2]; 41742 } 41743 41744 return args.reduce( 41745 /** @type {(diff:number, arg: number|string, index:number) => number} */ 41746 (diff, arg, index) => { 41747 const value = getNumber(arg); 41748 return index === 0 ? value : diff - value; 41749 }, 0); 41750 } 41751 /** 41752 * Determines the decimal position of a number value. 41753 * 41754 * @param {number} value The number to evaluate. 41755 * 41756 * @return {number} The number of decimal places. 41757 */ 41758 41759 function getPrecision(value) { 41760 const split = (value + '').split('.'); 41761 return split[1] !== undefined ? split[1].length : 0; 41762 } 41763 /** 41764 * Clamps a value based on a min/max range with rounding 41765 * 41766 * @param {number} value The value. 41767 * @param {number} min The minimum range. 41768 * @param {number} max The maximum range. 41769 * @param {number} step A multiplier for the value. 41770 * 41771 * @return {number} The rounded and clamped value. 41772 */ 41773 41774 41775 function roundClamp() { 41776 let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 41777 let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; 41778 let max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; 41779 let step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; 41780 const baseValue = getNumber(value); 41781 const stepValue = getNumber(step); 41782 const precision = getPrecision(step); 41783 const rounded = Math.round(baseValue / stepValue) * stepValue; 41784 const clampedValue = (0,external_lodash_namespaceObject.clamp)(rounded, min, max); 41785 return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue; 41786 } 41787 /** 41788 * Clamps a value based on a min/max range with rounding. 41789 * Returns a string. 41790 * 41791 * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp(). 41792 * @return {string} The rounded and clamped value. 41793 */ 41794 41795 function roundClampString() { 41796 return roundClamp(...arguments).toString(); 41797 } 41798 41799 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/values.js 41800 /* eslint-disable jsdoc/valid-types */ 41801 41802 /** 41803 * Determines if a value is null or undefined. 41804 * 41805 * @template T 41806 * 41807 * @param {T | null | undefined} value The value to check. 41808 * @return {value is T} Whether value is not null or undefined. 41809 */ 41810 function isValueDefined(value) { 41811 return value !== undefined && value !== null; 41812 } 41813 /* eslint-enable jsdoc/valid-types */ 41814 41815 /* eslint-disable jsdoc/valid-types */ 41816 41817 /** 41818 * Determines if a value is empty, null, or undefined. 41819 * 41820 * @template T 41821 * 41822 * @param {T | "" | null | undefined} value The value to check. 41823 * @return {value is T} Whether value is empty. 41824 */ 41825 41826 function isValueEmpty(value) { 41827 const isEmptyString = value === ''; 41828 return !isValueDefined(value) || isEmptyString; 41829 } 41830 /* eslint-enable jsdoc/valid-types */ 41831 41832 /** 41833 * Get the first defined/non-null value from an array. 41834 * 41835 * @template T 41836 * 41837 * @param {Array<T | null | undefined>} values Values to derive from. 41838 * @param {T} fallbackValue Fallback value if there are no defined values. 41839 * @return {T} A defined value or the fallback value. 41840 */ 41841 41842 function getDefinedValue() { 41843 var _values$find; 41844 41845 let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 41846 let fallbackValue = arguments.length > 1 ? arguments[1] : undefined; 41847 return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue; 41848 } 41849 /** 41850 * @param {string} [locale] 41851 * @return {[RegExp, RegExp]} The delimiter and decimal regexp 41852 */ 41853 41854 const getDelimiterAndDecimalRegex = locale => { 41855 const formatted = Intl.NumberFormat(locale).format(1000.1); 41856 const delimiter = formatted[1]; 41857 const decimal = formatted[formatted.length - 2]; 41858 return [new RegExp(`\\$delimiter}`, 'g'), new RegExp(`\\$decimal}`, 'g')]; 41859 }; // https://en.wikipedia.org/wiki/Decimal_separator#Current_standards 41860 41861 41862 const INTERNATIONAL_THOUSANDS_DELIMITER = / /g; 41863 const ARABIC_NUMERAL_LOCALES = (/* unused pure expression or super */ null && (['ar', 'fa', 'ur', 'ckb', 'ps'])); 41864 const EASTERN_ARABIC_NUMBERS = /([۰-۹]|[٠-٩])/g; 41865 /** 41866 * Checks to see if a value is a numeric value (`number` or `string`). 41867 * 41868 * Intentionally ignores whether the thousands delimiters are only 41869 * in the thousands marks. 41870 * 41871 * @param {any} value 41872 * @param {string} [locale] 41873 * @return {boolean} Whether value is numeric. 41874 */ 41875 41876 function isValueNumeric(value) { 41877 let locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.navigator.language; 41878 41879 if (ARABIC_NUMERAL_LOCALES.some(l => locale.startsWith(l))) { 41880 locale = 'en-GB'; 41881 41882 if (EASTERN_ARABIC_NUMBERS.test(value)) { 41883 value = value.replace(/[٠-٩]/g, ( 41884 /** @type {string} */ 41885 d) => '٠١٢٣٤٥٦٧٨٩'.indexOf(d)).replace(/[۰-۹]/g, ( 41886 /** @type {string} */ 41887 d) => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d)).replace(/٬/g, ',').replace(/٫/g, '.'); 41888 } 41889 } 41890 41891 const [delimiterRegexp, decimalRegexp] = getDelimiterAndDecimalRegex(locale); 41892 const valueToCheck = typeof value === 'string' ? value.replace(delimiterRegexp, '').replace(decimalRegexp, '.').replace(INTERNATIONAL_THOUSANDS_DELIMITER, '') : value; 41893 return !isNaN(parseFloat(valueToCheck)) && isFinite(valueToCheck); 41894 } 41895 41896 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js 41897 41898 41899 // @ts-nocheck 41900 41901 /** 41902 * External dependencies 41903 */ 41904 41905 /** 41906 * WordPress dependencies 41907 */ 41908 41909 41910 41911 /** 41912 * Internal dependencies 41913 */ 41914 41915 41916 41917 41918 41919 function NumberControl(_ref, ref) { 41920 let { 41921 __unstableStateReducer: stateReducerProp, 41922 className, 41923 dragDirection = 'n', 41924 hideHTMLArrows = false, 41925 isDragEnabled = true, 41926 isShiftStepEnabled = true, 41927 label, 41928 max = Infinity, 41929 min = -Infinity, 41930 required = false, 41931 shiftStep = 10, 41932 step = 1, 41933 type: typeProp = 'number', 41934 value: valueProp, 41935 ...props 41936 } = _ref; 41937 const isStepAny = step === 'any'; 41938 const baseStep = isStepAny ? 1 : parseFloat(step); 41939 const baseValue = roundClamp(0, min, max, baseStep); 41940 41941 const constrainValue = (value, stepOverride) => { 41942 // When step is "any" clamp the value, otherwise round and clamp it. 41943 return isStepAny ? Math.min(max, Math.max(min, value)) : roundClamp(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep); 41944 }; 41945 41946 const autoComplete = typeProp === 'number' ? 'off' : null; 41947 const classes = classnames_default()('components-number-control', className); 41948 /** 41949 * "Middleware" function that intercepts updates from InputControl. 41950 * This allows us to tap into actions to transform the (next) state for 41951 * InputControl. 41952 * 41953 * @param {Object} state State from InputControl 41954 * @param {Object} action Action triggering state change 41955 * @return {Object} The updated state to apply to InputControl 41956 */ 41957 41958 const numberControlStateReducer = (state, action) => { 41959 const nextState = { ...state 41960 }; 41961 const { 41962 type, 41963 payload 41964 } = action; 41965 const event = payload === null || payload === void 0 ? void 0 : payload.event; 41966 const currentValue = nextState.value; 41967 /** 41968 * Handles custom UP and DOWN Keyboard events 41969 */ 41970 41971 if (type === PRESS_UP || type === PRESS_DOWN) { 41972 const enableShift = event.shiftKey && isShiftStepEnabled; 41973 const incrementalValue = enableShift ? parseFloat(shiftStep) * baseStep : baseStep; 41974 let nextValue = isValueEmpty(currentValue) ? baseValue : currentValue; 41975 41976 if (event !== null && event !== void 0 && event.preventDefault) { 41977 event.preventDefault(); 41978 } 41979 41980 if (type === PRESS_UP) { 41981 nextValue = add(nextValue, incrementalValue); 41982 } 41983 41984 if (type === PRESS_DOWN) { 41985 nextValue = subtract(nextValue, incrementalValue); 41986 } 41987 41988 nextState.value = constrainValue(nextValue, enableShift ? incrementalValue : null); 41989 } 41990 /** 41991 * Handles drag to update events 41992 */ 41993 41994 41995 if (type === DRAG && isDragEnabled) { 41996 const [x, y] = payload.delta; 41997 const enableShift = payload.shiftKey && isShiftStepEnabled; 41998 const modifier = enableShift ? parseFloat(shiftStep) * baseStep : baseStep; 41999 let directionModifier; 42000 let delta; 42001 42002 switch (dragDirection) { 42003 case 'n': 42004 delta = y; 42005 directionModifier = -1; 42006 break; 42007 42008 case 'e': 42009 delta = x; 42010 directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1; 42011 break; 42012 42013 case 's': 42014 delta = y; 42015 directionModifier = 1; 42016 break; 42017 42018 case 'w': 42019 delta = x; 42020 directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1; 42021 break; 42022 } 42023 42024 if (delta !== 0) { 42025 delta = Math.ceil(Math.abs(delta)) * Math.sign(delta); 42026 const distance = delta * modifier * directionModifier; 42027 nextState.value = constrainValue(add(currentValue, distance), enableShift ? modifier : null); 42028 } 42029 } 42030 /** 42031 * Handles commit (ENTER key press or blur) 42032 */ 42033 42034 42035 if (type === PRESS_ENTER || type === COMMIT) { 42036 const applyEmptyValue = required === false && currentValue === ''; 42037 nextState.value = applyEmptyValue ? currentValue : constrainValue(currentValue); 42038 } 42039 42040 return nextState; 42041 }; 42042 42043 return (0,external_wp_element_namespaceObject.createElement)(number_control_styles_Input, extends_extends({ 42044 autoComplete: autoComplete, 42045 inputMode: "numeric" 42046 }, props, { 42047 className: classes, 42048 dragDirection: dragDirection, 42049 hideHTMLArrows: hideHTMLArrows, 42050 isDragEnabled: isDragEnabled, 42051 label: label, 42052 max: max, 42053 min: min, 42054 ref: ref, 42055 required: required, 42056 step: step, 42057 type: typeProp, 42058 value: valueProp, 42059 __unstableStateReducer: (state, action) => { 42060 var _stateReducerProp; 42061 42062 const baseState = numberControlStateReducer(state, action); 42063 return (_stateReducerProp = stateReducerProp === null || stateReducerProp === void 0 ? void 0 : stateReducerProp(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState; 42064 } 42065 })); 42066 } 42067 /* harmony default export */ var number_control = ((0,external_wp_element_namespaceObject.forwardRef)(NumberControl)); 42068 42069 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js 42070 42071 42072 function unit_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 42073 42074 /** 42075 * External dependencies 42076 */ 42077 42078 42079 /** 42080 * Internal dependencies 42081 */ 42082 42083 42084 const unit_control_styles_Root = emotion_styled_base_browser_esm("div", true ? { 42085 target: "e1bagdl33" 42086 } : 0)( true ? { 42087 name: "100d0a9", 42088 styles: "box-sizing:border-box;position:relative" 42089 } : 0); 42090 42091 const paddingStyles = _ref2 => { 42092 let { 42093 disableUnits, 42094 size 42095 } = _ref2; 42096 const paddings = { 42097 default: { 42098 paddingRight: 8 42099 }, 42100 small: { 42101 paddingRight: 8 42102 }, 42103 '__unstable-large': { 42104 paddingRight: disableUnits ? 16 : 8 42105 } 42106 }; 42107 return /*#__PURE__*/emotion_react_browser_esm_css(rtl(paddings[size])(), ";" + ( true ? "" : 0), true ? "" : 0); 42108 }; 42109 42110 var unit_control_styles_ref = true ? { 42111 name: "1y65o8", 42112 styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}" 42113 } : 0; 42114 42115 const arrowStyles = _ref3 => { 42116 let { 42117 disableUnits 42118 } = _ref3; 42119 if (disableUnits) return ''; 42120 return unit_control_styles_ref; 42121 }; // TODO: Resolve need to use &&& to increase specificity 42122 // https://github.com/WordPress/gutenberg/issues/18483 42123 42124 42125 const ValueInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { 42126 target: "e1bagdl32" 42127 } : 0)("&&&{input{appearance:none;-moz-appearance:textfield;display:block;width:100%;", arrowStyles, ";", paddingStyles, ";}}" + ( true ? "" : 0)); 42128 const baseUnitLabelStyles = /*#__PURE__*/emotion_react_browser_esm_css("appearance:none;background:transparent;border-radius:2px;border:none;box-sizing:border-box;color:", COLORS.darkGray[500], ";display:block;font-size:8px;letter-spacing:-0.5px;outline:none;padding:2px 1px;text-align-last:center;text-transform:uppercase;width:20px;", rtl({ 42129 borderTopLeftRadius: 0, 42130 borderBottomLeftRadius: 0 42131 })(), ";" + ( true ? "" : 0), true ? "" : 0); 42132 const UnitLabel = emotion_styled_base_browser_esm("div", true ? { 42133 target: "e1bagdl31" 42134 } : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";}" + ( true ? "" : 0)); 42135 const UnitSelect = emotion_styled_base_browser_esm("select", true ? { 42136 target: "e1bagdl30" 42137 } : 0)("&&&{", baseUnitLabelStyles, ";cursor:pointer;border:1px solid transparent;height:100%;&:hover{background-color:", COLORS.lightGray[300], ";}&:focus{border-color:", COLORS.ui.borderFocus, ";outline:2px solid transparent;outline-offset:0;}&:disabled{cursor:initial;&:hover{background-color:transparent;}}}" + ( true ? "" : 0)); 42138 42139 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/styles.js 42140 function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } 42141 42142 /** 42143 * External dependencies 42144 */ 42145 42146 42147 /** 42148 * Internal dependencies 42149 */ 42150 42151 42152 42153 42154 42155 const styles_labelStyles = true ? { 42156 name: "f3vz0n", 42157 styles: "font-weight:500" 42158 } : 0; 42159 const borderControl = true ? { 42160 name: "bjn8wh", 42161 styles: "position:relative" 42162 } : 0; 42163 const innerWrapper = () => /*#__PURE__*/emotion_react_browser_esm_css("border:", config_values.borderWidth, " solid ", COLORS.gray[200], ";border-radius:2px;flex:1 0 40%;background:#fff;", unit_control_styles_Root, "{flex:1;", rtl({ 42164 marginLeft: 0 42165 })(), ";}" + ( true ? "" : 0), true ? "" : 0); 42166 const styles_wrapperWidth = width => { 42167 return /*#__PURE__*/emotion_react_browser_esm_css("width:", width, ";flex:0 0 auto;" + ( true ? "" : 0), true ? "" : 0); 42168 }; 42169 const borderControlDropdown = () => /*#__PURE__*/emotion_react_browser_esm_css("background:#fff;", rtl({ 42170 borderRadius: `1px 0 0 1px`, 42171 borderRight: `$config_values.borderWidth} solid $COLORS.gray[200]}` 42172 }, { 42173 borderRadius: `0 1px 1px 0`, 42174 borderLeft: `$config_values.borderWidth} solid $COLORS.gray[200]}` 42175 })(), " &&>button{padding:", space(1), ";border-radius:inherit;}" + ( true ? "" : 0), true ? "" : 0); 42176 const colorIndicatorBorder = border => { 42177 const { 42178 color, 42179 style 42180 } = border || {}; 42181 const fallbackColor = !!style && style !== 'none' ? COLORS.gray[300] : undefined; 42182 return /*#__PURE__*/emotion_react_browser_esm_css("border-style:", style === 'none' ? 'solid' : style, ";border-color:", color || fallbackColor, ";" + ( true ? "" : 0), true ? "" : 0); 42183 }; 42184 const colorIndicatorWrapper = border => { 42185 const { 42186 style 42187 } = border || {}; 42188 return /*#__PURE__*/emotion_react_browser_esm_css("border-radius:9999px;border:2px solid transparent;", style ? colorIndicatorBorder(border) : undefined, " width:28px;height:28px;padding:2px;&>span{background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}" + ( true ? "" : 0), true ? "" : 0); 42189 }; 42190 const borderControlPopover = true ? { 42191 name: "1phacrs", 42192 styles: "&&>div>div{padding:0;}" 42193 } : 0; 42194 const borderControlPopoverControls = /*#__PURE__*/emotion_react_browser_esm_css("padding:", space(2), ";>div:first-of-type>", StyledLabel, "{margin-bottom:0;", styles_labelStyles, ";}&& ", StyledLabel, "+button:not( .has-text ){min-width:24px;padding:0;}" + ( true ? "" : 0), true ? "" : 0); 42195 const borderControlPopoverContent = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); 42196 const borderColorIndicator = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); 42197 const resetButton = /*#__PURE__*/emotion_react_browser_esm_css("justify-content:center;width:100%;&&{border-top:", config_values.borderWidth, " solid ", COLORS.gray[200], ";height:46px;}" + ( true ? "" : 0), true ? "" : 0); 42198 const borderWidthControl = () => /*#__PURE__*/emotion_react_browser_esm_css("&&& ", BackdropUI, "{border:none;}&&& input{", rtl({ 42199 paddingRight: 0 42200 })(), ";}" + ( true ? "" : 0), true ? "" : 0); 42201 const borderControlStylePicker = /*#__PURE__*/emotion_react_browser_esm_css(StyledLabel, "{", styles_labelStyles, ";}" + ( true ? "" : 0), true ? "" : 0); 42202 const borderStyleButton = true ? { 42203 name: "1486260", 42204 styles: "&&&&&{min-width:30px;width:30px;height:30px;padding:3px;}" 42205 } : 0; 42206 const borderSlider = () => /*#__PURE__*/emotion_react_browser_esm_css("flex:1 1 60%;", rtl({ 42207 marginRight: space(3) 42208 })(), " ", StyledField, "{margin-bottom:0;font-size:0;display:flex;}" + ( true ? "" : 0), true ? "" : 0); 42209 42210 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/hook.js 42211 /** 42212 * WordPress dependencies 42213 */ 42214 42215 /** 42216 * Internal dependencies 42217 */ 42218 42219 42220 42221 42222 function useBorderControlStylePicker(props) { 42223 const { 42224 className, 42225 ...otherProps 42226 } = useContextSystem(props, 'BorderControlStylePicker'); // Generate class names. 42227 42228 const cx = useCx(); 42229 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { 42230 return cx(borderControlStylePicker, className); 42231 }, [className, cx]); 42232 const buttonClassName = (0,external_wp_element_namespaceObject.useMemo)(() => { 42233 return cx(borderStyleButton); 42234 }, [cx]); 42235 return { ...otherProps, 42236 className: classes, 42237 buttonClassName 42238 }; 42239 } 42240 42241 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js 42242 42243 42244 42245 /** 42246 * WordPress dependencies 42247 */ 42248 42249 42250 /** 42251 * Internal dependencies 42252 */ 42253 42254 42255 42256 42257 42258 42259 42260 42261 const BORDER_STYLES = [{ 42262 label: (0,external_wp_i18n_namespaceObject.__)('Solid'), 42263 icon: line_solid, 42264 value: 'solid' 42265 }, { 42266 label: (0,external_wp_i18n_namespaceObject.__)('Dashed'), 42267 icon: line_dashed, 42268 value: 'dashed' 42269 }, { 42270 label: (0,external_wp_i18n_namespaceObject.__)('Dotted'), 42271 icon: line_dotted, 42272 value: 'dotted' 42273 }]; 42274 42275 const component_Label = props => { 42276 const { 42277 label, 42278 hideLabelFromVision 42279 } = props; 42280 42281 if (!label) { 42282 return null; 42283 } 42284 42285 return hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { 42286 as: "label" 42287 }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, null, label); 42288 }; 42289 42290 const BorderControlStylePicker = (props, forwardedRef) => { 42291 const { 42292 buttonClassName, 42293 hideLabelFromVision, 42294 label, 42295 onChange, 42296 value, 42297 ...otherProps 42298 } = useBorderControlStylePicker(props); 42299 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, otherProps, { 42300 ref: forwardedRef 42301 }), (0,external_wp_element_namespaceObject.createElement)(component_Label, { 42302 label: label, 42303 hideLabelFromVision: hideLabelFromVision 42304 }), (0,external_wp_element_namespaceObject.createElement)(flex_component, { 42305 justify: "flex-start", 42306 gap: 1 42307 }, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { 42308 key: borderStyle.value, 42309 className: buttonClassName, 42310 icon: borderStyle.icon, 42311 isSmall: true, 42312 isPressed: borderStyle.value === value, 42313 onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value), 42314 "aria-label": borderStyle.label, 42315 label: borderStyle.label, 42316 showTooltip: true 42317 })))); 42318 }; 42319 42320 const ConnectedBorderControlStylePicker = contextConnect(BorderControlStylePicker, 'BorderControlStylePicker'); 42321 /* harmony default export */ var border_control_style_picker_component = (ConnectedBorderControlStylePicker); 42322 42323 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js 42324 42325 42326 // @ts-nocheck 42327 42328 /** 42329 * External dependencies 42330 */ 42331 42332 42333 const ColorIndicator = _ref => { 42334 let { 42335 className, 42336 colorValue, 42337 ...props 42338 } = _ref; 42339 return (0,external_wp_element_namespaceObject.createElement)("span", extends_extends({ 42340 className: classnames_default()('component-color-indicator', className), 42341 style: { 42342 background: colorValue 42343 } 42344 }, props)); 42345 }; 42346 42347 /* harmony default export */ var color_indicator = (ColorIndicator); 42348 42349 ;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs 42350 var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} 42351 42352 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js 42353 42354 42355 // @ts-nocheck 42356 42357 /** 42358 * External dependencies 42359 */ 42360 42361 /** 42362 * WordPress dependencies 42363 */ 42364 42365 42366 /** 42367 * Internal dependencies 42368 */ 42369 42370 42371 42372 function useObservableState(initialState, onStateChange) { 42373 const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialState); 42374 return [state, value => { 42375 setState(value); 42376 42377 if (onStateChange) { 42378 onStateChange(value); 42379 } 42380 }]; 42381 } 42382 42383 function Dropdown(props) { 42384 var _popoverProps$anchorR; 42385 42386 const { 42387 renderContent, 42388 renderToggle, 42389 position = 'bottom right', 42390 className, 42391 contentClassName, 42392 expandOnMobile, 42393 headerTitle, 42394 focusOnMount, 42395 popoverProps, 42396 onClose, 42397 onToggle 42398 } = props; 42399 const containerRef = (0,external_wp_element_namespaceObject.useRef)(); 42400 const [isOpen, setIsOpen] = useObservableState(false, onToggle); 42401 (0,external_wp_element_namespaceObject.useEffect)(() => () => { 42402 if (onToggle) { 42403 onToggle(false); 42404 } 42405 }, []); 42406 42407 function toggle() { 42408 setIsOpen(!isOpen); 42409 } 42410 /** 42411 * Closes the popover when focus leaves it unless the toggle was pressed or 42412 * focus has moved to a separate dialog. The former is to let the toggle 42413 * handle closing the popover and the latter is to preserve presence in 42414 * case a dialog has opened, allowing focus to return when it's dismissed. 42415 */ 42416 42417 42418 function closeIfFocusOutside() { 42419 const { 42420 ownerDocument 42421 } = containerRef.current; 42422 const dialog = ownerDocument.activeElement.closest('[role="dialog"]'); 42423 42424 if (!containerRef.current.contains(ownerDocument.activeElement) && (!dialog || dialog.contains(containerRef.current))) { 42425 close(); 42426 } 42427 } 42428 42429 function close() { 42430 if (onClose) { 42431 onClose(); 42432 } 42433 42434 setIsOpen(false); 42435 } 42436 42437 const args = { 42438 isOpen, 42439 onToggle: toggle, 42440 onClose: close 42441 }; 42442 return (0,external_wp_element_namespaceObject.createElement)("div", { 42443 className: classnames_default()('components-dropdown', className), 42444 ref: containerRef // Some UAs focus the closest focusable parent when the toggle is 42445 // clicked. Making this div focusable ensures such UAs will focus 42446 // it and `closeIfFocusOutside` can tell if the toggle was clicked. 42447 , 42448 tabIndex: "-1" 42449 }, renderToggle(args), isOpen && (0,external_wp_element_namespaceObject.createElement)(popover, extends_extends({ 42450 position: position, 42451 onClose: close, 42452 onFocusOutside: closeIfFocusOutside, 42453 expandOnMobile: expandOnMobile, 42454 headerTitle: headerTitle, 42455 focusOnMount: focusOnMount 42456 }, popoverProps, { 42457 anchorRef: (_popoverProps$anchorR = popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.anchorRef) !== null && _popoverProps$anchorR !== void 0 ? _popoverProps$anchorR : containerRef.current, 42458 className: classnames_default()('components-dropdown__content', popoverProps ? popoverProps.className : undefined, contentClassName) 42459 }), renderContent(args))); 42460 } 42461 42462 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js 42463 42464 42465 /** 42466 * WordPress dependencies 42467 */ 42468 42469 const settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42470 xmlns: "http://www.w3.org/2000/svg", 42471 viewBox: "0 0 24 24" 42472 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42473 d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z" 42474 })); 42475 /* harmony default export */ var library_settings = (settings); 42476 42477 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/utils.js 42478 /** 42479 * External dependencies 42480 */ 42481 42482 /** @type {import('./types').Alignments} */ 42483 42484 const utils_ALIGNMENTS = { 42485 bottom: { 42486 align: 'flex-end', 42487 justify: 'center' 42488 }, 42489 bottomLeft: { 42490 align: 'flex-start', 42491 justify: 'flex-end' 42492 }, 42493 bottomRight: { 42494 align: 'flex-end', 42495 justify: 'flex-end' 42496 }, 42497 center: { 42498 align: 'center', 42499 justify: 'center' 42500 }, 42501 edge: { 42502 align: 'center', 42503 justify: 'space-between' 42504 }, 42505 left: { 42506 align: 'center', 42507 justify: 'flex-start' 42508 }, 42509 right: { 42510 align: 'center', 42511 justify: 'flex-end' 42512 }, 42513 stretch: { 42514 align: 'stretch' 42515 }, 42516 top: { 42517 align: 'flex-start', 42518 justify: 'center' 42519 }, 42520 topLeft: { 42521 align: 'flex-start', 42522 justify: 'flex-start' 42523 }, 42524 topRight: { 42525 align: 'flex-start', 42526 justify: 'flex-end' 42527 } 42528 }; 42529 /** @type {import('./types').Alignments} */ 42530 42531 const V_ALIGNMENTS = { 42532 bottom: { 42533 justify: 'flex-end', 42534 align: 'center' 42535 }, 42536 bottomLeft: { 42537 justify: 'flex-start', 42538 align: 'flex-end' 42539 }, 42540 bottomRight: { 42541 justify: 'flex-end', 42542 align: 'flex-end' 42543 }, 42544 center: { 42545 justify: 'center', 42546 align: 'center' 42547 }, 42548 edge: { 42549 justify: 'space-between', 42550 align: 'center' 42551 }, 42552 left: { 42553 justify: 'center', 42554 align: 'flex-start' 42555 }, 42556 right: { 42557 justify: 'center', 42558 align: 'flex-end' 42559 }, 42560 stretch: { 42561 justify: 'stretch' 42562 }, 42563 top: { 42564 justify: 'flex-start', 42565 align: 'center' 42566 }, 42567 topLeft: { 42568 justify: 'flex-start', 42569 align: 'flex-start' 42570 }, 42571 topRight: { 42572 justify: 'flex-start', 42573 align: 'flex-end' 42574 } 42575 }; 42576 /* eslint-disable jsdoc/valid-types */ 42577 42578 /** 42579 * @param {import('./types').HStackAlignment | import('react').CSSProperties[ 'alignItems' ]} alignment Where to align. 42580 * @param {import('../flex/types').FlexDirection} [direction='row'] Direction to align. 42581 * @return {import('./types').AlignmentProps} Alignment props. 42582 */ 42583 42584 /* eslint-enable jsdoc/valid-types */ 42585 42586 function getAlignmentProps(alignment) { 42587 let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'row'; 42588 42589 if ((0,external_lodash_namespaceObject.isNil)(alignment)) { 42590 return {}; 42591 } 42592 42593 const isVertical = direction === 'column'; 42594 const props = isVertical ? V_ALIGNMENTS : utils_ALIGNMENTS; 42595 const alignmentProps = alignment in props ? props[ 42596 /** @type {keyof typeof ALIGNMENTS} */ 42597 alignment] : { 42598 align: alignment 42599 }; 42600 return alignmentProps; 42601 } 42602 42603 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/get-valid-children.js 42604 /** 42605 * External dependencies 42606 */ 42607 42608 /** 42609 * WordPress dependencies 42610 */ 42611 42612 /** 42613 * Gets a collection of available children elements from a React component's children prop. 42614 * 42615 * @param children 42616 * 42617 * @return An array of available children. 42618 */ 42619 42620 function getValidChildren(children) { 42621 if (typeof children === 'string') return [children]; 42622 return external_wp_element_namespaceObject.Children.toArray(children).filter(child => (0,external_wp_element_namespaceObject.isValidElement)(child)); 42623 } 42624 42625 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/hook.js 42626 42627 42628 42629 /** 42630 * Internal dependencies 42631 */ 42632 42633 42634 42635 42636 /** 42637 * 42638 * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props 42639 */ 42640 42641 function useHStack(props) { 42642 const { 42643 alignment = 'edge', 42644 children, 42645 direction, 42646 spacing = 2, 42647 ...otherProps 42648 } = useContextSystem(props, 'HStack'); 42649 const align = getAlignmentProps(alignment, direction); 42650 const validChildren = getValidChildren(children); 42651 const clonedChildren = validChildren.map( // @ts-ignore 42652 ( 42653 /** @type {import('react').ReactElement} */ 42654 child, index) => { 42655 const _key = child.key || `hstack-$index}`; 42656 42657 const _isSpacer = hasConnectNamespace(child, ['Spacer']); 42658 42659 if (_isSpacer) { 42660 return (0,external_wp_element_namespaceObject.createElement)(flex_item_component, extends_extends({ 42661 isBlock: true, 42662 key: _key 42663 }, child.props)); 42664 } 42665 42666 return child; 42667 }); 42668 const propsForFlex = { 42669 children: clonedChildren, 42670 direction, 42671 justify: 'center', 42672 ...align, 42673 ...otherProps, 42674 gap: spacing 42675 }; 42676 const flexProps = useFlex(propsForFlex); 42677 return flexProps; 42678 } 42679 42680 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/component.js 42681 42682 42683 42684 /** 42685 * Internal dependencies 42686 */ 42687 42688 42689 42690 /** 42691 * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props 42692 * @param {import('react').ForwardedRef<any>} forwardedRef 42693 */ 42694 42695 function HStack(props, forwardedRef) { 42696 const hStackProps = useHStack(props); 42697 return (0,external_wp_element_namespaceObject.createElement)(component, extends_extends({}, hStackProps, { 42698 ref: forwardedRef 42699 })); 42700 } 42701 /** 42702 * `HStack` (Horizontal Stack) arranges child elements in a horizontal line. 42703 * 42704 * `HStack` can render anything inside. 42705 * 42706 * @example 42707 * ```jsx 42708 * import { 42709 * __experimentalHStack as HStack, 42710 * __experimentalText as Text, 42711 * } from `@wordpress/components`; 42712 * 42713 * function Example() { 42714 * return ( 42715 * <HStack> 42716 * <Text>Code</Text> 42717 * <Text>is</Text> 42718 * <Text>Poetry</Text> 42719 * </HStack> 42720 * ); 42721 * } 42722 * ``` 42723 */ 42724 42725 42726 const ConnectedHStack = contextConnect(HStack, 'HStack'); 42727 /* harmony default export */ var h_stack_component = (ConnectedHStack); 42728 42729 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js 42730 /** 42731 * WordPress dependencies 42732 */ 42733 42734 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 42735 42736 /** 42737 * Return an SVG icon. 42738 * 42739 * @param {IconProps} props icon is the SVG component to render 42740 * size is a number specifiying the icon size in pixels 42741 * Other props will be passed to wrapped SVG component 42742 * 42743 * @return {JSX.Element} Icon component 42744 */ 42745 42746 function icon_Icon(_ref) { 42747 let { 42748 icon, 42749 size = 24, 42750 ...props 42751 } = _ref; 42752 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { 42753 width: size, 42754 height: size, 42755 ...props 42756 }); 42757 } 42758 42759 /* harmony default export */ var icons_build_module_icon = (icon_Icon); 42760 42761 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js 42762 42763 42764 /** 42765 * WordPress dependencies 42766 */ 42767 42768 const chevronDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42769 viewBox: "0 0 24 24", 42770 xmlns: "http://www.w3.org/2000/svg" 42771 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42772 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" 42773 })); 42774 /* harmony default export */ var chevron_down = (chevronDown); 42775 42776 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js 42777 42778 42779 /** 42780 * External dependencies 42781 */ 42782 42783 42784 /** 42785 * Internal dependencies 42786 */ 42787 42788 42789 const select_control_styles_disabledStyles = _ref => { 42790 let { 42791 disabled 42792 } = _ref; 42793 if (!disabled) return ''; 42794 return /*#__PURE__*/emotion_react_browser_esm_css({ 42795 color: COLORS.ui.textDisabled 42796 }, true ? "" : 0, true ? "" : 0); 42797 }; 42798 42799 const select_control_styles_fontSizeStyles = _ref2 => { 42800 let { 42801 selectSize 42802 } = _ref2; 42803 const sizes = { 42804 default: '13px', 42805 small: '11px', 42806 '__unstable-large': '13px' 42807 }; 42808 const fontSize = sizes[selectSize]; 42809 const fontSizeMobile = '16px'; 42810 if (!fontSize) return ''; 42811 return /*#__PURE__*/emotion_react_browser_esm_css("font-size:", fontSizeMobile, ";@media ( min-width: 600px ){font-size:", fontSize, ";}" + ( true ? "" : 0), true ? "" : 0); 42812 }; 42813 42814 const select_control_styles_sizeStyles = _ref3 => { 42815 let { 42816 selectSize 42817 } = _ref3; 42818 const sizes = { 42819 default: { 42820 height: 30, 42821 lineHeight: 1, 42822 minHeight: 30 42823 }, 42824 small: { 42825 height: 24, 42826 lineHeight: 1, 42827 minHeight: 24 42828 }, 42829 '__unstable-large': { 42830 height: 40, 42831 lineHeight: 1, 42832 minHeight: 40 42833 } 42834 }; 42835 const style = sizes[selectSize] || sizes.default; 42836 return /*#__PURE__*/emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0); 42837 }; 42838 42839 const sizePaddings = _ref4 => { 42840 let { 42841 selectSize = 'default' 42842 } = _ref4; 42843 const sizes = { 42844 default: { 42845 paddingLeft: 8, 42846 paddingRight: 24 42847 }, 42848 small: { 42849 paddingLeft: 8, 42850 paddingRight: 24 42851 }, 42852 '__unstable-large': { 42853 paddingLeft: 16, 42854 paddingRight: 32 42855 } 42856 }; 42857 return rtl(sizes[selectSize]); 42858 }; // TODO: Resolve need to use &&& to increase specificity 42859 // https://github.com/WordPress/gutenberg/issues/18483 42860 42861 42862 const Select = emotion_styled_base_browser_esm("select", true ? { 42863 target: "e1mv6sxx1" 42864 } : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.black, ";display:block;font-family:inherit;margin:0;width:100%;", select_control_styles_disabledStyles, ";", select_control_styles_fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";}" + ( true ? "" : 0)); 42865 const DownArrowWrapper = emotion_styled_base_browser_esm("div", true ? { 42866 target: "e1mv6sxx0" 42867 } : 0)("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;", rtl({ 42868 right: 0 42869 }), " svg{display:block;}" + ( true ? "" : 0)); 42870 42871 ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/index.js 42872 42873 42874 42875 /** 42876 * External dependencies 42877 */ 42878 42879 42880 42881 /** 42882 * WordPress dependencies 42883 */ 42884 42885 42886 42887 /** 42888 * Internal dependencies 42889 */ 42890 42891 42892 42893 42894 42895 function select_control_useUniqueId(idProp) { 42896 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Se