@ballistix.digital/react-components 3.0.1 → 3.1.1

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/index.js CHANGED
@@ -598,6 +598,15 @@ function isOverflowElement(element) {
598
598
  function isTableElement(element) {
599
599
  return ['table', 'td', 'th'].includes(getNodeName(element));
600
600
  }
601
+ function isTopLayer(element) {
602
+ return [':popover-open', ':modal'].some(selector => {
603
+ try {
604
+ return element.matches(selector);
605
+ } catch (e) {
606
+ return false;
607
+ }
608
+ });
609
+ }
601
610
  function isContainingBlock(element) {
602
611
  const webkit = isWebKit();
603
612
  const css = getComputedStyle(element);
@@ -606,6 +615,9 @@ function isContainingBlock(element) {
606
615
  function getContainingBlock(element) {
607
616
  let currentNode = getParentNode(element);
608
617
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
618
+ if (isTopLayer(currentNode)) {
619
+ return null;
620
+ }
609
621
  if (isContainingBlock(currentNode)) {
610
622
  return currentNode;
611
623
  }
@@ -631,8 +643,8 @@ function getNodeScroll(element) {
631
643
  };
632
644
  }
633
645
  return {
634
- scrollLeft: element.pageXOffset,
635
- scrollTop: element.pageYOffset
646
+ scrollLeft: element.scrollX,
647
+ scrollTop: element.scrollY
636
648
  };
637
649
  }
638
650
  function getParentNode(node) {
@@ -740,7 +752,7 @@ function isJSDOM() {
740
752
  }
741
753
  function isMouseLikePointerType(pointerType, strict) {
742
754
  const values = ['mouse', 'pen'];
743
- if (!strict) {
755
+ {
744
756
  values.push('', undefined);
745
757
  }
746
758
  return values.includes(pointerType);
@@ -1197,10 +1209,12 @@ const flip$2 = function (options) {
1197
1209
  return {};
1198
1210
  }
1199
1211
  const side = getSide(placement);
1212
+ const initialSideAxis = getSideAxis(initialPlacement);
1200
1213
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1201
1214
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1202
1215
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1203
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
1216
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
1217
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1204
1218
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1205
1219
  }
1206
1220
  const placements = [initialPlacement, ...fallbackPlacements];
@@ -1238,8 +1252,15 @@ const flip$2 = function (options) {
1238
1252
  switch (fallbackStrategy) {
1239
1253
  case 'bestFit':
1240
1254
  {
1241
- var _overflowsData$map$so;
1242
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
1255
+ var _overflowsData$filter2;
1256
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
1257
+ if (hasFallbackAxisSideDirection) {
1258
+ const currentSideAxis = getSideAxis(d.placement);
1259
+ return currentSideAxis === initialSideAxis ||
1260
+ currentSideAxis === 'y';
1261
+ }
1262
+ return true;
1263
+ }).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];
1243
1264
  if (placement) {
1244
1265
  resetPlacement = placement;
1245
1266
  }
@@ -1516,16 +1537,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
1516
1537
  y
1517
1538
  });
1518
1539
  }
1519
- const topLayerSelectors = [':popover-open', ':modal'];
1520
- function isTopLayer(element) {
1521
- return topLayerSelectors.some(selector => {
1522
- try {
1523
- return element.matches(selector);
1524
- } catch (e) {
1525
- return false;
1526
- }
1527
- });
1528
- }
1529
1540
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1530
1541
  let {
1531
1542
  elements,
@@ -2871,6 +2882,14 @@ const FloatingArrow = React__namespace.forwardRef(function FloatingArrow(props,
2871
2882
  }
2872
2883
  }
2873
2884
  const clipPathId = useId();
2885
+ const [isRTL, setIsRTL] = React__namespace.useState(false);
2886
+ index(() => {
2887
+ if (!floating) return;
2888
+ const isRTL = getComputedStyle(floating).direction === 'rtl';
2889
+ if (isRTL) {
2890
+ setIsRTL(true);
2891
+ }
2892
+ }, [floating]);
2874
2893
  if (!floating) {
2875
2894
  return null;
2876
2895
  }
@@ -2879,7 +2898,6 @@ const FloatingArrow = React__namespace.forwardRef(function FloatingArrow(props,
2879
2898
  const svgX = width / 2 * (tipRadius / -8 + 1);
2880
2899
  const svgY = height / 2 * tipRadius / 4;
2881
2900
  const [side, alignment] = placement.split('-');
2882
- const isRTL = platform.isRTL(floating);
2883
2901
  const isCustomShape = !!d;
2884
2902
  const isVerticalSide = side === 'top' || side === 'bottom';
2885
2903
  const yOffsetProp = staticOffset && alignment === 'end' ? 'bottom' : 'top';
@@ -2982,10 +3000,7 @@ function useHover(context, props) {
2982
3000
  onOpenChange,
2983
3001
  dataRef,
2984
3002
  events,
2985
- elements: {
2986
- domReference,
2987
- floating
2988
- }
3003
+ elements
2989
3004
  } = context;
2990
3005
  const {
2991
3006
  enabled = true,
@@ -2999,6 +3014,7 @@ function useHover(context, props) {
2999
3014
  const parentId = useFloatingParentNodeId();
3000
3015
  const handleCloseRef = useLatestRef(handleClose);
3001
3016
  const delayRef = useLatestRef(delay);
3017
+ const openRef = useLatestRef(open);
3002
3018
  const pointerTypeRef = React__namespace.useRef();
3003
3019
  const timeoutRef = React__namespace.useRef(-1);
3004
3020
  const handlerRef = React__namespace.useRef();
@@ -3012,9 +3028,7 @@ function useHover(context, props) {
3012
3028
  return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';
3013
3029
  }, [dataRef]);
3014
3030
  React__namespace.useEffect(() => {
3015
- if (!enabled) {
3016
- return;
3017
- }
3031
+ if (!enabled) return;
3018
3032
  function onOpenChange(_ref) {
3019
3033
  let {
3020
3034
  open
@@ -3031,20 +3045,20 @@ function useHover(context, props) {
3031
3045
  };
3032
3046
  }, [enabled, events]);
3033
3047
  React__namespace.useEffect(() => {
3034
- if (!enabled || !handleCloseRef.current || !open) {
3035
- return;
3036
- }
3048
+ if (!enabled) return;
3049
+ if (!handleCloseRef.current) return;
3050
+ if (!open) return;
3037
3051
  function onLeave(event) {
3038
3052
  if (isHoverOpen()) {
3039
3053
  onOpenChange(false, event, 'hover');
3040
3054
  }
3041
3055
  }
3042
- const html = getDocument(floating).documentElement;
3056
+ const html = getDocument(elements.floating).documentElement;
3043
3057
  html.addEventListener('mouseleave', onLeave);
3044
3058
  return () => {
3045
3059
  html.removeEventListener('mouseleave', onLeave);
3046
3060
  };
3047
- }, [floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
3061
+ }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
3048
3062
  const closeWithDelay = React__namespace.useCallback(function (event, runElseBranch, reason) {
3049
3063
  if (runElseBranch === void 0) {
3050
3064
  runElseBranch = true;
@@ -3067,16 +3081,14 @@ function useHover(context, props) {
3067
3081
  });
3068
3082
  const clearPointerEvents = useEffectEvent(() => {
3069
3083
  if (performedPointerEventsMutationRef.current) {
3070
- const body = getDocument(floating).body;
3084
+ const body = getDocument(elements.floating).body;
3071
3085
  body.style.pointerEvents = '';
3072
3086
  body.removeAttribute(safePolygonIdentifier);
3073
3087
  performedPointerEventsMutationRef.current = false;
3074
3088
  }
3075
3089
  });
3076
3090
  React__namespace.useEffect(() => {
3077
- if (!enabled) {
3078
- return;
3079
- }
3091
+ if (!enabled) return;
3080
3092
  function isClickLikeOpenEvent() {
3081
3093
  return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;
3082
3094
  }
@@ -3089,7 +3101,9 @@ function useHover(context, props) {
3089
3101
  const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);
3090
3102
  if (openDelay) {
3091
3103
  timeoutRef.current = window.setTimeout(() => {
3092
- onOpenChange(true, event, 'hover');
3104
+ if (!openRef.current) {
3105
+ onOpenChange(true, event, 'hover');
3106
+ }
3093
3107
  }, openDelay);
3094
3108
  } else {
3095
3109
  onOpenChange(true, event, 'hover');
@@ -3098,7 +3112,7 @@ function useHover(context, props) {
3098
3112
  function onMouseLeave(event) {
3099
3113
  if (isClickLikeOpenEvent()) return;
3100
3114
  unbindMouseMoveRef.current();
3101
- const doc = getDocument(floating);
3115
+ const doc = getDocument(elements.floating);
3102
3116
  clearTimeout(restTimeoutRef.current);
3103
3117
  if (handleCloseRef.current && dataRef.current.floatingContext) {
3104
3118
  if (!open) {
@@ -3122,7 +3136,7 @@ function useHover(context, props) {
3122
3136
  };
3123
3137
  return;
3124
3138
  }
3125
- const shouldClose = pointerTypeRef.current === 'touch' ? !contains(floating, event.relatedTarget) : true;
3139
+ const shouldClose = pointerTypeRef.current === 'touch' ? !contains(elements.floating, event.relatedTarget) : true;
3126
3140
  if (shouldClose) {
3127
3141
  closeWithDelay(event);
3128
3142
  }
@@ -3142,50 +3156,51 @@ function useHover(context, props) {
3142
3156
  }
3143
3157
  })(event);
3144
3158
  }
3145
- if (isElement(domReference)) {
3146
- const ref = domReference;
3159
+ if (isElement(elements.domReference)) {
3160
+ var _elements$floating;
3161
+ const ref = elements.domReference;
3147
3162
  open && ref.addEventListener('mouseleave', onScrollMouseLeave);
3148
- floating == null || floating.addEventListener('mouseleave', onScrollMouseLeave);
3163
+ (_elements$floating = elements.floating) == null || _elements$floating.addEventListener('mouseleave', onScrollMouseLeave);
3149
3164
  move && ref.addEventListener('mousemove', onMouseEnter, {
3150
3165
  once: true
3151
3166
  });
3152
3167
  ref.addEventListener('mouseenter', onMouseEnter);
3153
3168
  ref.addEventListener('mouseleave', onMouseLeave);
3154
3169
  return () => {
3170
+ var _elements$floating2;
3155
3171
  open && ref.removeEventListener('mouseleave', onScrollMouseLeave);
3156
- floating == null || floating.removeEventListener('mouseleave', onScrollMouseLeave);
3172
+ (_elements$floating2 = elements.floating) == null || _elements$floating2.removeEventListener('mouseleave', onScrollMouseLeave);
3157
3173
  move && ref.removeEventListener('mousemove', onMouseEnter);
3158
3174
  ref.removeEventListener('mouseenter', onMouseEnter);
3159
3175
  ref.removeEventListener('mouseleave', onMouseLeave);
3160
3176
  };
3161
3177
  }
3162
- }, [domReference, floating, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, tree, delayRef, handleCloseRef, dataRef]);
3178
+ }, [elements, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef]);
3163
3179
  index(() => {
3164
3180
  var _handleCloseRef$curre;
3165
- if (!enabled) {
3166
- return;
3167
- }
3181
+ if (!enabled) return;
3168
3182
  if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {
3169
- const body = getDocument(floating).body;
3183
+ const body = getDocument(elements.floating).body;
3170
3184
  body.setAttribute(safePolygonIdentifier, '');
3171
3185
  body.style.pointerEvents = 'none';
3172
3186
  performedPointerEventsMutationRef.current = true;
3173
- if (isElement(domReference) && floating) {
3187
+ const floatingEl = elements.floating;
3188
+ if (isElement(elements.domReference) && floatingEl) {
3174
3189
  var _tree$nodesRef$curren;
3175
- const ref = domReference;
3190
+ const ref = elements.domReference;
3176
3191
  const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;
3177
3192
  if (parentFloating) {
3178
3193
  parentFloating.style.pointerEvents = '';
3179
3194
  }
3180
3195
  ref.style.pointerEvents = 'auto';
3181
- floating.style.pointerEvents = 'auto';
3196
+ floatingEl.style.pointerEvents = 'auto';
3182
3197
  return () => {
3183
3198
  ref.style.pointerEvents = '';
3184
- floating.style.pointerEvents = '';
3199
+ floatingEl.style.pointerEvents = '';
3185
3200
  };
3186
3201
  }
3187
3202
  }
3188
- }, [enabled, open, parentId, floating, domReference, tree, handleCloseRef, isHoverOpen]);
3203
+ }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);
3189
3204
  index(() => {
3190
3205
  if (!open) {
3191
3206
  pointerTypeRef.current = undefined;
@@ -3200,51 +3215,50 @@ function useHover(context, props) {
3200
3215
  clearTimeout(restTimeoutRef.current);
3201
3216
  clearPointerEvents();
3202
3217
  };
3203
- }, [enabled, domReference, cleanupMouseMoveHandler, clearPointerEvents]);
3204
- return React__namespace.useMemo(() => {
3205
- if (!enabled) {
3206
- return {};
3207
- }
3218
+ }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);
3219
+ const reference = React__namespace.useMemo(() => {
3208
3220
  function setPointerRef(event) {
3209
3221
  pointerTypeRef.current = event.pointerType;
3210
3222
  }
3211
3223
  return {
3212
- reference: {
3213
- onPointerDown: setPointerRef,
3214
- onPointerEnter: setPointerRef,
3215
- onMouseMove(event) {
3216
- const {
3217
- nativeEvent
3218
- } = event;
3219
- function handleMouseMove() {
3220
- if (!blockMouseMoveRef.current) {
3221
- onOpenChange(true, nativeEvent, 'hover');
3222
- }
3223
- }
3224
- if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
3225
- return;
3226
- }
3227
- if (open || restMs === 0) {
3228
- return;
3229
- }
3230
- clearTimeout(restTimeoutRef.current);
3231
- if (pointerTypeRef.current === 'touch') {
3232
- handleMouseMove();
3233
- } else {
3234
- restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);
3224
+ onPointerDown: setPointerRef,
3225
+ onPointerEnter: setPointerRef,
3226
+ onMouseMove(event) {
3227
+ const {
3228
+ nativeEvent
3229
+ } = event;
3230
+ function handleMouseMove() {
3231
+ if (!blockMouseMoveRef.current && !openRef.current) {
3232
+ onOpenChange(true, nativeEvent, 'hover');
3235
3233
  }
3236
3234
  }
3237
- },
3238
- floating: {
3239
- onMouseEnter() {
3240
- clearTimeout(timeoutRef.current);
3241
- },
3242
- onMouseLeave(event) {
3243
- closeWithDelay(event.nativeEvent, false);
3235
+ if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
3236
+ return;
3237
+ }
3238
+ if (open || restMs === 0) {
3239
+ return;
3240
+ }
3241
+ clearTimeout(restTimeoutRef.current);
3242
+ if (pointerTypeRef.current === 'touch') {
3243
+ handleMouseMove();
3244
+ } else {
3245
+ restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);
3244
3246
  }
3245
3247
  }
3246
3248
  };
3247
- }, [enabled, mouseOnly, open, restMs, onOpenChange, closeWithDelay]);
3249
+ }, [mouseOnly, onOpenChange, open, openRef, restMs]);
3250
+ const floating = React__namespace.useMemo(() => ({
3251
+ onMouseEnter() {
3252
+ clearTimeout(timeoutRef.current);
3253
+ },
3254
+ onMouseLeave(event) {
3255
+ closeWithDelay(event.nativeEvent, false);
3256
+ }
3257
+ }), [closeWithDelay]);
3258
+ return React__namespace.useMemo(() => enabled ? {
3259
+ reference,
3260
+ floating
3261
+ } : {}, [enabled, reference, floating]);
3248
3262
  }
3249
3263
  const NOOP = () => {};
3250
3264
  React__namespace.createContext({
@@ -3339,8 +3353,8 @@ React__namespace.forwardRef(function FloatingOverlay(props, ref) {
3339
3353
  const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;
3340
3354
  const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';
3341
3355
  const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
3342
- const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.pageXOffset;
3343
- const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.pageYOffset;
3356
+ const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;
3357
+ const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;
3344
3358
  bodyStyle.overflow = 'hidden';
3345
3359
  if (scrollbarWidth) {
3346
3360
  bodyStyle[paddingProp] = scrollbarWidth + "px";
@@ -3413,11 +3427,7 @@ function useDismiss(context, props) {
3413
3427
  const {
3414
3428
  open,
3415
3429
  onOpenChange,
3416
- elements: {
3417
- reference,
3418
- domReference,
3419
- floating
3420
- },
3430
+ elements,
3421
3431
  dataRef
3422
3432
  } = context;
3423
3433
  const {
@@ -3495,7 +3505,7 @@ function useDismiss(context, props) {
3495
3505
  }
3496
3506
  const target = getTarget(event);
3497
3507
  const inertSelector = "[" + createAttribute('inert') + "]";
3498
- const markers = getDocument(floating).querySelectorAll(inertSelector);
3508
+ const markers = getDocument(elements.floating).querySelectorAll(inertSelector);
3499
3509
  let targetRootAncestor = isElement(target) ? target : null;
3500
3510
  while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
3501
3511
  const nextParent = getParentNode(targetRootAncestor);
@@ -3505,7 +3515,7 @@ function useDismiss(context, props) {
3505
3515
  targetRootAncestor = nextParent;
3506
3516
  }
3507
3517
  if (markers.length && isElement(target) && !isRootElement(target) &&
3508
- !contains(target, floating) &&
3518
+ !contains(target, elements.floating) &&
3509
3519
  Array.from(markers).every(marker => !contains(targetRootAncestor, marker))) {
3510
3520
  return;
3511
3521
  }
@@ -3528,7 +3538,7 @@ function useDismiss(context, props) {
3528
3538
  var _node$context;
3529
3539
  return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
3530
3540
  });
3531
- if (isEventTargetWithin(event, floating) || isEventTargetWithin(event, domReference) || targetIsInsideChildren) {
3541
+ if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {
3532
3542
  return;
3533
3543
  }
3534
3544
  const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];
@@ -3565,19 +3575,19 @@ function useDismiss(context, props) {
3565
3575
  function onScroll(event) {
3566
3576
  onOpenChange(false, event, 'ancestor-scroll');
3567
3577
  }
3568
- const doc = getDocument(floating);
3578
+ const doc = getDocument(elements.floating);
3569
3579
  escapeKey && doc.addEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
3570
3580
  outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
3571
3581
  let ancestors = [];
3572
3582
  if (ancestorScroll) {
3573
- if (isElement(domReference)) {
3574
- ancestors = getOverflowAncestors(domReference);
3583
+ if (isElement(elements.domReference)) {
3584
+ ancestors = getOverflowAncestors(elements.domReference);
3575
3585
  }
3576
- if (isElement(floating)) {
3577
- ancestors = ancestors.concat(getOverflowAncestors(floating));
3586
+ if (isElement(elements.floating)) {
3587
+ ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
3578
3588
  }
3579
- if (!isElement(reference) && reference && reference.contextElement) {
3580
- ancestors = ancestors.concat(getOverflowAncestors(reference.contextElement));
3589
+ if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {
3590
+ ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
3581
3591
  }
3582
3592
  }
3583
3593
  ancestors = ancestors.filter(ancestor => {
@@ -3596,37 +3606,34 @@ function useDismiss(context, props) {
3596
3606
  ancestor.removeEventListener('scroll', onScroll);
3597
3607
  });
3598
3608
  };
3599
- }, [dataRef, floating, domReference, reference, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
3609
+ }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
3600
3610
  React__namespace.useEffect(() => {
3601
3611
  insideReactTreeRef.current = false;
3602
3612
  }, [outsidePress, outsidePressEvent]);
3603
- return React__namespace.useMemo(() => {
3604
- if (!enabled) {
3605
- return {};
3606
- }
3607
- return {
3608
- reference: {
3609
- onKeyDown: closeOnEscapeKeyDown,
3610
- [bubbleHandlerKeys[referencePressEvent]]: event => {
3611
- if (referencePress) {
3612
- onOpenChange(false, event.nativeEvent, 'reference-press');
3613
- }
3614
- }
3615
- },
3616
- floating: {
3617
- onKeyDown: closeOnEscapeKeyDown,
3618
- onMouseDown() {
3619
- endedOrStartedInsideRef.current = true;
3620
- },
3621
- onMouseUp() {
3622
- endedOrStartedInsideRef.current = true;
3623
- },
3624
- [captureHandlerKeys[outsidePressEvent]]: () => {
3625
- insideReactTreeRef.current = true;
3626
- }
3613
+ const reference = React__namespace.useMemo(() => ({
3614
+ onKeyDown: closeOnEscapeKeyDown,
3615
+ [bubbleHandlerKeys[referencePressEvent]]: event => {
3616
+ if (referencePress) {
3617
+ onOpenChange(false, event.nativeEvent, 'reference-press');
3627
3618
  }
3628
- };
3629
- }, [enabled, referencePress, outsidePressEvent, referencePressEvent, onOpenChange, closeOnEscapeKeyDown]);
3619
+ }
3620
+ }), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
3621
+ const floating = React__namespace.useMemo(() => ({
3622
+ onKeyDown: closeOnEscapeKeyDown,
3623
+ onMouseDown() {
3624
+ endedOrStartedInsideRef.current = true;
3625
+ },
3626
+ onMouseUp() {
3627
+ endedOrStartedInsideRef.current = true;
3628
+ },
3629
+ [captureHandlerKeys[outsidePressEvent]]: () => {
3630
+ insideReactTreeRef.current = true;
3631
+ }
3632
+ }), [closeOnEscapeKeyDown, outsidePressEvent]);
3633
+ return React__namespace.useMemo(() => enabled ? {
3634
+ reference,
3635
+ floating
3636
+ } : {}, [enabled, reference, floating]);
3630
3637
  }
3631
3638
  function useFloatingRootContext(options) {
3632
3639
  const {
@@ -3768,9 +3775,7 @@ function useFocus(context, props) {
3768
3775
  onOpenChange,
3769
3776
  events,
3770
3777
  dataRef,
3771
- elements: {
3772
- domReference
3773
- }
3778
+ elements
3774
3779
  } = context;
3775
3780
  const {
3776
3781
  enabled = true,
@@ -3780,12 +3785,10 @@ function useFocus(context, props) {
3780
3785
  const timeoutRef = React__namespace.useRef();
3781
3786
  const keyboardModalityRef = React__namespace.useRef(true);
3782
3787
  React__namespace.useEffect(() => {
3783
- if (!enabled) {
3784
- return;
3785
- }
3786
- const win = getWindow(domReference);
3788
+ if (!enabled) return;
3789
+ const win = getWindow(elements.domReference);
3787
3790
  function onBlur() {
3788
- if (!open && isHTMLElement(domReference) && domReference === activeElement(getDocument(domReference))) {
3791
+ if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference))) {
3789
3792
  blockFocusRef.current = true;
3790
3793
  }
3791
3794
  }
@@ -3798,11 +3801,9 @@ function useFocus(context, props) {
3798
3801
  win.removeEventListener('blur', onBlur);
3799
3802
  win.removeEventListener('keydown', onKeyDown, true);
3800
3803
  };
3801
- }, [domReference, open, enabled]);
3804
+ }, [elements.domReference, open, enabled]);
3802
3805
  React__namespace.useEffect(() => {
3803
- if (!enabled) {
3804
- return;
3805
- }
3806
+ if (!enabled) return;
3806
3807
  function onOpenChange(_ref) {
3807
3808
  let {
3808
3809
  reason
@@ -3821,51 +3822,48 @@ function useFocus(context, props) {
3821
3822
  clearTimeout(timeoutRef.current);
3822
3823
  };
3823
3824
  }, []);
3824
- return React__namespace.useMemo(() => {
3825
- if (!enabled) {
3826
- return {};
3827
- }
3828
- return {
3829
- reference: {
3830
- onPointerDown(event) {
3831
- if (isVirtualPointerEvent(event.nativeEvent)) return;
3832
- keyboardModalityRef.current = false;
3833
- },
3834
- onMouseLeave() {
3835
- blockFocusRef.current = false;
3836
- },
3837
- onFocus(event) {
3838
- if (blockFocusRef.current) return;
3839
- const target = getTarget(event.nativeEvent);
3840
- if (visibleOnly && isElement(target)) {
3841
- try {
3842
- if (isSafari() && isMac()) throw Error();
3843
- if (!target.matches(':focus-visible')) return;
3844
- } catch (e) {
3845
- if (!keyboardModalityRef.current && !isTypeableElement(target)) {
3846
- return;
3847
- }
3848
- }
3825
+ const reference = React__namespace.useMemo(() => ({
3826
+ onPointerDown(event) {
3827
+ if (isVirtualPointerEvent(event.nativeEvent)) return;
3828
+ keyboardModalityRef.current = false;
3829
+ },
3830
+ onMouseLeave() {
3831
+ blockFocusRef.current = false;
3832
+ },
3833
+ onFocus(event) {
3834
+ if (blockFocusRef.current) return;
3835
+ const target = getTarget(event.nativeEvent);
3836
+ if (visibleOnly && isElement(target)) {
3837
+ try {
3838
+ if (isSafari() && isMac()) throw Error();
3839
+ if (!target.matches(':focus-visible')) return;
3840
+ } catch (e) {
3841
+ if (!keyboardModalityRef.current && !isTypeableElement(target)) {
3842
+ return;
3849
3843
  }
3850
- onOpenChange(true, event.nativeEvent, 'focus');
3851
- },
3852
- onBlur(event) {
3853
- blockFocusRef.current = false;
3854
- const relatedTarget = event.relatedTarget;
3855
- const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';
3856
- timeoutRef.current = window.setTimeout(() => {
3857
- var _dataRef$current$floa;
3858
- const activeEl = activeElement(domReference ? domReference.ownerDocument : document);
3859
- if (!relatedTarget && activeEl === domReference) return;
3860
- if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
3861
- return;
3862
- }
3863
- onOpenChange(false, event.nativeEvent, 'focus');
3864
- });
3865
3844
  }
3866
3845
  }
3867
- };
3868
- }, [enabled, visibleOnly, dataRef, domReference, onOpenChange]);
3846
+ onOpenChange(true, event.nativeEvent, 'focus');
3847
+ },
3848
+ onBlur(event) {
3849
+ blockFocusRef.current = false;
3850
+ const relatedTarget = event.relatedTarget;
3851
+ const nativeEvent = event.nativeEvent;
3852
+ const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';
3853
+ timeoutRef.current = window.setTimeout(() => {
3854
+ var _dataRef$current$floa;
3855
+ const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);
3856
+ if (!relatedTarget && activeEl === elements.domReference) return;
3857
+ if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {
3858
+ return;
3859
+ }
3860
+ onOpenChange(false, nativeEvent, 'focus');
3861
+ });
3862
+ }
3863
+ }), [dataRef, elements.domReference, onOpenChange, visibleOnly]);
3864
+ return React__namespace.useMemo(() => enabled ? {
3865
+ reference
3866
+ } : {}, [enabled, reference]);
3869
3867
  }
3870
3868
  const ACTIVE_KEY = 'active';
3871
3869
  const SELECTED_KEY = 'selected';
@@ -3928,13 +3926,15 @@ function useInteractions(propsList) {
3928
3926
  if (propsList === void 0) {
3929
3927
  propsList = [];
3930
3928
  }
3931
- const deps = propsList;
3929
+ const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);
3930
+ const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);
3931
+ const itemDeps = propsList.map(key => key == null ? void 0 : key.item);
3932
3932
  const getReferenceProps = React__namespace.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),
3933
- deps);
3933
+ referenceDeps);
3934
3934
  const getFloatingProps = React__namespace.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),
3935
- deps);
3935
+ floatingDeps);
3936
3936
  const getItemProps = React__namespace.useCallback(userProps => mergeProps(userProps, propsList, 'item'),
3937
- propsList.map(key => key == null ? void 0 : key.item));
3937
+ itemDeps);
3938
3938
  return React__namespace.useMemo(() => ({
3939
3939
  getReferenceProps,
3940
3940
  getFloatingProps,
@@ -3959,8 +3959,34 @@ function useRole(context, props) {
3959
3959
  const referenceId = useId();
3960
3960
  const parentId = useFloatingParentNodeId();
3961
3961
  const isNested = parentId != null;
3962
- return React__namespace.useMemo(() => {
3963
- if (!enabled) return {};
3962
+ const reference = React__namespace.useMemo(() => {
3963
+ if (ariaRole === 'tooltip' || role === 'label') {
3964
+ return {
3965
+ ["aria-" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined
3966
+ };
3967
+ }
3968
+ return {
3969
+ 'aria-expanded': open ? 'true' : 'false',
3970
+ 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,
3971
+ 'aria-controls': open ? floatingId : undefined,
3972
+ ...(ariaRole === 'listbox' && {
3973
+ role: 'combobox'
3974
+ }),
3975
+ ...(ariaRole === 'menu' && {
3976
+ id: referenceId
3977
+ }),
3978
+ ...(ariaRole === 'menu' && isNested && {
3979
+ role: 'menuitem'
3980
+ }),
3981
+ ...(role === 'select' && {
3982
+ 'aria-autocomplete': 'none'
3983
+ }),
3984
+ ...(role === 'combobox' && {
3985
+ 'aria-autocomplete': 'list'
3986
+ })
3987
+ };
3988
+ }, [ariaRole, floatingId, isNested, open, referenceId, role]);
3989
+ const floating = React__namespace.useMemo(() => {
3964
3990
  const floatingProps = {
3965
3991
  id: floatingId,
3966
3992
  ...(ariaRole && {
@@ -3968,71 +3994,49 @@ function useRole(context, props) {
3968
3994
  })
3969
3995
  };
3970
3996
  if (ariaRole === 'tooltip' || role === 'label') {
3971
- return {
3972
- reference: {
3973
- ["aria-" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined
3974
- },
3975
- floating: floatingProps
3976
- };
3997
+ return floatingProps;
3977
3998
  }
3978
3999
  return {
3979
- reference: {
3980
- 'aria-expanded': open ? 'true' : 'false',
3981
- 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,
3982
- 'aria-controls': open ? floatingId : undefined,
3983
- ...(ariaRole === 'listbox' && {
3984
- role: 'combobox'
3985
- }),
3986
- ...(ariaRole === 'menu' && {
3987
- id: referenceId
3988
- }),
3989
- ...(ariaRole === 'menu' && isNested && {
3990
- role: 'menuitem'
3991
- }),
3992
- ...(role === 'select' && {
3993
- 'aria-autocomplete': 'none'
3994
- }),
3995
- ...(role === 'combobox' && {
3996
- 'aria-autocomplete': 'list'
3997
- })
3998
- },
3999
- floating: {
4000
- ...floatingProps,
4001
- ...(ariaRole === 'menu' && {
4002
- 'aria-labelledby': referenceId
4003
- })
4004
- },
4005
- item(_ref) {
4006
- let {
4007
- active,
4008
- selected
4009
- } = _ref;
4010
- const commonProps = {
4011
- role: 'option',
4012
- ...(active && {
4013
- id: floatingId + "-option"
4014
- })
4000
+ ...floatingProps,
4001
+ ...(ariaRole === 'menu' && {
4002
+ 'aria-labelledby': referenceId
4003
+ })
4004
+ };
4005
+ }, [ariaRole, floatingId, referenceId, role]);
4006
+ const item = React__namespace.useCallback(_ref => {
4007
+ let {
4008
+ active,
4009
+ selected
4010
+ } = _ref;
4011
+ const commonProps = {
4012
+ role: 'option',
4013
+ ...(active && {
4014
+ id: floatingId + "-option"
4015
+ })
4016
+ };
4017
+ switch (role) {
4018
+ case 'select':
4019
+ return {
4020
+ ...commonProps,
4021
+ 'aria-selected': active && selected
4015
4022
  };
4016
- switch (role) {
4017
- case 'select':
4018
- return {
4019
- ...commonProps,
4020
- 'aria-selected': active && selected
4021
- };
4022
- case 'combobox':
4023
- {
4024
- return {
4025
- ...commonProps,
4026
- ...(active && {
4027
- 'aria-selected': true
4028
- })
4029
- };
4030
- }
4023
+ case 'combobox':
4024
+ {
4025
+ return {
4026
+ ...commonProps,
4027
+ ...(active && {
4028
+ 'aria-selected': true
4029
+ })
4030
+ };
4031
4031
  }
4032
- return {};
4033
- }
4034
- };
4035
- }, [enabled, role, ariaRole, open, floatingId, referenceId, isNested]);
4032
+ }
4033
+ return {};
4034
+ }, [floatingId, role]);
4035
+ return React__namespace.useMemo(() => enabled ? {
4036
+ reference,
4037
+ floating,
4038
+ item
4039
+ } : {}, [enabled, reference, floating, item]);
4036
4040
  }
4037
4041
 
4038
4042
  var TooltipElement = function (props) {
@@ -8728,23 +8732,25 @@ var moment$1 = {exports: {}};
8728
8732
  };
8729
8733
  }
8730
8734
  function isValid(m) {
8731
- if (m._isValid == null) {
8732
- var flags = getParsingFlags(m),
8733
- parsedParts = some.call(flags.parsedDateParts, function (i) {
8734
- return i != null;
8735
- }),
8736
- isNowValid =
8737
- !isNaN(m._d.getTime()) &&
8738
- flags.overflow < 0 &&
8739
- !flags.empty &&
8740
- !flags.invalidEra &&
8741
- !flags.invalidMonth &&
8742
- !flags.invalidWeekday &&
8743
- !flags.weekdayMismatch &&
8744
- !flags.nullInput &&
8745
- !flags.invalidFormat &&
8746
- !flags.userInvalidated &&
8747
- (!flags.meridiem || (flags.meridiem && parsedParts));
8735
+ var flags = null,
8736
+ parsedParts = false,
8737
+ isNowValid = m._d && !isNaN(m._d.getTime());
8738
+ if (isNowValid) {
8739
+ flags = getParsingFlags(m);
8740
+ parsedParts = some.call(flags.parsedDateParts, function (i) {
8741
+ return i != null;
8742
+ });
8743
+ isNowValid =
8744
+ flags.overflow < 0 &&
8745
+ !flags.empty &&
8746
+ !flags.invalidEra &&
8747
+ !flags.invalidMonth &&
8748
+ !flags.invalidWeekday &&
8749
+ !flags.weekdayMismatch &&
8750
+ !flags.nullInput &&
8751
+ !flags.invalidFormat &&
8752
+ !flags.userInvalidated &&
8753
+ (!flags.meridiem || (flags.meridiem && parsedParts));
8748
8754
  if (m._strict) {
8749
8755
  isNowValid =
8750
8756
  isNowValid &&
@@ -8752,11 +8758,11 @@ var moment$1 = {exports: {}};
8752
8758
  flags.unusedTokens.length === 0 &&
8753
8759
  flags.bigHour === undefined;
8754
8760
  }
8755
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
8756
- m._isValid = isNowValid;
8757
- } else {
8758
- return isNowValid;
8759
- }
8761
+ }
8762
+ if (Object.isFrozen == null || !Object.isFrozen(m)) {
8763
+ m._isValid = isNowValid;
8764
+ } else {
8765
+ return isNowValid;
8760
8766
  }
8761
8767
  return m._isValid;
8762
8768
  }
@@ -9137,11 +9143,56 @@ var moment$1 = {exports: {}};
9137
9143
  var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
9138
9144
  return isFunction(format) ? format(output) : format.replace(/%s/i, output);
9139
9145
  }
9140
- var aliases = {};
9141
- function addUnitAlias(unit, shorthand) {
9142
- var lowerCase = unit.toLowerCase();
9143
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
9144
- }
9146
+ var aliases = {
9147
+ D: 'date',
9148
+ dates: 'date',
9149
+ date: 'date',
9150
+ d: 'day',
9151
+ days: 'day',
9152
+ day: 'day',
9153
+ e: 'weekday',
9154
+ weekdays: 'weekday',
9155
+ weekday: 'weekday',
9156
+ E: 'isoWeekday',
9157
+ isoweekdays: 'isoWeekday',
9158
+ isoweekday: 'isoWeekday',
9159
+ DDD: 'dayOfYear',
9160
+ dayofyears: 'dayOfYear',
9161
+ dayofyear: 'dayOfYear',
9162
+ h: 'hour',
9163
+ hours: 'hour',
9164
+ hour: 'hour',
9165
+ ms: 'millisecond',
9166
+ milliseconds: 'millisecond',
9167
+ millisecond: 'millisecond',
9168
+ m: 'minute',
9169
+ minutes: 'minute',
9170
+ minute: 'minute',
9171
+ M: 'month',
9172
+ months: 'month',
9173
+ month: 'month',
9174
+ Q: 'quarter',
9175
+ quarters: 'quarter',
9176
+ quarter: 'quarter',
9177
+ s: 'second',
9178
+ seconds: 'second',
9179
+ second: 'second',
9180
+ gg: 'weekYear',
9181
+ weekyears: 'weekYear',
9182
+ weekyear: 'weekYear',
9183
+ GG: 'isoWeekYear',
9184
+ isoweekyears: 'isoWeekYear',
9185
+ isoweekyear: 'isoWeekYear',
9186
+ w: 'week',
9187
+ weeks: 'week',
9188
+ week: 'week',
9189
+ W: 'isoWeek',
9190
+ isoweeks: 'isoWeek',
9191
+ isoweek: 'isoWeek',
9192
+ y: 'year',
9193
+ years: 'year',
9194
+ year: 'year',
9195
+ };
9145
9196
  function normalizeUnits(units) {
9146
9197
  return typeof units === 'string'
9147
9198
  ? aliases[units] || aliases[units.toLowerCase()]
@@ -9161,10 +9212,24 @@ var moment$1 = {exports: {}};
9161
9212
  }
9162
9213
  return normalizedInput;
9163
9214
  }
9164
- var priorities = {};
9165
- function addUnitPriority(unit, priority) {
9166
- priorities[unit] = priority;
9167
- }
9215
+ var priorities = {
9216
+ date: 9,
9217
+ day: 11,
9218
+ weekday: 11,
9219
+ isoWeekday: 11,
9220
+ dayOfYear: 4,
9221
+ hour: 13,
9222
+ millisecond: 16,
9223
+ minute: 14,
9224
+ month: 8,
9225
+ quarter: 7,
9226
+ second: 15,
9227
+ weekYear: 1,
9228
+ isoWeekYear: 1,
9229
+ week: 5,
9230
+ isoWeek: 5,
9231
+ year: 1,
9232
+ };
9168
9233
  function getPrioritizedUnits(unitsObj) {
9169
9234
  var units = [],
9170
9235
  u;
@@ -9178,83 +9243,6 @@ var moment$1 = {exports: {}};
9178
9243
  });
9179
9244
  return units;
9180
9245
  }
9181
- function isLeapYear(year) {
9182
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
9183
- }
9184
- function absFloor(number) {
9185
- if (number < 0) {
9186
- return Math.ceil(number) || 0;
9187
- } else {
9188
- return Math.floor(number);
9189
- }
9190
- }
9191
- function toInt(argumentForCoercion) {
9192
- var coercedNumber = +argumentForCoercion,
9193
- value = 0;
9194
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
9195
- value = absFloor(coercedNumber);
9196
- }
9197
- return value;
9198
- }
9199
- function makeGetSet(unit, keepTime) {
9200
- return function (value) {
9201
- if (value != null) {
9202
- set$1(this, unit, value);
9203
- hooks.updateOffset(this, keepTime);
9204
- return this;
9205
- } else {
9206
- return get(this, unit);
9207
- }
9208
- };
9209
- }
9210
- function get(mom, unit) {
9211
- return mom.isValid()
9212
- ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
9213
- : NaN;
9214
- }
9215
- function set$1(mom, unit, value) {
9216
- if (mom.isValid() && !isNaN(value)) {
9217
- if (
9218
- unit === 'FullYear' &&
9219
- isLeapYear(mom.year()) &&
9220
- mom.month() === 1 &&
9221
- mom.date() === 29
9222
- ) {
9223
- value = toInt(value);
9224
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
9225
- value,
9226
- mom.month(),
9227
- daysInMonth(value, mom.month())
9228
- );
9229
- } else {
9230
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
9231
- }
9232
- }
9233
- }
9234
- function stringGet(units) {
9235
- units = normalizeUnits(units);
9236
- if (isFunction(this[units])) {
9237
- return this[units]();
9238
- }
9239
- return this;
9240
- }
9241
- function stringSet(units, value) {
9242
- if (typeof units === 'object') {
9243
- units = normalizeObjectUnits(units);
9244
- var prioritized = getPrioritizedUnits(units),
9245
- i,
9246
- prioritizedLen = prioritized.length;
9247
- for (i = 0; i < prioritizedLen; i++) {
9248
- this[prioritized[i].unit](units[prioritized[i].unit]);
9249
- }
9250
- } else {
9251
- units = normalizeUnits(units);
9252
- if (isFunction(this[units])) {
9253
- return this[units](value);
9254
- }
9255
- }
9256
- return this;
9257
- }
9258
9246
  var match1 = /\d/,
9259
9247
  match2 = /\d\d/,
9260
9248
  match3 = /\d{3}/,
@@ -9273,6 +9261,8 @@ var moment$1 = {exports: {}};
9273
9261
  matchTimestamp = /[+-]?\d+(\.\d{1,3})?/,
9274
9262
  matchWord =
9275
9263
  /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
9264
+ match1to2NoLeadingZero = /^[1-9]\d?/,
9265
+ match1to2HasZero = /^([1-9]\d|\d)/,
9276
9266
  regexes;
9277
9267
  regexes = {};
9278
9268
  function addRegexToken(token, regex, strictRegex) {
@@ -9303,6 +9293,21 @@ var moment$1 = {exports: {}};
9303
9293
  function regexEscape(s) {
9304
9294
  return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
9305
9295
  }
9296
+ function absFloor(number) {
9297
+ if (number < 0) {
9298
+ return Math.ceil(number) || 0;
9299
+ } else {
9300
+ return Math.floor(number);
9301
+ }
9302
+ }
9303
+ function toInt(argumentForCoercion) {
9304
+ var coercedNumber = +argumentForCoercion,
9305
+ value = 0;
9306
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
9307
+ value = absFloor(coercedNumber);
9308
+ }
9309
+ return value;
9310
+ }
9306
9311
  var tokens = {};
9307
9312
  function addParseToken(token, callback) {
9308
9313
  var i,
@@ -9332,6 +9337,9 @@ var moment$1 = {exports: {}};
9332
9337
  tokens[token](input, config._a, config, token);
9333
9338
  }
9334
9339
  }
9340
+ function isLeapYear(year) {
9341
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
9342
+ }
9335
9343
  var YEAR = 0,
9336
9344
  MONTH = 1,
9337
9345
  DATE = 2,
@@ -9341,6 +9349,137 @@ var moment$1 = {exports: {}};
9341
9349
  MILLISECOND = 6,
9342
9350
  WEEK = 7,
9343
9351
  WEEKDAY = 8;
9352
+ addFormatToken('Y', 0, 0, function () {
9353
+ var y = this.year();
9354
+ return y <= 9999 ? zeroFill(y, 4) : '+' + y;
9355
+ });
9356
+ addFormatToken(0, ['YY', 2], 0, function () {
9357
+ return this.year() % 100;
9358
+ });
9359
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
9360
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
9361
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
9362
+ addRegexToken('Y', matchSigned);
9363
+ addRegexToken('YY', match1to2, match2);
9364
+ addRegexToken('YYYY', match1to4, match4);
9365
+ addRegexToken('YYYYY', match1to6, match6);
9366
+ addRegexToken('YYYYYY', match1to6, match6);
9367
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
9368
+ addParseToken('YYYY', function (input, array) {
9369
+ array[YEAR] =
9370
+ input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
9371
+ });
9372
+ addParseToken('YY', function (input, array) {
9373
+ array[YEAR] = hooks.parseTwoDigitYear(input);
9374
+ });
9375
+ addParseToken('Y', function (input, array) {
9376
+ array[YEAR] = parseInt(input, 10);
9377
+ });
9378
+ function daysInYear(year) {
9379
+ return isLeapYear(year) ? 366 : 365;
9380
+ }
9381
+ hooks.parseTwoDigitYear = function (input) {
9382
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
9383
+ };
9384
+ var getSetYear = makeGetSet('FullYear', true);
9385
+ function getIsLeapYear() {
9386
+ return isLeapYear(this.year());
9387
+ }
9388
+ function makeGetSet(unit, keepTime) {
9389
+ return function (value) {
9390
+ if (value != null) {
9391
+ set$1(this, unit, value);
9392
+ hooks.updateOffset(this, keepTime);
9393
+ return this;
9394
+ } else {
9395
+ return get(this, unit);
9396
+ }
9397
+ };
9398
+ }
9399
+ function get(mom, unit) {
9400
+ if (!mom.isValid()) {
9401
+ return NaN;
9402
+ }
9403
+ var d = mom._d,
9404
+ isUTC = mom._isUTC;
9405
+ switch (unit) {
9406
+ case 'Milliseconds':
9407
+ return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
9408
+ case 'Seconds':
9409
+ return isUTC ? d.getUTCSeconds() : d.getSeconds();
9410
+ case 'Minutes':
9411
+ return isUTC ? d.getUTCMinutes() : d.getMinutes();
9412
+ case 'Hours':
9413
+ return isUTC ? d.getUTCHours() : d.getHours();
9414
+ case 'Date':
9415
+ return isUTC ? d.getUTCDate() : d.getDate();
9416
+ case 'Day':
9417
+ return isUTC ? d.getUTCDay() : d.getDay();
9418
+ case 'Month':
9419
+ return isUTC ? d.getUTCMonth() : d.getMonth();
9420
+ case 'FullYear':
9421
+ return isUTC ? d.getUTCFullYear() : d.getFullYear();
9422
+ default:
9423
+ return NaN;
9424
+ }
9425
+ }
9426
+ function set$1(mom, unit, value) {
9427
+ var d, isUTC, year, month, date;
9428
+ if (!mom.isValid() || isNaN(value)) {
9429
+ return;
9430
+ }
9431
+ d = mom._d;
9432
+ isUTC = mom._isUTC;
9433
+ switch (unit) {
9434
+ case 'Milliseconds':
9435
+ return void (isUTC
9436
+ ? d.setUTCMilliseconds(value)
9437
+ : d.setMilliseconds(value));
9438
+ case 'Seconds':
9439
+ return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
9440
+ case 'Minutes':
9441
+ return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
9442
+ case 'Hours':
9443
+ return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
9444
+ case 'Date':
9445
+ return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
9446
+ case 'FullYear':
9447
+ break;
9448
+ default:
9449
+ return;
9450
+ }
9451
+ year = value;
9452
+ month = mom.month();
9453
+ date = mom.date();
9454
+ date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
9455
+ void (isUTC
9456
+ ? d.setUTCFullYear(year, month, date)
9457
+ : d.setFullYear(year, month, date));
9458
+ }
9459
+ function stringGet(units) {
9460
+ units = normalizeUnits(units);
9461
+ if (isFunction(this[units])) {
9462
+ return this[units]();
9463
+ }
9464
+ return this;
9465
+ }
9466
+ function stringSet(units, value) {
9467
+ if (typeof units === 'object') {
9468
+ units = normalizeObjectUnits(units);
9469
+ var prioritized = getPrioritizedUnits(units),
9470
+ i,
9471
+ prioritizedLen = prioritized.length;
9472
+ for (i = 0; i < prioritizedLen; i++) {
9473
+ this[prioritized[i].unit](units[prioritized[i].unit]);
9474
+ }
9475
+ } else {
9476
+ units = normalizeUnits(units);
9477
+ if (isFunction(this[units])) {
9478
+ return this[units](value);
9479
+ }
9480
+ }
9481
+ return this;
9482
+ }
9344
9483
  function mod(n, x) {
9345
9484
  return ((n % x) + x) % x;
9346
9485
  }
@@ -9379,9 +9518,7 @@ var moment$1 = {exports: {}};
9379
9518
  addFormatToken('MMMM', 0, 0, function (format) {
9380
9519
  return this.localeData().months(this, format);
9381
9520
  });
9382
- addUnitAlias('month', 'M');
9383
- addUnitPriority('month', 8);
9384
- addRegexToken('M', match1to2);
9521
+ addRegexToken('M', match1to2, match1to2NoLeadingZero);
9385
9522
  addRegexToken('MM', match1to2, match2);
9386
9523
  addRegexToken('MMM', function (isStrict, locale) {
9387
9524
  return locale.monthsShortRegex(isStrict);
@@ -9524,7 +9661,6 @@ var moment$1 = {exports: {}};
9524
9661
  }
9525
9662
  }
9526
9663
  function setMonth(mom, value) {
9527
- var dayOfMonth;
9528
9664
  if (!mom.isValid()) {
9529
9665
  return mom;
9530
9666
  }
@@ -9538,8 +9674,12 @@ var moment$1 = {exports: {}};
9538
9674
  }
9539
9675
  }
9540
9676
  }
9541
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
9542
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
9677
+ var month = value,
9678
+ date = mom.date();
9679
+ date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
9680
+ void (mom._isUTC
9681
+ ? mom._d.setUTCMonth(month, date)
9682
+ : mom._d.setMonth(month, date));
9543
9683
  return mom;
9544
9684
  }
9545
9685
  function getSetMonth(value) {
@@ -9600,24 +9740,21 @@ var moment$1 = {exports: {}};
9600
9740
  longPieces = [],
9601
9741
  mixedPieces = [],
9602
9742
  i,
9603
- mom;
9743
+ mom,
9744
+ shortP,
9745
+ longP;
9604
9746
  for (i = 0; i < 12; i++) {
9605
9747
  mom = createUTC([2000, i]);
9606
- shortPieces.push(this.monthsShort(mom, ''));
9607
- longPieces.push(this.months(mom, ''));
9608
- mixedPieces.push(this.months(mom, ''));
9609
- mixedPieces.push(this.monthsShort(mom, ''));
9748
+ shortP = regexEscape(this.monthsShort(mom, ''));
9749
+ longP = regexEscape(this.months(mom, ''));
9750
+ shortPieces.push(shortP);
9751
+ longPieces.push(longP);
9752
+ mixedPieces.push(longP);
9753
+ mixedPieces.push(shortP);
9610
9754
  }
9611
9755
  shortPieces.sort(cmpLenRev);
9612
9756
  longPieces.sort(cmpLenRev);
9613
9757
  mixedPieces.sort(cmpLenRev);
9614
- for (i = 0; i < 12; i++) {
9615
- shortPieces[i] = regexEscape(shortPieces[i]);
9616
- longPieces[i] = regexEscape(longPieces[i]);
9617
- }
9618
- for (i = 0; i < 24; i++) {
9619
- mixedPieces[i] = regexEscape(mixedPieces[i]);
9620
- }
9621
9758
  this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
9622
9759
  this._monthsShortRegex = this._monthsRegex;
9623
9760
  this._monthsStrictRegex = new RegExp(
@@ -9629,44 +9766,6 @@ var moment$1 = {exports: {}};
9629
9766
  'i'
9630
9767
  );
9631
9768
  }
9632
- addFormatToken('Y', 0, 0, function () {
9633
- var y = this.year();
9634
- return y <= 9999 ? zeroFill(y, 4) : '+' + y;
9635
- });
9636
- addFormatToken(0, ['YY', 2], 0, function () {
9637
- return this.year() % 100;
9638
- });
9639
- addFormatToken(0, ['YYYY', 4], 0, 'year');
9640
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
9641
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
9642
- addUnitAlias('year', 'y');
9643
- addUnitPriority('year', 1);
9644
- addRegexToken('Y', matchSigned);
9645
- addRegexToken('YY', match1to2, match2);
9646
- addRegexToken('YYYY', match1to4, match4);
9647
- addRegexToken('YYYYY', match1to6, match6);
9648
- addRegexToken('YYYYYY', match1to6, match6);
9649
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
9650
- addParseToken('YYYY', function (input, array) {
9651
- array[YEAR] =
9652
- input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
9653
- });
9654
- addParseToken('YY', function (input, array) {
9655
- array[YEAR] = hooks.parseTwoDigitYear(input);
9656
- });
9657
- addParseToken('Y', function (input, array) {
9658
- array[YEAR] = parseInt(input, 10);
9659
- });
9660
- function daysInYear(year) {
9661
- return isLeapYear(year) ? 366 : 365;
9662
- }
9663
- hooks.parseTwoDigitYear = function (input) {
9664
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
9665
- };
9666
- var getSetYear = makeGetSet('FullYear', true);
9667
- function getIsLeapYear() {
9668
- return isLeapYear(this.year());
9669
- }
9670
9769
  function createDate(y, m, d, h, M, s, ms) {
9671
9770
  var date;
9672
9771
  if (y < 100 && y >= 0) {
@@ -9747,13 +9846,9 @@ var moment$1 = {exports: {}};
9747
9846
  }
9748
9847
  addFormatToken('w', ['ww', 2], 'wo', 'week');
9749
9848
  addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
9750
- addUnitAlias('week', 'w');
9751
- addUnitAlias('isoWeek', 'W');
9752
- addUnitPriority('week', 5);
9753
- addUnitPriority('isoWeek', 5);
9754
- addRegexToken('w', match1to2);
9849
+ addRegexToken('w', match1to2, match1to2NoLeadingZero);
9755
9850
  addRegexToken('ww', match1to2, match2);
9756
- addRegexToken('W', match1to2);
9851
+ addRegexToken('W', match1to2, match1to2NoLeadingZero);
9757
9852
  addRegexToken('WW', match1to2, match2);
9758
9853
  addWeekParseToken(
9759
9854
  ['w', 'ww', 'W', 'WW'],
@@ -9794,12 +9889,6 @@ var moment$1 = {exports: {}};
9794
9889
  });
9795
9890
  addFormatToken('e', 0, 0, 'weekday');
9796
9891
  addFormatToken('E', 0, 0, 'isoWeekday');
9797
- addUnitAlias('day', 'd');
9798
- addUnitAlias('weekday', 'e');
9799
- addUnitAlias('isoWeekday', 'E');
9800
- addUnitPriority('day', 11);
9801
- addUnitPriority('weekday', 11);
9802
- addUnitPriority('isoWeekday', 11);
9803
9892
  addRegexToken('d', match1to2);
9804
9893
  addRegexToken('e', match1to2);
9805
9894
  addRegexToken('E', match1to2);
@@ -9863,22 +9952,22 @@ var moment$1 = {exports: {}};
9863
9952
  return m === true
9864
9953
  ? shiftWeekdays(weekdays, this._week.dow)
9865
9954
  : m
9866
- ? weekdays[m.day()]
9867
- : weekdays;
9955
+ ? weekdays[m.day()]
9956
+ : weekdays;
9868
9957
  }
9869
9958
  function localeWeekdaysShort(m) {
9870
9959
  return m === true
9871
9960
  ? shiftWeekdays(this._weekdaysShort, this._week.dow)
9872
9961
  : m
9873
- ? this._weekdaysShort[m.day()]
9874
- : this._weekdaysShort;
9962
+ ? this._weekdaysShort[m.day()]
9963
+ : this._weekdaysShort;
9875
9964
  }
9876
9965
  function localeWeekdaysMin(m) {
9877
9966
  return m === true
9878
9967
  ? shiftWeekdays(this._weekdaysMin, this._week.dow)
9879
9968
  : m
9880
- ? this._weekdaysMin[m.day()]
9881
- : this._weekdaysMin;
9969
+ ? this._weekdaysMin[m.day()]
9970
+ : this._weekdaysMin;
9882
9971
  }
9883
9972
  function handleStrictParse$1(weekdayName, format, strict) {
9884
9973
  var i,
@@ -10014,7 +10103,7 @@ var moment$1 = {exports: {}};
10014
10103
  if (!this.isValid()) {
10015
10104
  return input != null ? this : NaN;
10016
10105
  }
10017
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
10106
+ var day = get(this, 'Day');
10018
10107
  if (input != null) {
10019
10108
  input = parseWeekday(input, this.localeData());
10020
10109
  return this.add(input - day, 'd');
@@ -10184,16 +10273,14 @@ var moment$1 = {exports: {}};
10184
10273
  }
10185
10274
  meridiem('a', true);
10186
10275
  meridiem('A', false);
10187
- addUnitAlias('hour', 'h');
10188
- addUnitPriority('hour', 13);
10189
10276
  function matchMeridiem(isStrict, locale) {
10190
10277
  return locale._meridiemParse;
10191
10278
  }
10192
10279
  addRegexToken('a', matchMeridiem);
10193
10280
  addRegexToken('A', matchMeridiem);
10194
- addRegexToken('H', match1to2);
10195
- addRegexToken('h', match1to2);
10196
- addRegexToken('k', match1to2);
10281
+ addRegexToken('H', match1to2, match1to2HasZero);
10282
+ addRegexToken('h', match1to2, match1to2NoLeadingZero);
10283
+ addRegexToken('k', match1to2, match1to2NoLeadingZero);
10197
10284
  addRegexToken('HH', match1to2, match2);
10198
10285
  addRegexToken('hh', match1to2, match2);
10199
10286
  addRegexToken('kk', match1to2, match2);
@@ -10313,7 +10400,7 @@ var moment$1 = {exports: {}};
10313
10400
  return globalLocale;
10314
10401
  }
10315
10402
  function isLocaleNameSane(name) {
10316
- return name.match('^[^/\\\\]*$') != null;
10403
+ return !!(name && name.match('^[^/\\\\]*$'));
10317
10404
  }
10318
10405
  function loadLocale(name) {
10319
10406
  var oldLocale = null,
@@ -10465,21 +10552,21 @@ var moment$1 = {exports: {}};
10465
10552
  a[MONTH] < 0 || a[MONTH] > 11
10466
10553
  ? MONTH
10467
10554
  : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
10468
- ? DATE
10469
- : a[HOUR] < 0 ||
10470
- a[HOUR] > 24 ||
10471
- (a[HOUR] === 24 &&
10472
- (a[MINUTE] !== 0 ||
10473
- a[SECOND] !== 0 ||
10474
- a[MILLISECOND] !== 0))
10475
- ? HOUR
10476
- : a[MINUTE] < 0 || a[MINUTE] > 59
10477
- ? MINUTE
10478
- : a[SECOND] < 0 || a[SECOND] > 59
10479
- ? SECOND
10480
- : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
10481
- ? MILLISECOND
10482
- : -1;
10555
+ ? DATE
10556
+ : a[HOUR] < 0 ||
10557
+ a[HOUR] > 24 ||
10558
+ (a[HOUR] === 24 &&
10559
+ (a[MINUTE] !== 0 ||
10560
+ a[SECOND] !== 0 ||
10561
+ a[MILLISECOND] !== 0))
10562
+ ? HOUR
10563
+ : a[MINUTE] < 0 || a[MINUTE] > 59
10564
+ ? MINUTE
10565
+ : a[SECOND] < 0 || a[SECOND] > 59
10566
+ ? SECOND
10567
+ : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
10568
+ ? MILLISECOND
10569
+ : -1;
10483
10570
  if (
10484
10571
  getParsingFlags(m)._overflowDayOfYear &&
10485
10572
  (overflow < YEAR || overflow > DATE)
@@ -11222,8 +11309,7 @@ var moment$1 = {exports: {}};
11222
11309
  i;
11223
11310
  for (i = 0; i < len; i++) {
11224
11311
  if (
11225
- (dontConvert && array1[i] !== array2[i]) ||
11226
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
11312
+ (toInt(array1[i]) !== toInt(array2[i]))
11227
11313
  ) {
11228
11314
  diffs++;
11229
11315
  }
@@ -11635,16 +11721,16 @@ var moment$1 = {exports: {}};
11635
11721
  return diff < -6
11636
11722
  ? 'sameElse'
11637
11723
  : diff < -1
11638
- ? 'lastWeek'
11639
- : diff < 0
11640
- ? 'lastDay'
11641
- : diff < 1
11642
- ? 'sameDay'
11643
- : diff < 2
11644
- ? 'nextDay'
11645
- : diff < 7
11646
- ? 'nextWeek'
11647
- : 'sameElse';
11724
+ ? 'lastWeek'
11725
+ : diff < 0
11726
+ ? 'lastDay'
11727
+ : diff < 1
11728
+ ? 'sameDay'
11729
+ : diff < 2
11730
+ ? 'nextDay'
11731
+ : diff < 7
11732
+ ? 'nextWeek'
11733
+ : 'sameElse';
11648
11734
  }
11649
11735
  function calendar$1(time, formats) {
11650
11736
  if (arguments.length === 1) {
@@ -12328,14 +12414,20 @@ var moment$1 = {exports: {}};
12328
12414
  mixedPieces = [],
12329
12415
  i,
12330
12416
  l,
12417
+ erasName,
12418
+ erasAbbr,
12419
+ erasNarrow,
12331
12420
  eras = this.eras();
12332
12421
  for (i = 0, l = eras.length; i < l; ++i) {
12333
- namePieces.push(regexEscape(eras[i].name));
12334
- abbrPieces.push(regexEscape(eras[i].abbr));
12335
- narrowPieces.push(regexEscape(eras[i].narrow));
12336
- mixedPieces.push(regexEscape(eras[i].name));
12337
- mixedPieces.push(regexEscape(eras[i].abbr));
12338
- mixedPieces.push(regexEscape(eras[i].narrow));
12422
+ erasName = regexEscape(eras[i].name);
12423
+ erasAbbr = regexEscape(eras[i].abbr);
12424
+ erasNarrow = regexEscape(eras[i].narrow);
12425
+ namePieces.push(erasName);
12426
+ abbrPieces.push(erasAbbr);
12427
+ narrowPieces.push(erasNarrow);
12428
+ mixedPieces.push(erasName);
12429
+ mixedPieces.push(erasAbbr);
12430
+ mixedPieces.push(erasNarrow);
12339
12431
  }
12340
12432
  this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
12341
12433
  this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
@@ -12358,10 +12450,6 @@ var moment$1 = {exports: {}};
12358
12450
  addWeekYearFormatToken('ggggg', 'weekYear');
12359
12451
  addWeekYearFormatToken('GGGG', 'isoWeekYear');
12360
12452
  addWeekYearFormatToken('GGGGG', 'isoWeekYear');
12361
- addUnitAlias('weekYear', 'gg');
12362
- addUnitAlias('isoWeekYear', 'GG');
12363
- addUnitPriority('weekYear', 1);
12364
- addUnitPriority('isoWeekYear', 1);
12365
12453
  addRegexToken('G', matchSigned);
12366
12454
  addRegexToken('g', matchSigned);
12367
12455
  addRegexToken('GG', match1to2, match2);
@@ -12384,7 +12472,7 @@ var moment$1 = {exports: {}};
12384
12472
  this,
12385
12473
  input,
12386
12474
  this.week(),
12387
- this.weekday(),
12475
+ this.weekday() + this.localeData()._week.dow,
12388
12476
  this.localeData()._week.dow,
12389
12477
  this.localeData()._week.doy
12390
12478
  );
@@ -12434,8 +12522,6 @@ var moment$1 = {exports: {}};
12434
12522
  return this;
12435
12523
  }
12436
12524
  addFormatToken('Q', 0, 'Qo', 'quarter');
12437
- addUnitAlias('quarter', 'Q');
12438
- addUnitPriority('quarter', 7);
12439
12525
  addRegexToken('Q', match1);
12440
12526
  addParseToken('Q', function (input, array) {
12441
12527
  array[MONTH] = (toInt(input) - 1) * 3;
@@ -12446,9 +12532,7 @@ var moment$1 = {exports: {}};
12446
12532
  : this.month((input - 1) * 3 + (this.month() % 3));
12447
12533
  }
12448
12534
  addFormatToken('D', ['DD', 2], 'Do', 'date');
12449
- addUnitAlias('date', 'D');
12450
- addUnitPriority('date', 9);
12451
- addRegexToken('D', match1to2);
12535
+ addRegexToken('D', match1to2, match1to2NoLeadingZero);
12452
12536
  addRegexToken('DD', match1to2, match2);
12453
12537
  addRegexToken('Do', function (isStrict, locale) {
12454
12538
  return isStrict
@@ -12461,8 +12545,6 @@ var moment$1 = {exports: {}};
12461
12545
  });
12462
12546
  var getSetDayOfMonth = makeGetSet('Date', true);
12463
12547
  addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
12464
- addUnitAlias('dayOfYear', 'DDD');
12465
- addUnitPriority('dayOfYear', 4);
12466
12548
  addRegexToken('DDD', match1to3);
12467
12549
  addRegexToken('DDDD', match3);
12468
12550
  addParseToken(['DDD', 'DDDD'], function (input, array, config) {
@@ -12476,16 +12558,12 @@ var moment$1 = {exports: {}};
12476
12558
  return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
12477
12559
  }
12478
12560
  addFormatToken('m', ['mm', 2], 0, 'minute');
12479
- addUnitAlias('minute', 'm');
12480
- addUnitPriority('minute', 14);
12481
- addRegexToken('m', match1to2);
12561
+ addRegexToken('m', match1to2, match1to2HasZero);
12482
12562
  addRegexToken('mm', match1to2, match2);
12483
12563
  addParseToken(['m', 'mm'], MINUTE);
12484
12564
  var getSetMinute = makeGetSet('Minutes', false);
12485
12565
  addFormatToken('s', ['ss', 2], 0, 'second');
12486
- addUnitAlias('second', 's');
12487
- addUnitPriority('second', 15);
12488
- addRegexToken('s', match1to2);
12566
+ addRegexToken('s', match1to2, match1to2HasZero);
12489
12567
  addRegexToken('ss', match1to2, match2);
12490
12568
  addParseToken(['s', 'ss'], SECOND);
12491
12569
  var getSetSecond = makeGetSet('Seconds', false);
@@ -12514,8 +12592,6 @@ var moment$1 = {exports: {}};
12514
12592
  addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
12515
12593
  return this.millisecond() * 1000000;
12516
12594
  });
12517
- addUnitAlias('millisecond', 'ms');
12518
- addUnitPriority('millisecond', 16);
12519
12595
  addRegexToken('S', match1to3, match1);
12520
12596
  addRegexToken('SS', match1to3, match2);
12521
12597
  addRegexToken('SSS', match1to3, match3);
@@ -12773,12 +12849,12 @@ var moment$1 = {exports: {}};
12773
12849
  toInt((number % 100) / 10) === 1
12774
12850
  ? 'th'
12775
12851
  : b === 1
12776
- ? 'st'
12777
- : b === 2
12778
- ? 'nd'
12779
- : b === 3
12780
- ? 'rd'
12781
- : 'th';
12852
+ ? 'st'
12853
+ : b === 2
12854
+ ? 'nd'
12855
+ : b === 3
12856
+ ? 'rd'
12857
+ : 'th';
12782
12858
  return number + output;
12783
12859
  },
12784
12860
  });
@@ -12907,17 +12983,6 @@ var moment$1 = {exports: {}};
12907
12983
  }
12908
12984
  }
12909
12985
  }
12910
- function valueOf$1() {
12911
- if (!this.isValid()) {
12912
- return NaN;
12913
- }
12914
- return (
12915
- this._milliseconds +
12916
- this._days * 864e5 +
12917
- (this._months % 12) * 2592e6 +
12918
- toInt(this._months / 12) * 31536e6
12919
- );
12920
- }
12921
12986
  function makeAs(alias) {
12922
12987
  return function () {
12923
12988
  return this.as(alias);
@@ -12931,7 +12996,8 @@ var moment$1 = {exports: {}};
12931
12996
  asWeeks = makeAs('w'),
12932
12997
  asMonths = makeAs('M'),
12933
12998
  asQuarters = makeAs('Q'),
12934
- asYears = makeAs('y');
12999
+ asYears = makeAs('y'),
13000
+ valueOf$1 = asMilliseconds;
12935
13001
  function clone$1() {
12936
13002
  return createDuration(this);
12937
13003
  }
@@ -13145,7 +13211,7 @@ var moment$1 = {exports: {}};
13145
13211
  addParseToken('x', function (input, array, config) {
13146
13212
  config._d = new Date(toInt(input));
13147
13213
  });
13148
- hooks.version = '2.29.4';
13214
+ hooks.version = '2.30.1';
13149
13215
  setHookCallback(createLocal);
13150
13216
  hooks.fn = proto;
13151
13217
  hooks.min = min;
@@ -13497,34 +13563,45 @@ var classnames$1 = {exports: {}};
13497
13563
  (function (module) {
13498
13564
  (function () {
13499
13565
  var hasOwn = {}.hasOwnProperty;
13500
- function classNames() {
13501
- var classes = [];
13566
+ function classNames () {
13567
+ var classes = '';
13502
13568
  for (var i = 0; i < arguments.length; i++) {
13503
13569
  var arg = arguments[i];
13504
- if (!arg) continue;
13505
- var argType = typeof arg;
13506
- if (argType === 'string' || argType === 'number') {
13507
- classes.push(arg);
13508
- } else if (Array.isArray(arg)) {
13509
- if (arg.length) {
13510
- var inner = classNames.apply(null, arg);
13511
- if (inner) {
13512
- classes.push(inner);
13513
- }
13514
- }
13515
- } else if (argType === 'object') {
13516
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
13517
- classes.push(arg.toString());
13518
- continue;
13519
- }
13520
- for (var key in arg) {
13521
- if (hasOwn.call(arg, key) && arg[key]) {
13522
- classes.push(key);
13523
- }
13524
- }
13570
+ if (arg) {
13571
+ classes = appendClass(classes, parseValue(arg));
13525
13572
  }
13526
13573
  }
13527
- return classes.join(' ');
13574
+ return classes;
13575
+ }
13576
+ function parseValue (arg) {
13577
+ if (typeof arg === 'string' || typeof arg === 'number') {
13578
+ return arg;
13579
+ }
13580
+ if (typeof arg !== 'object') {
13581
+ return '';
13582
+ }
13583
+ if (Array.isArray(arg)) {
13584
+ return classNames.apply(null, arg);
13585
+ }
13586
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
13587
+ return arg.toString();
13588
+ }
13589
+ var classes = '';
13590
+ for (var key in arg) {
13591
+ if (hasOwn.call(arg, key) && arg[key]) {
13592
+ classes = appendClass(classes, key);
13593
+ }
13594
+ }
13595
+ return classes;
13596
+ }
13597
+ function appendClass (value, newClass) {
13598
+ if (!newClass) {
13599
+ return value;
13600
+ }
13601
+ if (value) {
13602
+ return value + ' ' + newClass;
13603
+ }
13604
+ return value + newClass;
13528
13605
  }
13529
13606
  if (module.exports) {
13530
13607
  classNames.default = classNames;