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.
package/dist/native.js CHANGED
@@ -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
  }
@@ -4702,7 +4702,11 @@ var require_createComponent_native = __commonJS({
4702
4702
  let exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
4703
4703
  state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
4704
4704
  }
4705
- 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}` : "";
4705
+ let shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
4706
+ // disableClassName="until-hydrated" to be more straightforward
4707
+ // see issue if not, Button sets disableClassName to true <Button animation="" /> with
4708
+ // the react-native driver errors because it tries to animate var(--color) to rbga(..)
4709
+ propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
4706
4710
  if (groupName && !curState.group) {
4707
4711
  let listeners = /* @__PURE__ */ new Set();
4708
4712
  curState.group = {
@@ -4750,7 +4754,9 @@ var require_createComponent_native = __commonJS({
4750
4754
  if (console.info(
4751
4755
  `%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`,
4752
4756
  "background: green; color: white;"
4753
- ), !import_constants4.isServer) {
4757
+ ), import_constants4.isServer)
4758
+ (0, import_log.log)({ noClassNames, isAnimated, shouldAvoidClasses, isWeb: import_constants4.isWeb, supportsCSSVars });
4759
+ else {
4754
4760
  console.groupEnd();
4755
4761
  let stateLog = `${`${state.press || state.pressIn ? " PRESS " : ""}`}${state.hover ? " HOVER " : ""}${state.focus ? " FOCUS" : " "}`, ch = propsIn.children, childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
4756
4762
  childLog.length && (childLog = `(children: ${childLog})`), console.groupCollapsed(`${childLog}${stateLog}Props:`), (0, import_log.log)("props in:", propsIn), (0, import_log.log)("final props:", props), (0, import_log.log)({ state, staticConfig, elementType, themeStateProps }), (0, import_log.log)({ contextProps: styledContextProps, overriddenContextProps }), (0, import_log.log)({ presence, isAnimated, isHOC, hasAnimationProp, useAnimations }), console.groupEnd();
@@ -6793,7 +6799,7 @@ var require_createResponderEvent_native = __commonJS({
6793
6799
  default: () => createResponderEvent
6794
6800
  });
6795
6801
  module2.exports = __toCommonJS2(createResponderEvent_exports);
6796
- var import_utils = require_utils_native(), emptyFunction = () => {
6802
+ var import_utils3 = require_utils_native(), emptyFunction = () => {
6797
6803
  }, emptyObject = {}, emptyArray = [];
6798
6804
  function normalizeIdentifier(identifier) {
6799
6805
  return identifier > 20 ? identifier % 20 : identifier;
@@ -6883,11 +6889,11 @@ var require_createResponderEvent_native = __commonJS({
6883
6889
  touchHistory: responderTouchHistoryStore.touchHistory
6884
6890
  };
6885
6891
  function locationX(x) {
6886
- if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
6892
+ if (rect = rect || (0, import_utils3.getBoundingClientRect)(responderEvent.currentTarget), rect)
6887
6893
  return x - rect.left;
6888
6894
  }
6889
6895
  function locationY(y) {
6890
- if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
6896
+ if (rect = rect || (0, import_utils3.getBoundingClientRect)(responderEvent.currentTarget), rect)
6891
6897
  return y - rect.top;
6892
6898
  }
6893
6899
  return responderEvent;
@@ -7103,7 +7109,7 @@ var require_ResponderSystem_native = __commonJS({
7103
7109
  terminateResponder: () => terminateResponder
7104
7110
  });
7105
7111
  module2.exports = __toCommonJS2(ResponderSystem_exports);
7106
- 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 = [
7112
+ 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 = [
7107
7113
  "onStartShouldSetResponderCapture",
7108
7114
  "onStartShouldSetResponder",
7109
7115
  { bubbles: !0 }
@@ -7142,16 +7148,16 @@ var require_ResponderSystem_native = __commonJS({
7142
7148
  trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
7143
7149
  return;
7144
7150
  }
7145
- 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);
7151
+ 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);
7146
7152
  (isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
7147
7153
  eventType,
7148
7154
  responderEvent.nativeEvent
7149
7155
  ));
7150
- let eventPaths = (0, import_utils2.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
7156
+ let eventPaths = (0, import_utils22.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
7151
7157
  if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
7152
7158
  let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
7153
7159
  if (currentResponderIdPath != null && eventIdPath != null) {
7154
- let lowestCommonAncestor = (0, import_utils2.getLowestCommonAncestor)(
7160
+ let lowestCommonAncestor = (0, import_utils22.getLowestCommonAncestor)(
7155
7161
  currentResponderIdPath,
7156
7162
  eventIdPath
7157
7163
  );
@@ -7186,7 +7192,7 @@ var require_ResponderSystem_native = __commonJS({
7186
7192
  eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
7187
7193
  isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
7188
7194
  isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
7189
- isSelectionChangeEvent && (0, import_utils2.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils2.hasTargetTouches)(node, domEvent.touches);
7195
+ isSelectionChangeEvent && (0, import_utils22.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils22.hasTargetTouches)(node, domEvent.touches);
7190
7196
  if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
7191
7197
  let shouldTerminate = !0;
7192
7198
  (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);
@@ -7252,14 +7258,14 @@ var require_ResponderSystem_native = __commonJS({
7252
7258
  "selectionchange"
7253
7259
  ], isTamaguiResponderActive = Symbol();
7254
7260
  function attachListeners() {
7255
- import_utils.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
7261
+ import_utils3.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
7256
7262
  document.addEventListener(eventType, eventListener);
7257
7263
  }), documentEventsCapturePhase.forEach((eventType) => {
7258
7264
  document.addEventListener(eventType, eventListener, !0);
7259
7265
  }), window[isTamaguiResponderActive] = !0);
7260
7266
  }
7261
7267
  function addNode(id, node, config) {
7262
- (0, import_utils2.setResponderId)(node, id), responderListenersMap.set(id, config);
7268
+ (0, import_utils22.setResponderId)(node, id), responderListenersMap.set(id, config);
7263
7269
  }
7264
7270
  function removeNode(id) {
7265
7271
  currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
@@ -14213,6 +14219,103 @@ var require_index_native53 = __commonJS({
14213
14219
  }
14214
14220
  });
14215
14221
 
14222
+ // ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
14223
+ function clamp(start, value, end) {
14224
+ return max(start, min(value, end));
14225
+ }
14226
+ function evaluate(value, param) {
14227
+ return typeof value == "function" ? value(param) : value;
14228
+ }
14229
+ function getSide(placement) {
14230
+ return placement.split("-")[0];
14231
+ }
14232
+ function getAlignment(placement) {
14233
+ return placement.split("-")[1];
14234
+ }
14235
+ function getOppositeAxis(axis) {
14236
+ return axis === "x" ? "y" : "x";
14237
+ }
14238
+ function getAxisLength(axis) {
14239
+ return axis === "y" ? "height" : "width";
14240
+ }
14241
+ function getSideAxis(placement) {
14242
+ return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
14243
+ }
14244
+ function getAlignmentAxis(placement) {
14245
+ return getOppositeAxis(getSideAxis(placement));
14246
+ }
14247
+ function getAlignmentSides(placement, rects, rtl) {
14248
+ rtl === void 0 && (rtl = !1);
14249
+ let alignment = getAlignment(placement), alignmentAxis = getAlignmentAxis(placement), length = getAxisLength(alignmentAxis), mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
14250
+ return rects.reference[length] > rects.floating[length] && (mainAlignmentSide = getOppositePlacement(mainAlignmentSide)), [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
14251
+ }
14252
+ function getExpandedPlacements(placement) {
14253
+ let oppositePlacement = getOppositePlacement(placement);
14254
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
14255
+ }
14256
+ function getOppositeAlignmentPlacement(placement) {
14257
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
14258
+ }
14259
+ function getSideList(side, isStart, rtl) {
14260
+ let lr = ["left", "right"], rl = ["right", "left"], tb = ["top", "bottom"], bt = ["bottom", "top"];
14261
+ switch (side) {
14262
+ case "top":
14263
+ case "bottom":
14264
+ return rtl ? isStart ? rl : lr : isStart ? lr : rl;
14265
+ case "left":
14266
+ case "right":
14267
+ return isStart ? tb : bt;
14268
+ default:
14269
+ return [];
14270
+ }
14271
+ }
14272
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
14273
+ let alignment = getAlignment(placement), list = getSideList(getSide(placement), direction === "start", rtl);
14274
+ return alignment && (list = list.map((side) => side + "-" + alignment), flipAlignment && (list = list.concat(list.map(getOppositeAlignmentPlacement)))), list;
14275
+ }
14276
+ function getOppositePlacement(placement) {
14277
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
14278
+ }
14279
+ function expandPaddingObject(padding) {
14280
+ return {
14281
+ top: 0,
14282
+ right: 0,
14283
+ bottom: 0,
14284
+ left: 0,
14285
+ ...padding
14286
+ };
14287
+ }
14288
+ function getPaddingObject(padding) {
14289
+ return typeof padding != "number" ? expandPaddingObject(padding) : {
14290
+ top: padding,
14291
+ right: padding,
14292
+ bottom: padding,
14293
+ left: padding
14294
+ };
14295
+ }
14296
+ function rectToClientRect(rect) {
14297
+ return {
14298
+ ...rect,
14299
+ top: rect.y,
14300
+ left: rect.x,
14301
+ right: rect.x + rect.width,
14302
+ bottom: rect.y + rect.height
14303
+ };
14304
+ }
14305
+ var sides, alignments, placements, min, max, oppositeSideMap, oppositeAlignmentMap, init_floating_ui_utils = __esm({
14306
+ "../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"() {
14307
+ 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 = {
14308
+ left: "right",
14309
+ right: "left",
14310
+ bottom: "top",
14311
+ top: "bottom"
14312
+ }, oppositeAlignmentMap = {
14313
+ start: "end",
14314
+ end: "start"
14315
+ };
14316
+ }
14317
+ });
14318
+
14216
14319
  // ../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js
14217
14320
  var floating_ui_core_esm_exports = {};
14218
14321
  __export(floating_ui_core_esm_exports, {
@@ -14229,23 +14332,11 @@ __export(floating_ui_core_esm_exports, {
14229
14332
  shift: () => shift,
14230
14333
  size: () => size
14231
14334
  });
14232
- function getAlignment(placement) {
14233
- return placement.split("-")[1];
14234
- }
14235
- function getLengthFromAxis(axis) {
14236
- return axis === "y" ? "height" : "width";
14237
- }
14238
- function getSide(placement) {
14239
- return placement.split("-")[0];
14240
- }
14241
- function getMainAxisFromPlacement(placement) {
14242
- return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
14243
- }
14244
14335
  function computeCoordsFromPlacement(_ref, placement, rtl) {
14245
14336
  let {
14246
14337
  reference,
14247
14338
  floating
14248
- } = _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;
14339
+ } = _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;
14249
14340
  switch (side) {
14250
14341
  case "top":
14251
14342
  coords = {
@@ -14279,43 +14370,14 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
14279
14370
  }
14280
14371
  switch (getAlignment(placement)) {
14281
14372
  case "start":
14282
- coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
14373
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
14283
14374
  break;
14284
14375
  case "end":
14285
- coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
14376
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
14286
14377
  break;
14287
14378
  }
14288
14379
  return coords;
14289
14380
  }
14290
- function evaluate(value, param) {
14291
- return typeof value == "function" ? value(param) : value;
14292
- }
14293
- function expandPaddingObject(padding) {
14294
- return {
14295
- top: 0,
14296
- right: 0,
14297
- bottom: 0,
14298
- left: 0,
14299
- ...padding
14300
- };
14301
- }
14302
- function getSideObjectFromPadding(padding) {
14303
- return typeof padding != "number" ? expandPaddingObject(padding) : {
14304
- top: padding,
14305
- right: padding,
14306
- bottom: padding,
14307
- left: padding
14308
- };
14309
- }
14310
- function rectToClientRect(rect) {
14311
- return {
14312
- ...rect,
14313
- top: rect.y,
14314
- left: rect.x,
14315
- right: rect.x + rect.width,
14316
- bottom: rect.y + rect.height
14317
- };
14318
- }
14319
14381
  async function detectOverflow(state, options) {
14320
14382
  var _await$platform$isEle;
14321
14383
  options === void 0 && (options = {});
@@ -14332,7 +14394,7 @@ async function detectOverflow(state, options) {
14332
14394
  elementContext = "floating",
14333
14395
  altBoundary = !1,
14334
14396
  padding = 0
14335
- } = evaluate(options, state), paddingObject = getSideObjectFromPadding(padding), element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext], clippingClientRect = rectToClientRect(await platform.getClippingRect({
14397
+ } = evaluate(options, state), paddingObject = getPaddingObject(padding), element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext], clippingClientRect = rectToClientRect(await platform.getClippingRect({
14336
14398
  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)),
14337
14399
  boundary,
14338
14400
  rootBoundary,
@@ -14359,47 +14421,9 @@ async function detectOverflow(state, options) {
14359
14421
  right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
14360
14422
  };
14361
14423
  }
14362
- function within(min$1, value, max$1) {
14363
- return max(min$1, min(value, max$1));
14364
- }
14365
- function getOppositePlacement(placement) {
14366
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
14367
- }
14368
- function getAlignmentSides(placement, rects, rtl) {
14369
- rtl === void 0 && (rtl = !1);
14370
- let alignment = getAlignment(placement), mainAxis = getMainAxisFromPlacement(placement), length = getLengthFromAxis(mainAxis), mainAlignmentSide = mainAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
14371
- return rects.reference[length] > rects.floating[length] && (mainAlignmentSide = getOppositePlacement(mainAlignmentSide)), {
14372
- main: mainAlignmentSide,
14373
- cross: getOppositePlacement(mainAlignmentSide)
14374
- };
14375
- }
14376
- function getOppositeAlignmentPlacement(placement) {
14377
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
14378
- }
14379
14424
  function getPlacementList(alignment, autoAlignment, allowedPlacements) {
14380
14425
  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);
14381
14426
  }
14382
- function getExpandedPlacements(placement) {
14383
- let oppositePlacement = getOppositePlacement(placement);
14384
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
14385
- }
14386
- function getSideList(side, isStart, rtl) {
14387
- let lr = ["left", "right"], rl = ["right", "left"], tb = ["top", "bottom"], bt = ["bottom", "top"];
14388
- switch (side) {
14389
- case "top":
14390
- case "bottom":
14391
- return rtl ? isStart ? rl : lr : isStart ? lr : rl;
14392
- case "left":
14393
- case "right":
14394
- return isStart ? tb : bt;
14395
- default:
14396
- return [];
14397
- }
14398
- }
14399
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
14400
- let alignment = getAlignment(placement), list = getSideList(getSide(placement), direction === "start", rtl);
14401
- return alignment && (list = list.map((side) => side + "-" + alignment), flipAlignment && (list = list.concat(list.map(getOppositeAlignmentPlacement)))), list;
14402
- }
14403
14427
  function getSideOffsets(overflow, rect) {
14404
14428
  return {
14405
14429
  top: overflow.top - rect.height,
@@ -14433,7 +14457,7 @@ async function convertValueToCoords(state, options) {
14433
14457
  placement,
14434
14458
  platform,
14435
14459
  elements
14436
- } = 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), {
14460
+ } = 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), {
14437
14461
  mainAxis,
14438
14462
  crossAxis,
14439
14463
  alignmentAxis
@@ -14455,11 +14479,10 @@ async function convertValueToCoords(state, options) {
14455
14479
  y: crossAxis * crossAxisMulti
14456
14480
  };
14457
14481
  }
14458
- function getCrossAxis(axis) {
14459
- return axis === "x" ? "y" : "x";
14460
- }
14461
- var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, oppositeAlignmentMap, autoPlacement, flip, hide, inline, offset, shift, limitShift, size, init_floating_ui_core_esm = __esm({
14482
+ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, limitShift, size, init_floating_ui_core_esm = __esm({
14462
14483
  "../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js"() {
14484
+ init_floating_ui_utils();
14485
+ init_floating_ui_utils();
14463
14486
  computePosition = async (reference, floating, config) => {
14464
14487
  let {
14465
14488
  placement = "bottom",
@@ -14523,7 +14546,6 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14523
14546
  middlewareData
14524
14547
  };
14525
14548
  };
14526
- min = Math.min, max = Math.max;
14527
14549
  arrow = (options) => ({
14528
14550
  name: "arrow",
14529
14551
  options,
@@ -14534,37 +14556,33 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14534
14556
  placement,
14535
14557
  rects,
14536
14558
  platform,
14537
- elements
14559
+ elements,
14560
+ middlewareData
14538
14561
  } = state, {
14539
14562
  element,
14540
14563
  padding = 0
14541
14564
  } = evaluate(options, state) || {};
14542
14565
  if (element == null)
14543
14566
  return {};
14544
- let paddingObject = getSideObjectFromPadding(padding), coords = {
14567
+ let paddingObject = getPaddingObject(padding), coords = {
14545
14568
  x,
14546
14569
  y
14547
- }, 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;
14570
+ }, 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;
14548
14571
  (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) && (clientSize = elements.floating[clientProp] || rects.floating[length]);
14549
- 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;
14572
+ 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;
14550
14573
  return {
14551
- [axis]: coords[axis] - alignmentOffset,
14574
+ [axis]: coords[axis] + alignmentOffset,
14552
14575
  data: {
14553
14576
  [axis]: offset2,
14554
- centerOffset: center - offset2 + alignmentOffset
14555
- }
14577
+ centerOffset: center - offset2 - alignmentOffset,
14578
+ ...shouldAddOffset && {
14579
+ alignmentOffset
14580
+ }
14581
+ },
14582
+ reset: shouldAddOffset
14556
14583
  };
14557
14584
  }
14558
- }), sides = ["top", "right", "bottom", "left"], allPlacements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []), oppositeSideMap = {
14559
- left: "right",
14560
- right: "left",
14561
- bottom: "top",
14562
- top: "bottom"
14563
- };
14564
- oppositeAlignmentMap = {
14565
- start: "end",
14566
- end: "start"
14567
- };
14585
+ });
14568
14586
  autoPlacement = function(options) {
14569
14587
  return options === void 0 && (options = {}), {
14570
14588
  name: "autoPlacement",
@@ -14580,26 +14598,23 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14580
14598
  } = state, {
14581
14599
  crossAxis = !1,
14582
14600
  alignment,
14583
- allowedPlacements = allPlacements,
14601
+ allowedPlacements = placements,
14584
14602
  autoAlignment = !0,
14585
14603
  ...detectOverflowOptions
14586
- } = 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];
14604
+ } = 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];
14587
14605
  if (currentPlacement == null)
14588
14606
  return {};
14589
- let {
14590
- main,
14591
- cross
14592
- } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
14607
+ let alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
14593
14608
  if (placement !== currentPlacement)
14594
14609
  return {
14595
14610
  reset: {
14596
- placement: placements[0]
14611
+ placement: placements$1[0]
14597
14612
  }
14598
14613
  };
14599
- let currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]], allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
14614
+ let currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]], allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
14600
14615
  placement: currentPlacement,
14601
14616
  overflows: currentOverflows
14602
- }], nextPlacement = placements[currentIndex + 1];
14617
+ }], nextPlacement = placements$1[currentIndex + 1];
14603
14618
  if (nextPlacement)
14604
14619
  return {
14605
14620
  data: {
@@ -14636,13 +14651,12 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14636
14651
  } : {};
14637
14652
  }
14638
14653
  };
14639
- };
14640
- flip = function(options) {
14654
+ }, flip = function(options) {
14641
14655
  return options === void 0 && (options = {}), {
14642
14656
  name: "flip",
14643
14657
  options,
14644
14658
  async fn(state) {
14645
- var _middlewareData$flip;
14659
+ var _middlewareData$arrow, _middlewareData$flip;
14646
14660
  let {
14647
14661
  placement,
14648
14662
  middlewareData,
@@ -14658,22 +14672,22 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14658
14672
  fallbackAxisSideDirection = "none",
14659
14673
  flipAlignment = !0,
14660
14674
  ...detectOverflowOptions
14661
- } = 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));
14675
+ } = evaluate(options, state);
14676
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)
14677
+ return {};
14678
+ 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));
14662
14679
  !specifiedFallbackPlacements && fallbackAxisSideDirection !== "none" && fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
14663
- let placements = [initialPlacement, ...fallbackPlacements], overflow = await detectOverflow(state, detectOverflowOptions), overflows = [], overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
14680
+ let placements2 = [initialPlacement, ...fallbackPlacements], overflow = await detectOverflow(state, detectOverflowOptions), overflows = [], overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
14664
14681
  if (checkMainAxis && overflows.push(overflow[side]), checkCrossAxis) {
14665
- let {
14666
- main,
14667
- cross
14668
- } = getAlignmentSides(placement, rects, rtl);
14669
- overflows.push(overflow[main], overflow[cross]);
14682
+ let sides2 = getAlignmentSides(placement, rects, rtl);
14683
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
14670
14684
  }
14671
14685
  if (overflowsData = [...overflowsData, {
14672
14686
  placement,
14673
14687
  overflows
14674
14688
  }], !overflows.every((side2) => side2 <= 0)) {
14675
14689
  var _middlewareData$flip2, _overflowsData$filter;
14676
- let nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements[nextIndex];
14690
+ let nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
14677
14691
  if (nextPlacement)
14678
14692
  return {
14679
14693
  data: {
@@ -14765,12 +14779,12 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14765
14779
  padding = 2,
14766
14780
  x,
14767
14781
  y
14768
- } = 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);
14782
+ } = 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);
14769
14783
  function getBoundingClientRect() {
14770
14784
  if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null)
14771
14785
  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;
14772
14786
  if (clientRects.length >= 2) {
14773
- if (getMainAxisFromPlacement(placement) === "x") {
14787
+ if (getSideAxis(placement) === "y") {
14774
14788
  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;
14775
14789
  return {
14776
14790
  top: top2,
@@ -14817,19 +14831,24 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14817
14831
  name: "offset",
14818
14832
  options,
14819
14833
  async fn(state) {
14834
+ var _middlewareData$offse, _middlewareData$arrow;
14820
14835
  let {
14821
14836
  x,
14822
- y
14837
+ y,
14838
+ placement,
14839
+ middlewareData
14823
14840
  } = state, diffCoords = await convertValueToCoords(state, options);
14824
- return {
14841
+ return placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset ? {} : {
14825
14842
  x: x + diffCoords.x,
14826
14843
  y: y + diffCoords.y,
14827
- data: diffCoords
14844
+ data: {
14845
+ ...diffCoords,
14846
+ placement
14847
+ }
14828
14848
  };
14829
14849
  }
14830
14850
  };
14831
- };
14832
- shift = function(options) {
14851
+ }, shift = function(options) {
14833
14852
  return options === void 0 && (options = {}), {
14834
14853
  name: "shift",
14835
14854
  options,
@@ -14857,14 +14876,14 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14857
14876
  } = evaluate(options, state), coords = {
14858
14877
  x,
14859
14878
  y
14860
- }, overflow = await detectOverflow(state, detectOverflowOptions), mainAxis = getMainAxisFromPlacement(getSide(placement)), crossAxis = getCrossAxis(mainAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
14879
+ }, overflow = await detectOverflow(state, detectOverflowOptions), crossAxis = getSideAxis(getSide(placement)), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis];
14861
14880
  if (checkMainAxis) {
14862
14881
  let minSide = mainAxis === "y" ? "top" : "left", maxSide = mainAxis === "y" ? "bottom" : "right", min2 = mainAxisCoord + overflow[minSide], max2 = mainAxisCoord - overflow[maxSide];
14863
- mainAxisCoord = within(min2, mainAxisCoord, max2);
14882
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
14864
14883
  }
14865
14884
  if (checkCrossAxis) {
14866
14885
  let minSide = crossAxis === "y" ? "top" : "left", maxSide = crossAxis === "y" ? "bottom" : "right", min2 = crossAxisCoord + overflow[minSide], max2 = crossAxisCoord - overflow[maxSide];
14867
- crossAxisCoord = within(min2, crossAxisCoord, max2);
14886
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
14868
14887
  }
14869
14888
  let limitedCoords = limiter.fn({
14870
14889
  ...state,
@@ -14897,7 +14916,7 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14897
14916
  } = evaluate(options, state), coords = {
14898
14917
  x,
14899
14918
  y
14900
- }, mainAxis = getMainAxisFromPlacement(placement), crossAxis = getCrossAxis(mainAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
14919
+ }, crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], rawOffset = evaluate(offset2, state), computedOffset = typeof rawOffset == "number" ? {
14901
14920
  mainAxis: rawOffset,
14902
14921
  crossAxis: 0
14903
14922
  } : {
@@ -14934,13 +14953,13 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14934
14953
  apply = () => {
14935
14954
  },
14936
14955
  ...detectOverflowOptions
14937
- } = evaluate(options, state), overflow = await detectOverflow(state, detectOverflowOptions), side = getSide(placement), alignment = getAlignment(placement), isXAxis = getMainAxisFromPlacement(placement) === "x", {
14956
+ } = evaluate(options, state), overflow = await detectOverflow(state, detectOverflowOptions), side = getSide(placement), alignment = getAlignment(placement), isYAxis = getSideAxis(placement) === "y", {
14938
14957
  width,
14939
14958
  height
14940
14959
  } = rects.floating, heightSide, widthSide;
14941
14960
  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");
14942
14961
  let overflowAvailableHeight = height - overflow[heightSide], overflowAvailableWidth = width - overflow[widthSide], noShift = !state.middlewareData.shift, availableHeight = overflowAvailableHeight, availableWidth = overflowAvailableWidth;
14943
- if (isXAxis) {
14962
+ if (isYAxis) {
14944
14963
  let maximumClippingWidth = width - overflow.left - overflow.right;
14945
14964
  availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
14946
14965
  } else {
@@ -14949,7 +14968,7 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14949
14968
  }
14950
14969
  if (noShift && !alignment) {
14951
14970
  let xMin = max(overflow.left, 0), xMax = max(overflow.right, 0), yMin = max(overflow.top, 0), yMax = max(overflow.bottom, 0);
14952
- 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));
14971
+ 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));
14953
14972
  }
14954
14973
  await apply({
14955
14974
  ...state,
@@ -14972,11 +14991,8 @@ var computePosition, min, max, arrow, sides, allPlacements, oppositeSideMap, opp
14972
14991
  var require_floating_ui_react_native = __commonJS({
14973
14992
  "../../node_modules/@floating-ui/react-native/dist/floating-ui.react-native.js"(exports2) {
14974
14993
  "use strict";
14975
- Object.defineProperty(exports2, "__esModule", { value: !0 });
14976
14994
  var core = (init_floating_ui_core_esm(), __toCommonJS(floating_ui_core_esm_exports)), React2 = require("react"), reactNative = require("react-native");
14977
- function _interopNamespace(e) {
14978
- if (e && e.__esModule)
14979
- return e;
14995
+ function _interopNamespaceDefault(e) {
14980
14996
  var n = /* @__PURE__ */ Object.create(null);
14981
14997
  return e && Object.keys(e).forEach(function(k) {
14982
14998
  if (k !== "default") {
@@ -14990,7 +15006,7 @@ var require_floating_ui_react_native = __commonJS({
14990
15006
  }
14991
15007
  }), n.default = e, Object.freeze(n);
14992
15008
  }
14993
- var React__namespace = /* @__PURE__ */ _interopNamespace(React2), arrow2 = (options) => {
15009
+ var React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React2), arrow2 = (options) => {
14994
15010
  let {
14995
15011
  element,
14996
15012
  padding
@@ -15014,7 +15030,11 @@ var require_floating_ui_react_native = __commonJS({
15014
15030
  }, ORIGIN$1 = {
15015
15031
  x: 0,
15016
15032
  y: 0
15017
- }, createPlatform = (_ref) => {
15033
+ };
15034
+ function isView(reference) {
15035
+ return "measure" in reference;
15036
+ }
15037
+ var createPlatform = (_ref) => {
15018
15038
  let {
15019
15039
  offsetParent,
15020
15040
  sameScrollView = !0,
@@ -15033,19 +15053,32 @@ var require_floating_ui_react_native = __commonJS({
15033
15053
  width,
15034
15054
  height,
15035
15055
  ...ORIGIN$1
15036
- };
15037
- reference[sameScrollView ? "measure" : "measureInWindow"]((x2, y2, width2, height2) => {
15038
- let referenceRect = {
15039
- width: width2,
15040
- height: height2,
15041
- x: x2 - offsetX,
15042
- y: y2 - offsetY
15056
+ }, method = sameScrollView ? "measure" : "measureInWindow";
15057
+ if (isView(reference))
15058
+ reference[method]((x2, y2, width2, height2) => {
15059
+ let referenceRect = {
15060
+ width: width2,
15061
+ height: height2,
15062
+ x: x2 - offsetX,
15063
+ y: y2 - offsetY
15064
+ };
15065
+ resolve({
15066
+ reference: referenceRect,
15067
+ floating: floatingRect
15068
+ });
15069
+ });
15070
+ else {
15071
+ let boundingRect = reference.getBoundingClientRect(), referenceRect = {
15072
+ width: boundingRect.width,
15073
+ height: boundingRect.height,
15074
+ x: boundingRect.x - offsetX,
15075
+ y: boundingRect.y - offsetY
15043
15076
  };
15044
15077
  resolve({
15045
15078
  reference: referenceRect,
15046
15079
  floating: floatingRect
15047
15080
  });
15048
- });
15081
+ }
15049
15082
  });
15050
15083
  };
15051
15084
  offsetParent ? offsetParent.measure(onMeasure) : onMeasure();
@@ -15093,7 +15126,7 @@ var require_floating_ui_react_native = __commonJS({
15093
15126
  let length, i, keys;
15094
15127
  if (a && b && typeof a == "object") {
15095
15128
  if (Array.isArray(a)) {
15096
- if (length = a.length, length != b.length)
15129
+ if (length = a.length, length !== b.length)
15097
15130
  return !1;
15098
15131
  for (i = length; i-- !== 0; )
15099
15132
  if (!deepEqual(a[i], b[i]))
@@ -15131,11 +15164,11 @@ var require_floating_ui_react_native = __commonJS({
15131
15164
  } = {}
15132
15165
  } = 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) => {
15133
15166
  node !== referenceRef.current && (referenceRef.current = node, _setReference(node));
15134
- }, [_setReference]), setFloating = React__namespace.useCallback((node) => {
15167
+ }, []), setFloating = React__namespace.useCallback((node) => {
15135
15168
  node !== floatingRef.current && (floatingRef.current = node, _setFloating(node));
15136
- }, [_setFloating]), setOffsetParent = React__namespace.useCallback((node) => {
15169
+ }, []), setOffsetParent = React__namespace.useCallback((node) => {
15137
15170
  node !== offsetParentRef.current && (offsetParentRef.current = node, _setOffsetParent(node));
15138
- }, [_setOffsetParent]), referenceRef = React__namespace.useRef(null), floatingRef = React__namespace.useRef(null), offsetParentRef = React__namespace.useRef(null), [data, setData] = React__namespace.useState({
15171
+ }, []), referenceRef = React__namespace.useRef(null), floatingRef = React__namespace.useRef(null), offsetParentRef = React__namespace.useRef(null), [data, setData] = React__namespace.useState({
15139
15172
  x: 0,
15140
15173
  y: 0,
15141
15174
  placement,
@@ -15381,11 +15414,7 @@ var require_Popper_native = __commonJS({
15381
15414
  allowFlip,
15382
15415
  offset: offset2,
15383
15416
  __scopePopper
15384
- } = props, [isMounted, setIsMounted] = React2.useState(!1);
15385
- (0, import_constants4.useIsomorphicLayoutEffect)(() => {
15386
- setIsMounted(!0);
15387
- }, []);
15388
- let [anchorRef, setAnchorRef] = React2.useState(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
15417
+ } = props, isMounted = (0, import_core13.useDidFinishSSR)(), [arrowEl, setArrow] = React2.useState(null), [arrowSize, setArrowSize] = React2.useState(0), offsetOptions = offset2 ?? arrowSize, floating = (0, import_floating.useFloating)({
15389
15418
  strategy,
15390
15419
  placement,
15391
15420
  sameScrollView: !1,
@@ -15402,9 +15431,7 @@ var require_Popper_native = __commonJS({
15402
15431
  // @ts-expect-error this comes from Tooltip for example
15403
15432
  open
15404
15433
  } = floating;
15405
- if ((0, import_constants4.useIsomorphicLayoutEffect)(() => {
15406
- floating.refs.setReference(anchorRef);
15407
- }, [anchorRef]), import_constants4.isWeb)
15434
+ if (import_constants4.isWeb)
15408
15435
  (0, import_constants4.useIsomorphicLayoutEffect)(() => {
15409
15436
  if (open && refs.reference.current && refs.floating.current)
15410
15437
  return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
@@ -15425,7 +15452,6 @@ var require_Popper_native = __commonJS({
15425
15452
  }, [dimensions, keyboardOpen]);
15426
15453
  }
15427
15454
  let popperContext = {
15428
- anchorRef: setAnchorRef,
15429
15455
  size: size2,
15430
15456
  arrowRef: setArrow,
15431
15457
  arrowStyle: middlewareData.arrow,
@@ -15439,10 +15465,12 @@ var require_Popper_native = __commonJS({
15439
15465
  var PopperAnchor = import_stacks3.YStack.extractable(
15440
15466
  React2.forwardRef(
15441
15467
  function(props, forwardedRef) {
15442
- let { virtualRef, __scopePopper, ...anchorProps } = props, { anchorRef, getReferenceProps } = usePopperContext(__scopePopper), ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, anchorRef);
15443
- if (React2.useEffect(() => {
15444
- anchorRef((virtualRef == null ? void 0 : virtualRef.current) || ref.current);
15445
- }, [anchorRef, virtualRef]), virtualRef)
15468
+ let { virtualRef, __scopePopper, ...anchorProps } = props, { getReferenceProps, refs } = usePopperContext(__scopePopper), ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(
15469
+ forwardedRef,
15470
+ ref,
15471
+ virtualRef ?? refs.setReference
15472
+ );
15473
+ if (virtualRef)
15446
15474
  return null;
15447
15475
  let stackProps = {
15448
15476
  ref: composedRefs,
@@ -15863,7 +15891,7 @@ var require_Popover_native = __commonJS({
15863
15891
  componentName: "PopoverClose",
15864
15892
  onPress: (0, import_helpers.composeEventHandlers)(
15865
15893
  props.onPress,
15866
- () => context.onOpenChange(!1)
15894
+ () => context.onOpenChange(!1, "press")
15867
15895
  )
15868
15896
  }
15869
15897
  );
@@ -15895,13 +15923,17 @@ var require_Popover_native = __commonJS({
15895
15923
  ...restProps
15896
15924
  } = props, id = React2.useId(), { when, AdaptProvider } = (0, import_adapt.useAdaptParent)({
15897
15925
  Contents: React2.useCallback(() => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalHost, { name: `${id}PopoverContents` }), [])
15898
- }), sheetBreakpoint = when, triggerRef = React2.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React2.useState(!1), [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
15926
+ }), sheetBreakpoint = when, triggerRef = React2.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React2.useState(!1), viaRef = React2.useRef(), [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
15899
15927
  prop: openProp,
15900
15928
  defaultProp: defaultOpen || !1,
15901
- onChange: onOpenChange
15929
+ onChange: (val) => {
15930
+ onOpenChange == null || onOpenChange(val, viaRef.current);
15931
+ }
15902
15932
  }), sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
15903
15933
  open,
15904
- setOpen,
15934
+ setOpen: (val, via) => {
15935
+ viaRef.current = via, setOpen(val);
15936
+ },
15905
15937
  disable: sheetActive,
15906
15938
  hoverable,
15907
15939
  disableFocus
@@ -15916,7 +15948,9 @@ var require_Popover_native = __commonJS({
15916
15948
  triggerRef,
15917
15949
  open,
15918
15950
  breakpointActive: sheetActive,
15919
- onOpenChange: setOpen,
15951
+ onOpenChange: (val, via) => {
15952
+ viaRef.current = via, setOpen(val);
15953
+ },
15920
15954
  onOpenToggle: (0, import_core13.useEvent)(() => {
15921
15955
  open && sheetActive || setOpen(!open);
15922
15956
  }),