tamagui 1.88.11 → 1.88.13

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.
@@ -459,10 +459,10 @@ var require_clamp_native = __commonJS({
459
459
  return to;
460
460
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), clamp_exports = {};
461
461
  __export2(clamp_exports, {
462
- clamp: () => clamp
462
+ clamp: () => clamp2
463
463
  });
464
464
  module2.exports = __toCommonJS2(clamp_exports);
465
- function clamp(value, [min2, max2]) {
465
+ function clamp2(value, [min2, max2]) {
466
466
  return Math.min(max2, Math.max(min2, value));
467
467
  }
468
468
  }
@@ -4424,7 +4424,11 @@ var require_createComponent_native = __commonJS({
4424
4424
  let exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
4425
4425
  state.unmounted && env && staticConfig.variants[env] ? props[env] = !0 : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
4426
4426
  }
4427
- let shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
4427
+ let shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
4428
+ // disableClassName="until-hydrated" to be more straightforward
4429
+ // see issue if not, Button sets disableClassName to true <Button animation="" /> with
4430
+ // the react-native driver errors because it tries to animate var(--color) to rbga(..)
4431
+ propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
4428
4432
  if (groupName && !curState.group) {
4429
4433
  let listeners = /* @__PURE__ */ new Set();
4430
4434
  curState.group = {
@@ -6441,7 +6445,7 @@ var require_createResponderEvent_native = __commonJS({
6441
6445
  default: () => createResponderEvent
6442
6446
  });
6443
6447
  module2.exports = __toCommonJS2(createResponderEvent_exports);
6444
- var import_utils = require_utils_native(), emptyFunction = () => {
6448
+ var import_utils3 = require_utils_native(), emptyFunction = () => {
6445
6449
  }, emptyObject = {}, emptyArray = [];
6446
6450
  function normalizeIdentifier(identifier) {
6447
6451
  return identifier > 20 ? identifier % 20 : identifier;
@@ -6531,11 +6535,11 @@ var require_createResponderEvent_native = __commonJS({
6531
6535
  touchHistory: responderTouchHistoryStore.touchHistory
6532
6536
  };
6533
6537
  function locationX(x) {
6534
- if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
6538
+ if (rect = rect || (0, import_utils3.getBoundingClientRect)(responderEvent.currentTarget), rect)
6535
6539
  return x - rect.left;
6536
6540
  }
6537
6541
  function locationY(y) {
6538
- if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
6542
+ if (rect = rect || (0, import_utils3.getBoundingClientRect)(responderEvent.currentTarget), rect)
6539
6543
  return y - rect.top;
6540
6544
  }
6541
6545
  return responderEvent;
@@ -6743,7 +6747,7 @@ var require_ResponderSystem_native = __commonJS({
6743
6747
  terminateResponder: () => terminateResponder
6744
6748
  });
6745
6749
  module2.exports = __toCommonJS2(ResponderSystem_exports);
6746
- var import_createResponderEvent = __toESM2(require_createResponderEvent_native()), import_ResponderTouchHistoryStore = require_ResponderTouchHistoryStore_native(), import_types = require_types_native3(), import_utils = require_utils_native(), import_utils2 = require_utils_native(), emptyObject = {}, startRegistration = [
6750
+ var import_createResponderEvent = __toESM2(require_createResponderEvent_native()), import_ResponderTouchHistoryStore = require_ResponderTouchHistoryStore_native(), import_types = require_types_native3(), import_utils3 = require_utils_native(), import_utils22 = require_utils_native(), emptyObject = {}, startRegistration = [
6747
6751
  "onStartShouldSetResponderCapture",
6748
6752
  "onStartShouldSetResponder",
6749
6753
  { bubbles: !0 }
@@ -6782,16 +6786,16 @@ var require_ResponderSystem_native = __commonJS({
6782
6786
  trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
6783
6787
  return;
6784
6788
  }
6785
- let isStartEvent = (0, import_types.isStartish)(eventType) && (0, import_utils2.isPrimaryPointerDown)(domEvent), isMoveEvent = (0, import_types.isMoveish)(eventType), isEndEvent = (0, import_types.isEndish)(eventType), isScrollEvent = (0, import_types.isScroll)(eventType), isSelectionChangeEvent = (0, import_types.isSelectionChange)(eventType), responderEvent = (0, import_createResponderEvent.default)(domEvent, responderTouchHistoryStore);
6789
+ let isStartEvent = (0, import_types.isStartish)(eventType) && (0, import_utils22.isPrimaryPointerDown)(domEvent), isMoveEvent = (0, import_types.isMoveish)(eventType), isEndEvent = (0, import_types.isEndish)(eventType), isScrollEvent = (0, import_types.isScroll)(eventType), isSelectionChangeEvent = (0, import_types.isSelectionChange)(eventType), responderEvent = (0, import_createResponderEvent.default)(domEvent, responderTouchHistoryStore);
6786
6790
  (isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
6787
6791
  eventType,
6788
6792
  responderEvent.nativeEvent
6789
6793
  ));
6790
- let eventPaths = (0, import_utils2.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
6794
+ let eventPaths = (0, import_utils22.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
6791
6795
  if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
6792
6796
  let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
6793
6797
  if (currentResponderIdPath != null && eventIdPath != null) {
6794
- let lowestCommonAncestor = (0, import_utils2.getLowestCommonAncestor)(
6798
+ let lowestCommonAncestor = (0, import_utils22.getLowestCommonAncestor)(
6795
6799
  currentResponderIdPath,
6796
6800
  eventIdPath
6797
6801
  );
@@ -6826,7 +6830,7 @@ var require_ResponderSystem_native = __commonJS({
6826
6830
  eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
6827
6831
  isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
6828
6832
  isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
6829
- isSelectionChangeEvent && (0, import_utils2.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils2.hasTargetTouches)(node, domEvent.touches);
6833
+ isSelectionChangeEvent && (0, import_utils22.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils22.hasTargetTouches)(node, domEvent.touches);
6830
6834
  if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
6831
6835
  let shouldTerminate = !0;
6832
6836
  (eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") && (wasNegotiated ? shouldTerminate = !1 : onResponderTerminationRequest != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (shouldTerminate = !1))), shouldTerminate && (onResponderTerminate != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), changeCurrentResponder(emptyResponder), isEmulatingMouseEvents = !1, trackedTouchCount = 0);
@@ -6892,14 +6896,14 @@ var require_ResponderSystem_native = __commonJS({
6892
6896
  "selectionchange"
6893
6897
  ], isTamaguiResponderActive = Symbol();
6894
6898
  function attachListeners() {
6895
- import_utils.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
6899
+ import_utils3.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
6896
6900
  document.addEventListener(eventType, eventListener);
6897
6901
  }), documentEventsCapturePhase.forEach((eventType) => {
6898
6902
  document.addEventListener(eventType, eventListener, !0);
6899
6903
  }), window[isTamaguiResponderActive] = !0);
6900
6904
  }
6901
6905
  function addNode(id, node, config) {
6902
- (0, import_utils2.setResponderId)(node, id), responderListenersMap.set(id, config);
6906
+ (0, import_utils22.setResponderId)(node, id), responderListenersMap.set(id, config);
6903
6907
  }
6904
6908
  function removeNode(id) {
6905
6909
  currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
@@ -13671,6 +13675,103 @@ var require_index_native53 = __commonJS({
13671
13675
  }
13672
13676
  });
13673
13677
 
13678
+ // ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
13679
+ function clamp(start, value, end) {
13680
+ return max(start, min(value, end));
13681
+ }
13682
+ function evaluate(value, param) {
13683
+ return typeof value == "function" ? value(param) : value;
13684
+ }
13685
+ function getSide(placement) {
13686
+ return placement.split("-")[0];
13687
+ }
13688
+ function getAlignment(placement) {
13689
+ return placement.split("-")[1];
13690
+ }
13691
+ function getOppositeAxis(axis) {
13692
+ return axis === "x" ? "y" : "x";
13693
+ }
13694
+ function getAxisLength(axis) {
13695
+ return axis === "y" ? "height" : "width";
13696
+ }
13697
+ function getSideAxis(placement) {
13698
+ return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
13699
+ }
13700
+ function getAlignmentAxis(placement) {
13701
+ return getOppositeAxis(getSideAxis(placement));
13702
+ }
13703
+ function getAlignmentSides(placement, rects, rtl) {
13704
+ rtl === void 0 && (rtl = !1);
13705
+ let alignment = getAlignment(placement), alignmentAxis = getAlignmentAxis(placement), length = getAxisLength(alignmentAxis), mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
13706
+ return rects.reference[length] > rects.floating[length] && (mainAlignmentSide = getOppositePlacement(mainAlignmentSide)), [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
13707
+ }
13708
+ function getExpandedPlacements(placement) {
13709
+ let oppositePlacement = getOppositePlacement(placement);
13710
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
13711
+ }
13712
+ function getOppositeAlignmentPlacement(placement) {
13713
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
13714
+ }
13715
+ function getSideList(side, isStart, rtl) {
13716
+ let lr = ["left", "right"], rl = ["right", "left"], tb = ["top", "bottom"], bt = ["bottom", "top"];
13717
+ switch (side) {
13718
+ case "top":
13719
+ case "bottom":
13720
+ return rtl ? isStart ? rl : lr : isStart ? lr : rl;
13721
+ case "left":
13722
+ case "right":
13723
+ return isStart ? tb : bt;
13724
+ default:
13725
+ return [];
13726
+ }
13727
+ }
13728
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
13729
+ let alignment = getAlignment(placement), list = getSideList(getSide(placement), direction === "start", rtl);
13730
+ return alignment && (list = list.map((side) => side + "-" + alignment), flipAlignment && (list = list.concat(list.map(getOppositeAlignmentPlacement)))), list;
13731
+ }
13732
+ function getOppositePlacement(placement) {
13733
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
13734
+ }
13735
+ function expandPaddingObject(padding) {
13736
+ return {
13737
+ top: 0,
13738
+ right: 0,
13739
+ bottom: 0,
13740
+ left: 0,
13741
+ ...padding
13742
+ };
13743
+ }
13744
+ function getPaddingObject(padding) {
13745
+ return typeof padding != "number" ? expandPaddingObject(padding) : {
13746
+ top: padding,
13747
+ right: padding,
13748
+ bottom: padding,
13749
+ left: padding
13750
+ };
13751
+ }
13752
+ function rectToClientRect(rect) {
13753
+ return {
13754
+ ...rect,
13755
+ top: rect.y,
13756
+ left: rect.x,
13757
+ right: rect.x + rect.width,
13758
+ bottom: rect.y + rect.height
13759
+ };
13760
+ }
13761
+ var sides, alignments, placements, min, max, oppositeSideMap, oppositeAlignmentMap, init_floating_ui_utils = __esm({
13762
+ "../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"() {
13763
+ sides = ["top", "right", "bottom", "left"], alignments = ["start", "end"], placements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []), min = Math.min, max = Math.max, oppositeSideMap = {
13764
+ left: "right",
13765
+ right: "left",
13766
+ bottom: "top",
13767
+ top: "bottom"
13768
+ }, oppositeAlignmentMap = {
13769
+ start: "end",
13770
+ end: "start"
13771
+ };
13772
+ }
13773
+ });
13774
+
13674
13775
  // ../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js
13675
13776
  var floating_ui_core_esm_exports = {};
13676
13777
  __export(floating_ui_core_esm_exports, {
@@ -13687,23 +13788,11 @@ __export(floating_ui_core_esm_exports, {
13687
13788
  shift: () => shift,
13688
13789
  size: () => size
13689
13790
  });
13690
- function getAlignment(placement) {
13691
- return placement.split("-")[1];
13692
- }
13693
- function getLengthFromAxis(axis) {
13694
- return axis === "y" ? "height" : "width";
13695
- }
13696
- function getSide(placement) {
13697
- return placement.split("-")[0];
13698
- }
13699
- function getMainAxisFromPlacement(placement) {
13700
- return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
13701
- }
13702
13791
  function computeCoordsFromPlacement(_ref, placement, rtl) {
13703
13792
  let {
13704
13793
  reference,
13705
13794
  floating
13706
- } = _ref, commonX = reference.x + reference.width / 2 - floating.width / 2, commonY = reference.y + reference.height / 2 - floating.height / 2, mainAxis = getMainAxisFromPlacement(placement), length = getLengthFromAxis(mainAxis), commonAlign = reference[length] / 2 - floating[length] / 2, side = getSide(placement), isVertical = mainAxis === "x", coords;
13795
+ } = _ref, sideAxis = getSideAxis(placement), alignmentAxis = getAlignmentAxis(placement), alignLength = getAxisLength(alignmentAxis), side = getSide(placement), isVertical = sideAxis === "y", commonX = reference.x + reference.width / 2 - floating.width / 2, commonY = reference.y + reference.height / 2 - floating.height / 2, commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2, coords;
13707
13796
  switch (side) {
13708
13797
  case "top":
13709
13798
  coords = {
@@ -13737,43 +13826,14 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
13737
13826
  }
13738
13827
  switch (getAlignment(placement)) {
13739
13828
  case "start":
13740
- coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
13829
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
13741
13830
  break;
13742
13831
  case "end":
13743
- coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
13832
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
13744
13833
  break;
13745
13834
  }
13746
13835
  return coords;
13747
13836
  }
13748
- function evaluate(value, param) {
13749
- return typeof value == "function" ? value(param) : value;
13750
- }
13751
- function expandPaddingObject(padding) {
13752
- return {
13753
- top: 0,
13754
- right: 0,
13755
- bottom: 0,
13756
- left: 0,
13757
- ...padding
13758
- };
13759
- }
13760
- function getSideObjectFromPadding(padding) {
13761
- return typeof padding != "number" ? expandPaddingObject(padding) : {
13762
- top: padding,
13763
- right: padding,
13764
- bottom: padding,
13765
- left: padding
13766
- };
13767
- }
13768
- function rectToClientRect(rect) {
13769
- return {
13770
- ...rect,
13771
- top: rect.y,
13772
- left: rect.x,
13773
- right: rect.x + rect.width,
13774
- bottom: rect.y + rect.height
13775
- };
13776
- }
13777
13837
  async function detectOverflow(state, options) {
13778
13838
  var _await$platform$isEle;
13779
13839
  options === void 0 && (options = {});
@@ -13790,7 +13850,7 @@ async function detectOverflow(state, options) {
13790
13850
  elementContext = "floating",
13791
13851
  altBoundary = !1,
13792
13852
  padding = 0
13793
- } = evaluate(options, state), paddingObject = getSideObjectFromPadding(padding), element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext], clippingClientRect = rectToClientRect(await platform.getClippingRect({
13853
+ } = evaluate(options, state), paddingObject = getPaddingObject(padding), element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext], clippingClientRect = rectToClientRect(await platform.getClippingRect({
13794
13854
  element: (_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) == null || _await$platform$isEle ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
13795
13855
  boundary,
13796
13856
  rootBoundary,
@@ -13817,47 +13877,9 @@ async function detectOverflow(state, options) {
13817
13877
  right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
13818
13878
  };
13819
13879
  }
13820
- function within(min$1, value, max$1) {
13821
- return max(min$1, min(value, max$1));
13822
- }
13823
- function getOppositePlacement(placement) {
13824
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
13825
- }
13826
- function getAlignmentSides(placement, rects, rtl) {
13827
- rtl === void 0 && (rtl = !1);
13828
- let alignment = getAlignment(placement), mainAxis = getMainAxisFromPlacement(placement), length = getLengthFromAxis(mainAxis), mainAlignmentSide = mainAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
13829
- return rects.reference[length] > rects.floating[length] && (mainAlignmentSide = getOppositePlacement(mainAlignmentSide)), {
13830
- main: mainAlignmentSide,
13831
- cross: getOppositePlacement(mainAlignmentSide)
13832
- };
13833
- }
13834
- function getOppositeAlignmentPlacement(placement) {
13835
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
13836
- }
13837
13880
  function getPlacementList(alignment, autoAlignment, allowedPlacements) {
13838
13881
  return (alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement)).filter((placement) => alignment ? getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : !1) : !0);
13839
13882
  }
13840
- function getExpandedPlacements(placement) {
13841
- let oppositePlacement = getOppositePlacement(placement);
13842
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
13843
- }
13844
- function getSideList(side, isStart, rtl) {
13845
- let lr = ["left", "right"], rl = ["right", "left"], tb = ["top", "bottom"], bt = ["bottom", "top"];
13846
- switch (side) {
13847
- case "top":
13848
- case "bottom":
13849
- return rtl ? isStart ? rl : lr : isStart ? lr : rl;
13850
- case "left":
13851
- case "right":
13852
- return isStart ? tb : bt;
13853
- default:
13854
- return [];
13855
- }
13856
- }
13857
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
13858
- let alignment = getAlignment(placement), list = getSideList(getSide(placement), direction === "start", rtl);
13859
- return alignment && (list = list.map((side) => side + "-" + alignment), flipAlignment && (list = list.concat(list.map(getOppositeAlignmentPlacement)))), list;
13860
- }
13861
13883
  function getSideOffsets(overflow, rect) {
13862
13884
  return {
13863
13885
  top: overflow.top - rect.height,
@@ -13891,7 +13913,7 @@ async function convertValueToCoords(state, options) {
13891
13913
  placement,
13892
13914
  platform,
13893
13915
  elements
13894
- } = state, rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)), side = getSide(placement), alignment = getAlignment(placement), isVertical = getMainAxisFromPlacement(placement) === "x", mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1, crossAxisMulti = rtl && isVertical ? -1 : 1, rawValue = evaluate(options, state), {
13916
+ } = state, rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)), side = getSide(placement), alignment = getAlignment(placement), isVertical = getSideAxis(placement) === "y", mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1, crossAxisMulti = rtl && isVertical ? -1 : 1, rawValue = evaluate(options, state), {
13895
13917
  mainAxis,
13896
13918
  crossAxis,
13897
13919
  alignmentAxis
@@ -13913,11 +13935,10 @@ async function convertValueToCoords(state, options) {
13913
13935
  y: crossAxis * crossAxisMulti
13914
13936
  };
13915
13937
  }
13916
- function getCrossAxis(axis) {
13917
- return axis === "x" ? "y" : "x";
13918
- }
13919
- var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, oppositeAlignmentMap, autoPlacement, flip, hide, inline, offset, shift, limitShift, size, init_floating_ui_core_esm = __esm({
13938
+ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, limitShift, size, init_floating_ui_core_esm = __esm({
13920
13939
  "../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js"() {
13940
+ init_floating_ui_utils();
13941
+ init_floating_ui_utils();
13921
13942
  computePosition = async (reference, floating, config) => {
13922
13943
  let {
13923
13944
  placement = "bottom",
@@ -13981,7 +14002,6 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
13981
14002
  middlewareData
13982
14003
  };
13983
14004
  };
13984
- min = Math.min, max = Math.max;
13985
14005
  arrow = (options) => ({
13986
14006
  name: "arrow",
13987
14007
  options,
@@ -13992,37 +14012,33 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
13992
14012
  placement,
13993
14013
  rects,
13994
14014
  platform,
13995
- elements
14015
+ elements,
14016
+ middlewareData
13996
14017
  } = state, {
13997
14018
  element,
13998
14019
  padding = 0
13999
14020
  } = evaluate(options, state) || {};
14000
14021
  if (element == null)
14001
14022
  return {};
14002
- let paddingObject = getSideObjectFromPadding(padding), coords = {
14023
+ let paddingObject = getPaddingObject(padding), coords = {
14003
14024
  x,
14004
14025
  y
14005
- }, axis = getMainAxisFromPlacement(placement), length = getLengthFromAxis(axis), arrowDimensions = await platform.getDimensions(element), isYAxis = axis === "y", minProp = isYAxis ? "top" : "left", maxProp = isYAxis ? "bottom" : "right", clientProp = isYAxis ? "clientHeight" : "clientWidth", endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length], startDiff = coords[axis] - rects.reference[axis], arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)), clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
14026
+ }, axis = getAlignmentAxis(placement), length = getAxisLength(axis), arrowDimensions = await platform.getDimensions(element), isYAxis = axis === "y", minProp = isYAxis ? "top" : "left", maxProp = isYAxis ? "bottom" : "right", clientProp = isYAxis ? "clientHeight" : "clientWidth", endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length], startDiff = coords[axis] - rects.reference[axis], arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)), clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
14006
14027
  (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) && (clientSize = elements.floating[clientProp] || rects.floating[length]);
14007
- let centerToReference = endDiff / 2 - startDiff / 2, largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1, minPadding = min(paddingObject[minProp], largestPossiblePadding), maxPadding = min(paddingObject[maxProp], largestPossiblePadding), min$1 = minPadding, max2 = clientSize - arrowDimensions[length] - maxPadding, center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference, offset2 = within(min$1, center, max2), alignmentOffset = getAlignment(placement) != null && center != offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0 ? center < min$1 ? min$1 - center : max2 - center : 0;
14028
+ let centerToReference = endDiff / 2 - startDiff / 2, largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1, minPadding = min(paddingObject[minProp], largestPossiblePadding), maxPadding = min(paddingObject[maxProp], largestPossiblePadding), min$1 = minPadding, max2 = clientSize - arrowDimensions[length] - maxPadding, center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference, offset2 = clamp(min$1, center, max2), shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0, alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
14008
14029
  return {
14009
- [axis]: coords[axis] - alignmentOffset,
14030
+ [axis]: coords[axis] + alignmentOffset,
14010
14031
  data: {
14011
14032
  [axis]: offset2,
14012
- centerOffset: center - offset2 + alignmentOffset
14013
- }
14033
+ centerOffset: center - offset2 - alignmentOffset,
14034
+ ...shouldAddOffset && {
14035
+ alignmentOffset
14036
+ }
14037
+ },
14038
+ reset: shouldAddOffset
14014
14039
  };
14015
14040
  }
14016
- }), sides = ["top", "right", "bottom", "left"], allPlacements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []), oppositeSideMap = {
14017
- left: "right",
14018
- right: "left",
14019
- bottom: "top",
14020
- top: "bottom"
14021
- };
14022
- oppositeAlignmentMap = {
14023
- start: "end",
14024
- end: "start"
14025
- };
14041
+ });
14026
14042
  autoPlacement = function(options) {
14027
14043
  return options === void 0 && (options = {}), {
14028
14044
  name: "autoPlacement",
@@ -14038,26 +14054,23 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14038
14054
  } = state, {
14039
14055
  crossAxis = !1,
14040
14056
  alignment,
14041
- allowedPlacements = allPlacements,
14057
+ allowedPlacements = placements,
14042
14058
  autoAlignment = !0,
14043
14059
  ...detectOverflowOptions
14044
- } = evaluate(options, state), placements = alignment !== void 0 || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements, overflow = await detectOverflow(state, detectOverflowOptions), currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0, currentPlacement = placements[currentIndex];
14060
+ } = evaluate(options, state), placements$1 = alignment !== void 0 || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements, overflow = await detectOverflow(state, detectOverflowOptions), currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0, currentPlacement = placements$1[currentIndex];
14045
14061
  if (currentPlacement == null)
14046
14062
  return {};
14047
- let {
14048
- main,
14049
- cross
14050
- } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
14063
+ let alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
14051
14064
  if (placement !== currentPlacement)
14052
14065
  return {
14053
14066
  reset: {
14054
- placement: placements[0]
14067
+ placement: placements$1[0]
14055
14068
  }
14056
14069
  };
14057
- let currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]], allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
14070
+ let currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]], allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
14058
14071
  placement: currentPlacement,
14059
14072
  overflows: currentOverflows
14060
- }], nextPlacement = placements[currentIndex + 1];
14073
+ }], nextPlacement = placements$1[currentIndex + 1];
14061
14074
  if (nextPlacement)
14062
14075
  return {
14063
14076
  data: {
@@ -14094,13 +14107,12 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14094
14107
  } : {};
14095
14108
  }
14096
14109
  };
14097
- };
14098
- flip = function(options) {
14110
+ }, flip = function(options) {
14099
14111
  return options === void 0 && (options = {}), {
14100
14112
  name: "flip",
14101
14113
  options,
14102
14114
  async fn(state) {
14103
- var _middlewareData$flip;
14115
+ var _middlewareData$arrow, _middlewareData$flip;
14104
14116
  let {
14105
14117
  placement,
14106
14118
  middlewareData,
@@ -14116,22 +14128,22 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14116
14128
  fallbackAxisSideDirection = "none",
14117
14129
  flipAlignment = !0,
14118
14130
  ...detectOverflowOptions
14119
- } = evaluate(options, state), side = getSide(placement), isBasePlacement = getSide(initialPlacement) === initialPlacement, rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)), fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
14131
+ } = evaluate(options, state);
14132
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)
14133
+ return {};
14134
+ let side = getSide(placement), isBasePlacement = getSide(initialPlacement) === initialPlacement, rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)), fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
14120
14135
  !specifiedFallbackPlacements && fallbackAxisSideDirection !== "none" && fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
14121
- let placements = [initialPlacement, ...fallbackPlacements], overflow = await detectOverflow(state, detectOverflowOptions), overflows = [], overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
14136
+ let placements2 = [initialPlacement, ...fallbackPlacements], overflow = await detectOverflow(state, detectOverflowOptions), overflows = [], overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
14122
14137
  if (checkMainAxis && overflows.push(overflow[side]), checkCrossAxis) {
14123
- let {
14124
- main,
14125
- cross
14126
- } = getAlignmentSides(placement, rects, rtl);
14127
- overflows.push(overflow[main], overflow[cross]);
14138
+ let sides2 = getAlignmentSides(placement, rects, rtl);
14139
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
14128
14140
  }
14129
14141
  if (overflowsData = [...overflowsData, {
14130
14142
  placement,
14131
14143
  overflows
14132
14144
  }], !overflows.every((side2) => side2 <= 0)) {
14133
14145
  var _middlewareData$flip2, _overflowsData$filter;
14134
- let nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements[nextIndex];
14146
+ let nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
14135
14147
  if (nextPlacement)
14136
14148
  return {
14137
14149
  data: {
@@ -14223,12 +14235,12 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14223
14235
  padding = 2,
14224
14236
  x,
14225
14237
  y
14226
- } = evaluate(options, state), nativeClientRects = Array.from(await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference)) || []), clientRects = getRectsByLine(nativeClientRects), fallback = rectToClientRect(getBoundingRect(nativeClientRects)), paddingObject = getSideObjectFromPadding(padding);
14238
+ } = evaluate(options, state), nativeClientRects = Array.from(await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference)) || []), clientRects = getRectsByLine(nativeClientRects), fallback = rectToClientRect(getBoundingRect(nativeClientRects)), paddingObject = getPaddingObject(padding);
14227
14239
  function getBoundingClientRect() {
14228
14240
  if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null)
14229
14241
  return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
14230
14242
  if (clientRects.length >= 2) {
14231
- if (getMainAxisFromPlacement(placement) === "x") {
14243
+ if (getSideAxis(placement) === "y") {
14232
14244
  let firstRect = clientRects[0], lastRect = clientRects[clientRects.length - 1], isTop = getSide(placement) === "top", top2 = firstRect.top, bottom2 = lastRect.bottom, left2 = isTop ? firstRect.left : lastRect.left, right2 = isTop ? firstRect.right : lastRect.right, width2 = right2 - left2, height2 = bottom2 - top2;
14233
14245
  return {
14234
14246
  top: top2,
@@ -14275,19 +14287,24 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14275
14287
  name: "offset",
14276
14288
  options,
14277
14289
  async fn(state) {
14290
+ var _middlewareData$offse, _middlewareData$arrow;
14278
14291
  let {
14279
14292
  x,
14280
- y
14293
+ y,
14294
+ placement,
14295
+ middlewareData
14281
14296
  } = state, diffCoords = await convertValueToCoords(state, options);
14282
- return {
14297
+ return placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset ? {} : {
14283
14298
  x: x + diffCoords.x,
14284
14299
  y: y + diffCoords.y,
14285
- data: diffCoords
14300
+ data: {
14301
+ ...diffCoords,
14302
+ placement
14303
+ }
14286
14304
  };
14287
14305
  }
14288
14306
  };
14289
- };
14290
- shift = function(options) {
14307
+ }, shift = function(options) {
14291
14308
  return options === void 0 && (options = {}), {
14292
14309
  name: "shift",
14293
14310
  options,
@@ -14315,14 +14332,14 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14315
14332
  } = evaluate(options, state), coords = {
14316
14333
  x,
14317
14334
  y
14318
- }, overflow = await detectOverflow(state, detectOverflowOptions), mainAxis = getMainAxisFromPlacement(getSide(placement)), crossAxis = getCrossAxis(mainAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
14335
+ }, overflow = await detectOverflow(state, detectOverflowOptions), crossAxis = getSideAxis(getSide(placement)), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
14319
14336
  if (checkMainAxis) {
14320
14337
  let minSide = mainAxis === "y" ? "top" : "left", maxSide = mainAxis === "y" ? "bottom" : "right", min2 = mainAxisCoord + overflow[minSide], max2 = mainAxisCoord - overflow[maxSide];
14321
- mainAxisCoord = within(min2, mainAxisCoord, max2);
14338
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
14322
14339
  }
14323
14340
  if (checkCrossAxis) {
14324
14341
  let minSide = crossAxis === "y" ? "top" : "left", maxSide = crossAxis === "y" ? "bottom" : "right", min2 = crossAxisCoord + overflow[minSide], max2 = crossAxisCoord - overflow[maxSide];
14325
- crossAxisCoord = within(min2, crossAxisCoord, max2);
14342
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
14326
14343
  }
14327
14344
  let limitedCoords = limiter.fn({
14328
14345
  ...state,
@@ -14355,7 +14372,7 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14355
14372
  } = evaluate(options, state), coords = {
14356
14373
  x,
14357
14374
  y
14358
- }, mainAxis = getMainAxisFromPlacement(placement), crossAxis = getCrossAxis(mainAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
14375
+ }, crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
14359
14376
  mainAxis: rawOffset,
14360
14377
  crossAxis: 0
14361
14378
  } : {
@@ -14392,13 +14409,13 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14392
14409
  apply = () => {
14393
14410
  },
14394
14411
  ...detectOverflowOptions
14395
- } = evaluate(options, state), overflow = await detectOverflow(state, detectOverflowOptions), side = getSide(placement), alignment = getAlignment(placement), isXAxis = getMainAxisFromPlacement(placement) === "x", {
14412
+ } = evaluate(options, state), overflow = await detectOverflow(state, detectOverflowOptions), side = getSide(placement), alignment = getAlignment(placement), isYAxis = getSideAxis(placement) === "y", {
14396
14413
  width,
14397
14414
  height
14398
14415
  } = rects.floating, heightSide, widthSide;
14399
14416
  side === "top" || side === "bottom" ? (heightSide = side, widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right") : (widthSide = side, heightSide = alignment === "end" ? "top" : "bottom");
14400
14417
  let overflowAvailableHeight = height - overflow[heightSide], overflowAvailableWidth = width - overflow[widthSide], noShift = !state.middlewareData.shift, availableHeight = overflowAvailableHeight, availableWidth = overflowAvailableWidth;
14401
- if (isXAxis) {
14418
+ if (isYAxis) {
14402
14419
  let maximumClippingWidth = width - overflow.left - overflow.right;
14403
14420
  availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
14404
14421
  } else {
@@ -14407,7 +14424,7 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14407
14424
  }
14408
14425
  if (noShift && !alignment) {
14409
14426
  let xMin = max(overflow.left, 0), xMax = max(overflow.right, 0), yMin = max(overflow.top, 0), yMax = max(overflow.bottom, 0);
14410
- isXAxis ? availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)) : availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
14427
+ isYAxis ? availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)) : availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
14411
14428
  }
14412
14429
  await apply({
14413
14430
  ...state,
@@ -14430,11 +14447,8 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14430
14447
  var require_floating_ui_react_native = __commonJS({
14431
14448
  "../../node_modules/@floating-ui/react-native/dist/floating-ui.react-native.js"(exports2) {
14432
14449
  "use strict";
14433
- Object.defineProperty(exports2, "__esModule", { value: !0 });
14434
14450
  var core = (init_floating_ui_core_esm(), __toCommonJS(floating_ui_core_esm_exports)), React2 = require("react"), reactNative = require("react-native");
14435
- function _interopNamespace(e) {
14436
- if (e && e.__esModule)
14437
- return e;
14451
+ function _interopNamespaceDefault(e) {
14438
14452
  var n = /* @__PURE__ */ Object.create(null);
14439
14453
  return e && Object.keys(e).forEach(function(k) {
14440
14454
  if (k !== "default") {
@@ -14448,7 +14462,7 @@ var require_floating_ui_react_native = __commonJS({
14448
14462
  }
14449
14463
  }), n.default = e, Object.freeze(n);
14450
14464
  }
14451
- var React__namespace = /* @__PURE__ */ _interopNamespace(React2), arrow2 = (options) => {
14465
+ var React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React2), arrow2 = (options) => {
14452
14466
  let {
14453
14467
  element,
14454
14468
  padding
@@ -14472,7 +14486,11 @@ var require_floating_ui_react_native = __commonJS({
14472
14486
  }, ORIGIN$1 = {
14473
14487
  x: 0,
14474
14488
  y: 0
14475
- }, createPlatform = (_ref) => {
14489
+ };
14490
+ function isView(reference) {
14491
+ return "measure" in reference;
14492
+ }
14493
+ var createPlatform = (_ref) => {
14476
14494
  let {
14477
14495
  offsetParent,
14478
14496
  sameScrollView = !0,
@@ -14491,19 +14509,32 @@ var require_floating_ui_react_native = __commonJS({
14491
14509
  width,
14492
14510
  height,
14493
14511
  ...ORIGIN$1
14494
- };
14495
- reference[sameScrollView ? "measure" : "measureInWindow"]((x2, y2, width2, height2) => {
14496
- let referenceRect = {
14497
- width: width2,
14498
- height: height2,
14499
- x: x2 - offsetX,
14500
- y: y2 - offsetY
14512
+ }, method = sameScrollView ? "measure" : "measureInWindow";
14513
+ if (isView(reference))
14514
+ reference[method]((x2, y2, width2, height2) => {
14515
+ let referenceRect = {
14516
+ width: width2,
14517
+ height: height2,
14518
+ x: x2 - offsetX,
14519
+ y: y2 - offsetY
14520
+ };
14521
+ resolve({
14522
+ reference: referenceRect,
14523
+ floating: floatingRect
14524
+ });
14525
+ });
14526
+ else {
14527
+ let boundingRect = reference.getBoundingClientRect(), referenceRect = {
14528
+ width: boundingRect.width,
14529
+ height: boundingRect.height,
14530
+ x: boundingRect.x - offsetX,
14531
+ y: boundingRect.y - offsetY
14501
14532
  };
14502
14533
  resolve({
14503
14534
  reference: referenceRect,
14504
14535
  floating: floatingRect
14505
14536
  });
14506
- });
14537
+ }
14507
14538
  });
14508
14539
  };
14509
14540
  offsetParent ? offsetParent.measure(onMeasure) : onMeasure();
@@ -14551,7 +14582,7 @@ var require_floating_ui_react_native = __commonJS({
14551
14582
  let length, i, keys;
14552
14583
  if (a && b && typeof a == "object") {
14553
14584
  if (Array.isArray(a)) {
14554
- if (length = a.length, length != b.length)
14585
+ if (length = a.length, length !== b.length)
14555
14586
  return !1;
14556
14587
  for (i = length; i-- !== 0; )
14557
14588
  if (!deepEqual(a[i], b[i]))
@@ -14589,11 +14620,11 @@ var require_floating_ui_react_native = __commonJS({
14589
14620
  } = {}
14590
14621
  } = options, [_reference, _setReference] = React__namespace.useState(null), [_floating, _setFloating] = React__namespace.useState(null), [_offsetParent, _setOffsetParent] = React__namespace.useState(null), referenceEl = externalReference || _reference, floatingEl = externalFloating || _floating, offsetParentEl = externalOffsetParent || _offsetParent, setReference = React__namespace.useCallback((node) => {
14591
14622
  node !== referenceRef.current && (referenceRef.current = node, _setReference(node));
14592
- }, [_setReference]), setFloating = React__namespace.useCallback((node) => {
14623
+ }, []), setFloating = React__namespace.useCallback((node) => {
14593
14624
  node !== floatingRef.current && (floatingRef.current = node, _setFloating(node));
14594
- }, [_setFloating]), setOffsetParent = React__namespace.useCallback((node) => {
14625
+ }, []), setOffsetParent = React__namespace.useCallback((node) => {
14595
14626
  node !== offsetParentRef.current && (offsetParentRef.current = node, _setOffsetParent(node));
14596
- }, [_setOffsetParent]), referenceRef = React__namespace.useRef(null), floatingRef = React__namespace.useRef(null), offsetParentRef = React__namespace.useRef(null), [data, setData] = React__namespace.useState({
14627
+ }, []), referenceRef = React__namespace.useRef(null), floatingRef = React__namespace.useRef(null), offsetParentRef = React__namespace.useRef(null), [data, setData] = React__namespace.useState({
14597
14628
  x: 0,
14598
14629
  y: 0,
14599
14630
  placement,
@@ -14839,11 +14870,7 @@ var require_Popper_native = __commonJS({
14839
14870
  allowFlip,
14840
14871
  offset: offset2,
14841
14872
  __scopePopper
14842
- } = props, [isMounted, setIsMounted] = React2.useState(!1);
14843
- (0, import_constants4.useIsomorphicLayoutEffect)(() => {
14844
- setIsMounted(!0);
14845
- }, []);
14846
- let [anchorRef, setAnchorRef] = React2.useState(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
14873
+ } = props, isMounted = (0, import_core13.useDidFinishSSR)(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
14847
14874
  strategy,
14848
14875
  placement,
14849
14876
  sameScrollView: !1,
@@ -14860,9 +14887,7 @@ var require_Popper_native = __commonJS({
14860
14887
  // @ts-expect-error this comes from Tooltip for example
14861
14888
  open
14862
14889
  } = floating;
14863
- if ((0, import_constants4.useIsomorphicLayoutEffect)(() => {
14864
- floating.refs.setReference(anchorRef);
14865
- }, [anchorRef]), import_constants4.isWeb)
14890
+ if (import_constants4.isWeb)
14866
14891
  (0, import_constants4.useIsomorphicLayoutEffect)(() => {
14867
14892
  if (open && refs.reference.current && refs.floating.current)
14868
14893
  return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
@@ -14883,7 +14908,6 @@ var require_Popper_native = __commonJS({
14883
14908
  }, [dimensions, keyboardOpen]);
14884
14909
  }
14885
14910
  let popperContext = {
14886
- anchorRef: setAnchorRef,
14887
14911
  size: size2,
14888
14912
  arrowRef: setArrow,
14889
14913
  arrowStyle: middlewareData.arrow,
@@ -14897,10 +14921,12 @@ var require_Popper_native = __commonJS({
14897
14921
  var PopperAnchor = import_stacks3.YStack.extractable(
14898
14922
  React2.forwardRef(
14899
14923
  function(props, forwardedRef) {
14900
- let { virtualRef, __scopePopper, ...anchorProps } = props, { anchorRef, getReferenceProps } = usePopperContext(__scopePopper), ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, anchorRef);
14901
- if (React2.useEffect(() => {
14902
- anchorRef((virtualRef == null ? void 0 : virtualRef.current) || ref.current);
14903
- }, [anchorRef, virtualRef]), virtualRef)
14924
+ let { virtualRef, __scopePopper, ...anchorProps } = props, { getReferenceProps, refs } = usePopperContext(__scopePopper), ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(
14925
+ forwardedRef,
14926
+ ref,
14927
+ virtualRef ?? refs.setReference
14928
+ );
14929
+ if (virtualRef)
14904
14930
  return null;
14905
14931
  let stackProps = {
14906
14932
  ref: composedRefs,
@@ -15321,7 +15347,7 @@ var require_Popover_native = __commonJS({
15321
15347
  componentName: "PopoverClose",
15322
15348
  onPress: (0, import_helpers.composeEventHandlers)(
15323
15349
  props.onPress,
15324
- () => context.onOpenChange(!1)
15350
+ () => context.onOpenChange(!1, "press")
15325
15351
  )
15326
15352
  }
15327
15353
  );
@@ -15353,13 +15379,17 @@ var require_Popover_native = __commonJS({
15353
15379
  ...restProps
15354
15380
  } = props, id = React2.useId(), { when, AdaptProvider } = (0, import_adapt.useAdaptParent)({
15355
15381
  Contents: React2.useCallback(() => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalHost, { name: `${id}PopoverContents` }), [])
15356
- }), sheetBreakpoint = when, triggerRef = React2.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React2.useState(!1), [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
15382
+ }), sheetBreakpoint = when, triggerRef = React2.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React2.useState(!1), viaRef = React2.useRef(), [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
15357
15383
  prop: openProp,
15358
15384
  defaultProp: defaultOpen || !1,
15359
- onChange: onOpenChange
15385
+ onChange: (val) => {
15386
+ onOpenChange == null || onOpenChange(val, viaRef.current);
15387
+ }
15360
15388
  }), sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
15361
15389
  open,
15362
- setOpen,
15390
+ setOpen: (val, via) => {
15391
+ viaRef.current = via, setOpen(val);
15392
+ },
15363
15393
  disable: sheetActive,
15364
15394
  hoverable,
15365
15395
  disableFocus
@@ -15374,7 +15404,9 @@ var require_Popover_native = __commonJS({
15374
15404
  triggerRef,
15375
15405
  open,
15376
15406
  breakpointActive: sheetActive,
15377
- onOpenChange: setOpen,
15407
+ onOpenChange: (val, via) => {
15408
+ viaRef.current = via, setOpen(val);
15409
+ },
15378
15410
  onOpenToggle: (0, import_core13.useEvent)(() => {
15379
15411
  open && sheetActive || setOpen(!open);
15380
15412
  }),