@hexure/ui 1.13.63 → 1.13.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -139,11 +139,2563 @@ Copy.defaultProps = {
139
139
  type: 'default',
140
140
  };
141
141
 
142
+ /**
143
+ * Custom positioning reference element.
144
+ * @see https://floating-ui.com/docs/virtual-elements
145
+ */
146
+
147
+ const min = Math.min;
148
+ const max = Math.max;
149
+ const round = Math.round;
150
+ const floor = Math.floor;
151
+ const createCoords = v => ({
152
+ x: v,
153
+ y: v
154
+ });
155
+ const oppositeSideMap = {
156
+ left: 'right',
157
+ right: 'left',
158
+ bottom: 'top',
159
+ top: 'bottom'
160
+ };
161
+ const oppositeAlignmentMap = {
162
+ start: 'end',
163
+ end: 'start'
164
+ };
165
+ function clamp(start, value, end) {
166
+ return max(start, min(value, end));
167
+ }
168
+ function evaluate(value, param) {
169
+ return typeof value === 'function' ? value(param) : value;
170
+ }
171
+ function getSide(placement) {
172
+ return placement.split('-')[0];
173
+ }
174
+ function getAlignment(placement) {
175
+ return placement.split('-')[1];
176
+ }
177
+ function getOppositeAxis(axis) {
178
+ return axis === 'x' ? 'y' : 'x';
179
+ }
180
+ function getAxisLength(axis) {
181
+ return axis === 'y' ? 'height' : 'width';
182
+ }
183
+ function getSideAxis(placement) {
184
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
185
+ }
186
+ function getAlignmentAxis(placement) {
187
+ return getOppositeAxis(getSideAxis(placement));
188
+ }
189
+ function getAlignmentSides(placement, rects, rtl) {
190
+ if (rtl === void 0) {
191
+ rtl = false;
192
+ }
193
+ const alignment = getAlignment(placement);
194
+ const alignmentAxis = getAlignmentAxis(placement);
195
+ const length = getAxisLength(alignmentAxis);
196
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
197
+ if (rects.reference[length] > rects.floating[length]) {
198
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
199
+ }
200
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
201
+ }
202
+ function getExpandedPlacements(placement) {
203
+ const oppositePlacement = getOppositePlacement(placement);
204
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
205
+ }
206
+ function getOppositeAlignmentPlacement(placement) {
207
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
208
+ }
209
+ function getSideList(side, isStart, rtl) {
210
+ const lr = ['left', 'right'];
211
+ const rl = ['right', 'left'];
212
+ const tb = ['top', 'bottom'];
213
+ const bt = ['bottom', 'top'];
214
+ switch (side) {
215
+ case 'top':
216
+ case 'bottom':
217
+ if (rtl) return isStart ? rl : lr;
218
+ return isStart ? lr : rl;
219
+ case 'left':
220
+ case 'right':
221
+ return isStart ? tb : bt;
222
+ default:
223
+ return [];
224
+ }
225
+ }
226
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
227
+ const alignment = getAlignment(placement);
228
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
229
+ if (alignment) {
230
+ list = list.map(side => side + "-" + alignment);
231
+ if (flipAlignment) {
232
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
233
+ }
234
+ }
235
+ return list;
236
+ }
237
+ function getOppositePlacement(placement) {
238
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
239
+ }
240
+ function expandPaddingObject(padding) {
241
+ return {
242
+ top: 0,
243
+ right: 0,
244
+ bottom: 0,
245
+ left: 0,
246
+ ...padding
247
+ };
248
+ }
249
+ function getPaddingObject(padding) {
250
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
251
+ top: padding,
252
+ right: padding,
253
+ bottom: padding,
254
+ left: padding
255
+ };
256
+ }
257
+ function rectToClientRect(rect) {
258
+ const {
259
+ x,
260
+ y,
261
+ width,
262
+ height
263
+ } = rect;
264
+ return {
265
+ width,
266
+ height,
267
+ top: y,
268
+ left: x,
269
+ right: x + width,
270
+ bottom: y + height,
271
+ x,
272
+ y
273
+ };
274
+ }
275
+
276
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
277
+ let {
278
+ reference,
279
+ floating
280
+ } = _ref;
281
+ const sideAxis = getSideAxis(placement);
282
+ const alignmentAxis = getAlignmentAxis(placement);
283
+ const alignLength = getAxisLength(alignmentAxis);
284
+ const side = getSide(placement);
285
+ const isVertical = sideAxis === 'y';
286
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
287
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
288
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
289
+ let coords;
290
+ switch (side) {
291
+ case 'top':
292
+ coords = {
293
+ x: commonX,
294
+ y: reference.y - floating.height
295
+ };
296
+ break;
297
+ case 'bottom':
298
+ coords = {
299
+ x: commonX,
300
+ y: reference.y + reference.height
301
+ };
302
+ break;
303
+ case 'right':
304
+ coords = {
305
+ x: reference.x + reference.width,
306
+ y: commonY
307
+ };
308
+ break;
309
+ case 'left':
310
+ coords = {
311
+ x: reference.x - floating.width,
312
+ y: commonY
313
+ };
314
+ break;
315
+ default:
316
+ coords = {
317
+ x: reference.x,
318
+ y: reference.y
319
+ };
320
+ }
321
+ switch (getAlignment(placement)) {
322
+ case 'start':
323
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
324
+ break;
325
+ case 'end':
326
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
327
+ break;
328
+ }
329
+ return coords;
330
+ }
331
+
332
+ /**
333
+ * Computes the `x` and `y` coordinates that will place the floating element
334
+ * next to a given reference element.
335
+ *
336
+ * This export does not have any `platform` interface logic. You will need to
337
+ * write one for the platform you are using Floating UI with.
338
+ */
339
+ const computePosition$1 = async (reference, floating, config) => {
340
+ const {
341
+ placement = 'bottom',
342
+ strategy = 'absolute',
343
+ middleware = [],
344
+ platform
345
+ } = config;
346
+ const validMiddleware = middleware.filter(Boolean);
347
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
348
+ let rects = await platform.getElementRects({
349
+ reference,
350
+ floating,
351
+ strategy
352
+ });
353
+ let {
354
+ x,
355
+ y
356
+ } = computeCoordsFromPlacement(rects, placement, rtl);
357
+ let statefulPlacement = placement;
358
+ let middlewareData = {};
359
+ let resetCount = 0;
360
+ for (let i = 0; i < validMiddleware.length; i++) {
361
+ const {
362
+ name,
363
+ fn
364
+ } = validMiddleware[i];
365
+ const {
366
+ x: nextX,
367
+ y: nextY,
368
+ data,
369
+ reset
370
+ } = await fn({
371
+ x,
372
+ y,
373
+ initialPlacement: placement,
374
+ placement: statefulPlacement,
375
+ strategy,
376
+ middlewareData,
377
+ rects,
378
+ platform,
379
+ elements: {
380
+ reference,
381
+ floating
382
+ }
383
+ });
384
+ x = nextX != null ? nextX : x;
385
+ y = nextY != null ? nextY : y;
386
+ middlewareData = {
387
+ ...middlewareData,
388
+ [name]: {
389
+ ...middlewareData[name],
390
+ ...data
391
+ }
392
+ };
393
+ if (reset && resetCount <= 50) {
394
+ resetCount++;
395
+ if (typeof reset === 'object') {
396
+ if (reset.placement) {
397
+ statefulPlacement = reset.placement;
398
+ }
399
+ if (reset.rects) {
400
+ rects = reset.rects === true ? await platform.getElementRects({
401
+ reference,
402
+ floating,
403
+ strategy
404
+ }) : reset.rects;
405
+ }
406
+ ({
407
+ x,
408
+ y
409
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
410
+ }
411
+ i = -1;
412
+ }
413
+ }
414
+ return {
415
+ x,
416
+ y,
417
+ placement: statefulPlacement,
418
+ strategy,
419
+ middlewareData
420
+ };
421
+ };
422
+
423
+ /**
424
+ * Resolves with an object of overflow side offsets that determine how much the
425
+ * element is overflowing a given clipping boundary on each side.
426
+ * - positive = overflowing the boundary by that number of pixels
427
+ * - negative = how many pixels left before it will overflow
428
+ * - 0 = lies flush with the boundary
429
+ * @see https://floating-ui.com/docs/detectOverflow
430
+ */
431
+ async function detectOverflow(state, options) {
432
+ var _await$platform$isEle;
433
+ if (options === void 0) {
434
+ options = {};
435
+ }
436
+ const {
437
+ x,
438
+ y,
439
+ platform,
440
+ rects,
441
+ elements,
442
+ strategy
443
+ } = state;
444
+ const {
445
+ boundary = 'clippingAncestors',
446
+ rootBoundary = 'viewport',
447
+ elementContext = 'floating',
448
+ altBoundary = false,
449
+ padding = 0
450
+ } = evaluate(options, state);
451
+ const paddingObject = getPaddingObject(padding);
452
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
453
+ const element = elements[altBoundary ? altContext : elementContext];
454
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
455
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
456
+ boundary,
457
+ rootBoundary,
458
+ strategy
459
+ }));
460
+ const rect = elementContext === 'floating' ? {
461
+ x,
462
+ y,
463
+ width: rects.floating.width,
464
+ height: rects.floating.height
465
+ } : rects.reference;
466
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
467
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
468
+ x: 1,
469
+ y: 1
470
+ } : {
471
+ x: 1,
472
+ y: 1
473
+ };
474
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
475
+ elements,
476
+ rect,
477
+ offsetParent,
478
+ strategy
479
+ }) : rect);
480
+ return {
481
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
482
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
483
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
484
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
485
+ };
486
+ }
487
+
488
+ /**
489
+ * Provides data to position an inner element of the floating element so that it
490
+ * appears centered to the reference element.
491
+ * @see https://floating-ui.com/docs/arrow
492
+ */
493
+ const arrow$1 = options => ({
494
+ name: 'arrow',
495
+ options,
496
+ async fn(state) {
497
+ const {
498
+ x,
499
+ y,
500
+ placement,
501
+ rects,
502
+ platform,
503
+ elements,
504
+ middlewareData
505
+ } = state;
506
+ // Since `element` is required, we don't Partial<> the type.
507
+ const {
508
+ element,
509
+ padding = 0
510
+ } = evaluate(options, state) || {};
511
+ if (element == null) {
512
+ return {};
513
+ }
514
+ const paddingObject = getPaddingObject(padding);
515
+ const coords = {
516
+ x,
517
+ y
518
+ };
519
+ const axis = getAlignmentAxis(placement);
520
+ const length = getAxisLength(axis);
521
+ const arrowDimensions = await platform.getDimensions(element);
522
+ const isYAxis = axis === 'y';
523
+ const minProp = isYAxis ? 'top' : 'left';
524
+ const maxProp = isYAxis ? 'bottom' : 'right';
525
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
526
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
527
+ const startDiff = coords[axis] - rects.reference[axis];
528
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
529
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
530
+
531
+ // DOM platform can return `window` as the `offsetParent`.
532
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
533
+ clientSize = elements.floating[clientProp] || rects.floating[length];
534
+ }
535
+ const centerToReference = endDiff / 2 - startDiff / 2;
536
+
537
+ // If the padding is large enough that it causes the arrow to no longer be
538
+ // centered, modify the padding so that it is centered.
539
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
540
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
541
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
542
+
543
+ // Make sure the arrow doesn't overflow the floating element if the center
544
+ // point is outside the floating element's bounds.
545
+ const min$1 = minPadding;
546
+ const max = clientSize - arrowDimensions[length] - maxPadding;
547
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
548
+ const offset = clamp(min$1, center, max);
549
+
550
+ // If the reference is small enough that the arrow's padding causes it to
551
+ // to point to nothing for an aligned placement, adjust the offset of the
552
+ // floating element itself. To ensure `shift()` continues to take action,
553
+ // a single reset is performed when this is true.
554
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
555
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
556
+ return {
557
+ [axis]: coords[axis] + alignmentOffset,
558
+ data: {
559
+ [axis]: offset,
560
+ centerOffset: center - offset - alignmentOffset,
561
+ ...(shouldAddOffset && {
562
+ alignmentOffset
563
+ })
564
+ },
565
+ reset: shouldAddOffset
566
+ };
567
+ }
568
+ });
569
+
570
+ /**
571
+ * Optimizes the visibility of the floating element by flipping the `placement`
572
+ * in order to keep it in view when the preferred placement(s) will overflow the
573
+ * clipping boundary. Alternative to `autoPlacement`.
574
+ * @see https://floating-ui.com/docs/flip
575
+ */
576
+ const flip$1 = function (options) {
577
+ if (options === void 0) {
578
+ options = {};
579
+ }
580
+ return {
581
+ name: 'flip',
582
+ options,
583
+ async fn(state) {
584
+ var _middlewareData$arrow, _middlewareData$flip;
585
+ const {
586
+ placement,
587
+ middlewareData,
588
+ rects,
589
+ initialPlacement,
590
+ platform,
591
+ elements
592
+ } = state;
593
+ const {
594
+ mainAxis: checkMainAxis = true,
595
+ crossAxis: checkCrossAxis = true,
596
+ fallbackPlacements: specifiedFallbackPlacements,
597
+ fallbackStrategy = 'bestFit',
598
+ fallbackAxisSideDirection = 'none',
599
+ flipAlignment = true,
600
+ ...detectOverflowOptions
601
+ } = evaluate(options, state);
602
+
603
+ // If a reset by the arrow was caused due to an alignment offset being
604
+ // added, we should skip any logic now since `flip()` has already done its
605
+ // work.
606
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
607
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
608
+ return {};
609
+ }
610
+ const side = getSide(placement);
611
+ const initialSideAxis = getSideAxis(initialPlacement);
612
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
613
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
614
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
615
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
616
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
617
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
618
+ }
619
+ const placements = [initialPlacement, ...fallbackPlacements];
620
+ const overflow = await detectOverflow(state, detectOverflowOptions);
621
+ const overflows = [];
622
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
623
+ if (checkMainAxis) {
624
+ overflows.push(overflow[side]);
625
+ }
626
+ if (checkCrossAxis) {
627
+ const sides = getAlignmentSides(placement, rects, rtl);
628
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
629
+ }
630
+ overflowsData = [...overflowsData, {
631
+ placement,
632
+ overflows
633
+ }];
634
+
635
+ // One or more sides is overflowing.
636
+ if (!overflows.every(side => side <= 0)) {
637
+ var _middlewareData$flip2, _overflowsData$filter;
638
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
639
+ const nextPlacement = placements[nextIndex];
640
+ if (nextPlacement) {
641
+ // Try next placement and re-run the lifecycle.
642
+ return {
643
+ data: {
644
+ index: nextIndex,
645
+ overflows: overflowsData
646
+ },
647
+ reset: {
648
+ placement: nextPlacement
649
+ }
650
+ };
651
+ }
652
+
653
+ // First, find the candidates that fit on the mainAxis side of overflow,
654
+ // then find the placement that fits the best on the main crossAxis side.
655
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
656
+
657
+ // Otherwise fallback.
658
+ if (!resetPlacement) {
659
+ switch (fallbackStrategy) {
660
+ case 'bestFit':
661
+ {
662
+ var _overflowsData$filter2;
663
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
664
+ if (hasFallbackAxisSideDirection) {
665
+ const currentSideAxis = getSideAxis(d.placement);
666
+ return currentSideAxis === initialSideAxis ||
667
+ // Create a bias to the `y` side axis due to horizontal
668
+ // reading directions favoring greater width.
669
+ currentSideAxis === 'y';
670
+ }
671
+ return true;
672
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
673
+ if (placement) {
674
+ resetPlacement = placement;
675
+ }
676
+ break;
677
+ }
678
+ case 'initialPlacement':
679
+ resetPlacement = initialPlacement;
680
+ break;
681
+ }
682
+ }
683
+ if (placement !== resetPlacement) {
684
+ return {
685
+ reset: {
686
+ placement: resetPlacement
687
+ }
688
+ };
689
+ }
690
+ }
691
+ return {};
692
+ }
693
+ };
694
+ };
695
+
696
+ // For type backwards-compatibility, the `OffsetOptions` type was also
697
+ // Derivable.
698
+
699
+ async function convertValueToCoords(state, options) {
700
+ const {
701
+ placement,
702
+ platform,
703
+ elements
704
+ } = state;
705
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
706
+ const side = getSide(placement);
707
+ const alignment = getAlignment(placement);
708
+ const isVertical = getSideAxis(placement) === 'y';
709
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
710
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
711
+ const rawValue = evaluate(options, state);
712
+
713
+ // eslint-disable-next-line prefer-const
714
+ let {
715
+ mainAxis,
716
+ crossAxis,
717
+ alignmentAxis
718
+ } = typeof rawValue === 'number' ? {
719
+ mainAxis: rawValue,
720
+ crossAxis: 0,
721
+ alignmentAxis: null
722
+ } : {
723
+ mainAxis: rawValue.mainAxis || 0,
724
+ crossAxis: rawValue.crossAxis || 0,
725
+ alignmentAxis: rawValue.alignmentAxis
726
+ };
727
+ if (alignment && typeof alignmentAxis === 'number') {
728
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
729
+ }
730
+ return isVertical ? {
731
+ x: crossAxis * crossAxisMulti,
732
+ y: mainAxis * mainAxisMulti
733
+ } : {
734
+ x: mainAxis * mainAxisMulti,
735
+ y: crossAxis * crossAxisMulti
736
+ };
737
+ }
738
+
739
+ /**
740
+ * Modifies the placement by translating the floating element along the
741
+ * specified axes.
742
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
743
+ * object may be passed.
744
+ * @see https://floating-ui.com/docs/offset
745
+ */
746
+ const offset$1 = function (options) {
747
+ if (options === void 0) {
748
+ options = 0;
749
+ }
750
+ return {
751
+ name: 'offset',
752
+ options,
753
+ async fn(state) {
754
+ var _middlewareData$offse, _middlewareData$arrow;
755
+ const {
756
+ x,
757
+ y,
758
+ placement,
759
+ middlewareData
760
+ } = state;
761
+ const diffCoords = await convertValueToCoords(state, options);
762
+
763
+ // If the placement is the same and the arrow caused an alignment offset
764
+ // then we don't need to change the positioning coordinates.
765
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
766
+ return {};
767
+ }
768
+ return {
769
+ x: x + diffCoords.x,
770
+ y: y + diffCoords.y,
771
+ data: {
772
+ ...diffCoords,
773
+ placement
774
+ }
775
+ };
776
+ }
777
+ };
778
+ };
779
+
780
+ /**
781
+ * Optimizes the visibility of the floating element by shifting it in order to
782
+ * keep it in view when it will overflow the clipping boundary.
783
+ * @see https://floating-ui.com/docs/shift
784
+ */
785
+ const shift$1 = function (options) {
786
+ if (options === void 0) {
787
+ options = {};
788
+ }
789
+ return {
790
+ name: 'shift',
791
+ options,
792
+ async fn(state) {
793
+ const {
794
+ x,
795
+ y,
796
+ placement
797
+ } = state;
798
+ const {
799
+ mainAxis: checkMainAxis = true,
800
+ crossAxis: checkCrossAxis = false,
801
+ limiter = {
802
+ fn: _ref => {
803
+ let {
804
+ x,
805
+ y
806
+ } = _ref;
807
+ return {
808
+ x,
809
+ y
810
+ };
811
+ }
812
+ },
813
+ ...detectOverflowOptions
814
+ } = evaluate(options, state);
815
+ const coords = {
816
+ x,
817
+ y
818
+ };
819
+ const overflow = await detectOverflow(state, detectOverflowOptions);
820
+ const crossAxis = getSideAxis(getSide(placement));
821
+ const mainAxis = getOppositeAxis(crossAxis);
822
+ let mainAxisCoord = coords[mainAxis];
823
+ let crossAxisCoord = coords[crossAxis];
824
+ if (checkMainAxis) {
825
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
826
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
827
+ const min = mainAxisCoord + overflow[minSide];
828
+ const max = mainAxisCoord - overflow[maxSide];
829
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
830
+ }
831
+ if (checkCrossAxis) {
832
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
833
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
834
+ const min = crossAxisCoord + overflow[minSide];
835
+ const max = crossAxisCoord - overflow[maxSide];
836
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
837
+ }
838
+ const limitedCoords = limiter.fn({
839
+ ...state,
840
+ [mainAxis]: mainAxisCoord,
841
+ [crossAxis]: crossAxisCoord
842
+ });
843
+ return {
844
+ ...limitedCoords,
845
+ data: {
846
+ x: limitedCoords.x - x,
847
+ y: limitedCoords.y - y,
848
+ enabled: {
849
+ [mainAxis]: checkMainAxis,
850
+ [crossAxis]: checkCrossAxis
851
+ }
852
+ }
853
+ };
854
+ }
855
+ };
856
+ };
857
+
858
+ function hasWindow() {
859
+ return typeof window !== 'undefined';
860
+ }
861
+ function getNodeName(node) {
862
+ if (isNode(node)) {
863
+ return (node.nodeName || '').toLowerCase();
864
+ }
865
+ // Mocked nodes in testing environments may not be instances of Node. By
866
+ // returning `#document` an infinite loop won't occur.
867
+ // https://github.com/floating-ui/floating-ui/issues/2317
868
+ return '#document';
869
+ }
870
+ function getWindow(node) {
871
+ var _node$ownerDocument;
872
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
873
+ }
874
+ function getDocumentElement(node) {
875
+ var _ref;
876
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
877
+ }
878
+ function isNode(value) {
879
+ if (!hasWindow()) {
880
+ return false;
881
+ }
882
+ return value instanceof Node || value instanceof getWindow(value).Node;
883
+ }
884
+ function isElement(value) {
885
+ if (!hasWindow()) {
886
+ return false;
887
+ }
888
+ return value instanceof Element || value instanceof getWindow(value).Element;
889
+ }
890
+ function isHTMLElement(value) {
891
+ if (!hasWindow()) {
892
+ return false;
893
+ }
894
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
895
+ }
896
+ function isShadowRoot(value) {
897
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
898
+ return false;
899
+ }
900
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
901
+ }
902
+ function isOverflowElement(element) {
903
+ const {
904
+ overflow,
905
+ overflowX,
906
+ overflowY,
907
+ display
908
+ } = getComputedStyle$1(element);
909
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
910
+ }
911
+ function isTableElement(element) {
912
+ return ['table', 'td', 'th'].includes(getNodeName(element));
913
+ }
914
+ function isTopLayer(element) {
915
+ return [':popover-open', ':modal'].some(selector => {
916
+ try {
917
+ return element.matches(selector);
918
+ } catch (e) {
919
+ return false;
920
+ }
921
+ });
922
+ }
923
+ function isContainingBlock(elementOrCss) {
924
+ const webkit = isWebKit();
925
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
926
+
927
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
928
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
929
+ return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
930
+ }
931
+ function getContainingBlock(element) {
932
+ let currentNode = getParentNode(element);
933
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
934
+ if (isContainingBlock(currentNode)) {
935
+ return currentNode;
936
+ } else if (isTopLayer(currentNode)) {
937
+ return null;
938
+ }
939
+ currentNode = getParentNode(currentNode);
940
+ }
941
+ return null;
942
+ }
943
+ function isWebKit() {
944
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
945
+ return CSS.supports('-webkit-backdrop-filter', 'none');
946
+ }
947
+ function isLastTraversableNode(node) {
948
+ return ['html', 'body', '#document'].includes(getNodeName(node));
949
+ }
950
+ function getComputedStyle$1(element) {
951
+ return getWindow(element).getComputedStyle(element);
952
+ }
953
+ function getNodeScroll(element) {
954
+ if (isElement(element)) {
955
+ return {
956
+ scrollLeft: element.scrollLeft,
957
+ scrollTop: element.scrollTop
958
+ };
959
+ }
960
+ return {
961
+ scrollLeft: element.scrollX,
962
+ scrollTop: element.scrollY
963
+ };
964
+ }
965
+ function getParentNode(node) {
966
+ if (getNodeName(node) === 'html') {
967
+ return node;
968
+ }
969
+ const result =
970
+ // Step into the shadow DOM of the parent of a slotted node.
971
+ node.assignedSlot ||
972
+ // DOM Element detected.
973
+ node.parentNode ||
974
+ // ShadowRoot detected.
975
+ isShadowRoot(node) && node.host ||
976
+ // Fallback.
977
+ getDocumentElement(node);
978
+ return isShadowRoot(result) ? result.host : result;
979
+ }
980
+ function getNearestOverflowAncestor(node) {
981
+ const parentNode = getParentNode(node);
982
+ if (isLastTraversableNode(parentNode)) {
983
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
984
+ }
985
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
986
+ return parentNode;
987
+ }
988
+ return getNearestOverflowAncestor(parentNode);
989
+ }
990
+ function getOverflowAncestors(node, list, traverseIframes) {
991
+ var _node$ownerDocument2;
992
+ if (list === void 0) {
993
+ list = [];
994
+ }
995
+ if (traverseIframes === void 0) {
996
+ traverseIframes = true;
997
+ }
998
+ const scrollableAncestor = getNearestOverflowAncestor(node);
999
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1000
+ const win = getWindow(scrollableAncestor);
1001
+ if (isBody) {
1002
+ const frameElement = getFrameElement(win);
1003
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1004
+ }
1005
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1006
+ }
1007
+ function getFrameElement(win) {
1008
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1009
+ }
1010
+
1011
+ function getCssDimensions(element) {
1012
+ const css = getComputedStyle$1(element);
1013
+ // In testing environments, the `width` and `height` properties are empty
1014
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
1015
+ let width = parseFloat(css.width) || 0;
1016
+ let height = parseFloat(css.height) || 0;
1017
+ const hasOffset = isHTMLElement(element);
1018
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1019
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1020
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1021
+ if (shouldFallback) {
1022
+ width = offsetWidth;
1023
+ height = offsetHeight;
1024
+ }
1025
+ return {
1026
+ width,
1027
+ height,
1028
+ $: shouldFallback
1029
+ };
1030
+ }
1031
+ function unwrapElement(element) {
1032
+ return !isElement(element) ? element.contextElement : element;
1033
+ }
1034
+ function getScale(element) {
1035
+ const domElement = unwrapElement(element);
1036
+ if (!isHTMLElement(domElement)) {
1037
+ return createCoords(1);
1038
+ }
1039
+ const rect = domElement.getBoundingClientRect();
1040
+ const {
1041
+ width,
1042
+ height,
1043
+ $
1044
+ } = getCssDimensions(domElement);
1045
+ let x = ($ ? round(rect.width) : rect.width) / width;
1046
+ let y = ($ ? round(rect.height) : rect.height) / height;
1047
+
1048
+ // 0, NaN, or Infinity should always fallback to 1.
1049
+
1050
+ if (!x || !Number.isFinite(x)) {
1051
+ x = 1;
1052
+ }
1053
+ if (!y || !Number.isFinite(y)) {
1054
+ y = 1;
1055
+ }
1056
+ return {
1057
+ x,
1058
+ y
1059
+ };
1060
+ }
1061
+ const noOffsets = /*#__PURE__*/createCoords(0);
1062
+ function getVisualOffsets(element) {
1063
+ const win = getWindow(element);
1064
+ if (!isWebKit() || !win.visualViewport) {
1065
+ return noOffsets;
1066
+ }
1067
+ return {
1068
+ x: win.visualViewport.offsetLeft,
1069
+ y: win.visualViewport.offsetTop
1070
+ };
1071
+ }
1072
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1073
+ if (isFixed === void 0) {
1074
+ isFixed = false;
1075
+ }
1076
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1077
+ return false;
1078
+ }
1079
+ return isFixed;
1080
+ }
1081
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1082
+ if (includeScale === void 0) {
1083
+ includeScale = false;
1084
+ }
1085
+ if (isFixedStrategy === void 0) {
1086
+ isFixedStrategy = false;
1087
+ }
1088
+ const clientRect = element.getBoundingClientRect();
1089
+ const domElement = unwrapElement(element);
1090
+ let scale = createCoords(1);
1091
+ if (includeScale) {
1092
+ if (offsetParent) {
1093
+ if (isElement(offsetParent)) {
1094
+ scale = getScale(offsetParent);
1095
+ }
1096
+ } else {
1097
+ scale = getScale(element);
1098
+ }
1099
+ }
1100
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1101
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1102
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1103
+ let width = clientRect.width / scale.x;
1104
+ let height = clientRect.height / scale.y;
1105
+ if (domElement) {
1106
+ const win = getWindow(domElement);
1107
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1108
+ let currentWin = win;
1109
+ let currentIFrame = getFrameElement(currentWin);
1110
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1111
+ const iframeScale = getScale(currentIFrame);
1112
+ const iframeRect = currentIFrame.getBoundingClientRect();
1113
+ const css = getComputedStyle$1(currentIFrame);
1114
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1115
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1116
+ x *= iframeScale.x;
1117
+ y *= iframeScale.y;
1118
+ width *= iframeScale.x;
1119
+ height *= iframeScale.y;
1120
+ x += left;
1121
+ y += top;
1122
+ currentWin = getWindow(currentIFrame);
1123
+ currentIFrame = getFrameElement(currentWin);
1124
+ }
1125
+ }
1126
+ return rectToClientRect({
1127
+ width,
1128
+ height,
1129
+ x,
1130
+ y
1131
+ });
1132
+ }
1133
+
1134
+ // If <html> has a CSS width greater than the viewport, then this will be
1135
+ // incorrect for RTL.
1136
+ function getWindowScrollBarX(element, rect) {
1137
+ const leftScroll = getNodeScroll(element).scrollLeft;
1138
+ if (!rect) {
1139
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1140
+ }
1141
+ return rect.left + leftScroll;
1142
+ }
1143
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1144
+ if (ignoreScrollbarX === void 0) {
1145
+ ignoreScrollbarX = false;
1146
+ }
1147
+ const htmlRect = documentElement.getBoundingClientRect();
1148
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1149
+ // RTL <body> scrollbar.
1150
+ getWindowScrollBarX(documentElement, htmlRect));
1151
+ const y = htmlRect.top + scroll.scrollTop;
1152
+ return {
1153
+ x,
1154
+ y
1155
+ };
1156
+ }
1157
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1158
+ let {
1159
+ elements,
1160
+ rect,
1161
+ offsetParent,
1162
+ strategy
1163
+ } = _ref;
1164
+ const isFixed = strategy === 'fixed';
1165
+ const documentElement = getDocumentElement(offsetParent);
1166
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
1167
+ if (offsetParent === documentElement || topLayer && isFixed) {
1168
+ return rect;
1169
+ }
1170
+ let scroll = {
1171
+ scrollLeft: 0,
1172
+ scrollTop: 0
1173
+ };
1174
+ let scale = createCoords(1);
1175
+ const offsets = createCoords(0);
1176
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1177
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1178
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1179
+ scroll = getNodeScroll(offsetParent);
1180
+ }
1181
+ if (isHTMLElement(offsetParent)) {
1182
+ const offsetRect = getBoundingClientRect(offsetParent);
1183
+ scale = getScale(offsetParent);
1184
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1185
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1186
+ }
1187
+ }
1188
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1189
+ return {
1190
+ width: rect.width * scale.x,
1191
+ height: rect.height * scale.y,
1192
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1193
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1194
+ };
1195
+ }
1196
+ function getClientRects(element) {
1197
+ return Array.from(element.getClientRects());
1198
+ }
1199
+
1200
+ // Gets the entire size of the scrollable document area, even extending outside
1201
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1202
+ function getDocumentRect(element) {
1203
+ const html = getDocumentElement(element);
1204
+ const scroll = getNodeScroll(element);
1205
+ const body = element.ownerDocument.body;
1206
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1207
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1208
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1209
+ const y = -scroll.scrollTop;
1210
+ if (getComputedStyle$1(body).direction === 'rtl') {
1211
+ x += max(html.clientWidth, body.clientWidth) - width;
1212
+ }
1213
+ return {
1214
+ width,
1215
+ height,
1216
+ x,
1217
+ y
1218
+ };
1219
+ }
1220
+ function getViewportRect(element, strategy) {
1221
+ const win = getWindow(element);
1222
+ const html = getDocumentElement(element);
1223
+ const visualViewport = win.visualViewport;
1224
+ let width = html.clientWidth;
1225
+ let height = html.clientHeight;
1226
+ let x = 0;
1227
+ let y = 0;
1228
+ if (visualViewport) {
1229
+ width = visualViewport.width;
1230
+ height = visualViewport.height;
1231
+ const visualViewportBased = isWebKit();
1232
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1233
+ x = visualViewport.offsetLeft;
1234
+ y = visualViewport.offsetTop;
1235
+ }
1236
+ }
1237
+ return {
1238
+ width,
1239
+ height,
1240
+ x,
1241
+ y
1242
+ };
1243
+ }
1244
+
1245
+ // Returns the inner client rect, subtracting scrollbars if present.
1246
+ function getInnerBoundingClientRect(element, strategy) {
1247
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1248
+ const top = clientRect.top + element.clientTop;
1249
+ const left = clientRect.left + element.clientLeft;
1250
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1251
+ const width = element.clientWidth * scale.x;
1252
+ const height = element.clientHeight * scale.y;
1253
+ const x = left * scale.x;
1254
+ const y = top * scale.y;
1255
+ return {
1256
+ width,
1257
+ height,
1258
+ x,
1259
+ y
1260
+ };
1261
+ }
1262
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1263
+ let rect;
1264
+ if (clippingAncestor === 'viewport') {
1265
+ rect = getViewportRect(element, strategy);
1266
+ } else if (clippingAncestor === 'document') {
1267
+ rect = getDocumentRect(getDocumentElement(element));
1268
+ } else if (isElement(clippingAncestor)) {
1269
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1270
+ } else {
1271
+ const visualOffsets = getVisualOffsets(element);
1272
+ rect = {
1273
+ x: clippingAncestor.x - visualOffsets.x,
1274
+ y: clippingAncestor.y - visualOffsets.y,
1275
+ width: clippingAncestor.width,
1276
+ height: clippingAncestor.height
1277
+ };
1278
+ }
1279
+ return rectToClientRect(rect);
1280
+ }
1281
+ function hasFixedPositionAncestor(element, stopNode) {
1282
+ const parentNode = getParentNode(element);
1283
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1284
+ return false;
1285
+ }
1286
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1287
+ }
1288
+
1289
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1290
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1291
+ // of the given element up the tree.
1292
+ function getClippingElementAncestors(element, cache) {
1293
+ const cachedResult = cache.get(element);
1294
+ if (cachedResult) {
1295
+ return cachedResult;
1296
+ }
1297
+ let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1298
+ let currentContainingBlockComputedStyle = null;
1299
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1300
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1301
+
1302
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1303
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1304
+ const computedStyle = getComputedStyle$1(currentNode);
1305
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1306
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1307
+ currentContainingBlockComputedStyle = null;
1308
+ }
1309
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1310
+ if (shouldDropCurrentNode) {
1311
+ // Drop non-containing blocks.
1312
+ result = result.filter(ancestor => ancestor !== currentNode);
1313
+ } else {
1314
+ // Record last containing block for next iteration.
1315
+ currentContainingBlockComputedStyle = computedStyle;
1316
+ }
1317
+ currentNode = getParentNode(currentNode);
1318
+ }
1319
+ cache.set(element, result);
1320
+ return result;
1321
+ }
1322
+
1323
+ // Gets the maximum area that the element is visible in due to any number of
1324
+ // clipping ancestors.
1325
+ function getClippingRect(_ref) {
1326
+ let {
1327
+ element,
1328
+ boundary,
1329
+ rootBoundary,
1330
+ strategy
1331
+ } = _ref;
1332
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1333
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1334
+ const firstClippingAncestor = clippingAncestors[0];
1335
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1336
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1337
+ accRect.top = max(rect.top, accRect.top);
1338
+ accRect.right = min(rect.right, accRect.right);
1339
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1340
+ accRect.left = max(rect.left, accRect.left);
1341
+ return accRect;
1342
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1343
+ return {
1344
+ width: clippingRect.right - clippingRect.left,
1345
+ height: clippingRect.bottom - clippingRect.top,
1346
+ x: clippingRect.left,
1347
+ y: clippingRect.top
1348
+ };
1349
+ }
1350
+ function getDimensions(element) {
1351
+ const {
1352
+ width,
1353
+ height
1354
+ } = getCssDimensions(element);
1355
+ return {
1356
+ width,
1357
+ height
1358
+ };
1359
+ }
1360
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1361
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1362
+ const documentElement = getDocumentElement(offsetParent);
1363
+ const isFixed = strategy === 'fixed';
1364
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1365
+ let scroll = {
1366
+ scrollLeft: 0,
1367
+ scrollTop: 0
1368
+ };
1369
+ const offsets = createCoords(0);
1370
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1371
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1372
+ scroll = getNodeScroll(offsetParent);
1373
+ }
1374
+ if (isOffsetParentAnElement) {
1375
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1376
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1377
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1378
+ } else if (documentElement) {
1379
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1380
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1381
+ offsets.x = getWindowScrollBarX(documentElement);
1382
+ }
1383
+ }
1384
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1385
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1386
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1387
+ return {
1388
+ x,
1389
+ y,
1390
+ width: rect.width,
1391
+ height: rect.height
1392
+ };
1393
+ }
1394
+ function isStaticPositioned(element) {
1395
+ return getComputedStyle$1(element).position === 'static';
1396
+ }
1397
+ function getTrueOffsetParent(element, polyfill) {
1398
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1399
+ return null;
1400
+ }
1401
+ if (polyfill) {
1402
+ return polyfill(element);
1403
+ }
1404
+ let rawOffsetParent = element.offsetParent;
1405
+
1406
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
1407
+ // while Chrome and Safari return the <body> element. The <body> element must
1408
+ // be used to perform the correct calculations even if the <html> element is
1409
+ // non-static.
1410
+ if (getDocumentElement(element) === rawOffsetParent) {
1411
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
1412
+ }
1413
+ return rawOffsetParent;
1414
+ }
1415
+
1416
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1417
+ // such as table ancestors and cross browser bugs.
1418
+ function getOffsetParent(element, polyfill) {
1419
+ const win = getWindow(element);
1420
+ if (isTopLayer(element)) {
1421
+ return win;
1422
+ }
1423
+ if (!isHTMLElement(element)) {
1424
+ let svgOffsetParent = getParentNode(element);
1425
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1426
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1427
+ return svgOffsetParent;
1428
+ }
1429
+ svgOffsetParent = getParentNode(svgOffsetParent);
1430
+ }
1431
+ return win;
1432
+ }
1433
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1434
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1435
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1436
+ }
1437
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1438
+ return win;
1439
+ }
1440
+ return offsetParent || getContainingBlock(element) || win;
1441
+ }
1442
+ const getElementRects = async function (data) {
1443
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1444
+ const getDimensionsFn = this.getDimensions;
1445
+ const floatingDimensions = await getDimensionsFn(data.floating);
1446
+ return {
1447
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1448
+ floating: {
1449
+ x: 0,
1450
+ y: 0,
1451
+ width: floatingDimensions.width,
1452
+ height: floatingDimensions.height
1453
+ }
1454
+ };
1455
+ };
1456
+ function isRTL(element) {
1457
+ return getComputedStyle$1(element).direction === 'rtl';
1458
+ }
1459
+ const platform = {
1460
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1461
+ getDocumentElement,
1462
+ getClippingRect,
1463
+ getOffsetParent,
1464
+ getElementRects,
1465
+ getClientRects,
1466
+ getDimensions,
1467
+ getScale,
1468
+ isElement,
1469
+ isRTL
1470
+ };
1471
+ function rectsAreEqual(a, b) {
1472
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1473
+ }
1474
+
1475
+ // https://samthor.au/2021/observing-dom/
1476
+ function observeMove(element, onMove) {
1477
+ let io = null;
1478
+ let timeoutId;
1479
+ const root = getDocumentElement(element);
1480
+ function cleanup() {
1481
+ var _io;
1482
+ clearTimeout(timeoutId);
1483
+ (_io = io) == null || _io.disconnect();
1484
+ io = null;
1485
+ }
1486
+ function refresh(skip, threshold) {
1487
+ if (skip === void 0) {
1488
+ skip = false;
1489
+ }
1490
+ if (threshold === void 0) {
1491
+ threshold = 1;
1492
+ }
1493
+ cleanup();
1494
+ const elementRectForRootMargin = element.getBoundingClientRect();
1495
+ const {
1496
+ left,
1497
+ top,
1498
+ width,
1499
+ height
1500
+ } = elementRectForRootMargin;
1501
+ if (!skip) {
1502
+ onMove();
1503
+ }
1504
+ if (!width || !height) {
1505
+ return;
1506
+ }
1507
+ const insetTop = floor(top);
1508
+ const insetRight = floor(root.clientWidth - (left + width));
1509
+ const insetBottom = floor(root.clientHeight - (top + height));
1510
+ const insetLeft = floor(left);
1511
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1512
+ const options = {
1513
+ rootMargin,
1514
+ threshold: max(0, min(1, threshold)) || 1
1515
+ };
1516
+ let isFirstUpdate = true;
1517
+ function handleObserve(entries) {
1518
+ const ratio = entries[0].intersectionRatio;
1519
+ if (ratio !== threshold) {
1520
+ if (!isFirstUpdate) {
1521
+ return refresh();
1522
+ }
1523
+ if (!ratio) {
1524
+ // If the reference is clipped, the ratio is 0. Throttle the refresh
1525
+ // to prevent an infinite loop of updates.
1526
+ timeoutId = setTimeout(() => {
1527
+ refresh(false, 1e-7);
1528
+ }, 1000);
1529
+ } else {
1530
+ refresh(false, ratio);
1531
+ }
1532
+ }
1533
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1534
+ // It's possible that even though the ratio is reported as 1, the
1535
+ // element is not actually fully within the IntersectionObserver's root
1536
+ // area anymore. This can happen under performance constraints. This may
1537
+ // be a bug in the browser's IntersectionObserver implementation. To
1538
+ // work around this, we compare the element's bounding rect now with
1539
+ // what it was at the time we created the IntersectionObserver. If they
1540
+ // are not equal then the element moved, so we refresh.
1541
+ refresh();
1542
+ }
1543
+ isFirstUpdate = false;
1544
+ }
1545
+
1546
+ // Older browsers don't support a `document` as the root and will throw an
1547
+ // error.
1548
+ try {
1549
+ io = new IntersectionObserver(handleObserve, {
1550
+ ...options,
1551
+ // Handle <iframe>s
1552
+ root: root.ownerDocument
1553
+ });
1554
+ } catch (e) {
1555
+ io = new IntersectionObserver(handleObserve, options);
1556
+ }
1557
+ io.observe(element);
1558
+ }
1559
+ refresh(true);
1560
+ return cleanup;
1561
+ }
1562
+
1563
+ /**
1564
+ * Automatically updates the position of the floating element when necessary.
1565
+ * Should only be called when the floating element is mounted on the DOM or
1566
+ * visible on the screen.
1567
+ * @returns cleanup function that should be invoked when the floating element is
1568
+ * removed from the DOM or hidden from the screen.
1569
+ * @see https://floating-ui.com/docs/autoUpdate
1570
+ */
1571
+ function autoUpdate(reference, floating, update, options) {
1572
+ if (options === void 0) {
1573
+ options = {};
1574
+ }
1575
+ const {
1576
+ ancestorScroll = true,
1577
+ ancestorResize = true,
1578
+ elementResize = typeof ResizeObserver === 'function',
1579
+ layoutShift = typeof IntersectionObserver === 'function',
1580
+ animationFrame = false
1581
+ } = options;
1582
+ const referenceEl = unwrapElement(reference);
1583
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
1584
+ ancestors.forEach(ancestor => {
1585
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
1586
+ passive: true
1587
+ });
1588
+ ancestorResize && ancestor.addEventListener('resize', update);
1589
+ });
1590
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1591
+ let reobserveFrame = -1;
1592
+ let resizeObserver = null;
1593
+ if (elementResize) {
1594
+ resizeObserver = new ResizeObserver(_ref => {
1595
+ let [firstEntry] = _ref;
1596
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1597
+ // Prevent update loops when using the `size` middleware.
1598
+ // https://github.com/floating-ui/floating-ui/issues/1740
1599
+ resizeObserver.unobserve(floating);
1600
+ cancelAnimationFrame(reobserveFrame);
1601
+ reobserveFrame = requestAnimationFrame(() => {
1602
+ var _resizeObserver;
1603
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1604
+ });
1605
+ }
1606
+ update();
1607
+ });
1608
+ if (referenceEl && !animationFrame) {
1609
+ resizeObserver.observe(referenceEl);
1610
+ }
1611
+ resizeObserver.observe(floating);
1612
+ }
1613
+ let frameId;
1614
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1615
+ if (animationFrame) {
1616
+ frameLoop();
1617
+ }
1618
+ function frameLoop() {
1619
+ const nextRefRect = getBoundingClientRect(reference);
1620
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1621
+ update();
1622
+ }
1623
+ prevRefRect = nextRefRect;
1624
+ frameId = requestAnimationFrame(frameLoop);
1625
+ }
1626
+ update();
1627
+ return () => {
1628
+ var _resizeObserver2;
1629
+ ancestors.forEach(ancestor => {
1630
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
1631
+ ancestorResize && ancestor.removeEventListener('resize', update);
1632
+ });
1633
+ cleanupIo == null || cleanupIo();
1634
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1635
+ resizeObserver = null;
1636
+ if (animationFrame) {
1637
+ cancelAnimationFrame(frameId);
1638
+ }
1639
+ };
1640
+ }
1641
+
1642
+ /**
1643
+ * Modifies the placement by translating the floating element along the
1644
+ * specified axes.
1645
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
1646
+ * object may be passed.
1647
+ * @see https://floating-ui.com/docs/offset
1648
+ */
1649
+ const offset = offset$1;
1650
+
1651
+ /**
1652
+ * Optimizes the visibility of the floating element by shifting it in order to
1653
+ * keep it in view when it will overflow the clipping boundary.
1654
+ * @see https://floating-ui.com/docs/shift
1655
+ */
1656
+ const shift = shift$1;
1657
+
1658
+ /**
1659
+ * Optimizes the visibility of the floating element by flipping the `placement`
1660
+ * in order to keep it in view when the preferred placement(s) will overflow the
1661
+ * clipping boundary. Alternative to `autoPlacement`.
1662
+ * @see https://floating-ui.com/docs/flip
1663
+ */
1664
+ const flip = flip$1;
1665
+
1666
+ /**
1667
+ * Provides data to position an inner element of the floating element so that it
1668
+ * appears centered to the reference element.
1669
+ * @see https://floating-ui.com/docs/arrow
1670
+ */
1671
+ const arrow = arrow$1;
1672
+
1673
+ /**
1674
+ * Computes the `x` and `y` coordinates that will place the floating element
1675
+ * next to a given reference element.
1676
+ */
1677
+ const computePosition = (reference, floating, options) => {
1678
+ // This caches the expensive `getClippingElementAncestors` function so that
1679
+ // multiple lifecycle resets re-use the same result. It only lives for a
1680
+ // single call. If other functions become expensive, we can add them as well.
1681
+ const cache = new Map();
1682
+ const mergedOptions = {
1683
+ platform,
1684
+ ...options
1685
+ };
1686
+ const platformWithCache = {
1687
+ ...mergedOptions.platform,
1688
+ _c: cache
1689
+ };
1690
+ return computePosition$1(reference, floating, {
1691
+ ...mergedOptions,
1692
+ platform: platformWithCache
1693
+ });
1694
+ };
1695
+
1696
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1697
+
1698
+ function getDefaultExportFromCjs (x) {
1699
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1700
+ }
1701
+
1702
+ var classnames = {exports: {}};
1703
+
1704
+ /*!
1705
+ Copyright (c) 2018 Jed Watson.
1706
+ Licensed under the MIT License (MIT), see
1707
+ http://jedwatson.github.io/classnames
1708
+ */
1709
+ (function (module) {
1710
+ /* global define */
1711
+
1712
+ (function () {
1713
+
1714
+ var hasOwn = {}.hasOwnProperty;
1715
+ function classNames() {
1716
+ var classes = '';
1717
+ for (var i = 0; i < arguments.length; i++) {
1718
+ var arg = arguments[i];
1719
+ if (arg) {
1720
+ classes = appendClass(classes, parseValue(arg));
1721
+ }
1722
+ }
1723
+ return classes;
1724
+ }
1725
+ function parseValue(arg) {
1726
+ if (typeof arg === 'string' || typeof arg === 'number') {
1727
+ return arg;
1728
+ }
1729
+ if (typeof arg !== 'object') {
1730
+ return '';
1731
+ }
1732
+ if (Array.isArray(arg)) {
1733
+ return classNames.apply(null, arg);
1734
+ }
1735
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
1736
+ return arg.toString();
1737
+ }
1738
+ var classes = '';
1739
+ for (var key in arg) {
1740
+ if (hasOwn.call(arg, key) && arg[key]) {
1741
+ classes = appendClass(classes, key);
1742
+ }
1743
+ }
1744
+ return classes;
1745
+ }
1746
+ function appendClass(value, newClass) {
1747
+ if (!newClass) {
1748
+ return value;
1749
+ }
1750
+ if (value) {
1751
+ return value + ' ' + newClass;
1752
+ }
1753
+ return value + newClass;
1754
+ }
1755
+ if (module.exports) {
1756
+ classNames.default = classNames;
1757
+ module.exports = classNames;
1758
+ } else {
1759
+ window.classNames = classNames;
1760
+ }
1761
+ })();
1762
+ })(classnames);
1763
+ var classnamesExports = classnames.exports;
1764
+ var y = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
1765
+
1766
+ /*
1767
+ * React Tooltip
1768
+ * {@link https://github.com/ReactTooltip/react-tooltip}
1769
+ * @copyright ReactTooltip Team
1770
+ * @license MIT
1771
+ */
1772
+ const h = "react-tooltip-core-styles",
1773
+ w = "react-tooltip-base-styles",
1774
+ b = {
1775
+ core: !1,
1776
+ base: !1
1777
+ };
1778
+ function S({
1779
+ css: e,
1780
+ id: t = w,
1781
+ type: o = "base",
1782
+ ref: l
1783
+ }) {
1784
+ var r, n;
1785
+ if (!e || "undefined" == typeof document || b[o]) return;
1786
+ if ("core" === o && "undefined" != typeof process && (null === (r = null === process || void 0 === process ? void 0 : process.env) || void 0 === r ? void 0 : r.REACT_TOOLTIP_DISABLE_CORE_STYLES)) return;
1787
+ if ("base" !== o && "undefined" != typeof process && (null === (n = null === process || void 0 === process ? void 0 : process.env) || void 0 === n ? void 0 : n.REACT_TOOLTIP_DISABLE_BASE_STYLES)) return;
1788
+ "core" === o && (t = h), l || (l = {});
1789
+ const {
1790
+ insertAt: i
1791
+ } = l;
1792
+ if (document.getElementById(t)) return;
1793
+ const c = document.head || document.getElementsByTagName("head")[0],
1794
+ s = document.createElement("style");
1795
+ s.id = t, s.type = "text/css", "top" === i && c.firstChild ? c.insertBefore(s, c.firstChild) : c.appendChild(s), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(document.createTextNode(e)), b[o] = !0;
1796
+ }
1797
+ const E = async ({
1798
+ elementReference: e = null,
1799
+ tooltipReference: t = null,
1800
+ tooltipArrowReference: o = null,
1801
+ place: l = "top",
1802
+ offset: r = 10,
1803
+ strategy: n = "absolute",
1804
+ middlewares: i = [offset(Number(r)), flip({
1805
+ fallbackAxisSideDirection: "start"
1806
+ }), shift({
1807
+ padding: 5
1808
+ })],
1809
+ border: c
1810
+ }) => {
1811
+ if (!e) return {
1812
+ tooltipStyles: {},
1813
+ tooltipArrowStyles: {},
1814
+ place: l
1815
+ };
1816
+ if (null === t) return {
1817
+ tooltipStyles: {},
1818
+ tooltipArrowStyles: {},
1819
+ place: l
1820
+ };
1821
+ const s = i;
1822
+ return o ? (s.push(arrow({
1823
+ element: o,
1824
+ padding: 5
1825
+ })), computePosition(e, t, {
1826
+ placement: l,
1827
+ strategy: n,
1828
+ middleware: s
1829
+ }).then(({
1830
+ x: e,
1831
+ y: t,
1832
+ placement: o,
1833
+ middlewareData: l
1834
+ }) => {
1835
+ var r, n;
1836
+ const i = {
1837
+ left: `${e}px`,
1838
+ top: `${t}px`,
1839
+ border: c
1840
+ },
1841
+ {
1842
+ x: s,
1843
+ y: a
1844
+ } = null !== (r = l.arrow) && void 0 !== r ? r : {
1845
+ x: 0,
1846
+ y: 0
1847
+ },
1848
+ u = null !== (n = {
1849
+ top: "bottom",
1850
+ right: "left",
1851
+ bottom: "top",
1852
+ left: "right"
1853
+ }[o.split("-")[0]]) && void 0 !== n ? n : "bottom",
1854
+ d = c && {
1855
+ borderBottom: c,
1856
+ borderRight: c
1857
+ };
1858
+ let p = 0;
1859
+ if (c) {
1860
+ const e = `${c}`.match(/(\d+)px/);
1861
+ p = (null == e ? void 0 : e[1]) ? Number(e[1]) : 1;
1862
+ }
1863
+ return {
1864
+ tooltipStyles: i,
1865
+ tooltipArrowStyles: {
1866
+ left: null != s ? `${s}px` : "",
1867
+ top: null != a ? `${a}px` : "",
1868
+ right: "",
1869
+ bottom: "",
1870
+ ...d,
1871
+ [u]: `-${4 + p}px`
1872
+ },
1873
+ place: o
1874
+ };
1875
+ })) : computePosition(e, t, {
1876
+ placement: "bottom",
1877
+ strategy: n,
1878
+ middleware: s
1879
+ }).then(({
1880
+ x: e,
1881
+ y: t,
1882
+ placement: o
1883
+ }) => ({
1884
+ tooltipStyles: {
1885
+ left: `${e}px`,
1886
+ top: `${t}px`
1887
+ },
1888
+ tooltipArrowStyles: {},
1889
+ place: o
1890
+ }));
1891
+ },
1892
+ A = (e, t) => !("CSS" in window && "supports" in window.CSS) || window.CSS.supports(e, t),
1893
+ _ = (e, t, o) => {
1894
+ let l = null;
1895
+ const r = function (...r) {
1896
+ const n = () => {
1897
+ l = null, o || e.apply(this, r);
1898
+ };
1899
+ o && !l && (e.apply(this, r), l = setTimeout(n, t)), o || (l && clearTimeout(l), l = setTimeout(n, t));
1900
+ };
1901
+ return r.cancel = () => {
1902
+ l && (clearTimeout(l), l = null);
1903
+ }, r;
1904
+ },
1905
+ O = e => null !== e && !Array.isArray(e) && "object" == typeof e,
1906
+ k = (e, t) => {
1907
+ if (e === t) return !0;
1908
+ if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, o) => k(e, t[o]));
1909
+ if (Array.isArray(e) !== Array.isArray(t)) return !1;
1910
+ if (!O(e) || !O(t)) return e === t;
1911
+ const o = Object.keys(e),
1912
+ l = Object.keys(t);
1913
+ return o.length === l.length && o.every(o => k(e[o], t[o]));
1914
+ },
1915
+ T = e => {
1916
+ if (!(e instanceof HTMLElement || e instanceof SVGElement)) return !1;
1917
+ const t = getComputedStyle(e);
1918
+ return ["overflow", "overflow-x", "overflow-y"].some(e => {
1919
+ const o = t.getPropertyValue(e);
1920
+ return "auto" === o || "scroll" === o;
1921
+ });
1922
+ },
1923
+ L = e => {
1924
+ if (!e) return null;
1925
+ let t = e.parentElement;
1926
+ for (; t;) {
1927
+ if (T(t)) return t;
1928
+ t = t.parentElement;
1929
+ }
1930
+ return document.scrollingElement || document.documentElement;
1931
+ },
1932
+ C = "undefined" != typeof window ? React.useLayoutEffect : React.useEffect,
1933
+ R = e => {
1934
+ e.current && (clearTimeout(e.current), e.current = null);
1935
+ },
1936
+ x = "DEFAULT_TOOLTIP_ID",
1937
+ N = {
1938
+ anchorRefs: new Set(),
1939
+ activeAnchor: {
1940
+ current: null
1941
+ },
1942
+ attach: () => {},
1943
+ detach: () => {},
1944
+ setActiveAnchor: () => {}
1945
+ },
1946
+ $ = React.createContext({
1947
+ getTooltipData: () => N
1948
+ });
1949
+ function j(e = x) {
1950
+ return React.useContext($).getTooltipData(e);
1951
+ }
1952
+ var z = {
1953
+ tooltip: "core-styles-module_tooltip__3vRRp",
1954
+ fixed: "core-styles-module_fixed__pcSol",
1955
+ arrow: "core-styles-module_arrow__cvMwQ",
1956
+ noArrow: "core-styles-module_noArrow__xock6",
1957
+ clickable: "core-styles-module_clickable__ZuTTB",
1958
+ show: "core-styles-module_show__Nt9eE",
1959
+ closing: "core-styles-module_closing__sGnxF"
1960
+ },
1961
+ D = {
1962
+ tooltip: "styles-module_tooltip__mnnfp",
1963
+ arrow: "styles-module_arrow__K0L3T",
1964
+ dark: "styles-module_dark__xNqje",
1965
+ light: "styles-module_light__Z6W-X",
1966
+ success: "styles-module_success__A2AKt",
1967
+ warning: "styles-module_warning__SCK0X",
1968
+ error: "styles-module_error__JvumD",
1969
+ info: "styles-module_info__BWdHW"
1970
+ };
1971
+ const q = ({
1972
+ forwardRef: t,
1973
+ id: l,
1974
+ className: i,
1975
+ classNameArrow: c,
1976
+ variant: u = "dark",
1977
+ anchorId: d,
1978
+ anchorSelect: p,
1979
+ place: v = "top",
1980
+ offset: m = 10,
1981
+ events: h = ["hover"],
1982
+ openOnClick: w = !1,
1983
+ positionStrategy: b = "absolute",
1984
+ middlewares: S,
1985
+ wrapper: g,
1986
+ delayShow: A = 0,
1987
+ delayHide: O = 0,
1988
+ float: T = !1,
1989
+ hidden: x = !1,
1990
+ noArrow: N = !1,
1991
+ clickable: $ = !1,
1992
+ closeOnEsc: I = !1,
1993
+ closeOnScroll: B = !1,
1994
+ closeOnResize: q = !1,
1995
+ openEvents: H,
1996
+ closeEvents: M,
1997
+ globalCloseEvents: W,
1998
+ imperativeModeOnly: P,
1999
+ style: V,
2000
+ position: F,
2001
+ afterShow: K,
2002
+ afterHide: U,
2003
+ disableTooltip: X,
2004
+ content: Y,
2005
+ contentWrapperRef: G,
2006
+ isOpen: Z,
2007
+ defaultIsOpen: J = !1,
2008
+ setIsOpen: Q,
2009
+ activeAnchor: ee,
2010
+ setActiveAnchor: te,
2011
+ border: oe,
2012
+ opacity: le,
2013
+ arrowColor: re,
2014
+ role: ne = "tooltip"
2015
+ }) => {
2016
+ var ie;
2017
+ const ce = React.useRef(null),
2018
+ se = React.useRef(null),
2019
+ ae = React.useRef(null),
2020
+ ue = React.useRef(null),
2021
+ de = React.useRef(null),
2022
+ [pe, ve] = React.useState({
2023
+ tooltipStyles: {},
2024
+ tooltipArrowStyles: {},
2025
+ place: v
2026
+ }),
2027
+ [me, fe] = React.useState(!1),
2028
+ [ye, he] = React.useState(!1),
2029
+ [we, be] = React.useState(null),
2030
+ Se = React.useRef(!1),
2031
+ ge = React.useRef(null),
2032
+ {
2033
+ anchorRefs: Ee,
2034
+ setActiveAnchor: Ae
2035
+ } = j(l),
2036
+ _e = React.useRef(!1),
2037
+ [Oe, ke] = React.useState([]),
2038
+ Te = React.useRef(!1),
2039
+ Le = w || h.includes("click"),
2040
+ Ce = Le || (null == H ? void 0 : H.click) || (null == H ? void 0 : H.dblclick) || (null == H ? void 0 : H.mousedown),
2041
+ Re = H ? {
2042
+ ...H
2043
+ } : {
2044
+ mouseover: !0,
2045
+ focus: !0,
2046
+ mouseenter: !1,
2047
+ click: !1,
2048
+ dblclick: !1,
2049
+ mousedown: !1
2050
+ };
2051
+ !H && Le && Object.assign(Re, {
2052
+ mouseenter: !1,
2053
+ focus: !1,
2054
+ mouseover: !1,
2055
+ click: !0
2056
+ });
2057
+ const xe = M ? {
2058
+ ...M
2059
+ } : {
2060
+ mouseout: !0,
2061
+ blur: !0,
2062
+ mouseleave: !1,
2063
+ click: !1,
2064
+ dblclick: !1,
2065
+ mouseup: !1
2066
+ };
2067
+ !M && Le && Object.assign(xe, {
2068
+ mouseleave: !1,
2069
+ blur: !1,
2070
+ mouseout: !1
2071
+ });
2072
+ const Ne = W ? {
2073
+ ...W
2074
+ } : {
2075
+ escape: I || !1,
2076
+ scroll: B || !1,
2077
+ resize: q || !1,
2078
+ clickOutsideAnchor: Ce || !1
2079
+ };
2080
+ P && (Object.assign(Re, {
2081
+ mouseover: !1,
2082
+ focus: !1,
2083
+ mouseenter: !1,
2084
+ click: !1,
2085
+ dblclick: !1,
2086
+ mousedown: !1
2087
+ }), Object.assign(xe, {
2088
+ mouseout: !1,
2089
+ blur: !1,
2090
+ mouseleave: !1,
2091
+ click: !1,
2092
+ dblclick: !1,
2093
+ mouseup: !1
2094
+ }), Object.assign(Ne, {
2095
+ escape: !1,
2096
+ scroll: !1,
2097
+ resize: !1,
2098
+ clickOutsideAnchor: !1
2099
+ })), C(() => (Te.current = !0, () => {
2100
+ Te.current = !1;
2101
+ }), []);
2102
+ const $e = e => {
2103
+ Te.current && (e && he(!0), setTimeout(() => {
2104
+ Te.current && (null == Q || Q(e), void 0 === Z && fe(e));
2105
+ }, 10));
2106
+ };
2107
+ React.useEffect(() => {
2108
+ if (void 0 === Z) return () => null;
2109
+ Z && he(!0);
2110
+ const e = setTimeout(() => {
2111
+ fe(Z);
2112
+ }, 10);
2113
+ return () => {
2114
+ clearTimeout(e);
2115
+ };
2116
+ }, [Z]), React.useEffect(() => {
2117
+ if (me !== Se.current) if (R(de), Se.current = me, me) null == K || K();else {
2118
+ const e = (e => {
2119
+ const t = e.match(/^([\d.]+)(ms|s)$/);
2120
+ if (!t) return 0;
2121
+ const [, o, l] = t;
2122
+ return Number(o) * ("ms" === l ? 1 : 1e3);
2123
+ })(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));
2124
+ de.current = setTimeout(() => {
2125
+ he(!1), be(null), null == U || U();
2126
+ }, e + 25);
2127
+ }
2128
+ }, [me]);
2129
+ const Ie = e => {
2130
+ ve(t => k(t, e) ? t : e);
2131
+ },
2132
+ je = (e = A) => {
2133
+ R(ae), ye ? $e(!0) : ae.current = setTimeout(() => {
2134
+ $e(!0);
2135
+ }, e);
2136
+ },
2137
+ Be = (e = O) => {
2138
+ R(ue), ue.current = setTimeout(() => {
2139
+ _e.current || $e(!1);
2140
+ }, e);
2141
+ },
2142
+ ze = e => {
2143
+ var t;
2144
+ if (!e) return;
2145
+ const o = null !== (t = e.currentTarget) && void 0 !== t ? t : e.target;
2146
+ if (!(null == o ? void 0 : o.isConnected)) return te(null), void Ae({
2147
+ current: null
2148
+ });
2149
+ A ? je() : $e(!0), te(o), Ae({
2150
+ current: o
2151
+ }), R(ue);
2152
+ },
2153
+ De = () => {
2154
+ $ ? Be(O || 100) : O ? Be() : $e(!1), R(ae);
2155
+ },
2156
+ qe = ({
2157
+ x: e,
2158
+ y: t
2159
+ }) => {
2160
+ var o;
2161
+ const l = {
2162
+ getBoundingClientRect: () => ({
2163
+ x: e,
2164
+ y: t,
2165
+ width: 0,
2166
+ height: 0,
2167
+ top: t,
2168
+ left: e,
2169
+ right: e,
2170
+ bottom: t
2171
+ })
2172
+ };
2173
+ E({
2174
+ place: null !== (o = null == we ? void 0 : we.place) && void 0 !== o ? o : v,
2175
+ offset: m,
2176
+ elementReference: l,
2177
+ tooltipReference: ce.current,
2178
+ tooltipArrowReference: se.current,
2179
+ strategy: b,
2180
+ middlewares: S,
2181
+ border: oe
2182
+ }).then(e => {
2183
+ Ie(e);
2184
+ });
2185
+ },
2186
+ He = e => {
2187
+ if (!e) return;
2188
+ const t = e,
2189
+ o = {
2190
+ x: t.clientX,
2191
+ y: t.clientY
2192
+ };
2193
+ qe(o), ge.current = o;
2194
+ },
2195
+ Me = e => {
2196
+ var t;
2197
+ if (!me) return;
2198
+ const o = e.target;
2199
+ if (!o.isConnected) return;
2200
+ if (null === (t = ce.current) || void 0 === t ? void 0 : t.contains(o)) return;
2201
+ [document.querySelector(`[id='${d}']`), ...Oe].some(e => null == e ? void 0 : e.contains(o)) || ($e(!1), R(ae));
2202
+ },
2203
+ We = _(ze, 50, !0),
2204
+ Pe = _(De, 50, !0),
2205
+ Ve = e => {
2206
+ Pe.cancel(), We(e);
2207
+ },
2208
+ Fe = () => {
2209
+ We.cancel(), Pe();
2210
+ },
2211
+ Ke = React.useCallback(() => {
2212
+ var e, t;
2213
+ const o = null !== (e = null == we ? void 0 : we.position) && void 0 !== e ? e : F;
2214
+ o ? qe(o) : T ? ge.current && qe(ge.current) : (null == ee ? void 0 : ee.isConnected) && E({
2215
+ place: null !== (t = null == we ? void 0 : we.place) && void 0 !== t ? t : v,
2216
+ offset: m,
2217
+ elementReference: ee,
2218
+ tooltipReference: ce.current,
2219
+ tooltipArrowReference: se.current,
2220
+ strategy: b,
2221
+ middlewares: S,
2222
+ border: oe
2223
+ }).then(e => {
2224
+ Te.current && Ie(e);
2225
+ });
2226
+ }, [me, ee, Y, V, v, null == we ? void 0 : we.place, m, b, F, null == we ? void 0 : we.position, T]);
2227
+ React.useEffect(() => {
2228
+ var e, t;
2229
+ const o = new Set(Ee);
2230
+ Oe.forEach(e => {
2231
+ (null == X ? void 0 : X(e)) || o.add({
2232
+ current: e
2233
+ });
2234
+ });
2235
+ const l = document.querySelector(`[id='${d}']`);
2236
+ l && !(null == X ? void 0 : X(l)) && o.add({
2237
+ current: l
2238
+ });
2239
+ const r = () => {
2240
+ $e(!1);
2241
+ },
2242
+ n = L(ee),
2243
+ i = L(ce.current);
2244
+ Ne.scroll && (window.addEventListener("scroll", r), null == n || n.addEventListener("scroll", r), null == i || i.addEventListener("scroll", r));
2245
+ let c = null;
2246
+ Ne.resize ? window.addEventListener("resize", r) : ee && ce.current && (c = autoUpdate(ee, ce.current, Ke, {
2247
+ ancestorResize: !0,
2248
+ elementResize: !0,
2249
+ layoutShift: !0
2250
+ }));
2251
+ const s = e => {
2252
+ "Escape" === e.key && $e(!1);
2253
+ };
2254
+ Ne.escape && window.addEventListener("keydown", s), Ne.clickOutsideAnchor && window.addEventListener("click", Me);
2255
+ const a = [],
2256
+ u = e => Boolean((null == e ? void 0 : e.target) && (null == ee ? void 0 : ee.contains(e.target))),
2257
+ p = e => {
2258
+ me && u(e) || ze(e);
2259
+ },
2260
+ v = e => {
2261
+ me && u(e) && De();
2262
+ },
2263
+ m = ["mouseover", "mouseout", "mouseenter", "mouseleave", "focus", "blur"],
2264
+ y = ["click", "dblclick", "mousedown", "mouseup"];
2265
+ Object.entries(Re).forEach(([e, t]) => {
2266
+ t && (m.includes(e) ? a.push({
2267
+ event: e,
2268
+ listener: Ve
2269
+ }) : y.includes(e) && a.push({
2270
+ event: e,
2271
+ listener: p
2272
+ }));
2273
+ }), Object.entries(xe).forEach(([e, t]) => {
2274
+ t && (m.includes(e) ? a.push({
2275
+ event: e,
2276
+ listener: Fe
2277
+ }) : y.includes(e) && a.push({
2278
+ event: e,
2279
+ listener: v
2280
+ }));
2281
+ }), T && a.push({
2282
+ event: "pointermove",
2283
+ listener: He
2284
+ });
2285
+ const h = () => {
2286
+ _e.current = !0;
2287
+ },
2288
+ w = () => {
2289
+ _e.current = !1, De();
2290
+ },
2291
+ b = $ && (xe.mouseout || xe.mouseleave);
2292
+ return b && (null === (e = ce.current) || void 0 === e || e.addEventListener("mouseover", h), null === (t = ce.current) || void 0 === t || t.addEventListener("mouseout", w)), a.forEach(({
2293
+ event: e,
2294
+ listener: t
2295
+ }) => {
2296
+ o.forEach(o => {
2297
+ var l;
2298
+ null === (l = o.current) || void 0 === l || l.addEventListener(e, t);
2299
+ });
2300
+ }), () => {
2301
+ var e, t;
2302
+ Ne.scroll && (window.removeEventListener("scroll", r), null == n || n.removeEventListener("scroll", r), null == i || i.removeEventListener("scroll", r)), Ne.resize ? window.removeEventListener("resize", r) : null == c || c(), Ne.clickOutsideAnchor && window.removeEventListener("click", Me), Ne.escape && window.removeEventListener("keydown", s), b && (null === (e = ce.current) || void 0 === e || e.removeEventListener("mouseover", h), null === (t = ce.current) || void 0 === t || t.removeEventListener("mouseout", w)), a.forEach(({
2303
+ event: e,
2304
+ listener: t
2305
+ }) => {
2306
+ o.forEach(o => {
2307
+ var l;
2308
+ null === (l = o.current) || void 0 === l || l.removeEventListener(e, t);
2309
+ });
2310
+ });
2311
+ };
2312
+ }, [ee, Ke, ye, Ee, Oe, H, M, W, Le, A, O]), React.useEffect(() => {
2313
+ var e, t;
2314
+ let o = null !== (t = null !== (e = null == we ? void 0 : we.anchorSelect) && void 0 !== e ? e : p) && void 0 !== t ? t : "";
2315
+ !o && l && (o = `[data-tooltip-id='${l.replace(/'/g, "\\'")}']`);
2316
+ const r = new MutationObserver(e => {
2317
+ const t = [],
2318
+ r = [];
2319
+ e.forEach(e => {
2320
+ if ("attributes" === e.type && "data-tooltip-id" === e.attributeName) {
2321
+ e.target.getAttribute("data-tooltip-id") === l ? t.push(e.target) : e.oldValue === l && r.push(e.target);
2322
+ }
2323
+ if ("childList" === e.type) {
2324
+ if (ee) {
2325
+ const t = [...e.removedNodes].filter(e => 1 === e.nodeType);
2326
+ if (o) try {
2327
+ r.push(...t.filter(e => e.matches(o))), r.push(...t.flatMap(e => [...e.querySelectorAll(o)]));
2328
+ } catch (e) {}
2329
+ t.some(e => {
2330
+ var t;
2331
+ return !!(null === (t = null == e ? void 0 : e.contains) || void 0 === t ? void 0 : t.call(e, ee)) && (he(!1), $e(!1), te(null), R(ae), R(ue), !0);
2332
+ });
2333
+ }
2334
+ if (o) try {
2335
+ const l = [...e.addedNodes].filter(e => 1 === e.nodeType);
2336
+ t.push(...l.filter(e => e.matches(o))), t.push(...l.flatMap(e => [...e.querySelectorAll(o)]));
2337
+ } catch (e) {}
2338
+ }
2339
+ }), (t.length || r.length) && ke(e => [...e.filter(e => !r.includes(e)), ...t]);
2340
+ });
2341
+ return r.observe(document.body, {
2342
+ childList: !0,
2343
+ subtree: !0,
2344
+ attributes: !0,
2345
+ attributeFilter: ["data-tooltip-id"],
2346
+ attributeOldValue: !0
2347
+ }), () => {
2348
+ r.disconnect();
2349
+ };
2350
+ }, [l, p, null == we ? void 0 : we.anchorSelect, ee]), React.useEffect(() => {
2351
+ Ke();
2352
+ }, [Ke]), React.useEffect(() => {
2353
+ if (!(null == G ? void 0 : G.current)) return () => null;
2354
+ const e = new ResizeObserver(() => {
2355
+ setTimeout(() => Ke());
2356
+ });
2357
+ return e.observe(G.current), () => {
2358
+ e.disconnect();
2359
+ };
2360
+ }, [Y, null == G ? void 0 : G.current]), React.useEffect(() => {
2361
+ var e;
2362
+ const t = document.querySelector(`[id='${d}']`),
2363
+ o = [...Oe, t];
2364
+ ee && o.includes(ee) || te(null !== (e = Oe[0]) && void 0 !== e ? e : t);
2365
+ }, [d, Oe, ee]), React.useEffect(() => (J && $e(!0), () => {
2366
+ R(ae), R(ue);
2367
+ }), []), React.useEffect(() => {
2368
+ var e;
2369
+ let t = null !== (e = null == we ? void 0 : we.anchorSelect) && void 0 !== e ? e : p;
2370
+ if (!t && l && (t = `[data-tooltip-id='${l.replace(/'/g, "\\'")}']`), t) try {
2371
+ const e = Array.from(document.querySelectorAll(t));
2372
+ ke(e);
2373
+ } catch (e) {
2374
+ ke([]);
2375
+ }
2376
+ }, [l, p, null == we ? void 0 : we.anchorSelect]), React.useEffect(() => {
2377
+ ae.current && (R(ae), je(A));
2378
+ }, [A]);
2379
+ const Ue = null !== (ie = null == we ? void 0 : we.content) && void 0 !== ie ? ie : Y,
2380
+ Xe = me && Object.keys(pe.tooltipStyles).length > 0;
2381
+ return React.useImperativeHandle(t, () => ({
2382
+ open: e => {
2383
+ if (null == e ? void 0 : e.anchorSelect) try {
2384
+ document.querySelector(e.anchorSelect);
2385
+ } catch (t) {
2386
+ return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`);
2387
+ }
2388
+ be(null != e ? e : null), (null == e ? void 0 : e.delay) ? je(e.delay) : $e(!0);
2389
+ },
2390
+ close: e => {
2391
+ (null == e ? void 0 : e.delay) ? Be(e.delay) : $e(!1);
2392
+ },
2393
+ activeAnchor: ee,
2394
+ place: pe.place,
2395
+ isOpen: Boolean(ye && !x && Ue && Xe)
2396
+ })), ye && !x && Ue ? React.createElement(g, {
2397
+ id: l,
2398
+ role: ne,
2399
+ className: y("react-tooltip", z.tooltip, D.tooltip, D[u], i, `react-tooltip__place-${pe.place}`, z[Xe ? "show" : "closing"], Xe ? "react-tooltip__show" : "react-tooltip__closing", "fixed" === b && z.fixed, $ && z.clickable),
2400
+ onTransitionEnd: e => {
2401
+ R(de), me || "opacity" !== e.propertyName || (he(!1), be(null), null == U || U());
2402
+ },
2403
+ style: {
2404
+ ...V,
2405
+ ...pe.tooltipStyles,
2406
+ opacity: void 0 !== le && Xe ? le : void 0
2407
+ },
2408
+ ref: ce
2409
+ }, Ue, React.createElement(g, {
2410
+ className: y("react-tooltip-arrow", z.arrow, D.arrow, c, N && z.noArrow),
2411
+ style: {
2412
+ ...pe.tooltipArrowStyles,
2413
+ background: re ? `linear-gradient(to right bottom, transparent 50%, ${re} 50%)` : void 0
2414
+ },
2415
+ ref: se
2416
+ })) : null;
2417
+ },
2418
+ H = ({
2419
+ content: t
2420
+ }) => React.createElement("span", {
2421
+ dangerouslySetInnerHTML: {
2422
+ __html: t
2423
+ }
2424
+ }),
2425
+ M = React.forwardRef(({
2426
+ id: t,
2427
+ anchorId: l,
2428
+ anchorSelect: n,
2429
+ content: i,
2430
+ html: c,
2431
+ render: a,
2432
+ className: u,
2433
+ classNameArrow: d,
2434
+ variant: p = "dark",
2435
+ place: v = "top",
2436
+ offset: m = 10,
2437
+ wrapper: f = "div",
2438
+ children: h = null,
2439
+ events: w = ["hover"],
2440
+ openOnClick: b = !1,
2441
+ positionStrategy: S = "absolute",
2442
+ middlewares: g,
2443
+ delayShow: E = 0,
2444
+ delayHide: _ = 0,
2445
+ float: O = !1,
2446
+ hidden: k = !1,
2447
+ noArrow: T = !1,
2448
+ clickable: L = !1,
2449
+ closeOnEsc: C = !1,
2450
+ closeOnScroll: R = !1,
2451
+ closeOnResize: x = !1,
2452
+ openEvents: N,
2453
+ closeEvents: $,
2454
+ globalCloseEvents: I,
2455
+ imperativeModeOnly: B = !1,
2456
+ style: z,
2457
+ position: D,
2458
+ isOpen: M,
2459
+ defaultIsOpen: W = !1,
2460
+ disableStyleInjection: P = !1,
2461
+ border: V,
2462
+ opacity: F,
2463
+ arrowColor: K,
2464
+ setIsOpen: U,
2465
+ afterShow: X,
2466
+ afterHide: Y,
2467
+ disableTooltip: G,
2468
+ role: Z = "tooltip"
2469
+ }, J) => {
2470
+ const [Q, ee] = React.useState(i),
2471
+ [te, oe] = React.useState(c),
2472
+ [le, re] = React.useState(v),
2473
+ [ne, ie] = React.useState(p),
2474
+ [ce, se] = React.useState(m),
2475
+ [ae, ue] = React.useState(E),
2476
+ [de, pe] = React.useState(_),
2477
+ [ve, me] = React.useState(O),
2478
+ [fe, ye] = React.useState(k),
2479
+ [he, we] = React.useState(f),
2480
+ [be, Se] = React.useState(w),
2481
+ [ge, Ee] = React.useState(S),
2482
+ [Ae, _e] = React.useState(null),
2483
+ [Oe, ke] = React.useState(null),
2484
+ Te = React.useRef(P),
2485
+ {
2486
+ anchorRefs: Le,
2487
+ activeAnchor: Ce
2488
+ } = j(t),
2489
+ Re = e => null == e ? void 0 : e.getAttributeNames().reduce((t, o) => {
2490
+ var l;
2491
+ if (o.startsWith("data-tooltip-")) {
2492
+ t[o.replace(/^data-tooltip-/, "")] = null !== (l = null == e ? void 0 : e.getAttribute(o)) && void 0 !== l ? l : null;
2493
+ }
2494
+ return t;
2495
+ }, {}),
2496
+ xe = e => {
2497
+ const t = {
2498
+ place: e => {
2499
+ var t;
2500
+ re(null !== (t = e) && void 0 !== t ? t : v);
2501
+ },
2502
+ content: e => {
2503
+ ee(null != e ? e : i);
2504
+ },
2505
+ html: e => {
2506
+ oe(null != e ? e : c);
2507
+ },
2508
+ variant: e => {
2509
+ var t;
2510
+ ie(null !== (t = e) && void 0 !== t ? t : p);
2511
+ },
2512
+ offset: e => {
2513
+ se(null === e ? m : Number(e));
2514
+ },
2515
+ wrapper: e => {
2516
+ var t;
2517
+ we(null !== (t = e) && void 0 !== t ? t : f);
2518
+ },
2519
+ events: e => {
2520
+ const t = null == e ? void 0 : e.split(" ");
2521
+ Se(null != t ? t : w);
2522
+ },
2523
+ "position-strategy": e => {
2524
+ var t;
2525
+ Ee(null !== (t = e) && void 0 !== t ? t : S);
2526
+ },
2527
+ "delay-show": e => {
2528
+ ue(null === e ? E : Number(e));
2529
+ },
2530
+ "delay-hide": e => {
2531
+ pe(null === e ? _ : Number(e));
2532
+ },
2533
+ float: e => {
2534
+ me(null === e ? O : "true" === e);
2535
+ },
2536
+ hidden: e => {
2537
+ ye(null === e ? k : "true" === e);
2538
+ },
2539
+ "class-name": e => {
2540
+ _e(e);
2541
+ }
2542
+ };
2543
+ Object.values(t).forEach(e => e(null)), Object.entries(e).forEach(([e, o]) => {
2544
+ var l;
2545
+ null === (l = t[e]) || void 0 === l || l.call(t, o);
2546
+ });
2547
+ };
2548
+ React.useEffect(() => {
2549
+ ee(i);
2550
+ }, [i]), React.useEffect(() => {
2551
+ oe(c);
2552
+ }, [c]), React.useEffect(() => {
2553
+ re(v);
2554
+ }, [v]), React.useEffect(() => {
2555
+ ie(p);
2556
+ }, [p]), React.useEffect(() => {
2557
+ se(m);
2558
+ }, [m]), React.useEffect(() => {
2559
+ ue(E);
2560
+ }, [E]), React.useEffect(() => {
2561
+ pe(_);
2562
+ }, [_]), React.useEffect(() => {
2563
+ me(O);
2564
+ }, [O]), React.useEffect(() => {
2565
+ ye(k);
2566
+ }, [k]), React.useEffect(() => {
2567
+ Ee(S);
2568
+ }, [S]), React.useEffect(() => {
2569
+ Te.current !== P && console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");
2570
+ }, [P]), React.useEffect(() => {
2571
+ "undefined" != typeof window && window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles", {
2572
+ detail: {
2573
+ disableCore: "core" === P,
2574
+ disableBase: P
2575
+ }
2576
+ }));
2577
+ }, []), React.useEffect(() => {
2578
+ var e;
2579
+ const o = new Set(Le);
2580
+ let r = n;
2581
+ if (!r && t && (r = `[data-tooltip-id='${t.replace(/'/g, "\\'")}']`), r) try {
2582
+ document.querySelectorAll(r).forEach(e => {
2583
+ o.add({
2584
+ current: e
2585
+ });
2586
+ });
2587
+ } catch (e) {
2588
+ console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`);
2589
+ }
2590
+ const i = document.querySelector(`[id='${l}']`);
2591
+ if (i && o.add({
2592
+ current: i
2593
+ }), !o.size) return () => null;
2594
+ const c = null !== (e = null != Oe ? Oe : i) && void 0 !== e ? e : Ce.current,
2595
+ s = new MutationObserver(e => {
2596
+ e.forEach(e => {
2597
+ var t;
2598
+ if (!c || "attributes" !== e.type || !(null === (t = e.attributeName) || void 0 === t ? void 0 : t.startsWith("data-tooltip-"))) return;
2599
+ const o = Re(c);
2600
+ xe(o);
2601
+ });
2602
+ }),
2603
+ a = {
2604
+ attributes: !0,
2605
+ childList: !1,
2606
+ subtree: !1
2607
+ };
2608
+ if (c) {
2609
+ const e = Re(c);
2610
+ xe(e), s.observe(c, a);
2611
+ }
2612
+ return () => {
2613
+ s.disconnect();
2614
+ };
2615
+ }, [Le, Ce, Oe, l, n]), React.useEffect(() => {
2616
+ (null == z ? void 0 : z.border) && console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."), V && !A("border", `${V}`) && console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`), (null == z ? void 0 : z.opacity) && console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."), F && !A("opacity", `${F}`) && console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);
2617
+ }, []);
2618
+ let Ne = h;
2619
+ const $e = React.useRef(null);
2620
+ if (a) {
2621
+ const t = a({
2622
+ content: (null == Oe ? void 0 : Oe.getAttribute("data-tooltip-content")) || Q || null,
2623
+ activeAnchor: Oe
2624
+ });
2625
+ Ne = t ? React.createElement("div", {
2626
+ ref: $e,
2627
+ className: "react-tooltip-content-wrapper"
2628
+ }, t) : null;
2629
+ } else Q && (Ne = Q);
2630
+ te && (Ne = React.createElement(H, {
2631
+ content: te
2632
+ }));
2633
+ const Ie = {
2634
+ forwardRef: J,
2635
+ id: t,
2636
+ anchorId: l,
2637
+ anchorSelect: n,
2638
+ className: y(u, Ae),
2639
+ classNameArrow: d,
2640
+ content: Ne,
2641
+ contentWrapperRef: $e,
2642
+ place: le,
2643
+ variant: ne,
2644
+ offset: ce,
2645
+ wrapper: he,
2646
+ events: be,
2647
+ openOnClick: b,
2648
+ positionStrategy: ge,
2649
+ middlewares: g,
2650
+ delayShow: ae,
2651
+ delayHide: de,
2652
+ float: ve,
2653
+ hidden: fe,
2654
+ noArrow: T,
2655
+ clickable: L,
2656
+ closeOnEsc: C,
2657
+ closeOnScroll: R,
2658
+ closeOnResize: x,
2659
+ openEvents: N,
2660
+ closeEvents: $,
2661
+ globalCloseEvents: I,
2662
+ imperativeModeOnly: B,
2663
+ style: z,
2664
+ position: D,
2665
+ isOpen: M,
2666
+ defaultIsOpen: W,
2667
+ border: V,
2668
+ opacity: F,
2669
+ arrowColor: K,
2670
+ setIsOpen: U,
2671
+ afterShow: X,
2672
+ afterHide: Y,
2673
+ disableTooltip: G,
2674
+ activeAnchor: Oe,
2675
+ setActiveAnchor: e => ke(e),
2676
+ role: Z
2677
+ };
2678
+ return React.createElement(q, {
2679
+ ...Ie
2680
+ });
2681
+ });
2682
+ "undefined" != typeof window && window.addEventListener("react-tooltip-inject-styles", e => {
2683
+ e.detail.disableCore || S({
2684
+ css: `:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,
2685
+ type: "core"
2686
+ }), e.detail.disableBase || S({
2687
+ css: `
2688
+ .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,
2689
+ type: "base"
2690
+ });
2691
+ });
2692
+
142
2693
  const Wrapper$h = styled.div(props => ({
143
2694
  display: 'inline-block',
144
2695
  position: 'relative',
145
2696
  height: props.$height || '16px',
146
2697
  }));
2698
+ const StyledAnchor = styled.a ``;
147
2699
  const StyledIcon$6 = styled(Icon) `
148
2700
  width: 16px;
149
2701
  height: 16px;
@@ -182,9 +2734,30 @@ const positions = {
182
2734
  };
183
2735
  const Content$3 = styled.div(props => (Object.assign({ position: 'absolute', borderRadius: '4px', borderWidth: '1px', borderStyle: 'solid', borderColor: props.theme.PRIMARY_COLOR.Hex, background: '#ffffff', boxShadow: '0px 5px 30px -10px rgba(0, 0, 0, 0.5)', width: props.$width || '240px', padding: '10px 12px', zIndex: 9999 }, positions[props.$position])));
184
2736
  Content$3.defaultProps = { theme: EditableTheme };
185
- const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, height, }) => {
2737
+ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, height, auto = false, }) => {
186
2738
  const [show_content, toggleContent] = React.useState(false);
187
2739
  const baseId = dataItemid || 'tooltip';
2740
+ if (auto) {
2741
+ return (React.createElement(React.Fragment, null,
2742
+ React.createElement("style", null, `
2743
+ .custom-tooltip-arrow {
2744
+ box-shadow: 1px 1px 0 0 #0193D7; /* top border for arrow (matches border) */
2745
+ }
2746
+ .custom-tooltip {
2747
+ border-radius: 4px;
2748
+ border-width: 1px;
2749
+ border-style: solid;
2750
+ border-color: #0193D7;
2751
+ background: #ffffff;
2752
+ boxShadow: 0px 5px 30px -10px rgba(0, 0, 0, 0.5);
2753
+ color: #000;
2754
+ max-width: ${width};
2755
+ }
2756
+
2757
+ `),
2758
+ React.createElement(StyledAnchor, { "data-tooltip-html": children, "data-tooltip-id": 'auto-tooltip-data-html' }, trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline })),
2759
+ React.createElement(M, { className: 'custom-tooltip', classNameArrow: 'custom-tooltip-arrow', id: 'auto-tooltip-data-html' })));
2760
+ }
188
2761
  return (React.createElement(Wrapper$h, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
189
2762
  trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline }),
190
2763
  show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-copy`, type: 'small' }, children)))) : null));
@@ -1790,6 +4363,694 @@ const formatAsMask = (number, mask) => {
1790
4363
  return result;
1791
4364
  };
1792
4365
 
4366
+ var textMaskAddons = {exports: {}};
4367
+
4368
+ (function (module, exports) {
4369
+ !function (e, t) {
4370
+ module.exports = t() ;
4371
+ }(commonjsGlobal, function () {
4372
+ return function (e) {
4373
+ function t(r) {
4374
+ if (n[r]) return n[r].exports;
4375
+ var i = n[r] = {
4376
+ exports: {},
4377
+ id: r,
4378
+ loaded: !1
4379
+ };
4380
+ return e[r].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports;
4381
+ }
4382
+ var n = {};
4383
+ return t.m = e, t.c = n, t.p = "", t(0);
4384
+ }([function (e, t, n) {
4385
+
4386
+ function r(e) {
4387
+ return e && e.__esModule ? e : {
4388
+ default: e
4389
+ };
4390
+ }
4391
+ Object.defineProperty(t, "__esModule", {
4392
+ value: !0
4393
+ });
4394
+ var i = n(1);
4395
+ Object.defineProperty(t, "createAutoCorrectedDatePipe", {
4396
+ enumerable: !0,
4397
+ get: function () {
4398
+ return r(i).default;
4399
+ }
4400
+ });
4401
+ var o = n(2);
4402
+ Object.defineProperty(t, "createNumberMask", {
4403
+ enumerable: !0,
4404
+ get: function () {
4405
+ return r(o).default;
4406
+ }
4407
+ });
4408
+ var u = n(3);
4409
+ Object.defineProperty(t, "emailMask", {
4410
+ enumerable: !0,
4411
+ get: function () {
4412
+ return r(u).default;
4413
+ }
4414
+ });
4415
+ }, function (e, t) {
4416
+
4417
+ function n() {
4418
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "mm dd yyyy",
4419
+ t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
4420
+ n = t.minYear,
4421
+ o = void 0 === n ? 1 : n,
4422
+ u = t.maxYear,
4423
+ a = void 0 === u ? 9999 : u,
4424
+ c = e.split(/[^dmyHMS]+/).sort(function (e, t) {
4425
+ return i.indexOf(e) - i.indexOf(t);
4426
+ });
4427
+ return function (t) {
4428
+ var n = [],
4429
+ i = {
4430
+ dd: 31,
4431
+ mm: 12,
4432
+ yy: 99,
4433
+ yyyy: a,
4434
+ HH: 23,
4435
+ MM: 59,
4436
+ SS: 59
4437
+ },
4438
+ u = {
4439
+ dd: 1,
4440
+ mm: 1,
4441
+ yy: 0,
4442
+ yyyy: o,
4443
+ HH: 0,
4444
+ MM: 0,
4445
+ SS: 0
4446
+ },
4447
+ l = t.split("");
4448
+ c.forEach(function (t) {
4449
+ var r = e.indexOf(t),
4450
+ o = parseInt(i[t].toString().substr(0, 1), 10);
4451
+ parseInt(l[r], 10) > o && (l[r + 1] = l[r], l[r] = 0, n.push(r));
4452
+ });
4453
+ var s = 0,
4454
+ d = c.some(function (n) {
4455
+ var c = e.indexOf(n),
4456
+ l = n.length,
4457
+ d = t.substr(c, l).replace(/\D/g, ""),
4458
+ f = parseInt(d, 10);
4459
+ "mm" === n && (s = f || 0);
4460
+ var p = "dd" === n ? r[s] : i[n];
4461
+ if ("yyyy" === n && (1 !== o || 9999 !== a)) {
4462
+ var v = parseInt(i[n].toString().substring(0, d.length), 10),
4463
+ y = parseInt(u[n].toString().substring(0, d.length), 10);
4464
+ return f < y || f > v;
4465
+ }
4466
+ return f > p || d.length === l && f < u[n];
4467
+ });
4468
+ return !d && {
4469
+ value: l.join(""),
4470
+ indexesOfPipedChars: n
4471
+ };
4472
+ };
4473
+ }
4474
+ Object.defineProperty(t, "__esModule", {
4475
+ value: !0
4476
+ }), t.default = n;
4477
+ var r = [31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
4478
+ i = ["yyyy", "yy", "mm", "dd", "HH", "MM", "SS"];
4479
+ }, function (e, t) {
4480
+
4481
+ function n() {
4482
+ function e() {
4483
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a,
4484
+ t = e.length;
4485
+ if (e === a || e[0] === g[0] && 1 === t) return g.split(a).concat([v]).concat(h.split(a));
4486
+ if (e === P && _) return g.split(a).concat(["0", P, v]).concat(h.split(a));
4487
+ var n = e[0] === s && D;
4488
+ n && (e = e.toString().substr(1));
4489
+ var u = e.lastIndexOf(P),
4490
+ c = u !== -1,
4491
+ l = void 0,
4492
+ m = void 0,
4493
+ b = void 0;
4494
+ if (e.slice($ * -1) === h && (e = e.slice(0, $ * -1)), c && (_ || I) ? (l = e.slice(e.slice(0, N) === g ? N : 0, u), m = e.slice(u + 1, t), m = r(m.replace(f, a))) : l = e.slice(0, N) === g ? e.slice(N) : e, L && ("undefined" == typeof L ? "undefined" : o(L)) === p) {
4495
+ var O = "." === S ? "[.]" : "" + S,
4496
+ M = (l.match(new RegExp(O, "g")) || []).length;
4497
+ l = l.slice(0, L + M * V);
4498
+ }
4499
+ return l = l.replace(f, a), R || (l = l.replace(/^0+(0$|[^0])/, "$1")), l = x ? i(l, S) : l, b = r(l), (c && _ || I === !0) && (e[u - 1] !== P && b.push(y), b.push(P, y), m && (("undefined" == typeof C ? "undefined" : o(C)) === p && (m = m.slice(0, C)), b = b.concat(m)), I === !0 && e[u - 1] === P && b.push(v)), N > 0 && (b = g.split(a).concat(b)), n && (b.length === N && b.push(v), b = [d].concat(b)), h.length > 0 && (b = b.concat(h.split(a))), b;
4500
+ }
4501
+ var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
4502
+ n = t.prefix,
4503
+ g = void 0 === n ? u : n,
4504
+ m = t.suffix,
4505
+ h = void 0 === m ? a : m,
4506
+ b = t.includeThousandsSeparator,
4507
+ x = void 0 === b || b,
4508
+ O = t.thousandsSeparatorSymbol,
4509
+ S = void 0 === O ? c : O,
4510
+ M = t.allowDecimal,
4511
+ _ = void 0 !== M && M,
4512
+ j = t.decimalSymbol,
4513
+ P = void 0 === j ? l : j,
4514
+ w = t.decimalLimit,
4515
+ C = void 0 === w ? 2 : w,
4516
+ H = t.requireDecimal,
4517
+ I = void 0 !== H && H,
4518
+ k = t.allowNegative,
4519
+ D = void 0 !== k && k,
4520
+ E = t.allowLeadingZeroes,
4521
+ R = void 0 !== E && E,
4522
+ A = t.integerLimit,
4523
+ L = void 0 === A ? null : A,
4524
+ N = g && g.length || 0,
4525
+ $ = h && h.length || 0,
4526
+ V = S && S.length || 0;
4527
+ return e.instanceOf = "createNumberMask", e;
4528
+ }
4529
+ function r(e) {
4530
+ return e.split(a).map(function (e) {
4531
+ return v.test(e) ? v : e;
4532
+ });
4533
+ }
4534
+ function i(e, t) {
4535
+ return e.replace(/\B(?=(\d{3})+(?!\d))/g, t);
4536
+ }
4537
+ Object.defineProperty(t, "__esModule", {
4538
+ value: !0
4539
+ });
4540
+ var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
4541
+ return typeof e;
4542
+ } : function (e) {
4543
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
4544
+ };
4545
+ t.default = n;
4546
+ var u = "$",
4547
+ a = "",
4548
+ c = ",",
4549
+ l = ".",
4550
+ s = "-",
4551
+ d = /-/,
4552
+ f = /\D+/g,
4553
+ p = "number",
4554
+ v = /\d/,
4555
+ y = "[]";
4556
+ }, function (e, t, n) {
4557
+
4558
+ function r(e) {
4559
+ return e && e.__esModule ? e : {
4560
+ default: e
4561
+ };
4562
+ }
4563
+ function i(e, t) {
4564
+ e = e.replace(O, v);
4565
+ var n = t.placeholderChar,
4566
+ r = t.currentCaretPosition,
4567
+ i = e.indexOf(y),
4568
+ s = e.lastIndexOf(p),
4569
+ d = s < i ? -1 : s,
4570
+ f = o(e, i + 1, y),
4571
+ g = o(e, d - 1, p),
4572
+ m = u(e, i),
4573
+ h = a(e, i, d, n),
4574
+ b = c(e, d, n, r);
4575
+ m = l(m), h = l(h), b = l(b, !0);
4576
+ var x = m.concat(f).concat(h).concat(g).concat(b);
4577
+ return x;
4578
+ }
4579
+ function o(e, t, n) {
4580
+ var r = [];
4581
+ return e[t] === n ? r.push(n) : r.push(g, n), r.push(g), r;
4582
+ }
4583
+ function u(e, t) {
4584
+ return t === -1 ? e : e.slice(0, t);
4585
+ }
4586
+ function a(e, t, n, r) {
4587
+ var i = v;
4588
+ return t !== -1 && (i = n === -1 ? e.slice(t + 1, e.length) : e.slice(t + 1, n)), i = i.replace(new RegExp("[\\s" + r + "]", h), v), i === y ? f : i.length < 1 ? m : i[i.length - 1] === p ? i.slice(0, i.length - 1) : i;
4589
+ }
4590
+ function c(e, t, n, r) {
4591
+ var i = v;
4592
+ return t !== -1 && (i = e.slice(t + 1, e.length)), i = i.replace(new RegExp("[\\s" + n + ".]", h), v), 0 === i.length ? e[t - 1] === p && r !== e.length ? f : v : i;
4593
+ }
4594
+ function l(e, t) {
4595
+ return e.split(v).map(function (e) {
4596
+ return e === m ? e : t ? x : b;
4597
+ });
4598
+ }
4599
+ Object.defineProperty(t, "__esModule", {
4600
+ value: !0
4601
+ });
4602
+ var s = n(4),
4603
+ d = r(s),
4604
+ f = "*",
4605
+ p = ".",
4606
+ v = "",
4607
+ y = "@",
4608
+ g = "[]",
4609
+ m = " ",
4610
+ h = "g",
4611
+ b = /[^\s]/,
4612
+ x = /[^.\s]/,
4613
+ O = /\s/g;
4614
+ t.default = {
4615
+ mask: i,
4616
+ pipe: d.default
4617
+ };
4618
+ }, function (e, t) {
4619
+
4620
+ function n(e, t) {
4621
+ var n = t.currentCaretPosition,
4622
+ o = t.rawValue,
4623
+ f = t.previousConformedValue,
4624
+ p = t.placeholderChar,
4625
+ v = e;
4626
+ v = r(v);
4627
+ var y = v.indexOf(a),
4628
+ g = null === o.match(new RegExp("[^@\\s." + p + "]"));
4629
+ if (g) return u;
4630
+ if (v.indexOf(l) !== -1 || y !== -1 && n !== y + 1 || o.indexOf(i) === -1 && f !== u && o.indexOf(c) !== -1) return !1;
4631
+ var m = v.indexOf(i),
4632
+ h = v.slice(m + 1, v.length);
4633
+ return (h.match(d) || s).length > 1 && v.substr(-1) === c && n !== o.length && (v = v.slice(0, v.length - 1)), v;
4634
+ }
4635
+ function r(e) {
4636
+ var t = 0;
4637
+ return e.replace(o, function () {
4638
+ return t++, 1 === t ? i : u;
4639
+ });
4640
+ }
4641
+ Object.defineProperty(t, "__esModule", {
4642
+ value: !0
4643
+ }), t.default = n;
4644
+ var i = "@",
4645
+ o = /@/g,
4646
+ u = "",
4647
+ a = "@.",
4648
+ c = ".",
4649
+ l = "..",
4650
+ s = [],
4651
+ d = /\./g;
4652
+ }]);
4653
+ });
4654
+ })(textMaskAddons);
4655
+ var textMaskAddonsExports = textMaskAddons.exports;
4656
+
4657
+ var textMaskCore = {exports: {}};
4658
+
4659
+ (function (module, exports) {
4660
+ !function (e, r) {
4661
+ module.exports = r() ;
4662
+ }(commonjsGlobal, function () {
4663
+ return function (e) {
4664
+ function r(n) {
4665
+ if (t[n]) return t[n].exports;
4666
+ var o = t[n] = {
4667
+ exports: {},
4668
+ id: n,
4669
+ loaded: !1
4670
+ };
4671
+ return e[n].call(o.exports, o, o.exports, r), o.loaded = !0, o.exports;
4672
+ }
4673
+ var t = {};
4674
+ return r.m = e, r.c = t, r.p = "", r(0);
4675
+ }([function (e, r, t) {
4676
+
4677
+ function n(e) {
4678
+ return e && e.__esModule ? e : {
4679
+ default: e
4680
+ };
4681
+ }
4682
+ Object.defineProperty(r, "__esModule", {
4683
+ value: !0
4684
+ });
4685
+ var o = t(3);
4686
+ Object.defineProperty(r, "conformToMask", {
4687
+ enumerable: !0,
4688
+ get: function () {
4689
+ return n(o).default;
4690
+ }
4691
+ });
4692
+ var i = t(2);
4693
+ Object.defineProperty(r, "adjustCaretPosition", {
4694
+ enumerable: !0,
4695
+ get: function () {
4696
+ return n(i).default;
4697
+ }
4698
+ });
4699
+ var a = t(5);
4700
+ Object.defineProperty(r, "createTextMaskInputElement", {
4701
+ enumerable: !0,
4702
+ get: function () {
4703
+ return n(a).default;
4704
+ }
4705
+ });
4706
+ }, function (e, r) {
4707
+
4708
+ Object.defineProperty(r, "__esModule", {
4709
+ value: !0
4710
+ }), r.placeholderChar = "_", r.strFunction = "function";
4711
+ }, function (e, r) {
4712
+
4713
+ function t(e) {
4714
+ var r = e.previousConformedValue,
4715
+ t = void 0 === r ? o : r,
4716
+ i = e.previousPlaceholder,
4717
+ a = void 0 === i ? o : i,
4718
+ u = e.currentCaretPosition,
4719
+ l = void 0 === u ? 0 : u,
4720
+ s = e.conformedValue,
4721
+ f = e.rawValue,
4722
+ d = e.placeholderChar,
4723
+ c = e.placeholder,
4724
+ p = e.indexesOfPipedChars,
4725
+ v = void 0 === p ? n : p,
4726
+ h = e.caretTrapIndexes,
4727
+ m = void 0 === h ? n : h;
4728
+ if (0 === l || !f.length) return 0;
4729
+ var y = f.length,
4730
+ g = t.length,
4731
+ b = c.length,
4732
+ C = s.length,
4733
+ P = y - g,
4734
+ k = P > 0,
4735
+ x = 0 === g,
4736
+ O = P > 1 && !k && !x;
4737
+ if (O) return l;
4738
+ var T = k && (t === s || s === c),
4739
+ w = 0,
4740
+ M = void 0,
4741
+ S = void 0;
4742
+ if (T) w = l - P;else {
4743
+ var j = s.toLowerCase(),
4744
+ _ = f.toLowerCase(),
4745
+ V = _.substr(0, l).split(o),
4746
+ A = V.filter(function (e) {
4747
+ return j.indexOf(e) !== -1;
4748
+ });
4749
+ S = A[A.length - 1];
4750
+ var N = a.substr(0, A.length).split(o).filter(function (e) {
4751
+ return e !== d;
4752
+ }).length,
4753
+ E = c.substr(0, A.length).split(o).filter(function (e) {
4754
+ return e !== d;
4755
+ }).length,
4756
+ F = E !== N,
4757
+ R = void 0 !== a[A.length - 1] && void 0 !== c[A.length - 2] && a[A.length - 1] !== d && a[A.length - 1] !== c[A.length - 1] && a[A.length - 1] === c[A.length - 2];
4758
+ !k && (F || R) && N > 0 && c.indexOf(S) > -1 && void 0 !== f[l] && (M = !0, S = f[l]);
4759
+ for (var I = v.map(function (e) {
4760
+ return j[e];
4761
+ }), J = I.filter(function (e) {
4762
+ return e === S;
4763
+ }).length, W = A.filter(function (e) {
4764
+ return e === S;
4765
+ }).length, q = c.substr(0, c.indexOf(d)).split(o).filter(function (e, r) {
4766
+ return e === S && f[r] !== e;
4767
+ }).length, L = q + W + J + (M ? 1 : 0), z = 0, B = 0; B < C; B++) {
4768
+ var D = j[B];
4769
+ if (w = B + 1, D === S && z++, z >= L) break;
4770
+ }
4771
+ }
4772
+ if (k) {
4773
+ for (var G = w, H = w; H <= b; H++) if (c[H] === d && (G = H), c[H] === d || m.indexOf(H) !== -1 || H === b) return G;
4774
+ } else if (M) {
4775
+ for (var K = w - 1; K >= 0; K--) if (s[K] === S || m.indexOf(K) !== -1 || 0 === K) return K;
4776
+ } else for (var Q = w; Q >= 0; Q--) if (c[Q - 1] === d || m.indexOf(Q) !== -1 || 0 === Q) return Q;
4777
+ }
4778
+ Object.defineProperty(r, "__esModule", {
4779
+ value: !0
4780
+ }), r.default = t;
4781
+ var n = [],
4782
+ o = "";
4783
+ }, function (e, r, t) {
4784
+
4785
+ function n() {
4786
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : l,
4787
+ r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : u,
4788
+ t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
4789
+ if (!(0, i.isArray)(r)) {
4790
+ if (("undefined" == typeof r ? "undefined" : o(r)) !== a.strFunction) throw new Error("Text-mask:conformToMask; The mask property must be an array.");
4791
+ r = r(e, t), r = (0, i.processCaretTraps)(r).maskWithoutCaretTraps;
4792
+ }
4793
+ var n = t.guide,
4794
+ s = void 0 === n || n,
4795
+ f = t.previousConformedValue,
4796
+ d = void 0 === f ? l : f,
4797
+ c = t.placeholderChar,
4798
+ p = void 0 === c ? a.placeholderChar : c,
4799
+ v = t.placeholder,
4800
+ h = void 0 === v ? (0, i.convertMaskToPlaceholder)(r, p) : v,
4801
+ m = t.currentCaretPosition,
4802
+ y = t.keepCharPositions,
4803
+ g = s === !1 && void 0 !== d,
4804
+ b = e.length,
4805
+ C = d.length,
4806
+ P = h.length,
4807
+ k = r.length,
4808
+ x = b - C,
4809
+ O = x > 0,
4810
+ T = m + (O ? -x : 0),
4811
+ w = T + Math.abs(x);
4812
+ if (y === !0 && !O) {
4813
+ for (var M = l, S = T; S < w; S++) h[S] === p && (M += p);
4814
+ e = e.slice(0, T) + M + e.slice(T, b);
4815
+ }
4816
+ for (var j = e.split(l).map(function (e, r) {
4817
+ return {
4818
+ char: e,
4819
+ isNew: r >= T && r < w
4820
+ };
4821
+ }), _ = b - 1; _ >= 0; _--) {
4822
+ var V = j[_].char;
4823
+ if (V !== p) {
4824
+ var A = _ >= T && C === k;
4825
+ V === h[A ? _ - x : _] && j.splice(_, 1);
4826
+ }
4827
+ }
4828
+ var N = l,
4829
+ E = !1;
4830
+ e: for (var F = 0; F < P; F++) {
4831
+ var R = h[F];
4832
+ if (R === p) {
4833
+ if (j.length > 0) for (; j.length > 0;) {
4834
+ var I = j.shift(),
4835
+ J = I.char,
4836
+ W = I.isNew;
4837
+ if (J === p && g !== !0) {
4838
+ N += p;
4839
+ continue e;
4840
+ }
4841
+ if (r[F].test(J)) {
4842
+ if (y === !0 && W !== !1 && d !== l && s !== !1 && O) {
4843
+ for (var q = j.length, L = null, z = 0; z < q; z++) {
4844
+ var B = j[z];
4845
+ if (B.char !== p && B.isNew === !1) break;
4846
+ if (B.char === p) {
4847
+ L = z;
4848
+ break;
4849
+ }
4850
+ }
4851
+ null !== L ? (N += J, j.splice(L, 1)) : F--;
4852
+ } else N += J;
4853
+ continue e;
4854
+ }
4855
+ E = !0;
4856
+ }
4857
+ g === !1 && (N += h.substr(F, P));
4858
+ break;
4859
+ }
4860
+ N += R;
4861
+ }
4862
+ if (g && O === !1) {
4863
+ for (var D = null, G = 0; G < N.length; G++) h[G] === p && (D = G);
4864
+ N = null !== D ? N.substr(0, D + 1) : l;
4865
+ }
4866
+ return {
4867
+ conformedValue: N,
4868
+ meta: {
4869
+ someCharsRejected: E
4870
+ }
4871
+ };
4872
+ }
4873
+ Object.defineProperty(r, "__esModule", {
4874
+ value: !0
4875
+ });
4876
+ var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
4877
+ return typeof e;
4878
+ } : function (e) {
4879
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
4880
+ };
4881
+ r.default = n;
4882
+ var i = t(4),
4883
+ a = t(1),
4884
+ u = [],
4885
+ l = "";
4886
+ }, function (e, r, t) {
4887
+
4888
+ function n() {
4889
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : f,
4890
+ r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : s.placeholderChar;
4891
+ if (!o(e)) throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");
4892
+ if (e.indexOf(r) !== -1) throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n" + ("The placeholder character that was received is: " + JSON.stringify(r) + "\n\n") + ("The mask that was received is: " + JSON.stringify(e)));
4893
+ return e.map(function (e) {
4894
+ return e instanceof RegExp ? r : e;
4895
+ }).join("");
4896
+ }
4897
+ function o(e) {
4898
+ return Array.isArray && Array.isArray(e) || e instanceof Array;
4899
+ }
4900
+ function i(e) {
4901
+ return "string" == typeof e || e instanceof String;
4902
+ }
4903
+ function a(e) {
4904
+ return "number" == typeof e && void 0 === e.length && !isNaN(e);
4905
+ }
4906
+ function u(e) {
4907
+ return "undefined" == typeof e || null === e;
4908
+ }
4909
+ function l(e) {
4910
+ for (var r = [], t = void 0; t = e.indexOf(d), t !== -1;) r.push(t), e.splice(t, 1);
4911
+ return {
4912
+ maskWithoutCaretTraps: e,
4913
+ indexes: r
4914
+ };
4915
+ }
4916
+ Object.defineProperty(r, "__esModule", {
4917
+ value: !0
4918
+ }), r.convertMaskToPlaceholder = n, r.isArray = o, r.isString = i, r.isNumber = a, r.isNil = u, r.processCaretTraps = l;
4919
+ var s = t(1),
4920
+ f = [],
4921
+ d = "[]";
4922
+ }, function (e, r, t) {
4923
+
4924
+ function n(e) {
4925
+ return e && e.__esModule ? e : {
4926
+ default: e
4927
+ };
4928
+ }
4929
+ function o(e) {
4930
+ var r = {
4931
+ previousConformedValue: void 0,
4932
+ previousPlaceholder: void 0
4933
+ };
4934
+ return {
4935
+ state: r,
4936
+ update: function (t) {
4937
+ var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e,
4938
+ o = n.inputElement,
4939
+ s = n.mask,
4940
+ d = n.guide,
4941
+ m = n.pipe,
4942
+ g = n.placeholderChar,
4943
+ b = void 0 === g ? v.placeholderChar : g,
4944
+ C = n.keepCharPositions,
4945
+ P = void 0 !== C && C,
4946
+ k = n.showMask,
4947
+ x = void 0 !== k && k;
4948
+ if ("undefined" == typeof t && (t = o.value), t !== r.previousConformedValue) {
4949
+ ("undefined" == typeof s ? "undefined" : l(s)) === y && void 0 !== s.pipe && void 0 !== s.mask && (m = s.pipe, s = s.mask);
4950
+ var O = void 0,
4951
+ T = void 0;
4952
+ if (s instanceof Array && (O = (0, p.convertMaskToPlaceholder)(s, b)), s !== !1) {
4953
+ var w = a(t),
4954
+ M = o.selectionEnd,
4955
+ S = r.previousConformedValue,
4956
+ j = r.previousPlaceholder,
4957
+ _ = void 0;
4958
+ if (("undefined" == typeof s ? "undefined" : l(s)) === v.strFunction) {
4959
+ if (T = s(w, {
4960
+ currentCaretPosition: M,
4961
+ previousConformedValue: S,
4962
+ placeholderChar: b
4963
+ }), T === !1) return;
4964
+ var V = (0, p.processCaretTraps)(T),
4965
+ A = V.maskWithoutCaretTraps,
4966
+ N = V.indexes;
4967
+ T = A, _ = N, O = (0, p.convertMaskToPlaceholder)(T, b);
4968
+ } else T = s;
4969
+ var E = {
4970
+ previousConformedValue: S,
4971
+ guide: d,
4972
+ placeholderChar: b,
4973
+ pipe: m,
4974
+ placeholder: O,
4975
+ currentCaretPosition: M,
4976
+ keepCharPositions: P
4977
+ },
4978
+ F = (0, c.default)(w, T, E),
4979
+ R = F.conformedValue,
4980
+ I = ("undefined" == typeof m ? "undefined" : l(m)) === v.strFunction,
4981
+ J = {};
4982
+ I && (J = m(R, u({
4983
+ rawValue: w
4984
+ }, E)), J === !1 ? J = {
4985
+ value: S,
4986
+ rejected: !0
4987
+ } : (0, p.isString)(J) && (J = {
4988
+ value: J
4989
+ }));
4990
+ var W = I ? J.value : R,
4991
+ q = (0, f.default)({
4992
+ previousConformedValue: S,
4993
+ previousPlaceholder: j,
4994
+ conformedValue: W,
4995
+ placeholder: O,
4996
+ rawValue: w,
4997
+ currentCaretPosition: M,
4998
+ placeholderChar: b,
4999
+ indexesOfPipedChars: J.indexesOfPipedChars,
5000
+ caretTrapIndexes: _
5001
+ }),
5002
+ L = W === O && 0 === q,
5003
+ z = x ? O : h,
5004
+ B = L ? z : W;
5005
+ r.previousConformedValue = B, r.previousPlaceholder = O, o.value !== B && (o.value = B, i(o, q));
5006
+ }
5007
+ }
5008
+ }
5009
+ };
5010
+ }
5011
+ function i(e, r) {
5012
+ document.activeElement === e && (g ? b(function () {
5013
+ return e.setSelectionRange(r, r, m);
5014
+ }, 0) : e.setSelectionRange(r, r, m));
5015
+ }
5016
+ function a(e) {
5017
+ if ((0, p.isString)(e)) return e;
5018
+ if ((0, p.isNumber)(e)) return String(e);
5019
+ if (void 0 === e || null === e) return h;
5020
+ throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value received was:\n\n " + JSON.stringify(e));
5021
+ }
5022
+ Object.defineProperty(r, "__esModule", {
5023
+ value: !0
5024
+ });
5025
+ var u = Object.assign || function (e) {
5026
+ for (var r = 1; r < arguments.length; r++) {
5027
+ var t = arguments[r];
5028
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
5029
+ }
5030
+ return e;
5031
+ },
5032
+ l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
5033
+ return typeof e;
5034
+ } : function (e) {
5035
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
5036
+ };
5037
+ r.default = o;
5038
+ var s = t(2),
5039
+ f = n(s),
5040
+ d = t(3),
5041
+ c = n(d),
5042
+ p = t(4),
5043
+ v = t(1),
5044
+ h = "",
5045
+ m = "none",
5046
+ y = "object",
5047
+ g = "undefined" != typeof navigator && /Android/i.test(navigator.userAgent),
5048
+ b = "undefined" != typeof requestAnimationFrame ? requestAnimationFrame : setTimeout;
5049
+ }]);
5050
+ });
5051
+ })(textMaskCore);
5052
+ var textMaskCoreExports = textMaskCore.exports;
5053
+
1793
5054
  const StyledInput = styled.input `
1794
5055
  border: none !important;
1795
5056
  background: none !important;
@@ -2003,6 +5264,7 @@ const Input$1 = (_a) => {
2003
5264
  if (type === 'number' && max && parseInt(newValue, 10) > parseInt(max, 10)) {
2004
5265
  e.target.value = `${max}`;
2005
5266
  }
5267
+ handleInputMaskChange(newValue);
2006
5268
  setInternalValue(e.target.value);
2007
5269
  if (onChange)
2008
5270
  onChange(e);
@@ -2031,8 +5293,30 @@ const Input$1 = (_a) => {
2031
5293
  formatted_value = formatAsSsn(internalValue);
2032
5294
  }
2033
5295
  if (mask && !format) {
2034
- formatted_value = formatAsMask(internalValue, mask);
5296
+ if (mask[0] !== '{') {
5297
+ formatted_value = formatAsMask(internalValue, mask);
5298
+ }
2035
5299
  }
5300
+ const inputRef = innerRef ? innerRef : React.useRef(null);
5301
+ const textMask = React.useRef(null); // Explicitly type the ref
5302
+ const numberMask = mask && mask[0] === '{' ? textMaskAddonsExports.createNumberMask(JSON.parse(mask)) : textMaskAddonsExports.createNumberMask({});
5303
+ React.useEffect(() => {
5304
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5305
+ if (inputRef.current) {
5306
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
5307
+ textMask.current = textMaskCoreExports.createTextMaskInputElement({
5308
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5309
+ inputElement: inputRef.current,
5310
+ mask: numberMask,
5311
+ });
5312
+ }
5313
+ }, [numberMask]);
5314
+ const handleInputMaskChange = (value) => {
5315
+ if (mask && !format && mask[0] === '{' && textMask.current) {
5316
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
5317
+ textMask.current.update(value); // Apply the mask
5318
+ }
5319
+ };
2036
5320
  const baseId = dataItemid || 'input';
2037
5321
  return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
2038
5322
  React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, maxLength: maxLength, onBlur: readOnly
@@ -2083,7 +5367,7 @@ const Input$1 = (_a) => {
2083
5367
  }, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, onPaste: e => {
2084
5368
  if (onPaste)
2085
5369
  onPaste(e);
2086
- }, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { "data-itemid": `${baseId}-input` })),
5370
+ }, placeholder: placeholder, readOnly: readOnly, ref: inputRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { "data-itemid": `${baseId}-input` })),
2087
5371
  loading ? (React.createElement(Loader$1, { "data-itemid": `${baseId}-loader` },
2088
5372
  React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
2089
5373
  showCharCount ? (React.createElement(CharacterCount, { "data-itemid": `${baseId}-char-count` },
@@ -2212,7 +5496,7 @@ const StepLine = styled.div `
2212
5496
  const Container$2 = styled.div ``;
2213
5497
  const ProgressBarFill = styled.div `
2214
5498
  width: 110px;
2215
- height: 8px;
5499
+ height: 12px;
2216
5500
  margin-top: 4px;
2217
5501
  background-color: #e7e6e6;
2218
5502
  border-radius: 16px;
@@ -2226,7 +5510,7 @@ const ProgressBarFill = styled.div `
2226
5510
  transform: translate(-50%, -50%);
2227
5511
  color: ${props => (props.$percent >= 83 ? '#fff' : '#757575')};
2228
5512
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
2229
- font-size: 8px;
5513
+ font-size: 11px;
2230
5514
  font-weight: 600;
2231
5515
  transition: left 0.5s ease-in-out;
2232
5516
  }