sodtrack-web-ui 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -199,16 +199,16 @@ function createSplitModifiers(config) {
199
199
  let bracketDepth = 0;
200
200
  let modifierStart = 0;
201
201
  let postfixModifierPosition;
202
- for (let index2 = 0; index2 < className.length; index2++) {
203
- let currentCharacter = className[index2];
202
+ for (let index = 0; index < className.length; index++) {
203
+ let currentCharacter = className[index];
204
204
  if (bracketDepth === 0) {
205
- if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index2, index2 + separatorLength) === separator)) {
206
- modifiers.push(className.slice(modifierStart, index2));
207
- modifierStart = index2 + separatorLength;
205
+ if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
206
+ modifiers.push(className.slice(modifierStart, index));
207
+ modifierStart = index + separatorLength;
208
208
  continue;
209
209
  }
210
210
  if (currentCharacter === "/") {
211
- postfixModifierPosition = index2;
211
+ postfixModifierPosition = index;
212
212
  continue;
213
213
  }
214
214
  }
@@ -316,12 +316,12 @@ function mergeClassList(classList, configUtils) {
316
316
  }).reverse().map((parsed) => parsed.originalClassName).join(" ");
317
317
  }
318
318
  function twJoin() {
319
- let index2 = 0;
319
+ let index = 0;
320
320
  let argument;
321
321
  let resolvedValue;
322
322
  let string = "";
323
- while (index2 < arguments.length) {
324
- if (argument = arguments[index2++]) {
323
+ while (index < arguments.length) {
324
+ if (argument = arguments[index++]) {
325
325
  if (resolvedValue = toValue(argument)) {
326
326
  string && (string += " ");
327
327
  string += resolvedValue;
@@ -2517,8 +2517,8 @@ import { forwardRef as forwardRef2, createElement as createElement2 } from "reac
2517
2517
 
2518
2518
  // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
2519
2519
  var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2520
- var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
2521
- return Boolean(className) && array.indexOf(className) === index2;
2520
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
2521
+ return Boolean(className) && array.indexOf(className) === index;
2522
2522
  }).join(" ");
2523
2523
 
2524
2524
  // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
@@ -2541,7 +2541,7 @@ var defaultAttributes = {
2541
2541
  var Icon = forwardRef(
2542
2542
  ({
2543
2543
  color = "currentColor",
2544
- size: size4 = 24,
2544
+ size = 24,
2545
2545
  strokeWidth = 2,
2546
2546
  absoluteStrokeWidth,
2547
2547
  className = "",
@@ -2554,10 +2554,10 @@ var Icon = forwardRef(
2554
2554
  {
2555
2555
  ref,
2556
2556
  ...defaultAttributes,
2557
- width: size4,
2558
- height: size4,
2557
+ width: size,
2558
+ height: size,
2559
2559
  stroke: color,
2560
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
2560
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
2561
2561
  className: mergeClasses("lucide", className),
2562
2562
  ...rest
2563
2563
  },
@@ -2640,7 +2640,7 @@ var Button = ({
2640
2640
  children,
2641
2641
  className,
2642
2642
  variant = "contained",
2643
- size: size4 = "medium",
2643
+ size = "medium",
2644
2644
  startIcon,
2645
2645
  endIcon,
2646
2646
  loading = false,
@@ -2652,24 +2652,24 @@ var Button = ({
2652
2652
  {
2653
2653
  ...props,
2654
2654
  disabled: loading || disabled,
2655
- className: cn(button({ variant, size: size4, loading }), className)
2655
+ className: cn(button({ variant, size, loading }), className)
2656
2656
  },
2657
2657
  loading && /* @__PURE__ */ React.createElement(
2658
2658
  LoaderCircleIcon,
2659
2659
  {
2660
2660
  className: cn("absolute animate-spin text-neutral-500"),
2661
- width: size4 === "small" ? "16px" : "24px",
2662
- height: size4 === "small" ? "16px" : "24px"
2661
+ width: size === "small" ? "16px" : "24px",
2662
+ height: size === "small" ? "16px" : "24px"
2663
2663
  }
2664
2664
  ),
2665
2665
  startIcon && React.cloneElement(startIcon, {
2666
- width: size4 === "small" ? "16px" : "24px",
2667
- height: size4 === "small" ? "16px" : "24px"
2666
+ width: size === "small" ? "16px" : "24px",
2667
+ height: size === "small" ? "16px" : "24px"
2668
2668
  }),
2669
2669
  children,
2670
2670
  endIcon && React.cloneElement(endIcon, {
2671
- width: size4 === "small" ? "16px" : "24px",
2672
- height: size4 === "small" ? "16px" : "24px"
2671
+ width: size === "small" ? "16px" : "24px",
2672
+ height: size === "small" ? "16px" : "24px"
2673
2673
  })
2674
2674
  );
2675
2675
  };
@@ -2727,17 +2727,17 @@ var Alert = ({
2727
2727
  variant,
2728
2728
  className,
2729
2729
  description,
2730
- size: size4 = "sm",
2730
+ size = "sm",
2731
2731
  title
2732
2732
  }) => {
2733
2733
  const [open, setOpen] = useState(true);
2734
- return /* @__PURE__ */ React2.createElement("div", { className: cn(alertRoot({ variant, className }), !open && "hidden") }, /* @__PURE__ */ React2.createElement("div", { className: "flex" }, variant === "warning" && /* @__PURE__ */ React2.createElement(TriangleAlertIcon, { className: alertIcon({ variant }) }), variant === "success" && /* @__PURE__ */ React2.createElement(CircleCheckIcon, { className: alertIcon({ variant }) }), variant === "error" && /* @__PURE__ */ React2.createElement(CircleXIcon, { className: alertIcon({ variant }) }), variant === "info" && /* @__PURE__ */ React2.createElement(InfoIcon, { className: alertIcon({ variant }) }), size4 === "sm" && /* @__PURE__ */ React2.createElement("p", { className: "leading-[130%]" }, title), size4 !== "sm" && /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React2.createElement("h6", { className: "font-semibold leading-[130%]" }, title), /* @__PURE__ */ React2.createElement(
2734
+ return /* @__PURE__ */ React2.createElement("div", { className: cn(alertRoot({ variant, className }), !open && "hidden") }, /* @__PURE__ */ React2.createElement("div", { className: "flex" }, variant === "warning" && /* @__PURE__ */ React2.createElement(TriangleAlertIcon, { className: alertIcon({ variant }) }), variant === "success" && /* @__PURE__ */ React2.createElement(CircleCheckIcon, { className: alertIcon({ variant }) }), variant === "error" && /* @__PURE__ */ React2.createElement(CircleXIcon, { className: alertIcon({ variant }) }), variant === "info" && /* @__PURE__ */ React2.createElement(InfoIcon, { className: alertIcon({ variant }) }), size === "sm" && /* @__PURE__ */ React2.createElement("p", { className: "leading-[130%]" }, title), size !== "sm" && /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React2.createElement("h6", { className: "font-semibold leading-[130%]" }, title), /* @__PURE__ */ React2.createElement(
2735
2735
  "p",
2736
2736
  {
2737
2737
  className: cn(
2738
2738
  "mt-1 text-sm leading-[120%] text-neutral-700",
2739
- size4 === "md" && "line-clamp-1",
2740
- size4 === "lg" && "line-clamp-2"
2739
+ size === "md" && "line-clamp-1",
2740
+ size === "lg" && "line-clamp-2"
2741
2741
  )
2742
2742
  },
2743
2743
  description
@@ -2774,13 +2774,13 @@ var iconButton = cva3({
2774
2774
  }
2775
2775
  });
2776
2776
  var IconButton = forwardRef3(
2777
- ({ children, className, variant = "contained", size: size4 = "medium", ...props }, ref) => {
2777
+ ({ children, className, variant = "contained", size = "medium", ...props }, ref) => {
2778
2778
  return /* @__PURE__ */ React3.createElement(
2779
2779
  "button",
2780
2780
  {
2781
2781
  ref,
2782
2782
  ...props,
2783
- className: iconButton({ variant, size: size4, className })
2783
+ className: iconButton({ variant, size, className })
2784
2784
  },
2785
2785
  children
2786
2786
  );
@@ -2788,3359 +2788,15 @@ var IconButton = forwardRef3(
2788
2788
  );
2789
2789
 
2790
2790
  // src/components/tooltip.tsx
2791
- import React5 from "react";
2792
-
2793
- // node_modules/.pnpm/@babel+runtime@7.24.5/node_modules/@babel/runtime/helpers/esm/extends.js
2794
- function _extends() {
2795
- _extends = Object.assign ? Object.assign.bind() : function(target) {
2796
- for (var i = 1; i < arguments.length; i++) {
2797
- var source = arguments[i];
2798
- for (var key in source) {
2799
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2800
- target[key] = source[key];
2801
- }
2802
- }
2803
- }
2804
- return target;
2805
- };
2806
- return _extends.apply(this, arguments);
2807
- }
2808
-
2809
- // node_modules/.pnpm/@radix-ui+react-tooltip@1.0.7_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.mjs
2810
- import { useState as $8wepK$useState, useRef as $8wepK$useRef, useEffect as $8wepK$useEffect, createElement as $8wepK$createElement, useCallback as $8wepK$useCallback, useMemo as $8wepK$useMemo, forwardRef as $8wepK$forwardRef } from "react";
2811
-
2812
- // node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
2813
- function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
2814
- return function handleEvent(event) {
2815
- originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
2816
- if (checkForDefaultPrevented === false || !event.defaultPrevented)
2817
- return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
2818
- };
2819
- }
2820
-
2821
- // node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
2822
- import { useCallback as $3vqmr$useCallback } from "react";
2823
- function $6ed0406888f73fc4$var$setRef(ref, value) {
2824
- if (typeof ref === "function")
2825
- ref(value);
2826
- else if (ref !== null && ref !== void 0)
2827
- ref.current = value;
2828
- }
2829
- function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
2830
- return (node) => refs.forEach(
2831
- (ref) => $6ed0406888f73fc4$var$setRef(ref, node)
2832
- );
2833
- }
2834
- function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
2835
- return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
2836
- }
2837
-
2838
- // node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs
2839
- import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
2840
- function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
2841
- let defaultContexts = [];
2842
- function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
2843
- const BaseContext = /* @__PURE__ */ $3bkAK$createContext(defaultContext);
2844
- const index2 = defaultContexts.length;
2845
- defaultContexts = [
2846
- ...defaultContexts,
2847
- defaultContext
2848
- ];
2849
- function Provider(props) {
2850
- const { scope, children, ...context } = props;
2851
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
2852
- const value = $3bkAK$useMemo(
2853
- () => context,
2854
- Object.values(context)
2855
- );
2856
- return /* @__PURE__ */ $3bkAK$createElement(Context.Provider, {
2857
- value
2858
- }, children);
2859
- }
2860
- function useContext(consumerName, scope) {
2861
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
2862
- const context = $3bkAK$useContext(Context);
2863
- if (context)
2864
- return context;
2865
- if (defaultContext !== void 0)
2866
- return defaultContext;
2867
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2868
- }
2869
- Provider.displayName = rootComponentName + "Provider";
2870
- return [
2871
- Provider,
2872
- useContext
2873
- ];
2874
- }
2875
- const createScope = () => {
2876
- const scopeContexts = defaultContexts.map((defaultContext) => {
2877
- return /* @__PURE__ */ $3bkAK$createContext(defaultContext);
2878
- });
2879
- return function useScope(scope) {
2880
- const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
2881
- return $3bkAK$useMemo(
2882
- () => ({
2883
- [`__scope${scopeName}`]: {
2884
- ...scope,
2885
- [scopeName]: contexts
2886
- }
2887
- }),
2888
- [
2889
- scope,
2890
- contexts
2891
- ]
2892
- );
2893
- };
2894
- };
2895
- createScope.scopeName = scopeName;
2896
- return [
2897
- $c512c27ab02ef895$export$fd42f52fd3ae1109,
2898
- $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
2899
- ];
2900
- }
2901
- function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
2902
- const baseScope = scopes[0];
2903
- if (scopes.length === 1)
2904
- return baseScope;
2905
- const createScope1 = () => {
2906
- const scopeHooks = scopes.map(
2907
- (createScope) => ({
2908
- useScope: createScope(),
2909
- scopeName: createScope.scopeName
2910
- })
2911
- );
2912
- return function useComposedScopes(overrideScopes) {
2913
- const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
2914
- const scopeProps = useScope(overrideScopes);
2915
- const currentScope = scopeProps[`__scope${scopeName}`];
2916
- return {
2917
- ...nextScopes,
2918
- ...currentScope
2919
- };
2920
- }, {});
2921
- return $3bkAK$useMemo(
2922
- () => ({
2923
- [`__scope${baseScope.scopeName}`]: nextScopes1
2924
- }),
2925
- [
2926
- nextScopes1
2927
- ]
2928
- );
2929
- };
2930
- };
2931
- createScope1.scopeName = baseScope.scopeName;
2932
- return createScope1;
2933
- }
2934
-
2935
- // node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
2936
- import { createContext as $kqwpH$createContext, forwardRef as $kqwpH$forwardRef, useContext as $kqwpH$useContext, useState as $kqwpH$useState, useEffect as $kqwpH$useEffect, createElement as $kqwpH$createElement, useRef as $kqwpH$useRef } from "react";
2937
-
2938
- // node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs
2939
- import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
2940
- import { flushSync as $4q5Fq$flushSync } from "react-dom";
2941
-
2942
- // node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
2943
- import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
2944
- var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ $9IrjX$forwardRef((props, forwardedRef) => {
2945
- const { children, ...slotProps } = props;
2946
- const childrenArray = $9IrjX$Children.toArray(children);
2947
- const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
2948
- if (slottable) {
2949
- const newElement = slottable.props.children;
2950
- const newChildren = childrenArray.map((child) => {
2951
- if (child === slottable) {
2952
- if ($9IrjX$Children.count(newElement) > 1)
2953
- return $9IrjX$Children.only(null);
2954
- return /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;
2955
- } else
2956
- return child;
2957
- });
2958
- return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
2959
- ref: forwardedRef
2960
- }), /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? /* @__PURE__ */ $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
2961
- }
2962
- return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
2963
- ref: forwardedRef
2964
- }), children);
2965
- });
2966
- $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
2967
- var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ $9IrjX$forwardRef((props, forwardedRef) => {
2968
- const { children, ...slotProps } = props;
2969
- if (/* @__PURE__ */ $9IrjX$isValidElement(children))
2970
- return /* @__PURE__ */ $9IrjX$cloneElement(children, {
2971
- ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
2972
- ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
2973
- });
2974
- return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
2975
- });
2976
- $5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
2977
- var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
2978
- return /* @__PURE__ */ $9IrjX$createElement($9IrjX$Fragment, null, children);
2979
- };
2980
- function $5e63c961fc1ce211$var$isSlottable(child) {
2981
- return /* @__PURE__ */ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
2982
- }
2983
- function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
2984
- const overrideProps = {
2985
- ...childProps
2986
- };
2987
- for (const propName in childProps) {
2988
- const slotPropValue = slotProps[propName];
2989
- const childPropValue = childProps[propName];
2990
- const isHandler = /^on[A-Z]/.test(propName);
2991
- if (isHandler) {
2992
- if (slotPropValue && childPropValue)
2993
- overrideProps[propName] = (...args) => {
2994
- childPropValue(...args);
2995
- slotPropValue(...args);
2996
- };
2997
- else if (slotPropValue)
2998
- overrideProps[propName] = slotPropValue;
2999
- } else if (propName === "style")
3000
- overrideProps[propName] = {
3001
- ...slotPropValue,
3002
- ...childPropValue
3003
- };
3004
- else if (propName === "className")
3005
- overrideProps[propName] = [
3006
- slotPropValue,
3007
- childPropValue
3008
- ].filter(Boolean).join(" ");
3009
- }
3010
- return {
3011
- ...slotProps,
3012
- ...overrideProps
3013
- };
3014
- }
3015
-
3016
- // node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs
3017
- var $8927f6f2acc4f386$var$NODES = [
3018
- "a",
3019
- "button",
3020
- "div",
3021
- "form",
3022
- "h2",
3023
- "h3",
3024
- "img",
3025
- "input",
3026
- "label",
3027
- "li",
3028
- "nav",
3029
- "ol",
3030
- "p",
3031
- "span",
3032
- "svg",
3033
- "ul"
3034
- ];
3035
- var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
3036
- const Node2 = /* @__PURE__ */ $4q5Fq$forwardRef((props, forwardedRef) => {
3037
- const { asChild, ...primitiveProps } = props;
3038
- const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
3039
- $4q5Fq$useEffect(() => {
3040
- window[Symbol.for("radix-ui")] = true;
3041
- }, []);
3042
- return /* @__PURE__ */ $4q5Fq$createElement(Comp, _extends({}, primitiveProps, {
3043
- ref: forwardedRef
3044
- }));
3045
- });
3046
- Node2.displayName = `Primitive.${node}`;
3047
- return {
3048
- ...primitive,
3049
- [node]: Node2
3050
- };
3051
- }, {});
3052
- function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
3053
- if (target)
3054
- $4q5Fq$flushSync(
3055
- () => target.dispatchEvent(event)
3056
- );
3057
- }
3058
-
3059
- // node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
3060
- import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
3061
- function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
3062
- const callbackRef = $lwiWj$useRef(callback);
3063
- $lwiWj$useEffect(() => {
3064
- callbackRef.current = callback;
3065
- });
3066
- return $lwiWj$useMemo(
3067
- () => (...args) => {
3068
- var _callbackRef$current;
3069
- return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
3070
- },
3071
- []
3072
- );
3073
- }
3074
-
3075
- // node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.0.3_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
3076
- import { useEffect as $hPSQ5$useEffect } from "react";
3077
- function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3078
- const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
3079
- $hPSQ5$useEffect(() => {
3080
- const handleKeyDown = (event) => {
3081
- if (event.key === "Escape")
3082
- onEscapeKeyDown(event);
3083
- };
3084
- ownerDocument.addEventListener("keydown", handleKeyDown);
3085
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown);
3086
- }, [
3087
- onEscapeKeyDown,
3088
- ownerDocument
3089
- ]);
3090
- }
3091
-
3092
- // node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
3093
- var $5cb92bef7577960e$var$CONTEXT_UPDATE = "dismissableLayer.update";
3094
- var $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
3095
- var $5cb92bef7577960e$var$FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
3096
- var $5cb92bef7577960e$var$originalBodyPointerEvents;
3097
- var $5cb92bef7577960e$var$DismissableLayerContext = /* @__PURE__ */ $kqwpH$createContext({
3098
- layers: /* @__PURE__ */ new Set(),
3099
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
3100
- branches: /* @__PURE__ */ new Set()
3101
- });
3102
- var $5cb92bef7577960e$export$177fb62ff3ec1f22 = /* @__PURE__ */ $kqwpH$forwardRef((props, forwardedRef) => {
3103
- var _node$ownerDocument;
3104
- const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
3105
- const context = $kqwpH$useContext($5cb92bef7577960e$var$DismissableLayerContext);
3106
- const [node1, setNode] = $kqwpH$useState(null);
3107
- const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
3108
- const [, force] = $kqwpH$useState({});
3109
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
3110
- forwardedRef,
3111
- (node) => setNode(node)
3112
- );
3113
- const layers = Array.from(context.layers);
3114
- const [highestLayerWithOutsidePointerEventsDisabled] = [
3115
- ...context.layersWithOutsidePointerEventsDisabled
3116
- ].slice(-1);
3117
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
3118
- const index2 = node1 ? layers.indexOf(node1) : -1;
3119
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
3120
- const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
3121
- const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event) => {
3122
- const target = event.target;
3123
- const isPointerDownOnBranch = [
3124
- ...context.branches
3125
- ].some(
3126
- (branch) => branch.contains(target)
3127
- );
3128
- if (!isPointerEventsEnabled || isPointerDownOnBranch)
3129
- return;
3130
- onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
3131
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
3132
- if (!event.defaultPrevented)
3133
- onDismiss === null || onDismiss === void 0 || onDismiss();
3134
- }, ownerDocument);
3135
- const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event) => {
3136
- const target = event.target;
3137
- const isFocusInBranch = [
3138
- ...context.branches
3139
- ].some(
3140
- (branch) => branch.contains(target)
3141
- );
3142
- if (isFocusInBranch)
3143
- return;
3144
- onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
3145
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
3146
- if (!event.defaultPrevented)
3147
- onDismiss === null || onDismiss === void 0 || onDismiss();
3148
- }, ownerDocument);
3149
- $addc16e1bbe58fd0$export$3a72a57244d6e765((event) => {
3150
- const isHighestLayer = index2 === context.layers.size - 1;
3151
- if (!isHighestLayer)
3152
- return;
3153
- onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
3154
- if (!event.defaultPrevented && onDismiss) {
3155
- event.preventDefault();
3156
- onDismiss();
3157
- }
3158
- }, ownerDocument);
3159
- $kqwpH$useEffect(() => {
3160
- if (!node1)
3161
- return;
3162
- if (disableOutsidePointerEvents) {
3163
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
3164
- $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
3165
- ownerDocument.body.style.pointerEvents = "none";
3166
- }
3167
- context.layersWithOutsidePointerEventsDisabled.add(node1);
3168
- }
3169
- context.layers.add(node1);
3170
- $5cb92bef7577960e$var$dispatchUpdate();
3171
- return () => {
3172
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1)
3173
- ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
3174
- };
3175
- }, [
3176
- node1,
3177
- ownerDocument,
3178
- disableOutsidePointerEvents,
3179
- context
3180
- ]);
3181
- $kqwpH$useEffect(() => {
3182
- return () => {
3183
- if (!node1)
3184
- return;
3185
- context.layers.delete(node1);
3186
- context.layersWithOutsidePointerEventsDisabled.delete(node1);
3187
- $5cb92bef7577960e$var$dispatchUpdate();
3188
- };
3189
- }, [
3190
- node1,
3191
- context
3192
- ]);
3193
- $kqwpH$useEffect(() => {
3194
- const handleUpdate = () => force({});
3195
- document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
3196
- return () => document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
3197
- }, []);
3198
- return /* @__PURE__ */ $kqwpH$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
3199
- ref: composedRefs,
3200
- style: {
3201
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
3202
- ...props.style
3203
- },
3204
- onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
3205
- onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
3206
- onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
3207
- }));
3208
- });
3209
- function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3210
- const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
3211
- const isPointerInsideReactTreeRef = $kqwpH$useRef(false);
3212
- const handleClickRef = $kqwpH$useRef(() => {
3213
- });
3214
- $kqwpH$useEffect(() => {
3215
- const handlePointerDown = (event) => {
3216
- if (event.target && !isPointerInsideReactTreeRef.current) {
3217
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
3218
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
3219
- discrete: true
3220
- });
3221
- };
3222
- var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
3223
- const eventDetail = {
3224
- originalEvent: event
3225
- };
3226
- if (event.pointerType === "touch") {
3227
- ownerDocument.removeEventListener("click", handleClickRef.current);
3228
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
3229
- ownerDocument.addEventListener("click", handleClickRef.current, {
3230
- once: true
3231
- });
3232
- } else
3233
- handleAndDispatchPointerDownOutsideEvent2();
3234
- } else
3235
- ownerDocument.removeEventListener("click", handleClickRef.current);
3236
- isPointerInsideReactTreeRef.current = false;
3237
- };
3238
- const timerId = window.setTimeout(() => {
3239
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
3240
- }, 0);
3241
- return () => {
3242
- window.clearTimeout(timerId);
3243
- ownerDocument.removeEventListener("pointerdown", handlePointerDown);
3244
- ownerDocument.removeEventListener("click", handleClickRef.current);
3245
- };
3246
- }, [
3247
- ownerDocument,
3248
- handlePointerDownOutside
3249
- ]);
3250
- return {
3251
- // ensures we check React component tree (not just DOM tree)
3252
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
3253
- };
3254
- }
3255
- function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3256
- const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
3257
- const isFocusInsideReactTreeRef = $kqwpH$useRef(false);
3258
- $kqwpH$useEffect(() => {
3259
- const handleFocus = (event) => {
3260
- if (event.target && !isFocusInsideReactTreeRef.current) {
3261
- const eventDetail = {
3262
- originalEvent: event
3263
- };
3264
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
3265
- discrete: false
3266
- });
3267
- }
3268
- };
3269
- ownerDocument.addEventListener("focusin", handleFocus);
3270
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
3271
- }, [
3272
- ownerDocument,
3273
- handleFocusOutside
3274
- ]);
3275
- return {
3276
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
3277
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
3278
- };
3279
- }
3280
- function $5cb92bef7577960e$var$dispatchUpdate() {
3281
- const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
3282
- document.dispatchEvent(event);
3283
- }
3284
- function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
3285
- const target = detail.originalEvent.target;
3286
- const event = new CustomEvent(name, {
3287
- bubbles: false,
3288
- cancelable: true,
3289
- detail
3290
- });
3291
- if (handler)
3292
- target.addEventListener(name, handler, {
3293
- once: true
3294
- });
3295
- if (discrete)
3296
- $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
3297
- else
3298
- target.dispatchEvent(event);
3299
- }
3300
-
3301
- // node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
3302
- import * as $2AODx$react from "react";
3303
-
3304
- // node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
3305
- import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
3306
- var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : () => {
3307
- };
3308
-
3309
- // node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
3310
- var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
3311
- var $1746a345f3d73bb7$var$count = 0;
3312
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
3313
- const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
3314
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
3315
- if (!deterministicId)
3316
- setId(
3317
- (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
3318
- );
3319
- }, [
3320
- deterministicId
3321
- ]);
3322
- return deterministicId || (id ? `radix-${id}` : "");
3323
- }
3324
-
3325
- // node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.mjs
3326
- import { useState as $kY93V$useState, createElement as $kY93V$createElement, forwardRef as $kY93V$forwardRef, useRef as $kY93V$useRef, useEffect as $kY93V$useEffect } from "react";
3327
-
3328
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
3329
- var sides = ["top", "right", "bottom", "left"];
3330
- var min = Math.min;
3331
- var max = Math.max;
3332
- var round = Math.round;
3333
- var floor = Math.floor;
3334
- var createCoords = (v) => ({
3335
- x: v,
3336
- y: v
3337
- });
3338
- var oppositeSideMap = {
3339
- left: "right",
3340
- right: "left",
3341
- bottom: "top",
3342
- top: "bottom"
3343
- };
3344
- var oppositeAlignmentMap = {
3345
- start: "end",
3346
- end: "start"
3347
- };
3348
- function clamp(start, value, end) {
3349
- return max(start, min(value, end));
3350
- }
3351
- function evaluate(value, param) {
3352
- return typeof value === "function" ? value(param) : value;
3353
- }
3354
- function getSide(placement) {
3355
- return placement.split("-")[0];
3356
- }
3357
- function getAlignment(placement) {
3358
- return placement.split("-")[1];
3359
- }
3360
- function getOppositeAxis(axis) {
3361
- return axis === "x" ? "y" : "x";
3362
- }
3363
- function getAxisLength(axis) {
3364
- return axis === "y" ? "height" : "width";
3365
- }
3366
- function getSideAxis(placement) {
3367
- return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
3368
- }
3369
- function getAlignmentAxis(placement) {
3370
- return getOppositeAxis(getSideAxis(placement));
3371
- }
3372
- function getAlignmentSides(placement, rects, rtl) {
3373
- if (rtl === void 0) {
3374
- rtl = false;
3375
- }
3376
- const alignment = getAlignment(placement);
3377
- const alignmentAxis = getAlignmentAxis(placement);
3378
- const length = getAxisLength(alignmentAxis);
3379
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
3380
- if (rects.reference[length] > rects.floating[length]) {
3381
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
3382
- }
3383
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
3384
- }
3385
- function getExpandedPlacements(placement) {
3386
- const oppositePlacement = getOppositePlacement(placement);
3387
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
3388
- }
3389
- function getOppositeAlignmentPlacement(placement) {
3390
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
3391
- }
3392
- function getSideList(side, isStart, rtl) {
3393
- const lr = ["left", "right"];
3394
- const rl = ["right", "left"];
3395
- const tb = ["top", "bottom"];
3396
- const bt = ["bottom", "top"];
3397
- switch (side) {
3398
- case "top":
3399
- case "bottom":
3400
- if (rtl)
3401
- return isStart ? rl : lr;
3402
- return isStart ? lr : rl;
3403
- case "left":
3404
- case "right":
3405
- return isStart ? tb : bt;
3406
- default:
3407
- return [];
3408
- }
3409
- }
3410
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
3411
- const alignment = getAlignment(placement);
3412
- let list = getSideList(getSide(placement), direction === "start", rtl);
3413
- if (alignment) {
3414
- list = list.map((side) => side + "-" + alignment);
3415
- if (flipAlignment) {
3416
- list = list.concat(list.map(getOppositeAlignmentPlacement));
3417
- }
3418
- }
3419
- return list;
3420
- }
3421
- function getOppositePlacement(placement) {
3422
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
3423
- }
3424
- function expandPaddingObject(padding) {
3425
- return {
3426
- top: 0,
3427
- right: 0,
3428
- bottom: 0,
3429
- left: 0,
3430
- ...padding
3431
- };
3432
- }
3433
- function getPaddingObject(padding) {
3434
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
3435
- top: padding,
3436
- right: padding,
3437
- bottom: padding,
3438
- left: padding
3439
- };
3440
- }
3441
- function rectToClientRect(rect) {
3442
- const {
3443
- x,
3444
- y,
3445
- width,
3446
- height
3447
- } = rect;
3448
- return {
3449
- width,
3450
- height,
3451
- top: y,
3452
- left: x,
3453
- right: x + width,
3454
- bottom: y + height,
3455
- x,
3456
- y
3457
- };
3458
- }
3459
-
3460
- // node_modules/.pnpm/@floating-ui+core@1.6.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
3461
- function computeCoordsFromPlacement(_ref, placement, rtl) {
3462
- let {
3463
- reference,
3464
- floating
3465
- } = _ref;
3466
- const sideAxis = getSideAxis(placement);
3467
- const alignmentAxis = getAlignmentAxis(placement);
3468
- const alignLength = getAxisLength(alignmentAxis);
3469
- const side = getSide(placement);
3470
- const isVertical = sideAxis === "y";
3471
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
3472
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
3473
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
3474
- let coords;
3475
- switch (side) {
3476
- case "top":
3477
- coords = {
3478
- x: commonX,
3479
- y: reference.y - floating.height
3480
- };
3481
- break;
3482
- case "bottom":
3483
- coords = {
3484
- x: commonX,
3485
- y: reference.y + reference.height
3486
- };
3487
- break;
3488
- case "right":
3489
- coords = {
3490
- x: reference.x + reference.width,
3491
- y: commonY
3492
- };
3493
- break;
3494
- case "left":
3495
- coords = {
3496
- x: reference.x - floating.width,
3497
- y: commonY
3498
- };
3499
- break;
3500
- default:
3501
- coords = {
3502
- x: reference.x,
3503
- y: reference.y
3504
- };
3505
- }
3506
- switch (getAlignment(placement)) {
3507
- case "start":
3508
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
3509
- break;
3510
- case "end":
3511
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
3512
- break;
3513
- }
3514
- return coords;
3515
- }
3516
- var computePosition = async (reference, floating, config) => {
3517
- const {
3518
- placement = "bottom",
3519
- strategy = "absolute",
3520
- middleware = [],
3521
- platform: platform2
3522
- } = config;
3523
- const validMiddleware = middleware.filter(Boolean);
3524
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
3525
- let rects = await platform2.getElementRects({
3526
- reference,
3527
- floating,
3528
- strategy
3529
- });
3530
- let {
3531
- x,
3532
- y
3533
- } = computeCoordsFromPlacement(rects, placement, rtl);
3534
- let statefulPlacement = placement;
3535
- let middlewareData = {};
3536
- let resetCount = 0;
3537
- for (let i = 0; i < validMiddleware.length; i++) {
3538
- const {
3539
- name,
3540
- fn
3541
- } = validMiddleware[i];
3542
- const {
3543
- x: nextX,
3544
- y: nextY,
3545
- data,
3546
- reset
3547
- } = await fn({
3548
- x,
3549
- y,
3550
- initialPlacement: placement,
3551
- placement: statefulPlacement,
3552
- strategy,
3553
- middlewareData,
3554
- rects,
3555
- platform: platform2,
3556
- elements: {
3557
- reference,
3558
- floating
3559
- }
3560
- });
3561
- x = nextX != null ? nextX : x;
3562
- y = nextY != null ? nextY : y;
3563
- middlewareData = {
3564
- ...middlewareData,
3565
- [name]: {
3566
- ...middlewareData[name],
3567
- ...data
3568
- }
3569
- };
3570
- if (reset && resetCount <= 50) {
3571
- resetCount++;
3572
- if (typeof reset === "object") {
3573
- if (reset.placement) {
3574
- statefulPlacement = reset.placement;
3575
- }
3576
- if (reset.rects) {
3577
- rects = reset.rects === true ? await platform2.getElementRects({
3578
- reference,
3579
- floating,
3580
- strategy
3581
- }) : reset.rects;
3582
- }
3583
- ({
3584
- x,
3585
- y
3586
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
3587
- }
3588
- i = -1;
3589
- }
3590
- }
3591
- return {
3592
- x,
3593
- y,
3594
- placement: statefulPlacement,
3595
- strategy,
3596
- middlewareData
3597
- };
3598
- };
3599
- async function detectOverflow(state, options) {
3600
- var _await$platform$isEle;
3601
- if (options === void 0) {
3602
- options = {};
3603
- }
3604
- const {
3605
- x,
3606
- y,
3607
- platform: platform2,
3608
- rects,
3609
- elements,
3610
- strategy
3611
- } = state;
3612
- const {
3613
- boundary = "clippingAncestors",
3614
- rootBoundary = "viewport",
3615
- elementContext = "floating",
3616
- altBoundary = false,
3617
- padding = 0
3618
- } = evaluate(options, state);
3619
- const paddingObject = getPaddingObject(padding);
3620
- const altContext = elementContext === "floating" ? "reference" : "floating";
3621
- const element = elements[altBoundary ? altContext : elementContext];
3622
- const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
3623
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
3624
- boundary,
3625
- rootBoundary,
3626
- strategy
3627
- }));
3628
- const rect = elementContext === "floating" ? {
3629
- x,
3630
- y,
3631
- width: rects.floating.width,
3632
- height: rects.floating.height
3633
- } : rects.reference;
3634
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
3635
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
3636
- x: 1,
3637
- y: 1
3638
- } : {
3639
- x: 1,
3640
- y: 1
3641
- };
3642
- const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
3643
- elements,
3644
- rect,
3645
- offsetParent,
3646
- strategy
3647
- }) : rect);
3648
- return {
3649
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
3650
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
3651
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
3652
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
3653
- };
3654
- }
3655
- var arrow = (options) => ({
3656
- name: "arrow",
3657
- options,
3658
- async fn(state) {
3659
- const {
3660
- x,
3661
- y,
3662
- placement,
3663
- rects,
3664
- platform: platform2,
3665
- elements,
3666
- middlewareData
3667
- } = state;
3668
- const {
3669
- element,
3670
- padding = 0
3671
- } = evaluate(options, state) || {};
3672
- if (element == null) {
3673
- return {};
3674
- }
3675
- const paddingObject = getPaddingObject(padding);
3676
- const coords = {
3677
- x,
3678
- y
3679
- };
3680
- const axis = getAlignmentAxis(placement);
3681
- const length = getAxisLength(axis);
3682
- const arrowDimensions = await platform2.getDimensions(element);
3683
- const isYAxis = axis === "y";
3684
- const minProp = isYAxis ? "top" : "left";
3685
- const maxProp = isYAxis ? "bottom" : "right";
3686
- const clientProp = isYAxis ? "clientHeight" : "clientWidth";
3687
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
3688
- const startDiff = coords[axis] - rects.reference[axis];
3689
- const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
3690
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
3691
- if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
3692
- clientSize = elements.floating[clientProp] || rects.floating[length];
3693
- }
3694
- const centerToReference = endDiff / 2 - startDiff / 2;
3695
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
3696
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
3697
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
3698
- const min$1 = minPadding;
3699
- const max2 = clientSize - arrowDimensions[length] - maxPadding;
3700
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
3701
- const offset4 = clamp(min$1, center, max2);
3702
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
3703
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
3704
- return {
3705
- [axis]: coords[axis] + alignmentOffset,
3706
- data: {
3707
- [axis]: offset4,
3708
- centerOffset: center - offset4 - alignmentOffset,
3709
- ...shouldAddOffset && {
3710
- alignmentOffset
3711
- }
3712
- },
3713
- reset: shouldAddOffset
3714
- };
3715
- }
3716
- });
3717
- var flip = function(options) {
3718
- if (options === void 0) {
3719
- options = {};
3720
- }
3721
- return {
3722
- name: "flip",
3723
- options,
3724
- async fn(state) {
3725
- var _middlewareData$arrow, _middlewareData$flip;
3726
- const {
3727
- placement,
3728
- middlewareData,
3729
- rects,
3730
- initialPlacement,
3731
- platform: platform2,
3732
- elements
3733
- } = state;
3734
- const {
3735
- mainAxis: checkMainAxis = true,
3736
- crossAxis: checkCrossAxis = true,
3737
- fallbackPlacements: specifiedFallbackPlacements,
3738
- fallbackStrategy = "bestFit",
3739
- fallbackAxisSideDirection = "none",
3740
- flipAlignment = true,
3741
- ...detectOverflowOptions
3742
- } = evaluate(options, state);
3743
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3744
- return {};
3745
- }
3746
- const side = getSide(placement);
3747
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
3748
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3749
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
3750
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
3751
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
3752
- }
3753
- const placements2 = [initialPlacement, ...fallbackPlacements];
3754
- const overflow = await detectOverflow(state, detectOverflowOptions);
3755
- const overflows = [];
3756
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
3757
- if (checkMainAxis) {
3758
- overflows.push(overflow[side]);
3759
- }
3760
- if (checkCrossAxis) {
3761
- const sides2 = getAlignmentSides(placement, rects, rtl);
3762
- overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
3763
- }
3764
- overflowsData = [...overflowsData, {
3765
- placement,
3766
- overflows
3767
- }];
3768
- if (!overflows.every((side2) => side2 <= 0)) {
3769
- var _middlewareData$flip2, _overflowsData$filter;
3770
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
3771
- const nextPlacement = placements2[nextIndex];
3772
- if (nextPlacement) {
3773
- return {
3774
- data: {
3775
- index: nextIndex,
3776
- overflows: overflowsData
3777
- },
3778
- reset: {
3779
- placement: nextPlacement
3780
- }
3781
- };
3782
- }
3783
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
3784
- if (!resetPlacement) {
3785
- switch (fallbackStrategy) {
3786
- case "bestFit": {
3787
- var _overflowsData$map$so;
3788
- const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
3789
- if (placement2) {
3790
- resetPlacement = placement2;
3791
- }
3792
- break;
3793
- }
3794
- case "initialPlacement":
3795
- resetPlacement = initialPlacement;
3796
- break;
3797
- }
3798
- }
3799
- if (placement !== resetPlacement) {
3800
- return {
3801
- reset: {
3802
- placement: resetPlacement
3803
- }
3804
- };
3805
- }
3806
- }
3807
- return {};
3808
- }
3809
- };
3810
- };
3811
- function getSideOffsets(overflow, rect) {
3812
- return {
3813
- top: overflow.top - rect.height,
3814
- right: overflow.right - rect.width,
3815
- bottom: overflow.bottom - rect.height,
3816
- left: overflow.left - rect.width
3817
- };
3818
- }
3819
- function isAnySideFullyClipped(overflow) {
3820
- return sides.some((side) => overflow[side] >= 0);
3821
- }
3822
- var hide = function(options) {
3823
- if (options === void 0) {
3824
- options = {};
3825
- }
3826
- return {
3827
- name: "hide",
3828
- options,
3829
- async fn(state) {
3830
- const {
3831
- rects
3832
- } = state;
3833
- const {
3834
- strategy = "referenceHidden",
3835
- ...detectOverflowOptions
3836
- } = evaluate(options, state);
3837
- switch (strategy) {
3838
- case "referenceHidden": {
3839
- const overflow = await detectOverflow(state, {
3840
- ...detectOverflowOptions,
3841
- elementContext: "reference"
3842
- });
3843
- const offsets = getSideOffsets(overflow, rects.reference);
3844
- return {
3845
- data: {
3846
- referenceHiddenOffsets: offsets,
3847
- referenceHidden: isAnySideFullyClipped(offsets)
3848
- }
3849
- };
3850
- }
3851
- case "escaped": {
3852
- const overflow = await detectOverflow(state, {
3853
- ...detectOverflowOptions,
3854
- altBoundary: true
3855
- });
3856
- const offsets = getSideOffsets(overflow, rects.floating);
3857
- return {
3858
- data: {
3859
- escapedOffsets: offsets,
3860
- escaped: isAnySideFullyClipped(offsets)
3861
- }
3862
- };
3863
- }
3864
- default: {
3865
- return {};
3866
- }
3867
- }
3868
- }
3869
- };
3870
- };
3871
- async function convertValueToCoords(state, options) {
3872
- const {
3873
- placement,
3874
- platform: platform2,
3875
- elements
3876
- } = state;
3877
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3878
- const side = getSide(placement);
3879
- const alignment = getAlignment(placement);
3880
- const isVertical = getSideAxis(placement) === "y";
3881
- const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
3882
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
3883
- const rawValue = evaluate(options, state);
3884
- let {
3885
- mainAxis,
3886
- crossAxis,
3887
- alignmentAxis
3888
- } = typeof rawValue === "number" ? {
3889
- mainAxis: rawValue,
3890
- crossAxis: 0,
3891
- alignmentAxis: null
3892
- } : {
3893
- mainAxis: 0,
3894
- crossAxis: 0,
3895
- alignmentAxis: null,
3896
- ...rawValue
3897
- };
3898
- if (alignment && typeof alignmentAxis === "number") {
3899
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
3900
- }
3901
- return isVertical ? {
3902
- x: crossAxis * crossAxisMulti,
3903
- y: mainAxis * mainAxisMulti
3904
- } : {
3905
- x: mainAxis * mainAxisMulti,
3906
- y: crossAxis * crossAxisMulti
3907
- };
3908
- }
3909
- var offset = function(options) {
3910
- if (options === void 0) {
3911
- options = 0;
3912
- }
3913
- return {
3914
- name: "offset",
3915
- options,
3916
- async fn(state) {
3917
- var _middlewareData$offse, _middlewareData$arrow;
3918
- const {
3919
- x,
3920
- y,
3921
- placement,
3922
- middlewareData
3923
- } = state;
3924
- const diffCoords = await convertValueToCoords(state, options);
3925
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3926
- return {};
3927
- }
3928
- return {
3929
- x: x + diffCoords.x,
3930
- y: y + diffCoords.y,
3931
- data: {
3932
- ...diffCoords,
3933
- placement
3934
- }
3935
- };
3936
- }
3937
- };
3938
- };
3939
- var shift = function(options) {
3940
- if (options === void 0) {
3941
- options = {};
3942
- }
3943
- return {
3944
- name: "shift",
3945
- options,
3946
- async fn(state) {
3947
- const {
3948
- x,
3949
- y,
3950
- placement
3951
- } = state;
3952
- const {
3953
- mainAxis: checkMainAxis = true,
3954
- crossAxis: checkCrossAxis = false,
3955
- limiter = {
3956
- fn: (_ref) => {
3957
- let {
3958
- x: x2,
3959
- y: y2
3960
- } = _ref;
3961
- return {
3962
- x: x2,
3963
- y: y2
3964
- };
3965
- }
3966
- },
3967
- ...detectOverflowOptions
3968
- } = evaluate(options, state);
3969
- const coords = {
3970
- x,
3971
- y
3972
- };
3973
- const overflow = await detectOverflow(state, detectOverflowOptions);
3974
- const crossAxis = getSideAxis(getSide(placement));
3975
- const mainAxis = getOppositeAxis(crossAxis);
3976
- let mainAxisCoord = coords[mainAxis];
3977
- let crossAxisCoord = coords[crossAxis];
3978
- if (checkMainAxis) {
3979
- const minSide = mainAxis === "y" ? "top" : "left";
3980
- const maxSide = mainAxis === "y" ? "bottom" : "right";
3981
- const min2 = mainAxisCoord + overflow[minSide];
3982
- const max2 = mainAxisCoord - overflow[maxSide];
3983
- mainAxisCoord = clamp(min2, mainAxisCoord, max2);
3984
- }
3985
- if (checkCrossAxis) {
3986
- const minSide = crossAxis === "y" ? "top" : "left";
3987
- const maxSide = crossAxis === "y" ? "bottom" : "right";
3988
- const min2 = crossAxisCoord + overflow[minSide];
3989
- const max2 = crossAxisCoord - overflow[maxSide];
3990
- crossAxisCoord = clamp(min2, crossAxisCoord, max2);
3991
- }
3992
- const limitedCoords = limiter.fn({
3993
- ...state,
3994
- [mainAxis]: mainAxisCoord,
3995
- [crossAxis]: crossAxisCoord
3996
- });
3997
- return {
3998
- ...limitedCoords,
3999
- data: {
4000
- x: limitedCoords.x - x,
4001
- y: limitedCoords.y - y
4002
- }
4003
- };
4004
- }
4005
- };
4006
- };
4007
- var limitShift = function(options) {
4008
- if (options === void 0) {
4009
- options = {};
4010
- }
4011
- return {
4012
- options,
4013
- fn(state) {
4014
- const {
4015
- x,
4016
- y,
4017
- placement,
4018
- rects,
4019
- middlewareData
4020
- } = state;
4021
- const {
4022
- offset: offset4 = 0,
4023
- mainAxis: checkMainAxis = true,
4024
- crossAxis: checkCrossAxis = true
4025
- } = evaluate(options, state);
4026
- const coords = {
4027
- x,
4028
- y
4029
- };
4030
- const crossAxis = getSideAxis(placement);
4031
- const mainAxis = getOppositeAxis(crossAxis);
4032
- let mainAxisCoord = coords[mainAxis];
4033
- let crossAxisCoord = coords[crossAxis];
4034
- const rawOffset = evaluate(offset4, state);
4035
- const computedOffset = typeof rawOffset === "number" ? {
4036
- mainAxis: rawOffset,
4037
- crossAxis: 0
4038
- } : {
4039
- mainAxis: 0,
4040
- crossAxis: 0,
4041
- ...rawOffset
4042
- };
4043
- if (checkMainAxis) {
4044
- const len = mainAxis === "y" ? "height" : "width";
4045
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
4046
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
4047
- if (mainAxisCoord < limitMin) {
4048
- mainAxisCoord = limitMin;
4049
- } else if (mainAxisCoord > limitMax) {
4050
- mainAxisCoord = limitMax;
4051
- }
4052
- }
4053
- if (checkCrossAxis) {
4054
- var _middlewareData$offse, _middlewareData$offse2;
4055
- const len = mainAxis === "y" ? "width" : "height";
4056
- const isOriginSide = ["top", "left"].includes(getSide(placement));
4057
- const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
4058
- const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
4059
- if (crossAxisCoord < limitMin) {
4060
- crossAxisCoord = limitMin;
4061
- } else if (crossAxisCoord > limitMax) {
4062
- crossAxisCoord = limitMax;
4063
- }
4064
- }
4065
- return {
4066
- [mainAxis]: mainAxisCoord,
4067
- [crossAxis]: crossAxisCoord
4068
- };
4069
- }
4070
- };
4071
- };
4072
- var size = function(options) {
4073
- if (options === void 0) {
4074
- options = {};
4075
- }
4076
- return {
4077
- name: "size",
4078
- options,
4079
- async fn(state) {
4080
- const {
4081
- placement,
4082
- rects,
4083
- platform: platform2,
4084
- elements
4085
- } = state;
4086
- const {
4087
- apply = () => {
4088
- },
4089
- ...detectOverflowOptions
4090
- } = evaluate(options, state);
4091
- const overflow = await detectOverflow(state, detectOverflowOptions);
4092
- const side = getSide(placement);
4093
- const alignment = getAlignment(placement);
4094
- const isYAxis = getSideAxis(placement) === "y";
4095
- const {
4096
- width,
4097
- height
4098
- } = rects.floating;
4099
- let heightSide;
4100
- let widthSide;
4101
- if (side === "top" || side === "bottom") {
4102
- heightSide = side;
4103
- widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
4104
- } else {
4105
- widthSide = side;
4106
- heightSide = alignment === "end" ? "top" : "bottom";
4107
- }
4108
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
4109
- const maximumClippingWidth = width - overflow.left - overflow.right;
4110
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
4111
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
4112
- const noShift = !state.middlewareData.shift;
4113
- let availableHeight = overflowAvailableHeight;
4114
- let availableWidth = overflowAvailableWidth;
4115
- if (isYAxis) {
4116
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
4117
- } else {
4118
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
4119
- }
4120
- if (noShift && !alignment) {
4121
- const xMin = max(overflow.left, 0);
4122
- const xMax = max(overflow.right, 0);
4123
- const yMin = max(overflow.top, 0);
4124
- const yMax = max(overflow.bottom, 0);
4125
- if (isYAxis) {
4126
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
4127
- } else {
4128
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
4129
- }
4130
- }
4131
- await apply({
4132
- ...state,
4133
- availableWidth,
4134
- availableHeight
4135
- });
4136
- const nextDimensions = await platform2.getDimensions(elements.floating);
4137
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
4138
- return {
4139
- reset: {
4140
- rects: true
4141
- }
4142
- };
4143
- }
4144
- return {};
4145
- }
4146
- };
4147
- };
4148
-
4149
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
4150
- function getNodeName(node) {
4151
- if (isNode(node)) {
4152
- return (node.nodeName || "").toLowerCase();
4153
- }
4154
- return "#document";
4155
- }
4156
- function getWindow(node) {
4157
- var _node$ownerDocument;
4158
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4159
- }
4160
- function getDocumentElement(node) {
4161
- var _ref;
4162
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
4163
- }
4164
- function isNode(value) {
4165
- return value instanceof Node || value instanceof getWindow(value).Node;
4166
- }
4167
- function isElement(value) {
4168
- return value instanceof Element || value instanceof getWindow(value).Element;
4169
- }
4170
- function isHTMLElement(value) {
4171
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
4172
- }
4173
- function isShadowRoot(value) {
4174
- if (typeof ShadowRoot === "undefined") {
4175
- return false;
4176
- }
4177
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
4178
- }
4179
- function isOverflowElement(element) {
4180
- const {
4181
- overflow,
4182
- overflowX,
4183
- overflowY,
4184
- display
4185
- } = getComputedStyle2(element);
4186
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
4187
- }
4188
- function isTableElement(element) {
4189
- return ["table", "td", "th"].includes(getNodeName(element));
4190
- }
4191
- function isContainingBlock(element) {
4192
- const webkit = isWebKit();
4193
- const css = getComputedStyle2(element);
4194
- return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
4195
- }
4196
- function getContainingBlock(element) {
4197
- let currentNode = getParentNode(element);
4198
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
4199
- if (isContainingBlock(currentNode)) {
4200
- return currentNode;
4201
- }
4202
- currentNode = getParentNode(currentNode);
4203
- }
4204
- return null;
4205
- }
4206
- function isWebKit() {
4207
- if (typeof CSS === "undefined" || !CSS.supports)
4208
- return false;
4209
- return CSS.supports("-webkit-backdrop-filter", "none");
4210
- }
4211
- function isLastTraversableNode(node) {
4212
- return ["html", "body", "#document"].includes(getNodeName(node));
4213
- }
4214
- function getComputedStyle2(element) {
4215
- return getWindow(element).getComputedStyle(element);
4216
- }
4217
- function getNodeScroll(element) {
4218
- if (isElement(element)) {
4219
- return {
4220
- scrollLeft: element.scrollLeft,
4221
- scrollTop: element.scrollTop
4222
- };
4223
- }
4224
- return {
4225
- scrollLeft: element.pageXOffset,
4226
- scrollTop: element.pageYOffset
4227
- };
4228
- }
4229
- function getParentNode(node) {
4230
- if (getNodeName(node) === "html") {
4231
- return node;
4232
- }
4233
- const result = (
4234
- // Step into the shadow DOM of the parent of a slotted node.
4235
- node.assignedSlot || // DOM Element detected.
4236
- node.parentNode || // ShadowRoot detected.
4237
- isShadowRoot(node) && node.host || // Fallback.
4238
- getDocumentElement(node)
4239
- );
4240
- return isShadowRoot(result) ? result.host : result;
4241
- }
4242
- function getNearestOverflowAncestor(node) {
4243
- const parentNode = getParentNode(node);
4244
- if (isLastTraversableNode(parentNode)) {
4245
- return node.ownerDocument ? node.ownerDocument.body : node.body;
4246
- }
4247
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
4248
- return parentNode;
4249
- }
4250
- return getNearestOverflowAncestor(parentNode);
4251
- }
4252
- function getOverflowAncestors(node, list, traverseIframes) {
4253
- var _node$ownerDocument2;
4254
- if (list === void 0) {
4255
- list = [];
4256
- }
4257
- if (traverseIframes === void 0) {
4258
- traverseIframes = true;
4259
- }
4260
- const scrollableAncestor = getNearestOverflowAncestor(node);
4261
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
4262
- const win = getWindow(scrollableAncestor);
4263
- if (isBody) {
4264
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
4265
- }
4266
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4267
- }
4268
-
4269
- // node_modules/.pnpm/@floating-ui+dom@1.6.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
4270
- function getCssDimensions(element) {
4271
- const css = getComputedStyle2(element);
4272
- let width = parseFloat(css.width) || 0;
4273
- let height = parseFloat(css.height) || 0;
4274
- const hasOffset = isHTMLElement(element);
4275
- const offsetWidth = hasOffset ? element.offsetWidth : width;
4276
- const offsetHeight = hasOffset ? element.offsetHeight : height;
4277
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
4278
- if (shouldFallback) {
4279
- width = offsetWidth;
4280
- height = offsetHeight;
4281
- }
4282
- return {
4283
- width,
4284
- height,
4285
- $: shouldFallback
4286
- };
4287
- }
4288
- function unwrapElement(element) {
4289
- return !isElement(element) ? element.contextElement : element;
4290
- }
4291
- function getScale(element) {
4292
- const domElement = unwrapElement(element);
4293
- if (!isHTMLElement(domElement)) {
4294
- return createCoords(1);
4295
- }
4296
- const rect = domElement.getBoundingClientRect();
4297
- const {
4298
- width,
4299
- height,
4300
- $
4301
- } = getCssDimensions(domElement);
4302
- let x = ($ ? round(rect.width) : rect.width) / width;
4303
- let y = ($ ? round(rect.height) : rect.height) / height;
4304
- if (!x || !Number.isFinite(x)) {
4305
- x = 1;
4306
- }
4307
- if (!y || !Number.isFinite(y)) {
4308
- y = 1;
4309
- }
4310
- return {
4311
- x,
4312
- y
4313
- };
4314
- }
4315
- var noOffsets = /* @__PURE__ */ createCoords(0);
4316
- function getVisualOffsets(element) {
4317
- const win = getWindow(element);
4318
- if (!isWebKit() || !win.visualViewport) {
4319
- return noOffsets;
4320
- }
4321
- return {
4322
- x: win.visualViewport.offsetLeft,
4323
- y: win.visualViewport.offsetTop
4324
- };
4325
- }
4326
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
4327
- if (isFixed === void 0) {
4328
- isFixed = false;
4329
- }
4330
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
4331
- return false;
4332
- }
4333
- return isFixed;
4334
- }
4335
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
4336
- if (includeScale === void 0) {
4337
- includeScale = false;
4338
- }
4339
- if (isFixedStrategy === void 0) {
4340
- isFixedStrategy = false;
4341
- }
4342
- const clientRect = element.getBoundingClientRect();
4343
- const domElement = unwrapElement(element);
4344
- let scale = createCoords(1);
4345
- if (includeScale) {
4346
- if (offsetParent) {
4347
- if (isElement(offsetParent)) {
4348
- scale = getScale(offsetParent);
4349
- }
4350
- } else {
4351
- scale = getScale(element);
4352
- }
4353
- }
4354
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
4355
- let x = (clientRect.left + visualOffsets.x) / scale.x;
4356
- let y = (clientRect.top + visualOffsets.y) / scale.y;
4357
- let width = clientRect.width / scale.x;
4358
- let height = clientRect.height / scale.y;
4359
- if (domElement) {
4360
- const win = getWindow(domElement);
4361
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
4362
- let currentWin = win;
4363
- let currentIFrame = currentWin.frameElement;
4364
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
4365
- const iframeScale = getScale(currentIFrame);
4366
- const iframeRect = currentIFrame.getBoundingClientRect();
4367
- const css = getComputedStyle2(currentIFrame);
4368
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
4369
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
4370
- x *= iframeScale.x;
4371
- y *= iframeScale.y;
4372
- width *= iframeScale.x;
4373
- height *= iframeScale.y;
4374
- x += left;
4375
- y += top;
4376
- currentWin = getWindow(currentIFrame);
4377
- currentIFrame = currentWin.frameElement;
4378
- }
4379
- }
4380
- return rectToClientRect({
4381
- width,
4382
- height,
4383
- x,
4384
- y
4385
- });
4386
- }
4387
- var topLayerSelectors = [":popover-open", ":modal"];
4388
- function isTopLayer(element) {
4389
- return topLayerSelectors.some((selector) => {
4390
- try {
4391
- return element.matches(selector);
4392
- } catch (e) {
4393
- return false;
4394
- }
4395
- });
4396
- }
4397
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
4398
- let {
4399
- elements,
4400
- rect,
4401
- offsetParent,
4402
- strategy
4403
- } = _ref;
4404
- const isFixed = strategy === "fixed";
4405
- const documentElement = getDocumentElement(offsetParent);
4406
- const topLayer = elements ? isTopLayer(elements.floating) : false;
4407
- if (offsetParent === documentElement || topLayer && isFixed) {
4408
- return rect;
4409
- }
4410
- let scroll = {
4411
- scrollLeft: 0,
4412
- scrollTop: 0
4413
- };
4414
- let scale = createCoords(1);
4415
- const offsets = createCoords(0);
4416
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
4417
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
4418
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4419
- scroll = getNodeScroll(offsetParent);
4420
- }
4421
- if (isHTMLElement(offsetParent)) {
4422
- const offsetRect = getBoundingClientRect(offsetParent);
4423
- scale = getScale(offsetParent);
4424
- offsets.x = offsetRect.x + offsetParent.clientLeft;
4425
- offsets.y = offsetRect.y + offsetParent.clientTop;
4426
- }
4427
- }
4428
- return {
4429
- width: rect.width * scale.x,
4430
- height: rect.height * scale.y,
4431
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
4432
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
4433
- };
4434
- }
4435
- function getClientRects(element) {
4436
- return Array.from(element.getClientRects());
4437
- }
4438
- function getWindowScrollBarX(element) {
4439
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
4440
- }
4441
- function getDocumentRect(element) {
4442
- const html = getDocumentElement(element);
4443
- const scroll = getNodeScroll(element);
4444
- const body = element.ownerDocument.body;
4445
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
4446
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
4447
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
4448
- const y = -scroll.scrollTop;
4449
- if (getComputedStyle2(body).direction === "rtl") {
4450
- x += max(html.clientWidth, body.clientWidth) - width;
4451
- }
4452
- return {
4453
- width,
4454
- height,
4455
- x,
4456
- y
4457
- };
4458
- }
4459
- function getViewportRect(element, strategy) {
4460
- const win = getWindow(element);
4461
- const html = getDocumentElement(element);
4462
- const visualViewport = win.visualViewport;
4463
- let width = html.clientWidth;
4464
- let height = html.clientHeight;
4465
- let x = 0;
4466
- let y = 0;
4467
- if (visualViewport) {
4468
- width = visualViewport.width;
4469
- height = visualViewport.height;
4470
- const visualViewportBased = isWebKit();
4471
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
4472
- x = visualViewport.offsetLeft;
4473
- y = visualViewport.offsetTop;
4474
- }
4475
- }
4476
- return {
4477
- width,
4478
- height,
4479
- x,
4480
- y
4481
- };
4482
- }
4483
- function getInnerBoundingClientRect(element, strategy) {
4484
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
4485
- const top = clientRect.top + element.clientTop;
4486
- const left = clientRect.left + element.clientLeft;
4487
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
4488
- const width = element.clientWidth * scale.x;
4489
- const height = element.clientHeight * scale.y;
4490
- const x = left * scale.x;
4491
- const y = top * scale.y;
4492
- return {
4493
- width,
4494
- height,
4495
- x,
4496
- y
4497
- };
4498
- }
4499
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
4500
- let rect;
4501
- if (clippingAncestor === "viewport") {
4502
- rect = getViewportRect(element, strategy);
4503
- } else if (clippingAncestor === "document") {
4504
- rect = getDocumentRect(getDocumentElement(element));
4505
- } else if (isElement(clippingAncestor)) {
4506
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
4507
- } else {
4508
- const visualOffsets = getVisualOffsets(element);
4509
- rect = {
4510
- ...clippingAncestor,
4511
- x: clippingAncestor.x - visualOffsets.x,
4512
- y: clippingAncestor.y - visualOffsets.y
4513
- };
4514
- }
4515
- return rectToClientRect(rect);
4516
- }
4517
- function hasFixedPositionAncestor(element, stopNode) {
4518
- const parentNode = getParentNode(element);
4519
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
4520
- return false;
4521
- }
4522
- return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
4523
- }
4524
- function getClippingElementAncestors(element, cache) {
4525
- const cachedResult = cache.get(element);
4526
- if (cachedResult) {
4527
- return cachedResult;
4528
- }
4529
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
4530
- let currentContainingBlockComputedStyle = null;
4531
- const elementIsFixed = getComputedStyle2(element).position === "fixed";
4532
- let currentNode = elementIsFixed ? getParentNode(element) : element;
4533
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
4534
- const computedStyle = getComputedStyle2(currentNode);
4535
- const currentNodeIsContaining = isContainingBlock(currentNode);
4536
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
4537
- currentContainingBlockComputedStyle = null;
4538
- }
4539
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
4540
- if (shouldDropCurrentNode) {
4541
- result = result.filter((ancestor) => ancestor !== currentNode);
4542
- } else {
4543
- currentContainingBlockComputedStyle = computedStyle;
4544
- }
4545
- currentNode = getParentNode(currentNode);
4546
- }
4547
- cache.set(element, result);
4548
- return result;
4549
- }
4550
- function getClippingRect(_ref) {
4551
- let {
4552
- element,
4553
- boundary,
4554
- rootBoundary,
4555
- strategy
4556
- } = _ref;
4557
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
4558
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
4559
- const firstClippingAncestor = clippingAncestors[0];
4560
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
4561
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
4562
- accRect.top = max(rect.top, accRect.top);
4563
- accRect.right = min(rect.right, accRect.right);
4564
- accRect.bottom = min(rect.bottom, accRect.bottom);
4565
- accRect.left = max(rect.left, accRect.left);
4566
- return accRect;
4567
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
4568
- return {
4569
- width: clippingRect.right - clippingRect.left,
4570
- height: clippingRect.bottom - clippingRect.top,
4571
- x: clippingRect.left,
4572
- y: clippingRect.top
4573
- };
4574
- }
4575
- function getDimensions(element) {
4576
- const {
4577
- width,
4578
- height
4579
- } = getCssDimensions(element);
4580
- return {
4581
- width,
4582
- height
4583
- };
4584
- }
4585
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
4586
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
4587
- const documentElement = getDocumentElement(offsetParent);
4588
- const isFixed = strategy === "fixed";
4589
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
4590
- let scroll = {
4591
- scrollLeft: 0,
4592
- scrollTop: 0
4593
- };
4594
- const offsets = createCoords(0);
4595
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
4596
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4597
- scroll = getNodeScroll(offsetParent);
4598
- }
4599
- if (isOffsetParentAnElement) {
4600
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
4601
- offsets.x = offsetRect.x + offsetParent.clientLeft;
4602
- offsets.y = offsetRect.y + offsetParent.clientTop;
4603
- } else if (documentElement) {
4604
- offsets.x = getWindowScrollBarX(documentElement);
4605
- }
4606
- }
4607
- const x = rect.left + scroll.scrollLeft - offsets.x;
4608
- const y = rect.top + scroll.scrollTop - offsets.y;
4609
- return {
4610
- x,
4611
- y,
4612
- width: rect.width,
4613
- height: rect.height
4614
- };
4615
- }
4616
- function isStaticPositioned(element) {
4617
- return getComputedStyle2(element).position === "static";
4618
- }
4619
- function getTrueOffsetParent(element, polyfill) {
4620
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
4621
- return null;
4622
- }
4623
- if (polyfill) {
4624
- return polyfill(element);
4625
- }
4626
- return element.offsetParent;
4627
- }
4628
- function getOffsetParent(element, polyfill) {
4629
- const win = getWindow(element);
4630
- if (isTopLayer(element)) {
4631
- return win;
4632
- }
4633
- if (!isHTMLElement(element)) {
4634
- let svgOffsetParent = getParentNode(element);
4635
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
4636
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
4637
- return svgOffsetParent;
4638
- }
4639
- svgOffsetParent = getParentNode(svgOffsetParent);
4640
- }
4641
- return win;
4642
- }
4643
- let offsetParent = getTrueOffsetParent(element, polyfill);
4644
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
4645
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
4646
- }
4647
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
4648
- return win;
4649
- }
4650
- return offsetParent || getContainingBlock(element) || win;
4651
- }
4652
- var getElementRects = async function(data) {
4653
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
4654
- const getDimensionsFn = this.getDimensions;
4655
- const floatingDimensions = await getDimensionsFn(data.floating);
4656
- return {
4657
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
4658
- floating: {
4659
- x: 0,
4660
- y: 0,
4661
- width: floatingDimensions.width,
4662
- height: floatingDimensions.height
4663
- }
4664
- };
4665
- };
4666
- function isRTL(element) {
4667
- return getComputedStyle2(element).direction === "rtl";
4668
- }
4669
- var platform = {
4670
- convertOffsetParentRelativeRectToViewportRelativeRect,
4671
- getDocumentElement,
4672
- getClippingRect,
4673
- getOffsetParent,
4674
- getElementRects,
4675
- getClientRects,
4676
- getDimensions,
4677
- getScale,
4678
- isElement,
4679
- isRTL
4680
- };
4681
- function observeMove(element, onMove) {
4682
- let io = null;
4683
- let timeoutId;
4684
- const root = getDocumentElement(element);
4685
- function cleanup() {
4686
- var _io;
4687
- clearTimeout(timeoutId);
4688
- (_io = io) == null || _io.disconnect();
4689
- io = null;
4690
- }
4691
- function refresh(skip, threshold) {
4692
- if (skip === void 0) {
4693
- skip = false;
4694
- }
4695
- if (threshold === void 0) {
4696
- threshold = 1;
4697
- }
4698
- cleanup();
4699
- const {
4700
- left,
4701
- top,
4702
- width,
4703
- height
4704
- } = element.getBoundingClientRect();
4705
- if (!skip) {
4706
- onMove();
4707
- }
4708
- if (!width || !height) {
4709
- return;
4710
- }
4711
- const insetTop = floor(top);
4712
- const insetRight = floor(root.clientWidth - (left + width));
4713
- const insetBottom = floor(root.clientHeight - (top + height));
4714
- const insetLeft = floor(left);
4715
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
4716
- const options = {
4717
- rootMargin,
4718
- threshold: max(0, min(1, threshold)) || 1
4719
- };
4720
- let isFirstUpdate = true;
4721
- function handleObserve(entries) {
4722
- const ratio = entries[0].intersectionRatio;
4723
- if (ratio !== threshold) {
4724
- if (!isFirstUpdate) {
4725
- return refresh();
4726
- }
4727
- if (!ratio) {
4728
- timeoutId = setTimeout(() => {
4729
- refresh(false, 1e-7);
4730
- }, 1e3);
4731
- } else {
4732
- refresh(false, ratio);
4733
- }
4734
- }
4735
- isFirstUpdate = false;
4736
- }
4737
- try {
4738
- io = new IntersectionObserver(handleObserve, {
4739
- ...options,
4740
- // Handle <iframe>s
4741
- root: root.ownerDocument
4742
- });
4743
- } catch (e) {
4744
- io = new IntersectionObserver(handleObserve, options);
4745
- }
4746
- io.observe(element);
4747
- }
4748
- refresh(true);
4749
- return cleanup;
4750
- }
4751
- function autoUpdate(reference, floating, update, options) {
4752
- if (options === void 0) {
4753
- options = {};
4754
- }
4755
- const {
4756
- ancestorScroll = true,
4757
- ancestorResize = true,
4758
- elementResize = typeof ResizeObserver === "function",
4759
- layoutShift = typeof IntersectionObserver === "function",
4760
- animationFrame = false
4761
- } = options;
4762
- const referenceEl = unwrapElement(reference);
4763
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
4764
- ancestors.forEach((ancestor) => {
4765
- ancestorScroll && ancestor.addEventListener("scroll", update, {
4766
- passive: true
4767
- });
4768
- ancestorResize && ancestor.addEventListener("resize", update);
4769
- });
4770
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
4771
- let reobserveFrame = -1;
4772
- let resizeObserver = null;
4773
- if (elementResize) {
4774
- resizeObserver = new ResizeObserver((_ref) => {
4775
- let [firstEntry] = _ref;
4776
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
4777
- resizeObserver.unobserve(floating);
4778
- cancelAnimationFrame(reobserveFrame);
4779
- reobserveFrame = requestAnimationFrame(() => {
4780
- var _resizeObserver;
4781
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
4782
- });
4783
- }
4784
- update();
4785
- });
4786
- if (referenceEl && !animationFrame) {
4787
- resizeObserver.observe(referenceEl);
4788
- }
4789
- resizeObserver.observe(floating);
4790
- }
4791
- let frameId;
4792
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
4793
- if (animationFrame) {
4794
- frameLoop();
4795
- }
4796
- function frameLoop() {
4797
- const nextRefRect = getBoundingClientRect(reference);
4798
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
4799
- update();
4800
- }
4801
- prevRefRect = nextRefRect;
4802
- frameId = requestAnimationFrame(frameLoop);
4803
- }
4804
- update();
4805
- return () => {
4806
- var _resizeObserver2;
4807
- ancestors.forEach((ancestor) => {
4808
- ancestorScroll && ancestor.removeEventListener("scroll", update);
4809
- ancestorResize && ancestor.removeEventListener("resize", update);
4810
- });
4811
- cleanupIo == null || cleanupIo();
4812
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
4813
- resizeObserver = null;
4814
- if (animationFrame) {
4815
- cancelAnimationFrame(frameId);
4816
- }
4817
- };
4818
- }
4819
- var offset2 = offset;
4820
- var shift2 = shift;
4821
- var flip2 = flip;
4822
- var size2 = size;
4823
- var hide2 = hide;
4824
- var arrow2 = arrow;
4825
- var limitShift2 = limitShift;
4826
- var computePosition2 = (reference, floating, options) => {
4827
- const cache = /* @__PURE__ */ new Map();
4828
- const mergedOptions = {
4829
- platform,
4830
- ...options
4831
- };
4832
- const platformWithCache = {
4833
- ...mergedOptions.platform,
4834
- _c: cache
4835
- };
4836
- return computePosition(reference, floating, {
4837
- ...mergedOptions,
4838
- platform: platformWithCache
4839
- });
4840
- };
4841
-
4842
- // node_modules/.pnpm/@floating-ui+react-dom@2.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
4843
- import * as React4 from "react";
4844
- import { useLayoutEffect, useEffect } from "react";
4845
- import * as ReactDOM from "react-dom";
4846
- var index = typeof document !== "undefined" ? useLayoutEffect : useEffect;
4847
- function deepEqual(a, b) {
4848
- if (a === b) {
4849
- return true;
4850
- }
4851
- if (typeof a !== typeof b) {
4852
- return false;
4853
- }
4854
- if (typeof a === "function" && a.toString() === b.toString()) {
4855
- return true;
4856
- }
4857
- let length;
4858
- let i;
4859
- let keys;
4860
- if (a && b && typeof a === "object") {
4861
- if (Array.isArray(a)) {
4862
- length = a.length;
4863
- if (length !== b.length)
4864
- return false;
4865
- for (i = length; i-- !== 0; ) {
4866
- if (!deepEqual(a[i], b[i])) {
4867
- return false;
4868
- }
4869
- }
4870
- return true;
4871
- }
4872
- keys = Object.keys(a);
4873
- length = keys.length;
4874
- if (length !== Object.keys(b).length) {
4875
- return false;
4876
- }
4877
- for (i = length; i-- !== 0; ) {
4878
- if (!{}.hasOwnProperty.call(b, keys[i])) {
4879
- return false;
4880
- }
4881
- }
4882
- for (i = length; i-- !== 0; ) {
4883
- const key = keys[i];
4884
- if (key === "_owner" && a.$$typeof) {
4885
- continue;
4886
- }
4887
- if (!deepEqual(a[key], b[key])) {
4888
- return false;
4889
- }
4890
- }
4891
- return true;
4892
- }
4893
- return a !== a && b !== b;
4894
- }
4895
- function getDPR(element) {
4896
- if (typeof window === "undefined") {
4897
- return 1;
4898
- }
4899
- const win = element.ownerDocument.defaultView || window;
4900
- return win.devicePixelRatio || 1;
4901
- }
4902
- function roundByDPR(element, value) {
4903
- const dpr = getDPR(element);
4904
- return Math.round(value * dpr) / dpr;
4905
- }
4906
- function useLatestRef(value) {
4907
- const ref = React4.useRef(value);
4908
- index(() => {
4909
- ref.current = value;
4910
- });
4911
- return ref;
4912
- }
4913
- function useFloating(options) {
4914
- if (options === void 0) {
4915
- options = {};
4916
- }
4917
- const {
4918
- placement = "bottom",
4919
- strategy = "absolute",
4920
- middleware = [],
4921
- platform: platform2,
4922
- elements: {
4923
- reference: externalReference,
4924
- floating: externalFloating
4925
- } = {},
4926
- transform = true,
4927
- whileElementsMounted,
4928
- open
4929
- } = options;
4930
- const [data, setData] = React4.useState({
4931
- x: 0,
4932
- y: 0,
4933
- strategy,
4934
- placement,
4935
- middlewareData: {},
4936
- isPositioned: false
4937
- });
4938
- const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
4939
- if (!deepEqual(latestMiddleware, middleware)) {
4940
- setLatestMiddleware(middleware);
4941
- }
4942
- const [_reference, _setReference] = React4.useState(null);
4943
- const [_floating, _setFloating] = React4.useState(null);
4944
- const setReference = React4.useCallback((node) => {
4945
- if (node !== referenceRef.current) {
4946
- referenceRef.current = node;
4947
- _setReference(node);
4948
- }
4949
- }, []);
4950
- const setFloating = React4.useCallback((node) => {
4951
- if (node !== floatingRef.current) {
4952
- floatingRef.current = node;
4953
- _setFloating(node);
4954
- }
4955
- }, []);
4956
- const referenceEl = externalReference || _reference;
4957
- const floatingEl = externalFloating || _floating;
4958
- const referenceRef = React4.useRef(null);
4959
- const floatingRef = React4.useRef(null);
4960
- const dataRef = React4.useRef(data);
4961
- const hasWhileElementsMounted = whileElementsMounted != null;
4962
- const whileElementsMountedRef = useLatestRef(whileElementsMounted);
4963
- const platformRef = useLatestRef(platform2);
4964
- const update = React4.useCallback(() => {
4965
- if (!referenceRef.current || !floatingRef.current) {
4966
- return;
4967
- }
4968
- const config = {
4969
- placement,
4970
- strategy,
4971
- middleware: latestMiddleware
4972
- };
4973
- if (platformRef.current) {
4974
- config.platform = platformRef.current;
4975
- }
4976
- computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
4977
- const fullData = {
4978
- ...data2,
4979
- isPositioned: true
4980
- };
4981
- if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
4982
- dataRef.current = fullData;
4983
- ReactDOM.flushSync(() => {
4984
- setData(fullData);
4985
- });
4986
- }
4987
- });
4988
- }, [latestMiddleware, placement, strategy, platformRef]);
4989
- index(() => {
4990
- if (open === false && dataRef.current.isPositioned) {
4991
- dataRef.current.isPositioned = false;
4992
- setData((data2) => ({
4993
- ...data2,
4994
- isPositioned: false
4995
- }));
4996
- }
4997
- }, [open]);
4998
- const isMountedRef = React4.useRef(false);
4999
- index(() => {
5000
- isMountedRef.current = true;
5001
- return () => {
5002
- isMountedRef.current = false;
5003
- };
5004
- }, []);
5005
- index(() => {
5006
- if (referenceEl)
5007
- referenceRef.current = referenceEl;
5008
- if (floatingEl)
5009
- floatingRef.current = floatingEl;
5010
- if (referenceEl && floatingEl) {
5011
- if (whileElementsMountedRef.current) {
5012
- return whileElementsMountedRef.current(referenceEl, floatingEl, update);
5013
- }
5014
- update();
5015
- }
5016
- }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
5017
- const refs = React4.useMemo(() => ({
5018
- reference: referenceRef,
5019
- floating: floatingRef,
5020
- setReference,
5021
- setFloating
5022
- }), [setReference, setFloating]);
5023
- const elements = React4.useMemo(() => ({
5024
- reference: referenceEl,
5025
- floating: floatingEl
5026
- }), [referenceEl, floatingEl]);
5027
- const floatingStyles = React4.useMemo(() => {
5028
- const initialStyles = {
5029
- position: strategy,
5030
- left: 0,
5031
- top: 0
5032
- };
5033
- if (!elements.floating) {
5034
- return initialStyles;
5035
- }
5036
- const x = roundByDPR(elements.floating, data.x);
5037
- const y = roundByDPR(elements.floating, data.y);
5038
- if (transform) {
5039
- return {
5040
- ...initialStyles,
5041
- transform: "translate(" + x + "px, " + y + "px)",
5042
- ...getDPR(elements.floating) >= 1.5 && {
5043
- willChange: "transform"
5044
- }
5045
- };
5046
- }
5047
- return {
5048
- position: strategy,
5049
- left: x,
5050
- top: y
5051
- };
5052
- }, [strategy, transform, elements.floating, data.x, data.y]);
5053
- return React4.useMemo(() => ({
5054
- ...data,
5055
- update,
5056
- refs,
5057
- elements,
5058
- floatingStyles
5059
- }), [data, update, refs, elements, floatingStyles]);
5060
- }
5061
- var arrow$1 = (options) => {
5062
- function isRef(value) {
5063
- return {}.hasOwnProperty.call(value, "current");
5064
- }
5065
- return {
5066
- name: "arrow",
5067
- options,
5068
- fn(state) {
5069
- const {
5070
- element,
5071
- padding
5072
- } = typeof options === "function" ? options(state) : options;
5073
- if (element && isRef(element)) {
5074
- if (element.current != null) {
5075
- return arrow2({
5076
- element: element.current,
5077
- padding
5078
- }).fn(state);
5079
- }
5080
- return {};
5081
- }
5082
- if (element) {
5083
- return arrow2({
5084
- element,
5085
- padding
5086
- }).fn(state);
5087
- }
5088
- return {};
5089
- }
5090
- };
5091
- };
5092
- var offset3 = (options, deps) => ({
5093
- ...offset2(options),
5094
- options: [options, deps]
5095
- });
5096
- var shift3 = (options, deps) => ({
5097
- ...shift2(options),
5098
- options: [options, deps]
5099
- });
5100
- var limitShift3 = (options, deps) => ({
5101
- ...limitShift2(options),
5102
- options: [options, deps]
5103
- });
5104
- var flip3 = (options, deps) => ({
5105
- ...flip2(options),
5106
- options: [options, deps]
5107
- });
5108
- var size3 = (options, deps) => ({
5109
- ...size2(options),
5110
- options: [options, deps]
5111
- });
5112
- var hide3 = (options, deps) => ({
5113
- ...hide2(options),
5114
- options: [options, deps]
5115
- });
5116
- var arrow3 = (options, deps) => ({
5117
- ...arrow$1(options),
5118
- options: [options, deps]
5119
- });
5120
-
5121
- // node_modules/.pnpm/@radix-ui+react-arrow@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-arrow/dist/index.mjs
5122
- import { forwardRef as $jbnEx$forwardRef, createElement as $jbnEx$createElement } from "react";
5123
- var $7e8f5cd07187803e$export$21b07c8f274aebd5 = /* @__PURE__ */ $jbnEx$forwardRef((props, forwardedRef) => {
5124
- const { children, width = 10, height = 5, ...arrowProps } = props;
5125
- return /* @__PURE__ */ $jbnEx$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
5126
- ref: forwardedRef,
5127
- width,
5128
- height,
5129
- viewBox: "0 0 30 10",
5130
- preserveAspectRatio: "none"
5131
- }), props.asChild ? children : /* @__PURE__ */ $jbnEx$createElement("polygon", {
5132
- points: "0,0 30,0 15,10"
5133
- }));
5134
- });
5135
- var $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
5136
-
5137
- // node_modules/.pnpm/@radix-ui+react-use-size@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.mjs
5138
- import { useState as $9gyGR$useState } from "react";
5139
- function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
5140
- const [size4, setSize] = $9gyGR$useState(void 0);
5141
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5142
- if (element) {
5143
- setSize({
5144
- width: element.offsetWidth,
5145
- height: element.offsetHeight
5146
- });
5147
- const resizeObserver = new ResizeObserver((entries) => {
5148
- if (!Array.isArray(entries))
5149
- return;
5150
- if (!entries.length)
5151
- return;
5152
- const entry = entries[0];
5153
- let width;
5154
- let height;
5155
- if ("borderBoxSize" in entry) {
5156
- const borderSizeEntry = entry["borderBoxSize"];
5157
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
5158
- width = borderSize["inlineSize"];
5159
- height = borderSize["blockSize"];
5160
- } else {
5161
- width = element.offsetWidth;
5162
- height = element.offsetHeight;
5163
- }
5164
- setSize({
5165
- width,
5166
- height
5167
- });
5168
- });
5169
- resizeObserver.observe(element, {
5170
- box: "border-box"
5171
- });
5172
- return () => resizeObserver.unobserve(element);
5173
- } else
5174
- setSize(void 0);
5175
- }, [
5176
- element
5177
- ]);
5178
- return size4;
5179
- }
5180
-
5181
- // node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.mjs
5182
- var $cf1ac5d9fe0e8206$var$POPPER_NAME = "Popper";
5183
- var [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
5184
- var [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
5185
- var $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props) => {
5186
- const { __scopePopper, children } = props;
5187
- const [anchor, setAnchor] = $kY93V$useState(null);
5188
- return /* @__PURE__ */ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
5189
- scope: __scopePopper,
5190
- anchor,
5191
- onAnchorChange: setAnchor
5192
- }, children);
5193
- };
5194
- var $cf1ac5d9fe0e8206$var$ANCHOR_NAME = "PopperAnchor";
5195
- var $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /* @__PURE__ */ $kY93V$forwardRef((props, forwardedRef) => {
5196
- const { __scopePopper, virtualRef, ...anchorProps } = props;
5197
- const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
5198
- const ref = $kY93V$useRef(null);
5199
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
5200
- $kY93V$useEffect(() => {
5201
- context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
5202
- });
5203
- return virtualRef ? null : /* @__PURE__ */ $kY93V$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
5204
- ref: composedRefs
5205
- }));
5206
- });
5207
- var $cf1ac5d9fe0e8206$var$CONTENT_NAME = "PopperContent";
5208
- var [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
5209
- var $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ $kY93V$forwardRef((props, forwardedRef) => {
5210
- var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
5211
- const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
5212
- const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
5213
- const [content, setContent] = $kY93V$useState(null);
5214
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
5215
- forwardedRef,
5216
- (node) => setContent(node)
5217
- );
5218
- const [arrow4, setArrow] = $kY93V$useState(null);
5219
- const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow4);
5220
- const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
5221
- const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
5222
- const desiredPlacement = side + (align !== "center" ? "-" + align : "");
5223
- const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : {
5224
- top: 0,
5225
- right: 0,
5226
- bottom: 0,
5227
- left: 0,
5228
- ...collisionPaddingProp
5229
- };
5230
- const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
5231
- collisionBoundary
5232
- ];
5233
- const hasExplicitBoundaries = boundary.length > 0;
5234
- const detectOverflowOptions = {
5235
- padding: collisionPadding,
5236
- boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
5237
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5238
- altBoundary: hasExplicitBoundaries
5239
- };
5240
- const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
5241
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5242
- strategy: "fixed",
5243
- placement: desiredPlacement,
5244
- whileElementsMounted: (...args) => {
5245
- const cleanup = autoUpdate(...args, {
5246
- animationFrame: updatePositionStrategy === "always"
5247
- });
5248
- return cleanup;
5249
- },
5250
- elements: {
5251
- reference: context.anchor
5252
- },
5253
- middleware: [
5254
- offset3({
5255
- mainAxis: sideOffset + arrowHeight,
5256
- alignmentAxis: alignOffset
5257
- }),
5258
- avoidCollisions && shift3({
5259
- mainAxis: true,
5260
- crossAxis: false,
5261
- limiter: sticky === "partial" ? limitShift3() : void 0,
5262
- ...detectOverflowOptions
5263
- }),
5264
- avoidCollisions && flip3({
5265
- ...detectOverflowOptions
5266
- }),
5267
- size3({
5268
- ...detectOverflowOptions,
5269
- apply: ({ elements, rects, availableWidth, availableHeight }) => {
5270
- const { width: anchorWidth, height: anchorHeight } = rects.reference;
5271
- const contentStyle = elements.floating.style;
5272
- contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
5273
- contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
5274
- contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
5275
- contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
5276
- }
5277
- }),
5278
- arrow4 && arrow3({
5279
- element: arrow4,
5280
- padding: arrowPadding
5281
- }),
5282
- $cf1ac5d9fe0e8206$var$transformOrigin({
5283
- arrowWidth,
5284
- arrowHeight
5285
- }),
5286
- hideWhenDetached && hide3({
5287
- strategy: "referenceHidden",
5288
- ...detectOverflowOptions
5289
- })
5290
- ]
5291
- });
5292
- const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
5293
- const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
5294
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5295
- if (isPositioned)
5296
- handlePlaced === null || handlePlaced === void 0 || handlePlaced();
5297
- }, [
5298
- isPositioned,
5299
- handlePlaced
5300
- ]);
5301
- const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
5302
- const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
5303
- const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
5304
- const [contentZIndex, setContentZIndex] = $kY93V$useState();
5305
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5306
- if (content)
5307
- setContentZIndex(window.getComputedStyle(content).zIndex);
5308
- }, [
5309
- content
5310
- ]);
5311
- return /* @__PURE__ */ $kY93V$createElement("div", {
5312
- ref: refs.setFloating,
5313
- "data-radix-popper-content-wrapper": "",
5314
- style: {
5315
- ...floatingStyles,
5316
- transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
5317
- // keep off the page when measuring
5318
- minWidth: "max-content",
5319
- zIndex: contentZIndex,
5320
- ["--radix-popper-transform-origin"]: [
5321
- (_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
5322
- (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
5323
- ].join(" ")
5324
- },
5325
- dir: props.dir
5326
- }, /* @__PURE__ */ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
5327
- scope: __scopePopper,
5328
- placedSide,
5329
- onArrowChange: setArrow,
5330
- arrowX,
5331
- arrowY,
5332
- shouldHideArrow: cannotCenterArrow
5333
- }, /* @__PURE__ */ $kY93V$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
5334
- "data-side": placedSide,
5335
- "data-align": placedAlign
5336
- }, contentProps, {
5337
- ref: composedRefs,
5338
- style: {
5339
- ...contentProps.style,
5340
- // if the PopperContent hasn't been placed yet (not all measurements done)
5341
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
5342
- animation: !isPositioned ? "none" : void 0,
5343
- // hide the content if using the hide middleware and should be hidden
5344
- opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : void 0
5345
- }
5346
- }))));
5347
- });
5348
- var $cf1ac5d9fe0e8206$var$ARROW_NAME = "PopperArrow";
5349
- var $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
5350
- top: "bottom",
5351
- right: "left",
5352
- bottom: "top",
5353
- left: "right"
5354
- };
5355
- var $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /* @__PURE__ */ $kY93V$forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd02(props, forwardedRef) {
5356
- const { __scopePopper, ...arrowProps } = props;
5357
- const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
5358
- const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
5359
- return (
5360
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
5361
- // doesn't report size as we'd expect on SVG elements.
5362
- // it reports their bounding box which is effectively the largest path inside the SVG.
5363
- /* @__PURE__ */ $kY93V$createElement("span", {
5364
- ref: contentContext.onArrowChange,
5365
- style: {
5366
- position: "absolute",
5367
- left: contentContext.arrowX,
5368
- top: contentContext.arrowY,
5369
- [baseSide]: 0,
5370
- transformOrigin: {
5371
- top: "",
5372
- right: "0 0",
5373
- bottom: "center 0",
5374
- left: "100% 0"
5375
- }[contentContext.placedSide],
5376
- transform: {
5377
- top: "translateY(100%)",
5378
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
5379
- bottom: `rotate(180deg)`,
5380
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
5381
- }[contentContext.placedSide],
5382
- visibility: contentContext.shouldHideArrow ? "hidden" : void 0
5383
- }
5384
- }, /* @__PURE__ */ $kY93V$createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
5385
- ref: forwardedRef,
5386
- style: {
5387
- ...arrowProps.style,
5388
- // ensures the element can be measured correctly (mostly for if SVG)
5389
- display: "block"
5390
- }
5391
- })))
5392
- );
5393
- });
5394
- function $cf1ac5d9fe0e8206$var$isNotNull(value) {
5395
- return value !== null;
5396
- }
5397
- var $cf1ac5d9fe0e8206$var$transformOrigin = (options) => ({
5398
- name: "transformOrigin",
5399
- options,
5400
- fn(data) {
5401
- var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
5402
- const { placement, rects, middlewareData } = data;
5403
- const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
5404
- const isArrowHidden = cannotCenterArrow;
5405
- const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
5406
- const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
5407
- const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
5408
- const noArrowAlign = {
5409
- start: "0%",
5410
- center: "50%",
5411
- end: "100%"
5412
- }[placedAlign];
5413
- const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
5414
- const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
5415
- let x = "";
5416
- let y = "";
5417
- if (placedSide === "bottom") {
5418
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
5419
- y = `${-arrowHeight}px`;
5420
- } else if (placedSide === "top") {
5421
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
5422
- y = `${rects.floating.height + arrowHeight}px`;
5423
- } else if (placedSide === "right") {
5424
- x = `${-arrowHeight}px`;
5425
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
5426
- } else if (placedSide === "left") {
5427
- x = `${rects.floating.width + arrowHeight}px`;
5428
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
5429
- }
5430
- return {
5431
- data: {
5432
- x,
5433
- y
5434
- }
5435
- };
5436
- }
5437
- });
5438
- function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
5439
- const [side, align = "center"] = placement.split("-");
5440
- return [
5441
- side,
5442
- align
5443
- ];
5444
- }
5445
- var $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
5446
- var $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
5447
- var $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
5448
- var $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
5449
-
5450
- // node_modules/.pnpm/@radix-ui+react-presence@1.0.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.mjs
5451
- import { Children as $iqq3r$Children, cloneElement as $iqq3r$cloneElement, useState as $iqq3r$useState, useRef as $iqq3r$useRef, useEffect as $iqq3r$useEffect, useCallback as $iqq3r$useCallback, useReducer as $iqq3r$useReducer } from "react";
5452
- import { flushSync as $iqq3r$flushSync } from "react-dom";
5453
- function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
5454
- return $iqq3r$useReducer((state, event) => {
5455
- const nextState = machine[state][event];
5456
- return nextState !== null && nextState !== void 0 ? nextState : state;
5457
- }, initialState);
5458
- }
5459
- var $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
5460
- const { present, children } = props;
5461
- const presence = $921a889cee6df7e8$var$usePresence(present);
5462
- const child = typeof children === "function" ? children({
5463
- present: presence.isPresent
5464
- }) : $iqq3r$Children.only(children);
5465
- const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
5466
- const forceMount = typeof children === "function";
5467
- return forceMount || presence.isPresent ? /* @__PURE__ */ $iqq3r$cloneElement(child, {
5468
- ref
5469
- }) : null;
5470
- };
5471
- $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
5472
- function $921a889cee6df7e8$var$usePresence(present) {
5473
- const [node1, setNode] = $iqq3r$useState();
5474
- const stylesRef = $iqq3r$useRef({});
5475
- const prevPresentRef = $iqq3r$useRef(present);
5476
- const prevAnimationNameRef = $iqq3r$useRef("none");
5477
- const initialState = present ? "mounted" : "unmounted";
5478
- const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
5479
- mounted: {
5480
- UNMOUNT: "unmounted",
5481
- ANIMATION_OUT: "unmountSuspended"
5482
- },
5483
- unmountSuspended: {
5484
- MOUNT: "mounted",
5485
- ANIMATION_END: "unmounted"
5486
- },
5487
- unmounted: {
5488
- MOUNT: "mounted"
5489
- }
5490
- });
5491
- $iqq3r$useEffect(() => {
5492
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5493
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
5494
- }, [
5495
- state
5496
- ]);
5497
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5498
- const styles = stylesRef.current;
5499
- const wasPresent = prevPresentRef.current;
5500
- const hasPresentChanged = wasPresent !== present;
5501
- if (hasPresentChanged) {
5502
- const prevAnimationName = prevAnimationNameRef.current;
5503
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
5504
- if (present)
5505
- send("MOUNT");
5506
- else if (currentAnimationName === "none" || (styles === null || styles === void 0 ? void 0 : styles.display) === "none")
5507
- send("UNMOUNT");
5508
- else {
5509
- const isAnimating = prevAnimationName !== currentAnimationName;
5510
- if (wasPresent && isAnimating)
5511
- send("ANIMATION_OUT");
5512
- else
5513
- send("UNMOUNT");
5514
- }
5515
- prevPresentRef.current = present;
5516
- }
5517
- }, [
5518
- present,
5519
- send
5520
- ]);
5521
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5522
- if (node1) {
5523
- const handleAnimationEnd = (event) => {
5524
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5525
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
5526
- if (event.target === node1 && isCurrentAnimation)
5527
- $iqq3r$flushSync(
5528
- () => send("ANIMATION_END")
5529
- );
5530
- };
5531
- const handleAnimationStart = (event) => {
5532
- if (event.target === node1)
5533
- prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5534
- };
5535
- node1.addEventListener("animationstart", handleAnimationStart);
5536
- node1.addEventListener("animationcancel", handleAnimationEnd);
5537
- node1.addEventListener("animationend", handleAnimationEnd);
5538
- return () => {
5539
- node1.removeEventListener("animationstart", handleAnimationStart);
5540
- node1.removeEventListener("animationcancel", handleAnimationEnd);
5541
- node1.removeEventListener("animationend", handleAnimationEnd);
5542
- };
5543
- } else
5544
- send("ANIMATION_END");
5545
- }, [
5546
- node1,
5547
- send
5548
- ]);
5549
- return {
5550
- isPresent: [
5551
- "mounted",
5552
- "unmountSuspended"
5553
- ].includes(state),
5554
- ref: $iqq3r$useCallback((node) => {
5555
- if (node)
5556
- stylesRef.current = getComputedStyle(node);
5557
- setNode(node);
5558
- }, [])
5559
- };
5560
- }
5561
- function $921a889cee6df7e8$var$getAnimationName(styles) {
5562
- return (styles === null || styles === void 0 ? void 0 : styles.animationName) || "none";
5563
- }
5564
-
5565
- // node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
5566
- import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
5567
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
5568
- } }) {
5569
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
5570
- defaultProp,
5571
- onChange
5572
- });
5573
- const isControlled = prop !== void 0;
5574
- const value1 = isControlled ? prop : uncontrolledProp;
5575
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
5576
- const setValue = $bnPw9$useCallback((nextValue) => {
5577
- if (isControlled) {
5578
- const setter = nextValue;
5579
- const value = typeof nextValue === "function" ? setter(prop) : nextValue;
5580
- if (value !== prop)
5581
- handleChange(value);
5582
- } else
5583
- setUncontrolledProp(nextValue);
5584
- }, [
5585
- isControlled,
5586
- prop,
5587
- setUncontrolledProp,
5588
- handleChange
5589
- ]);
5590
- return [
5591
- value1,
5592
- setValue
5593
- ];
5594
- }
5595
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
5596
- const uncontrolledState = $bnPw9$useState(defaultProp);
5597
- const [value] = uncontrolledState;
5598
- const prevValueRef = $bnPw9$useRef(value);
5599
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
5600
- $bnPw9$useEffect(() => {
5601
- if (prevValueRef.current !== value) {
5602
- handleChange(value);
5603
- prevValueRef.current = value;
5604
- }
5605
- }, [
5606
- value,
5607
- prevValueRef,
5608
- handleChange
5609
- ]);
5610
- return uncontrolledState;
5611
- }
5612
-
5613
- // node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
5614
- import { forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement } from "react";
5615
- var $ea1ef594cf570d83$export$439d29a4e110a164 = /* @__PURE__ */ $kVwnw$forwardRef((props, forwardedRef) => {
5616
- return /* @__PURE__ */ $kVwnw$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
5617
- ref: forwardedRef,
5618
- style: {
5619
- // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
5620
- position: "absolute",
5621
- border: 0,
5622
- width: 1,
5623
- height: 1,
5624
- padding: 0,
5625
- margin: -1,
5626
- overflow: "hidden",
5627
- clip: "rect(0, 0, 0, 0)",
5628
- whiteSpace: "nowrap",
5629
- wordWrap: "normal",
5630
- ...props.style
5631
- }
5632
- }));
5633
- });
5634
- var $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;
5635
-
5636
- // node_modules/.pnpm/@radix-ui+react-tooltip@1.0.7_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.mjs
5637
- var [$a093c7e1ec25a057$var$createTooltipContext, $a093c7e1ec25a057$export$1c540a2224f0d865] = $c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip", [
5638
- $cf1ac5d9fe0e8206$export$722aac194ae923
5639
- ]);
5640
- var $a093c7e1ec25a057$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
5641
- var $a093c7e1ec25a057$var$PROVIDER_NAME = "TooltipProvider";
5642
- var $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION = 700;
5643
- var $a093c7e1ec25a057$var$TOOLTIP_OPEN = "tooltip.open";
5644
- var [$a093c7e1ec25a057$var$TooltipProviderContextProvider, $a093c7e1ec25a057$var$useTooltipProviderContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME);
5645
- var $a093c7e1ec25a057$export$f78649fb9ca566b8 = (props) => {
5646
- const { __scopeTooltip, delayDuration = $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION, skipDelayDuration = 300, disableHoverableContent = false, children } = props;
5647
- const [isOpenDelayed, setIsOpenDelayed] = $8wepK$useState(true);
5648
- const isPointerInTransitRef = $8wepK$useRef(false);
5649
- const skipDelayTimerRef = $8wepK$useRef(0);
5650
- $8wepK$useEffect(() => {
5651
- const skipDelayTimer = skipDelayTimerRef.current;
5652
- return () => window.clearTimeout(skipDelayTimer);
5653
- }, []);
5654
- return /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$TooltipProviderContextProvider, {
5655
- scope: __scopeTooltip,
5656
- isOpenDelayed,
5657
- delayDuration,
5658
- onOpen: $8wepK$useCallback(() => {
5659
- window.clearTimeout(skipDelayTimerRef.current);
5660
- setIsOpenDelayed(false);
5661
- }, []),
5662
- onClose: $8wepK$useCallback(() => {
5663
- window.clearTimeout(skipDelayTimerRef.current);
5664
- skipDelayTimerRef.current = window.setTimeout(
5665
- () => setIsOpenDelayed(true),
5666
- skipDelayDuration
5667
- );
5668
- }, [
5669
- skipDelayDuration
5670
- ]),
5671
- isPointerInTransitRef,
5672
- onPointerInTransitChange: $8wepK$useCallback((inTransit) => {
5673
- isPointerInTransitRef.current = inTransit;
5674
- }, []),
5675
- disableHoverableContent
5676
- }, children);
5677
- };
5678
- var $a093c7e1ec25a057$var$TOOLTIP_NAME = "Tooltip";
5679
- var [$a093c7e1ec25a057$var$TooltipContextProvider, $a093c7e1ec25a057$var$useTooltipContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME);
5680
- var $a093c7e1ec25a057$export$28c660c63b792dea = (props) => {
5681
- const { __scopeTooltip, children, open: openProp, defaultOpen = false, onOpenChange, disableHoverableContent: disableHoverableContentProp, delayDuration: delayDurationProp } = props;
5682
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME, props.__scopeTooltip);
5683
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5684
- const [trigger, setTrigger] = $8wepK$useState(null);
5685
- const contentId = $1746a345f3d73bb7$export$f680877a34711e37();
5686
- const openTimerRef = $8wepK$useRef(0);
5687
- const disableHoverableContent = disableHoverableContentProp !== null && disableHoverableContentProp !== void 0 ? disableHoverableContentProp : providerContext.disableHoverableContent;
5688
- const delayDuration = delayDurationProp !== null && delayDurationProp !== void 0 ? delayDurationProp : providerContext.delayDuration;
5689
- const wasOpenDelayedRef = $8wepK$useRef(false);
5690
- const [open1 = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
5691
- prop: openProp,
5692
- defaultProp: defaultOpen,
5693
- onChange: (open) => {
5694
- if (open) {
5695
- providerContext.onOpen();
5696
- document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN));
5697
- } else
5698
- providerContext.onClose();
5699
- onOpenChange === null || onOpenChange === void 0 || onOpenChange(open);
5700
- }
5701
- });
5702
- const stateAttribute = $8wepK$useMemo(() => {
5703
- return open1 ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
5704
- }, [
5705
- open1
5706
- ]);
5707
- const handleOpen = $8wepK$useCallback(() => {
5708
- window.clearTimeout(openTimerRef.current);
5709
- wasOpenDelayedRef.current = false;
5710
- setOpen(true);
5711
- }, [
5712
- setOpen
5713
- ]);
5714
- const handleClose = $8wepK$useCallback(() => {
5715
- window.clearTimeout(openTimerRef.current);
5716
- setOpen(false);
5717
- }, [
5718
- setOpen
5719
- ]);
5720
- const handleDelayedOpen = $8wepK$useCallback(() => {
5721
- window.clearTimeout(openTimerRef.current);
5722
- openTimerRef.current = window.setTimeout(() => {
5723
- wasOpenDelayedRef.current = true;
5724
- setOpen(true);
5725
- }, delayDuration);
5726
- }, [
5727
- delayDuration,
5728
- setOpen
5729
- ]);
5730
- $8wepK$useEffect(() => {
5731
- return () => window.clearTimeout(openTimerRef.current);
5732
- }, []);
5733
- return /* @__PURE__ */ $8wepK$createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$TooltipContextProvider, {
5734
- scope: __scopeTooltip,
5735
- contentId,
5736
- open: open1,
5737
- stateAttribute,
5738
- trigger,
5739
- onTriggerChange: setTrigger,
5740
- onTriggerEnter: $8wepK$useCallback(() => {
5741
- if (providerContext.isOpenDelayed)
5742
- handleDelayedOpen();
5743
- else
5744
- handleOpen();
5745
- }, [
5746
- providerContext.isOpenDelayed,
5747
- handleDelayedOpen,
5748
- handleOpen
5749
- ]),
5750
- onTriggerLeave: $8wepK$useCallback(() => {
5751
- if (disableHoverableContent)
5752
- handleClose();
5753
- else
5754
- window.clearTimeout(openTimerRef.current);
5755
- }, [
5756
- handleClose,
5757
- disableHoverableContent
5758
- ]),
5759
- onOpen: handleOpen,
5760
- onClose: handleClose,
5761
- disableHoverableContent
5762
- }, children));
5763
- };
5764
- var $a093c7e1ec25a057$var$TRIGGER_NAME = "TooltipTrigger";
5765
- var $a093c7e1ec25a057$export$8c610744efcf8a1d = /* @__PURE__ */ $8wepK$forwardRef((props, forwardedRef) => {
5766
- const { __scopeTooltip, ...triggerProps } = props;
5767
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
5768
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
5769
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5770
- const ref = $8wepK$useRef(null);
5771
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onTriggerChange);
5772
- const isPointerDownRef = $8wepK$useRef(false);
5773
- const hasPointerMoveOpenedRef = $8wepK$useRef(false);
5774
- const handlePointerUp = $8wepK$useCallback(
5775
- () => isPointerDownRef.current = false,
5776
- []
5777
- );
5778
- $8wepK$useEffect(() => {
5779
- return () => document.removeEventListener("pointerup", handlePointerUp);
5780
- }, [
5781
- handlePointerUp
5782
- ]);
5783
- return /* @__PURE__ */ $8wepK$createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
5784
- asChild: true
5785
- }, popperScope), /* @__PURE__ */ $8wepK$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
5786
- // We purposefully avoid adding `type=button` here because tooltip triggers are also
5787
- // commonly anchors and the anchor `type` attribute signifies MIME type.
5788
- "aria-describedby": context.open ? context.contentId : void 0,
5789
- "data-state": context.stateAttribute
5790
- }, triggerProps, {
5791
- ref: composedRefs,
5792
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, (event) => {
5793
- if (event.pointerType === "touch")
5794
- return;
5795
- if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
5796
- context.onTriggerEnter();
5797
- hasPointerMoveOpenedRef.current = true;
5798
- }
5799
- }),
5800
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, () => {
5801
- context.onTriggerLeave();
5802
- hasPointerMoveOpenedRef.current = false;
5803
- }),
5804
- onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, () => {
5805
- isPointerDownRef.current = true;
5806
- document.addEventListener("pointerup", handlePointerUp, {
5807
- once: true
5808
- });
5809
- }),
5810
- onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, () => {
5811
- if (!isPointerDownRef.current)
5812
- context.onOpen();
5813
- }),
5814
- onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, context.onClose),
5815
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onClose)
5816
- })));
5817
- });
5818
- var $a093c7e1ec25a057$var$PORTAL_NAME = "TooltipPortal";
5819
- var [$a093c7e1ec25a057$var$PortalProvider, $a093c7e1ec25a057$var$usePortalContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME, {
5820
- forceMount: void 0
5821
- });
5822
- var $a093c7e1ec25a057$var$CONTENT_NAME = "TooltipContent";
5823
- var $a093c7e1ec25a057$export$e9003e2be37ec060 = /* @__PURE__ */ $8wepK$forwardRef((props, forwardedRef) => {
5824
- const portalContext = $a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5825
- const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
5826
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5827
- return /* @__PURE__ */ $8wepK$createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
5828
- present: forceMount || context.open
5829
- }, context.disableHoverableContent ? /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({
5830
- side
5831
- }, contentProps, {
5832
- ref: forwardedRef
5833
- })) : /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$TooltipContentHoverable, _extends({
5834
- side
5835
- }, contentProps, {
5836
- ref: forwardedRef
5837
- })));
5838
- });
5839
- var $a093c7e1ec25a057$var$TooltipContentHoverable = /* @__PURE__ */ $8wepK$forwardRef((props, forwardedRef) => {
5840
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5841
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5842
- const ref = $8wepK$useRef(null);
5843
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
5844
- const [pointerGraceArea, setPointerGraceArea] = $8wepK$useState(null);
5845
- const { trigger, onClose } = context;
5846
- const content = ref.current;
5847
- const { onPointerInTransitChange } = providerContext;
5848
- const handleRemoveGraceArea = $8wepK$useCallback(() => {
5849
- setPointerGraceArea(null);
5850
- onPointerInTransitChange(false);
5851
- }, [
5852
- onPointerInTransitChange
5853
- ]);
5854
- const handleCreateGraceArea = $8wepK$useCallback((event, hoverTarget) => {
5855
- const currentTarget = event.currentTarget;
5856
- const exitPoint = {
5857
- x: event.clientX,
5858
- y: event.clientY
5859
- };
5860
- const exitSide = $a093c7e1ec25a057$var$getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
5861
- const paddedExitPoints = $a093c7e1ec25a057$var$getPaddedExitPoints(exitPoint, exitSide);
5862
- const hoverTargetPoints = $a093c7e1ec25a057$var$getPointsFromRect(hoverTarget.getBoundingClientRect());
5863
- const graceArea = $a093c7e1ec25a057$var$getHull([
5864
- ...paddedExitPoints,
5865
- ...hoverTargetPoints
5866
- ]);
5867
- setPointerGraceArea(graceArea);
5868
- onPointerInTransitChange(true);
5869
- }, [
5870
- onPointerInTransitChange
5871
- ]);
5872
- $8wepK$useEffect(() => {
5873
- return () => handleRemoveGraceArea();
5874
- }, [
5875
- handleRemoveGraceArea
5876
- ]);
5877
- $8wepK$useEffect(() => {
5878
- if (trigger && content) {
5879
- const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
5880
- const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
5881
- trigger.addEventListener("pointerleave", handleTriggerLeave);
5882
- content.addEventListener("pointerleave", handleContentLeave);
5883
- return () => {
5884
- trigger.removeEventListener("pointerleave", handleTriggerLeave);
5885
- content.removeEventListener("pointerleave", handleContentLeave);
5886
- };
5887
- }
5888
- }, [
5889
- trigger,
5890
- content,
5891
- handleCreateGraceArea,
5892
- handleRemoveGraceArea
5893
- ]);
5894
- $8wepK$useEffect(() => {
5895
- if (pointerGraceArea) {
5896
- const handleTrackPointerGrace = (event) => {
5897
- const target = event.target;
5898
- const pointerPosition = {
5899
- x: event.clientX,
5900
- y: event.clientY
5901
- };
5902
- const hasEnteredTarget = (trigger === null || trigger === void 0 ? void 0 : trigger.contains(target)) || (content === null || content === void 0 ? void 0 : content.contains(target));
5903
- const isPointerOutsideGraceArea = !$a093c7e1ec25a057$var$isPointInPolygon(pointerPosition, pointerGraceArea);
5904
- if (hasEnteredTarget)
5905
- handleRemoveGraceArea();
5906
- else if (isPointerOutsideGraceArea) {
5907
- handleRemoveGraceArea();
5908
- onClose();
5909
- }
5910
- };
5911
- document.addEventListener("pointermove", handleTrackPointerGrace);
5912
- return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
5913
- }
5914
- }, [
5915
- trigger,
5916
- content,
5917
- pointerGraceArea,
5918
- onClose,
5919
- handleRemoveGraceArea
5920
- ]);
5921
- return /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({}, props, {
5922
- ref: composedRefs
5923
- }));
5924
- });
5925
- var [$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, $a093c7e1ec25a057$var$useVisuallyHiddenContentContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME, {
5926
- isInside: false
5927
- });
5928
- var $a093c7e1ec25a057$var$TooltipContentImpl = /* @__PURE__ */ $8wepK$forwardRef((props, forwardedRef) => {
5929
- const { __scopeTooltip, children, "aria-label": ariaLabel, onEscapeKeyDown, onPointerDownOutside, ...contentProps } = props;
5930
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, __scopeTooltip);
5931
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5932
- const { onClose } = context;
5933
- $8wepK$useEffect(() => {
5934
- document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose);
5935
- return () => document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose);
5936
- }, [
5937
- onClose
5938
- ]);
5939
- $8wepK$useEffect(() => {
5940
- if (context.trigger) {
5941
- const handleScroll = (event) => {
5942
- const target = event.target;
5943
- if (target !== null && target !== void 0 && target.contains(context.trigger))
5944
- onClose();
5945
- };
5946
- window.addEventListener("scroll", handleScroll, {
5947
- capture: true
5948
- });
5949
- return () => window.removeEventListener("scroll", handleScroll, {
5950
- capture: true
5951
- });
5952
- }
5953
- }, [
5954
- context.trigger,
5955
- onClose
5956
- ]);
5957
- return /* @__PURE__ */ $8wepK$createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
5958
- asChild: true,
5959
- disableOutsidePointerEvents: false,
5960
- onEscapeKeyDown,
5961
- onPointerDownOutside,
5962
- onFocusOutside: (event) => event.preventDefault(),
5963
- onDismiss: onClose
5964
- }, /* @__PURE__ */ $8wepK$createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
5965
- "data-state": context.stateAttribute
5966
- }, popperScope, contentProps, {
5967
- ref: forwardedRef,
5968
- style: {
5969
- ...contentProps.style,
5970
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
5971
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
5972
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
5973
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
5974
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
5975
- }
5976
- }), /* @__PURE__ */ $8wepK$createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45, null, children), /* @__PURE__ */ $8wepK$createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, {
5977
- scope: __scopeTooltip,
5978
- isInside: true
5979
- }, /* @__PURE__ */ $8wepK$createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9, {
5980
- id: context.contentId,
5981
- role: "tooltip"
5982
- }, ariaLabel || children))));
5983
- });
5984
- var $a093c7e1ec25a057$var$ARROW_NAME = "TooltipArrow";
5985
- var $a093c7e1ec25a057$export$c27ee0ad710f7559 = /* @__PURE__ */ $8wepK$forwardRef((props, forwardedRef) => {
5986
- const { __scopeTooltip, ...arrowProps } = props;
5987
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5988
- const visuallyHiddenContentContext = $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME, __scopeTooltip);
5989
- return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ $8wepK$createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
5990
- ref: forwardedRef
5991
- }));
5992
- });
5993
- function $a093c7e1ec25a057$var$getExitSideFromRect(point, rect) {
5994
- const top = Math.abs(rect.top - point.y);
5995
- const bottom = Math.abs(rect.bottom - point.y);
5996
- const right = Math.abs(rect.right - point.x);
5997
- const left = Math.abs(rect.left - point.x);
5998
- switch (Math.min(top, bottom, right, left)) {
5999
- case left:
6000
- return "left";
6001
- case right:
6002
- return "right";
6003
- case top:
6004
- return "top";
6005
- case bottom:
6006
- return "bottom";
6007
- default:
6008
- throw new Error("unreachable");
6009
- }
6010
- }
6011
- function $a093c7e1ec25a057$var$getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
6012
- const paddedExitPoints = [];
6013
- switch (exitSide) {
6014
- case "top":
6015
- paddedExitPoints.push({
6016
- x: exitPoint.x - padding,
6017
- y: exitPoint.y + padding
6018
- }, {
6019
- x: exitPoint.x + padding,
6020
- y: exitPoint.y + padding
6021
- });
6022
- break;
6023
- case "bottom":
6024
- paddedExitPoints.push({
6025
- x: exitPoint.x - padding,
6026
- y: exitPoint.y - padding
6027
- }, {
6028
- x: exitPoint.x + padding,
6029
- y: exitPoint.y - padding
6030
- });
6031
- break;
6032
- case "left":
6033
- paddedExitPoints.push({
6034
- x: exitPoint.x + padding,
6035
- y: exitPoint.y - padding
6036
- }, {
6037
- x: exitPoint.x + padding,
6038
- y: exitPoint.y + padding
6039
- });
6040
- break;
6041
- case "right":
6042
- paddedExitPoints.push({
6043
- x: exitPoint.x - padding,
6044
- y: exitPoint.y - padding
6045
- }, {
6046
- x: exitPoint.x - padding,
6047
- y: exitPoint.y + padding
6048
- });
6049
- break;
6050
- }
6051
- return paddedExitPoints;
6052
- }
6053
- function $a093c7e1ec25a057$var$getPointsFromRect(rect) {
6054
- const { top, right, bottom, left } = rect;
6055
- return [
6056
- {
6057
- x: left,
6058
- y: top
6059
- },
6060
- {
6061
- x: right,
6062
- y: top
6063
- },
6064
- {
6065
- x: right,
6066
- y: bottom
6067
- },
6068
- {
6069
- x: left,
6070
- y: bottom
6071
- }
6072
- ];
6073
- }
6074
- function $a093c7e1ec25a057$var$isPointInPolygon(point, polygon) {
6075
- const { x, y } = point;
6076
- let inside = false;
6077
- for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
6078
- const xi = polygon[i].x;
6079
- const yi = polygon[i].y;
6080
- const xj = polygon[j].x;
6081
- const yj = polygon[j].y;
6082
- const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
6083
- if (intersect)
6084
- inside = !inside;
6085
- }
6086
- return inside;
6087
- }
6088
- function $a093c7e1ec25a057$var$getHull(points) {
6089
- const newPoints = points.slice();
6090
- newPoints.sort((a, b) => {
6091
- if (a.x < b.x)
6092
- return -1;
6093
- else if (a.x > b.x)
6094
- return 1;
6095
- else if (a.y < b.y)
6096
- return -1;
6097
- else if (a.y > b.y)
6098
- return 1;
6099
- else
6100
- return 0;
6101
- });
6102
- return $a093c7e1ec25a057$var$getHullPresorted(newPoints);
6103
- }
6104
- function $a093c7e1ec25a057$var$getHullPresorted(points) {
6105
- if (points.length <= 1)
6106
- return points.slice();
6107
- const upperHull = [];
6108
- for (let i = 0; i < points.length; i++) {
6109
- const p = points[i];
6110
- while (upperHull.length >= 2) {
6111
- const q = upperHull[upperHull.length - 1];
6112
- const r2 = upperHull[upperHull.length - 2];
6113
- if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x))
6114
- upperHull.pop();
6115
- else
6116
- break;
6117
- }
6118
- upperHull.push(p);
6119
- }
6120
- upperHull.pop();
6121
- const lowerHull = [];
6122
- for (let i1 = points.length - 1; i1 >= 0; i1--) {
6123
- const p = points[i1];
6124
- while (lowerHull.length >= 2) {
6125
- const q = lowerHull[lowerHull.length - 1];
6126
- const r2 = lowerHull[lowerHull.length - 2];
6127
- if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x))
6128
- lowerHull.pop();
6129
- else
6130
- break;
6131
- }
6132
- lowerHull.push(p);
6133
- }
6134
- lowerHull.pop();
6135
- if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y)
6136
- return upperHull;
6137
- else
6138
- return upperHull.concat(lowerHull);
6139
- }
6140
- var $a093c7e1ec25a057$export$be92b6f5f03c0fe9 = $a093c7e1ec25a057$export$28c660c63b792dea;
6141
-
6142
- // src/components/tooltip.tsx
6143
- var TooltipProvider = $a093c7e1ec25a057$export$f78649fb9ca566b8;
2791
+ import React4 from "react";
2792
+ import {
2793
+ Root,
2794
+ TooltipProvider as TooltipProviderPrimitive,
2795
+ TooltipTrigger,
2796
+ TooltipContent,
2797
+ TooltipArrow
2798
+ } from "@radix-ui/react-tooltip";
2799
+ var TooltipProvider = TooltipProviderPrimitive;
6144
2800
  var Tooltip = ({
6145
2801
  children,
6146
2802
  content,
@@ -6148,16 +2804,16 @@ var Tooltip = ({
6148
2804
  defaultOpen,
6149
2805
  onOpenChange,
6150
2806
  className,
6151
- size: size4 = "medium",
2807
+ size = "medium",
6152
2808
  ...props
6153
2809
  }) => {
6154
- return /* @__PURE__ */ React5.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9, { open, defaultOpen, onOpenChange }, /* @__PURE__ */ React5.createElement($a093c7e1ec25a057$export$8c610744efcf8a1d, { asChild: true }, children), /* @__PURE__ */ React5.createElement(
6155
- $a093c7e1ec25a057$export$e9003e2be37ec060,
2810
+ return /* @__PURE__ */ React4.createElement(Root, { open, defaultOpen, onOpenChange }, /* @__PURE__ */ React4.createElement(TooltipTrigger, { asChild: true }, children), /* @__PURE__ */ React4.createElement(
2811
+ TooltipContent,
6156
2812
  {
6157
2813
  className: cn(
6158
2814
  "max-w-[20.5rem] rounded bg-neutral-900 text-sm leading-[120%] text-neutral-50",
6159
- size4 === "small" && "p-2",
6160
- size4 === "medium" && "p-4",
2815
+ size === "small" && "p-2",
2816
+ size === "medium" && "p-4",
6161
2817
  className
6162
2818
  ),
6163
2819
  side: "bottom",
@@ -6165,7 +2821,7 @@ var Tooltip = ({
6165
2821
  ...props
6166
2822
  },
6167
2823
  content,
6168
- /* @__PURE__ */ React5.createElement($a093c7e1ec25a057$export$c27ee0ad710f7559, { width: 16, height: 8, className: "fill-neutral-900" })
2824
+ /* @__PURE__ */ React4.createElement(TooltipArrow, { width: 16, height: 8, className: "fill-neutral-900" })
6169
2825
  ));
6170
2826
  };
6171
2827
  export {