@windrun-huaiin/third-ui 5.13.6 → 5.14.0

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.
@@ -2737,2477 +2737,21 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
2737
2737
  var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
2738
2738
  var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
2739
2739
 
2740
- // ../base-ui/src/ui/alert-dialog.tsx
2741
- var React57 = __toESM(require("react"), 1);
2742
-
2743
- // ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
2744
- var React55 = __toESM(require("react"), 1);
2745
-
2746
- // ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
2747
- var React33 = __toESM(require("react"), 1);
2748
- var import_jsx_runtime33 = require("react/jsx-runtime");
2749
- function createContext2(rootComponentName, defaultContext) {
2750
- const Context = React33.createContext(defaultContext);
2751
- const Provider = (props) => {
2752
- const _a = props, { children } = _a, context = __objRest(_a, ["children"]);
2753
- const value = React33.useMemo(() => context, Object.values(context));
2754
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Context.Provider, { value, children });
2755
- };
2756
- Provider.displayName = rootComponentName + "Provider";
2757
- function useContext22(consumerName) {
2758
- const context = React33.useContext(Context);
2759
- if (context) return context;
2760
- if (defaultContext !== void 0) return defaultContext;
2761
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2762
- }
2763
- return [Provider, useContext22];
2764
- }
2765
- function createContextScope(scopeName, createContextScopeDeps = []) {
2766
- let defaultContexts = [];
2767
- function createContext32(rootComponentName, defaultContext) {
2768
- const BaseContext = React33.createContext(defaultContext);
2769
- const index = defaultContexts.length;
2770
- defaultContexts = [...defaultContexts, defaultContext];
2771
- const Provider = (props) => {
2772
- var _b;
2773
- const _a = props, { scope, children } = _a, context = __objRest(_a, ["scope", "children"]);
2774
- const Context = ((_b = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _b[index]) || BaseContext;
2775
- const value = React33.useMemo(() => context, Object.values(context));
2776
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Context.Provider, { value, children });
2777
- };
2778
- Provider.displayName = rootComponentName + "Provider";
2779
- function useContext22(consumerName, scope) {
2780
- var _a;
2781
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
2782
- const context = React33.useContext(Context);
2783
- if (context) return context;
2784
- if (defaultContext !== void 0) return defaultContext;
2785
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2786
- }
2787
- return [Provider, useContext22];
2788
- }
2789
- const createScope = () => {
2790
- const scopeContexts = defaultContexts.map((defaultContext) => {
2791
- return React33.createContext(defaultContext);
2792
- });
2793
- return function useScope(scope) {
2794
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
2795
- return React33.useMemo(
2796
- () => ({ [`__scope${scopeName}`]: __spreadProps(__spreadValues({}, scope), { [scopeName]: contexts }) }),
2797
- [scope, contexts]
2798
- );
2799
- };
2800
- };
2801
- createScope.scopeName = scopeName;
2802
- return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
2803
- }
2804
- function composeContextScopes(...scopes) {
2805
- const baseScope = scopes[0];
2806
- if (scopes.length === 1) return baseScope;
2807
- const createScope = () => {
2808
- const scopeHooks = scopes.map((createScope2) => ({
2809
- useScope: createScope2(),
2810
- scopeName: createScope2.scopeName
2811
- }));
2812
- return function useComposedScopes(overrideScopes) {
2813
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
2814
- const scopeProps = useScope(overrideScopes);
2815
- const currentScope = scopeProps[`__scope${scopeName}`];
2816
- return __spreadValues(__spreadValues({}, nextScopes2), currentScope);
2817
- }, {});
2818
- return React33.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
2819
- };
2820
- };
2821
- createScope.scopeName = baseScope.scopeName;
2822
- return createScope;
2823
- }
2824
-
2825
- // ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
2826
- var React34 = __toESM(require("react"), 1);
2827
- function setRef(ref, value) {
2828
- if (typeof ref === "function") {
2829
- return ref(value);
2830
- } else if (ref !== null && ref !== void 0) {
2831
- ref.current = value;
2832
- }
2833
- }
2834
- function composeRefs(...refs) {
2835
- return (node) => {
2836
- let hasCleanup = false;
2837
- const cleanups = refs.map((ref) => {
2838
- const cleanup = setRef(ref, node);
2839
- if (!hasCleanup && typeof cleanup == "function") {
2840
- hasCleanup = true;
2841
- }
2842
- return cleanup;
2843
- });
2844
- if (hasCleanup) {
2845
- return () => {
2846
- for (let i = 0; i < cleanups.length; i++) {
2847
- const cleanup = cleanups[i];
2848
- if (typeof cleanup == "function") {
2849
- cleanup();
2850
- } else {
2851
- setRef(refs[i], null);
2852
- }
2853
- }
2854
- };
2855
- }
2856
- };
2857
- }
2858
- function useComposedRefs(...refs) {
2859
- return React34.useCallback(composeRefs(...refs), refs);
2860
- }
2861
-
2862
- // ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
2863
- var React54 = __toESM(require("react"), 1);
2864
-
2865
- // ../../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
2866
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
2867
- return function handleEvent(event) {
2868
- originalEventHandler == null ? void 0 : originalEventHandler(event);
2869
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
2870
- return ourEventHandler == null ? void 0 : ourEventHandler(event);
2871
- }
2872
- };
2873
- }
2874
-
2875
- // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
2876
- var React36 = __toESM(require("react"), 1);
2877
-
2878
- // ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
2879
- var React35 = __toESM(require("react"), 1);
2880
- var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React35.useLayoutEffect : () => {
2881
- };
2882
-
2883
- // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
2884
- var useReactId = React36[" useId ".trim().toString()] || (() => void 0);
2885
- var count = 0;
2886
- function useId(deterministicId) {
2887
- const [id, setId] = React36.useState(useReactId());
2888
- useLayoutEffect2(() => {
2889
- if (!deterministicId) setId((reactId) => reactId != null ? reactId : String(count++));
2890
- }, [deterministicId]);
2891
- return deterministicId || (id ? `radix-${id}` : "");
2892
- }
2893
-
2894
- // ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
2895
- var React37 = __toESM(require("react"), 1);
2896
- var React210 = __toESM(require("react"), 1);
2897
- var useInsertionEffect = React37[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
2898
- function useControllableState({
2899
- prop,
2900
- defaultProp,
2901
- onChange = () => {
2902
- },
2903
- caller
2904
- }) {
2905
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
2906
- defaultProp,
2907
- onChange
2908
- });
2909
- const isControlled = prop !== void 0;
2910
- const value = isControlled ? prop : uncontrolledProp;
2911
- if (true) {
2912
- const isControlledRef = React37.useRef(prop !== void 0);
2913
- React37.useEffect(() => {
2914
- const wasControlled = isControlledRef.current;
2915
- if (wasControlled !== isControlled) {
2916
- const from = wasControlled ? "controlled" : "uncontrolled";
2917
- const to = isControlled ? "controlled" : "uncontrolled";
2918
- console.warn(
2919
- `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
2920
- );
2921
- }
2922
- isControlledRef.current = isControlled;
2923
- }, [isControlled, caller]);
2924
- }
2925
- const setValue = React37.useCallback(
2926
- (nextValue) => {
2927
- var _a;
2928
- if (isControlled) {
2929
- const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
2930
- if (value2 !== prop) {
2931
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
2932
- }
2933
- } else {
2934
- setUncontrolledProp(nextValue);
2935
- }
2936
- },
2937
- [isControlled, prop, setUncontrolledProp, onChangeRef]
2938
- );
2939
- return [value, setValue];
2940
- }
2941
- function useUncontrolledState({
2942
- defaultProp,
2943
- onChange
2944
- }) {
2945
- const [value, setValue] = React37.useState(defaultProp);
2946
- const prevValueRef = React37.useRef(value);
2947
- const onChangeRef = React37.useRef(onChange);
2948
- useInsertionEffect(() => {
2949
- onChangeRef.current = onChange;
2950
- }, [onChange]);
2951
- React37.useEffect(() => {
2952
- var _a;
2953
- if (prevValueRef.current !== value) {
2954
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
2955
- prevValueRef.current = value;
2956
- }
2957
- }, [value, prevValueRef]);
2958
- return [value, setValue, onChangeRef];
2959
- }
2960
- function isFunction(value) {
2961
- return typeof value === "function";
2962
- }
2963
- var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
2964
-
2965
- // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
2966
- var React42 = __toESM(require("react"), 1);
2967
-
2968
- // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.3_@types+react@19.1.2__@types+rea_43250ccbc78c27b15284efcf829a65d5/node_modules/@radix-ui/react-primitive/dist/index.mjs
2969
- var React39 = __toESM(require("react"), 1);
2970
- var ReactDOM = __toESM(require("react-dom"), 1);
2971
-
2972
- // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
2973
- var React38 = __toESM(require("react"), 1);
2974
- var import_jsx_runtime34 = require("react/jsx-runtime");
2975
- // @__NO_SIDE_EFFECTS__
2976
- function createSlot(ownerName) {
2977
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
2978
- const Slot22 = React38.forwardRef((props, forwardedRef) => {
2979
- const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
2980
- const childrenArray = React38.Children.toArray(children);
2981
- const slottable = childrenArray.find(isSlottable);
2982
- if (slottable) {
2983
- const newElement = slottable.props.children;
2984
- const newChildren = childrenArray.map((child) => {
2985
- if (child === slottable) {
2986
- if (React38.Children.count(newElement) > 1) return React38.Children.only(null);
2987
- return React38.isValidElement(newElement) ? newElement.props.children : null;
2988
- } else {
2989
- return child;
2990
- }
2991
- });
2992
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React38.isValidElement(newElement) ? React38.cloneElement(newElement, void 0, newChildren) : null }));
2993
- }
2994
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
2995
- });
2996
- Slot22.displayName = `${ownerName}.Slot`;
2997
- return Slot22;
2998
- }
2999
- var Slot = /* @__PURE__ */ createSlot("Slot");
3000
- // @__NO_SIDE_EFFECTS__
3001
- function createSlotClone(ownerName) {
3002
- const SlotClone = React38.forwardRef((props, forwardedRef) => {
3003
- const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
3004
- if (React38.isValidElement(children)) {
3005
- const childrenRef = getElementRef(children);
3006
- const props2 = mergeProps(slotProps, children.props);
3007
- if (children.type !== React38.Fragment) {
3008
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
3009
- }
3010
- return React38.cloneElement(children, props2);
3011
- }
3012
- return React38.Children.count(children) > 1 ? React38.Children.only(null) : null;
3013
- });
3014
- SlotClone.displayName = `${ownerName}.SlotClone`;
3015
- return SlotClone;
3016
- }
3017
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
3018
- // @__NO_SIDE_EFFECTS__
3019
- function createSlottable(ownerName) {
3020
- const Slottable2 = ({ children }) => {
3021
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children });
3022
- };
3023
- Slottable2.displayName = `${ownerName}.Slottable`;
3024
- Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
3025
- return Slottable2;
3026
- }
3027
- function isSlottable(child) {
3028
- return React38.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
3029
- }
3030
- function mergeProps(slotProps, childProps) {
3031
- const overrideProps = __spreadValues({}, childProps);
3032
- for (const propName in childProps) {
3033
- const slotPropValue = slotProps[propName];
3034
- const childPropValue = childProps[propName];
3035
- const isHandler = /^on[A-Z]/.test(propName);
3036
- if (isHandler) {
3037
- if (slotPropValue && childPropValue) {
3038
- overrideProps[propName] = (...args) => {
3039
- const result = childPropValue(...args);
3040
- slotPropValue(...args);
3041
- return result;
3042
- };
3043
- } else if (slotPropValue) {
3044
- overrideProps[propName] = slotPropValue;
3045
- }
3046
- } else if (propName === "style") {
3047
- overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
3048
- } else if (propName === "className") {
3049
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
3050
- }
3051
- }
3052
- return __spreadValues(__spreadValues({}, slotProps), overrideProps);
3053
- }
3054
- function getElementRef(element) {
3055
- var _a, _b;
3056
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
3057
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3058
- if (mayWarn) {
3059
- return element.ref;
3060
- }
3061
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
3062
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3063
- if (mayWarn) {
3064
- return element.props.ref;
3065
- }
3066
- return element.props.ref || element.ref;
3067
- }
3068
-
3069
- // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.3_@types+react@19.1.2__@types+rea_43250ccbc78c27b15284efcf829a65d5/node_modules/@radix-ui/react-primitive/dist/index.mjs
3070
- var import_jsx_runtime35 = require("react/jsx-runtime");
3071
- var NODES = [
3072
- "a",
3073
- "button",
3074
- "div",
3075
- "form",
3076
- "h2",
3077
- "h3",
3078
- "img",
3079
- "input",
3080
- "label",
3081
- "li",
3082
- "nav",
3083
- "ol",
3084
- "p",
3085
- "select",
3086
- "span",
3087
- "svg",
3088
- "ul"
3089
- ];
3090
- var Primitive = NODES.reduce((primitive, node) => {
3091
- const Slot3 = createSlot(`Primitive.${node}`);
3092
- const Node2 = React39.forwardRef((props, forwardedRef) => {
3093
- const _a = props, { asChild } = _a, primitiveProps = __objRest(_a, ["asChild"]);
3094
- const Comp = asChild ? Slot3 : node;
3095
- if (typeof window !== "undefined") {
3096
- window[Symbol.for("radix-ui")] = true;
3097
- }
3098
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Comp, __spreadProps(__spreadValues({}, primitiveProps), { ref: forwardedRef }));
3099
- });
3100
- Node2.displayName = `Primitive.${node}`;
3101
- return __spreadProps(__spreadValues({}, primitive), { [node]: Node2 });
3102
- }, {});
3103
- function dispatchDiscreteCustomEvent(target, event) {
3104
- if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
3105
- }
3106
-
3107
- // ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
3108
- var React40 = __toESM(require("react"), 1);
3109
- function useCallbackRef(callback) {
3110
- const callbackRef = React40.useRef(callback);
3111
- React40.useEffect(() => {
3112
- callbackRef.current = callback;
3113
- });
3114
- return React40.useMemo(() => (...args) => {
3115
- var _a;
3116
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
3117
- }, []);
3118
- }
3119
-
3120
- // ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
3121
- var React41 = __toESM(require("react"), 1);
3122
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
3123
- const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
3124
- React41.useEffect(() => {
3125
- const handleKeyDown = (event) => {
3126
- if (event.key === "Escape") {
3127
- onEscapeKeyDown(event);
3128
- }
3129
- };
3130
- ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
3131
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
3132
- }, [onEscapeKeyDown, ownerDocument]);
3133
- }
3134
-
3135
- // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
3136
- var import_jsx_runtime36 = require("react/jsx-runtime");
3137
- var DISMISSABLE_LAYER_NAME = "DismissableLayer";
3138
- var CONTEXT_UPDATE = "dismissableLayer.update";
3139
- var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
3140
- var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
3141
- var originalBodyPointerEvents;
3142
- var DismissableLayerContext = React42.createContext({
3143
- layers: /* @__PURE__ */ new Set(),
3144
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
3145
- branches: /* @__PURE__ */ new Set()
3146
- });
3147
- var DismissableLayer = React42.forwardRef(
3148
- (props, forwardedRef) => {
3149
- var _b;
3150
- const _a = props, {
3151
- disableOutsidePointerEvents = false,
3152
- onEscapeKeyDown,
3153
- onPointerDownOutside,
3154
- onFocusOutside,
3155
- onInteractOutside,
3156
- onDismiss
3157
- } = _a, layerProps = __objRest(_a, [
3158
- "disableOutsidePointerEvents",
3159
- "onEscapeKeyDown",
3160
- "onPointerDownOutside",
3161
- "onFocusOutside",
3162
- "onInteractOutside",
3163
- "onDismiss"
3164
- ]);
3165
- const context = React42.useContext(DismissableLayerContext);
3166
- const [node, setNode] = React42.useState(null);
3167
- const ownerDocument = (_b = node == null ? void 0 : node.ownerDocument) != null ? _b : globalThis == null ? void 0 : globalThis.document;
3168
- const [, force] = React42.useState({});
3169
- const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
3170
- const layers = Array.from(context.layers);
3171
- const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
3172
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
3173
- const index = node ? layers.indexOf(node) : -1;
3174
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
3175
- const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
3176
- const pointerDownOutside = usePointerDownOutside((event) => {
3177
- const target = event.target;
3178
- const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
3179
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
3180
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
3181
- onInteractOutside == null ? void 0 : onInteractOutside(event);
3182
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
3183
- }, ownerDocument);
3184
- const focusOutside = useFocusOutside((event) => {
3185
- const target = event.target;
3186
- const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
3187
- if (isFocusInBranch) return;
3188
- onFocusOutside == null ? void 0 : onFocusOutside(event);
3189
- onInteractOutside == null ? void 0 : onInteractOutside(event);
3190
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
3191
- }, ownerDocument);
3192
- useEscapeKeydown((event) => {
3193
- const isHighestLayer = index === context.layers.size - 1;
3194
- if (!isHighestLayer) return;
3195
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
3196
- if (!event.defaultPrevented && onDismiss) {
3197
- event.preventDefault();
3198
- onDismiss();
3199
- }
3200
- }, ownerDocument);
3201
- React42.useEffect(() => {
3202
- if (!node) return;
3203
- if (disableOutsidePointerEvents) {
3204
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
3205
- originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
3206
- ownerDocument.body.style.pointerEvents = "none";
3207
- }
3208
- context.layersWithOutsidePointerEventsDisabled.add(node);
3209
- }
3210
- context.layers.add(node);
3211
- dispatchUpdate();
3212
- return () => {
3213
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
3214
- ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
3215
- }
3216
- };
3217
- }, [node, ownerDocument, disableOutsidePointerEvents, context]);
3218
- React42.useEffect(() => {
3219
- return () => {
3220
- if (!node) return;
3221
- context.layers.delete(node);
3222
- context.layersWithOutsidePointerEventsDisabled.delete(node);
3223
- dispatchUpdate();
3224
- };
3225
- }, [node, context]);
3226
- React42.useEffect(() => {
3227
- const handleUpdate = () => force({});
3228
- document.addEventListener(CONTEXT_UPDATE, handleUpdate);
3229
- return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
3230
- }, []);
3231
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3232
- Primitive.div,
3233
- __spreadProps(__spreadValues({}, layerProps), {
3234
- ref: composedRefs,
3235
- style: __spreadValues({
3236
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0
3237
- }, props.style),
3238
- onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
3239
- onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
3240
- onPointerDownCapture: composeEventHandlers(
3241
- props.onPointerDownCapture,
3242
- pointerDownOutside.onPointerDownCapture
3243
- )
3244
- })
3245
- );
3246
- }
3247
- );
3248
- DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
3249
- var BRANCH_NAME = "DismissableLayerBranch";
3250
- var DismissableLayerBranch = React42.forwardRef((props, forwardedRef) => {
3251
- const context = React42.useContext(DismissableLayerContext);
3252
- const ref = React42.useRef(null);
3253
- const composedRefs = useComposedRefs(forwardedRef, ref);
3254
- React42.useEffect(() => {
3255
- const node = ref.current;
3256
- if (node) {
3257
- context.branches.add(node);
3258
- return () => {
3259
- context.branches.delete(node);
3260
- };
3261
- }
3262
- }, [context.branches]);
3263
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Primitive.div, __spreadProps(__spreadValues({}, props), { ref: composedRefs }));
3264
- });
3265
- DismissableLayerBranch.displayName = BRANCH_NAME;
3266
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
3267
- const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
3268
- const isPointerInsideReactTreeRef = React42.useRef(false);
3269
- const handleClickRef = React42.useRef(() => {
3270
- });
3271
- React42.useEffect(() => {
3272
- const handlePointerDown = (event) => {
3273
- if (event.target && !isPointerInsideReactTreeRef.current) {
3274
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
3275
- handleAndDispatchCustomEvent(
3276
- POINTER_DOWN_OUTSIDE,
3277
- handlePointerDownOutside,
3278
- eventDetail,
3279
- { discrete: true }
3280
- );
3281
- };
3282
- var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
3283
- const eventDetail = { originalEvent: event };
3284
- if (event.pointerType === "touch") {
3285
- ownerDocument.removeEventListener("click", handleClickRef.current);
3286
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
3287
- ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
3288
- } else {
3289
- handleAndDispatchPointerDownOutsideEvent2();
3290
- }
3291
- } else {
3292
- ownerDocument.removeEventListener("click", handleClickRef.current);
3293
- }
3294
- isPointerInsideReactTreeRef.current = false;
3295
- };
3296
- const timerId = window.setTimeout(() => {
3297
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
3298
- }, 0);
3299
- return () => {
3300
- window.clearTimeout(timerId);
3301
- ownerDocument.removeEventListener("pointerdown", handlePointerDown);
3302
- ownerDocument.removeEventListener("click", handleClickRef.current);
3303
- };
3304
- }, [ownerDocument, handlePointerDownOutside]);
3305
- return {
3306
- // ensures we check React component tree (not just DOM tree)
3307
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
3308
- };
3309
- }
3310
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
3311
- const handleFocusOutside = useCallbackRef(onFocusOutside);
3312
- const isFocusInsideReactTreeRef = React42.useRef(false);
3313
- React42.useEffect(() => {
3314
- const handleFocus = (event) => {
3315
- if (event.target && !isFocusInsideReactTreeRef.current) {
3316
- const eventDetail = { originalEvent: event };
3317
- handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
3318
- discrete: false
3319
- });
3320
- }
3321
- };
3322
- ownerDocument.addEventListener("focusin", handleFocus);
3323
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
3324
- }, [ownerDocument, handleFocusOutside]);
3325
- return {
3326
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
3327
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
3328
- };
3329
- }
3330
- function dispatchUpdate() {
3331
- const event = new CustomEvent(CONTEXT_UPDATE);
3332
- document.dispatchEvent(event);
3333
- }
3334
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
3335
- const target = detail.originalEvent.target;
3336
- const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
3337
- if (handler) target.addEventListener(name, handler, { once: true });
3338
- if (discrete) {
3339
- dispatchDiscreteCustomEvent(target, event);
3340
- } else {
3341
- target.dispatchEvent(event);
3342
- }
3343
- }
3344
-
3345
- // ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.3_@types+react@19.1.2__@types+r_1ff7b04b7c975087a2da2b1568ac976e/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
3346
- var React43 = __toESM(require("react"), 1);
3347
- var import_jsx_runtime37 = require("react/jsx-runtime");
3348
- var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
3349
- var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
3350
- var EVENT_OPTIONS = { bubbles: false, cancelable: true };
3351
- var FOCUS_SCOPE_NAME = "FocusScope";
3352
- var FocusScope = React43.forwardRef((props, forwardedRef) => {
3353
- const _a = props, {
3354
- loop = false,
3355
- trapped = false,
3356
- onMountAutoFocus: onMountAutoFocusProp,
3357
- onUnmountAutoFocus: onUnmountAutoFocusProp
3358
- } = _a, scopeProps = __objRest(_a, [
3359
- "loop",
3360
- "trapped",
3361
- "onMountAutoFocus",
3362
- "onUnmountAutoFocus"
3363
- ]);
3364
- const [container, setContainer] = React43.useState(null);
3365
- const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
3366
- const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
3367
- const lastFocusedElementRef = React43.useRef(null);
3368
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
3369
- const focusScope = React43.useRef({
3370
- paused: false,
3371
- pause() {
3372
- this.paused = true;
3373
- },
3374
- resume() {
3375
- this.paused = false;
3376
- }
3377
- }).current;
3378
- React43.useEffect(() => {
3379
- if (trapped) {
3380
- let handleFocusIn2 = function(event) {
3381
- if (focusScope.paused || !container) return;
3382
- const target = event.target;
3383
- if (container.contains(target)) {
3384
- lastFocusedElementRef.current = target;
3385
- } else {
3386
- focus(lastFocusedElementRef.current, { select: true });
3387
- }
3388
- }, handleFocusOut2 = function(event) {
3389
- if (focusScope.paused || !container) return;
3390
- const relatedTarget = event.relatedTarget;
3391
- if (relatedTarget === null) return;
3392
- if (!container.contains(relatedTarget)) {
3393
- focus(lastFocusedElementRef.current, { select: true });
3394
- }
3395
- }, handleMutations2 = function(mutations) {
3396
- const focusedElement = document.activeElement;
3397
- if (focusedElement !== document.body) return;
3398
- for (const mutation of mutations) {
3399
- if (mutation.removedNodes.length > 0) focus(container);
3400
- }
3401
- };
3402
- var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
3403
- document.addEventListener("focusin", handleFocusIn2);
3404
- document.addEventListener("focusout", handleFocusOut2);
3405
- const mutationObserver = new MutationObserver(handleMutations2);
3406
- if (container) mutationObserver.observe(container, { childList: true, subtree: true });
3407
- return () => {
3408
- document.removeEventListener("focusin", handleFocusIn2);
3409
- document.removeEventListener("focusout", handleFocusOut2);
3410
- mutationObserver.disconnect();
3411
- };
3412
- }
3413
- }, [trapped, container, focusScope.paused]);
3414
- React43.useEffect(() => {
3415
- if (container) {
3416
- focusScopesStack.add(focusScope);
3417
- const previouslyFocusedElement = document.activeElement;
3418
- const hasFocusedCandidate = container.contains(previouslyFocusedElement);
3419
- if (!hasFocusedCandidate) {
3420
- const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
3421
- container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
3422
- container.dispatchEvent(mountEvent);
3423
- if (!mountEvent.defaultPrevented) {
3424
- focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
3425
- if (document.activeElement === previouslyFocusedElement) {
3426
- focus(container);
3427
- }
3428
- }
3429
- }
3430
- return () => {
3431
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
3432
- setTimeout(() => {
3433
- const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
3434
- container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
3435
- container.dispatchEvent(unmountEvent);
3436
- if (!unmountEvent.defaultPrevented) {
3437
- focus(previouslyFocusedElement != null ? previouslyFocusedElement : document.body, { select: true });
3438
- }
3439
- container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
3440
- focusScopesStack.remove(focusScope);
3441
- }, 0);
3442
- };
3443
- }
3444
- }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
3445
- const handleKeyDown = React43.useCallback(
3446
- (event) => {
3447
- if (!loop && !trapped) return;
3448
- if (focusScope.paused) return;
3449
- const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
3450
- const focusedElement = document.activeElement;
3451
- if (isTabKey && focusedElement) {
3452
- const container2 = event.currentTarget;
3453
- const [first, last] = getTabbableEdges(container2);
3454
- const hasTabbableElementsInside = first && last;
3455
- if (!hasTabbableElementsInside) {
3456
- if (focusedElement === container2) event.preventDefault();
3457
- } else {
3458
- if (!event.shiftKey && focusedElement === last) {
3459
- event.preventDefault();
3460
- if (loop) focus(first, { select: true });
3461
- } else if (event.shiftKey && focusedElement === first) {
3462
- event.preventDefault();
3463
- if (loop) focus(last, { select: true });
3464
- }
3465
- }
3466
- }
3467
- },
3468
- [loop, trapped, focusScope.paused]
3469
- );
3470
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Primitive.div, __spreadProps(__spreadValues({ tabIndex: -1 }, scopeProps), { ref: composedRefs, onKeyDown: handleKeyDown }));
3471
- });
3472
- FocusScope.displayName = FOCUS_SCOPE_NAME;
3473
- function focusFirst(candidates, { select = false } = {}) {
3474
- const previouslyFocusedElement = document.activeElement;
3475
- for (const candidate of candidates) {
3476
- focus(candidate, { select });
3477
- if (document.activeElement !== previouslyFocusedElement) return;
3478
- }
3479
- }
3480
- function getTabbableEdges(container) {
3481
- const candidates = getTabbableCandidates(container);
3482
- const first = findVisible(candidates, container);
3483
- const last = findVisible(candidates.reverse(), container);
3484
- return [first, last];
3485
- }
3486
- function getTabbableCandidates(container) {
3487
- const nodes = [];
3488
- const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
3489
- acceptNode: (node) => {
3490
- const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
3491
- if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
3492
- return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
3493
- }
3494
- });
3495
- while (walker.nextNode()) nodes.push(walker.currentNode);
3496
- return nodes;
3497
- }
3498
- function findVisible(elements, container) {
3499
- for (const element of elements) {
3500
- if (!isHidden(element, { upTo: container })) return element;
3501
- }
3502
- }
3503
- function isHidden(node, { upTo }) {
3504
- if (getComputedStyle(node).visibility === "hidden") return true;
3505
- while (node) {
3506
- if (upTo !== void 0 && node === upTo) return false;
3507
- if (getComputedStyle(node).display === "none") return true;
3508
- node = node.parentElement;
3509
- }
3510
- return false;
3511
- }
3512
- function isSelectableInput(element) {
3513
- return element instanceof HTMLInputElement && "select" in element;
3514
- }
3515
- function focus(element, { select = false } = {}) {
3516
- if (element && element.focus) {
3517
- const previouslyFocusedElement = document.activeElement;
3518
- element.focus({ preventScroll: true });
3519
- if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
3520
- element.select();
3521
- }
3522
- }
3523
- var focusScopesStack = createFocusScopesStack();
3524
- function createFocusScopesStack() {
3525
- let stack = [];
3526
- return {
3527
- add(focusScope) {
3528
- const activeFocusScope = stack[0];
3529
- if (focusScope !== activeFocusScope) {
3530
- activeFocusScope == null ? void 0 : activeFocusScope.pause();
3531
- }
3532
- stack = arrayRemove(stack, focusScope);
3533
- stack.unshift(focusScope);
3534
- },
3535
- remove(focusScope) {
3536
- var _a;
3537
- stack = arrayRemove(stack, focusScope);
3538
- (_a = stack[0]) == null ? void 0 : _a.resume();
3539
- }
3540
- };
3541
- }
3542
- function arrayRemove(array, item) {
3543
- const updatedArray = [...array];
3544
- const index = updatedArray.indexOf(item);
3545
- if (index !== -1) {
3546
- updatedArray.splice(index, 1);
3547
- }
3548
- return updatedArray;
3549
- }
3550
- function removeLinks(items) {
3551
- return items.filter((item) => item.tagName !== "A");
3552
- }
3553
-
3554
- // ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react@_a0745de0839b0b019298ec068509a840/node_modules/@radix-ui/react-portal/dist/index.mjs
3555
- var React44 = __toESM(require("react"), 1);
3556
- var import_react_dom = __toESM(require("react-dom"), 1);
3557
- var import_jsx_runtime38 = require("react/jsx-runtime");
3558
- var PORTAL_NAME = "Portal";
3559
- var Portal = React44.forwardRef((props, forwardedRef) => {
3560
- var _b;
3561
- const _a = props, { container: containerProp } = _a, portalProps = __objRest(_a, ["container"]);
3562
- const [mounted, setMounted] = React44.useState(false);
3563
- useLayoutEffect2(() => setMounted(true), []);
3564
- const container = containerProp || mounted && ((_b = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _b.body);
3565
- return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Primitive.div, __spreadProps(__spreadValues({}, portalProps), { ref: forwardedRef })), container) : null;
3566
- });
3567
- Portal.displayName = PORTAL_NAME;
3568
-
3569
- // ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.3_@types+react@19.1.2__@types+reac_dbbe976722e7c3e02883ea31c3bbbf14/node_modules/@radix-ui/react-presence/dist/index.mjs
3570
- var React211 = __toESM(require("react"), 1);
3571
- var React45 = __toESM(require("react"), 1);
3572
- function useStateMachine(initialState, machine) {
3573
- return React45.useReducer((state, event) => {
3574
- const nextState = machine[state][event];
3575
- return nextState != null ? nextState : state;
3576
- }, initialState);
3577
- }
3578
- var Presence = (props) => {
3579
- const { present, children } = props;
3580
- const presence = usePresence(present);
3581
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React211.Children.only(children);
3582
- const ref = useComposedRefs(presence.ref, getElementRef2(child));
3583
- const forceMount = typeof children === "function";
3584
- return forceMount || presence.isPresent ? React211.cloneElement(child, { ref }) : null;
3585
- };
3586
- Presence.displayName = "Presence";
3587
- function usePresence(present) {
3588
- const [node, setNode] = React211.useState();
3589
- const stylesRef = React211.useRef(null);
3590
- const prevPresentRef = React211.useRef(present);
3591
- const prevAnimationNameRef = React211.useRef("none");
3592
- const initialState = present ? "mounted" : "unmounted";
3593
- const [state, send] = useStateMachine(initialState, {
3594
- mounted: {
3595
- UNMOUNT: "unmounted",
3596
- ANIMATION_OUT: "unmountSuspended"
3597
- },
3598
- unmountSuspended: {
3599
- MOUNT: "mounted",
3600
- ANIMATION_END: "unmounted"
3601
- },
3602
- unmounted: {
3603
- MOUNT: "mounted"
3604
- }
3605
- });
3606
- React211.useEffect(() => {
3607
- const currentAnimationName = getAnimationName(stylesRef.current);
3608
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
3609
- }, [state]);
3610
- useLayoutEffect2(() => {
3611
- const styles = stylesRef.current;
3612
- const wasPresent = prevPresentRef.current;
3613
- const hasPresentChanged = wasPresent !== present;
3614
- if (hasPresentChanged) {
3615
- const prevAnimationName = prevAnimationNameRef.current;
3616
- const currentAnimationName = getAnimationName(styles);
3617
- if (present) {
3618
- send("MOUNT");
3619
- } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
3620
- send("UNMOUNT");
3621
- } else {
3622
- const isAnimating = prevAnimationName !== currentAnimationName;
3623
- if (wasPresent && isAnimating) {
3624
- send("ANIMATION_OUT");
3625
- } else {
3626
- send("UNMOUNT");
3627
- }
3628
- }
3629
- prevPresentRef.current = present;
3630
- }
3631
- }, [present, send]);
3632
- useLayoutEffect2(() => {
3633
- var _a;
3634
- if (node) {
3635
- let timeoutId;
3636
- const ownerWindow = (_a = node.ownerDocument.defaultView) != null ? _a : window;
3637
- const handleAnimationEnd = (event) => {
3638
- const currentAnimationName = getAnimationName(stylesRef.current);
3639
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
3640
- if (event.target === node && isCurrentAnimation) {
3641
- send("ANIMATION_END");
3642
- if (!prevPresentRef.current) {
3643
- const currentFillMode = node.style.animationFillMode;
3644
- node.style.animationFillMode = "forwards";
3645
- timeoutId = ownerWindow.setTimeout(() => {
3646
- if (node.style.animationFillMode === "forwards") {
3647
- node.style.animationFillMode = currentFillMode;
3648
- }
3649
- });
3650
- }
3651
- }
3652
- };
3653
- const handleAnimationStart = (event) => {
3654
- if (event.target === node) {
3655
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
3656
- }
3657
- };
3658
- node.addEventListener("animationstart", handleAnimationStart);
3659
- node.addEventListener("animationcancel", handleAnimationEnd);
3660
- node.addEventListener("animationend", handleAnimationEnd);
3661
- return () => {
3662
- ownerWindow.clearTimeout(timeoutId);
3663
- node.removeEventListener("animationstart", handleAnimationStart);
3664
- node.removeEventListener("animationcancel", handleAnimationEnd);
3665
- node.removeEventListener("animationend", handleAnimationEnd);
3666
- };
3667
- } else {
3668
- send("ANIMATION_END");
3669
- }
3670
- }, [node, send]);
3671
- return {
3672
- isPresent: ["mounted", "unmountSuspended"].includes(state),
3673
- ref: React211.useCallback((node2) => {
3674
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
3675
- setNode(node2);
3676
- }, [])
3677
- };
3678
- }
3679
- function getAnimationName(styles) {
3680
- return (styles == null ? void 0 : styles.animationName) || "none";
3681
- }
3682
- function getElementRef2(element) {
3683
- var _a, _b;
3684
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
3685
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3686
- if (mayWarn) {
3687
- return element.ref;
3688
- }
3689
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
3690
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3691
- if (mayWarn) {
3692
- return element.props.ref;
3693
- }
3694
- return element.props.ref || element.ref;
3695
- }
3696
-
3697
- // ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
3698
- var React46 = __toESM(require("react"), 1);
3699
- var count2 = 0;
3700
- function useFocusGuards() {
3701
- React46.useEffect(() => {
3702
- var _a, _b;
3703
- const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
3704
- document.body.insertAdjacentElement("afterbegin", (_a = edgeGuards[0]) != null ? _a : createFocusGuard());
3705
- document.body.insertAdjacentElement("beforeend", (_b = edgeGuards[1]) != null ? _b : createFocusGuard());
3706
- count2++;
3707
- return () => {
3708
- if (count2 === 1) {
3709
- document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
3710
- }
3711
- count2--;
3712
- };
3713
- }, []);
3714
- }
3715
- function createFocusGuard() {
3716
- const element = document.createElement("span");
3717
- element.setAttribute("data-radix-focus-guard", "");
3718
- element.tabIndex = 0;
3719
- element.style.outline = "none";
3720
- element.style.opacity = "0";
3721
- element.style.position = "fixed";
3722
- element.style.pointerEvents = "none";
3723
- return element;
3724
- }
3725
-
3726
- // ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
3727
- var __assign = function() {
3728
- __assign = Object.assign || function __assign2(t) {
3729
- for (var s, i = 1, n = arguments.length; i < n; i++) {
3730
- s = arguments[i];
3731
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3732
- }
3733
- return t;
3734
- };
3735
- return __assign.apply(this, arguments);
3736
- };
3737
- function __rest(s, e) {
3738
- var t = {};
3739
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3740
- t[p] = s[p];
3741
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
3742
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3743
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3744
- t[p[i]] = s[p[i]];
3745
- }
3746
- return t;
3747
- }
3748
- function __spreadArray(to, from, pack) {
3749
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3750
- if (ar || !(i in from)) {
3751
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3752
- ar[i] = from[i];
3753
- }
3754
- }
3755
- return to.concat(ar || Array.prototype.slice.call(from));
3756
- }
3757
-
3758
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
3759
- var React53 = __toESM(require("react"));
3760
-
3761
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
3762
- var React49 = __toESM(require("react"));
3763
-
3764
- // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
3765
- var zeroRightClassName = "right-scroll-bar-position";
3766
- var fullWidthClassName = "width-before-scroll-bar";
3767
- var noScrollbarsClassName = "with-scroll-bars-hidden";
3768
- var removedBarSizeVariable = "--removed-body-scroll-bar-size";
3769
-
3770
- // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
3771
- function assignRef(ref, value) {
3772
- if (typeof ref === "function") {
3773
- ref(value);
3774
- } else if (ref) {
3775
- ref.current = value;
3776
- }
3777
- return ref;
3778
- }
3779
-
3780
- // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js
3781
- var import_react35 = require("react");
3782
- function useCallbackRef2(initialValue, callback) {
3783
- var ref = (0, import_react35.useState)(function() {
3784
- return {
3785
- // value
3786
- value: initialValue,
3787
- // last callback
3788
- callback,
3789
- // "memoized" public interface
3790
- facade: {
3791
- get current() {
3792
- return ref.value;
3793
- },
3794
- set current(value) {
3795
- var last = ref.value;
3796
- if (last !== value) {
3797
- ref.value = value;
3798
- ref.callback(value, last);
3799
- }
3800
- }
3801
- }
3802
- };
3803
- })[0];
3804
- ref.callback = callback;
3805
- return ref.facade;
3806
- }
3807
-
3808
- // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
3809
- var React47 = __toESM(require("react"));
3810
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React47.useLayoutEffect : React47.useEffect;
3811
- var currentValues = /* @__PURE__ */ new WeakMap();
3812
- function useMergeRefs(refs, defaultValue) {
3813
- var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
3814
- return refs.forEach(function(ref) {
3815
- return assignRef(ref, newValue);
3816
- });
3817
- });
3818
- useIsomorphicLayoutEffect(function() {
3819
- var oldValue = currentValues.get(callbackRef);
3820
- if (oldValue) {
3821
- var prevRefs_1 = new Set(oldValue);
3822
- var nextRefs_1 = new Set(refs);
3823
- var current_1 = callbackRef.current;
3824
- prevRefs_1.forEach(function(ref) {
3825
- if (!nextRefs_1.has(ref)) {
3826
- assignRef(ref, null);
3827
- }
3828
- });
3829
- nextRefs_1.forEach(function(ref) {
3830
- if (!prevRefs_1.has(ref)) {
3831
- assignRef(ref, current_1);
3832
- }
3833
- });
3834
- }
3835
- currentValues.set(callbackRef, refs);
3836
- }, [refs]);
3837
- return callbackRef;
3838
- }
3839
-
3840
- // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js
3841
- function ItoI(a) {
3842
- return a;
3843
- }
3844
- function innerCreateMedium(defaults, middleware) {
3845
- if (middleware === void 0) {
3846
- middleware = ItoI;
3847
- }
3848
- var buffer = [];
3849
- var assigned = false;
3850
- var medium = {
3851
- read: function() {
3852
- if (assigned) {
3853
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
3854
- }
3855
- if (buffer.length) {
3856
- return buffer[buffer.length - 1];
3857
- }
3858
- return defaults;
3859
- },
3860
- useMedium: function(data) {
3861
- var item = middleware(data, assigned);
3862
- buffer.push(item);
3863
- return function() {
3864
- buffer = buffer.filter(function(x) {
3865
- return x !== item;
3866
- });
3867
- };
3868
- },
3869
- assignSyncMedium: function(cb) {
3870
- assigned = true;
3871
- while (buffer.length) {
3872
- var cbs = buffer;
3873
- buffer = [];
3874
- cbs.forEach(cb);
3875
- }
3876
- buffer = {
3877
- push: function(x) {
3878
- return cb(x);
3879
- },
3880
- filter: function() {
3881
- return buffer;
3882
- }
3883
- };
3884
- },
3885
- assignMedium: function(cb) {
3886
- assigned = true;
3887
- var pendingQueue = [];
3888
- if (buffer.length) {
3889
- var cbs = buffer;
3890
- buffer = [];
3891
- cbs.forEach(cb);
3892
- pendingQueue = buffer;
3893
- }
3894
- var executeQueue = function() {
3895
- var cbs2 = pendingQueue;
3896
- pendingQueue = [];
3897
- cbs2.forEach(cb);
3898
- };
3899
- var cycle = function() {
3900
- return Promise.resolve().then(executeQueue);
3901
- };
3902
- cycle();
3903
- buffer = {
3904
- push: function(x) {
3905
- pendingQueue.push(x);
3906
- cycle();
3907
- },
3908
- filter: function(filter) {
3909
- pendingQueue = pendingQueue.filter(filter);
3910
- return buffer;
3911
- }
3912
- };
3913
- }
3914
- };
3915
- return medium;
3916
- }
3917
- function createSidecarMedium(options) {
3918
- if (options === void 0) {
3919
- options = {};
3920
- }
3921
- var medium = innerCreateMedium(null);
3922
- medium.options = __assign({ async: true, ssr: false }, options);
3923
- return medium;
3924
- }
3925
-
3926
- // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js
3927
- var React48 = __toESM(require("react"));
3928
- var SideCar = function(_a) {
3929
- var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
3930
- if (!sideCar) {
3931
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
3932
- }
3933
- var Target = sideCar.read();
3934
- if (!Target) {
3935
- throw new Error("Sidecar medium not found");
3936
- }
3937
- return React48.createElement(Target, __assign({}, rest));
3938
- };
3939
- SideCar.isSideCarExport = true;
3940
- function exportSidecar(medium, exported) {
3941
- medium.useMedium(exported);
3942
- return SideCar;
3943
- }
3944
-
3945
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js
3946
- var effectCar = createSidecarMedium();
3947
-
3948
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
3949
- var nothing = function() {
3950
- return;
3951
- };
3952
- var RemoveScroll = React49.forwardRef(function(props, parentRef) {
3953
- var ref = React49.useRef(null);
3954
- var _a = React49.useState({
3955
- onScrollCapture: nothing,
3956
- onWheelCapture: nothing,
3957
- onTouchMoveCapture: nothing
3958
- }), callbacks = _a[0], setCallbacks = _a[1];
3959
- var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
3960
- var SideCar2 = sideCar;
3961
- var containerRef = useMergeRefs([ref, parentRef]);
3962
- var containerProps = __assign(__assign({}, rest), callbacks);
3963
- return React49.createElement(
3964
- React49.Fragment,
3965
- null,
3966
- enabled && React49.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
3967
- forwardProps ? React49.cloneElement(React49.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React49.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
3968
- );
3969
- });
3970
- RemoveScroll.defaultProps = {
3971
- enabled: true,
3972
- removeScrollBar: true,
3973
- inert: false
3974
- };
3975
- RemoveScroll.classNames = {
3976
- fullWidth: fullWidthClassName,
3977
- zeroRight: zeroRightClassName
3978
- };
3979
-
3980
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
3981
- var React52 = __toESM(require("react"));
3982
-
3983
- // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
3984
- var React51 = __toESM(require("react"));
3985
-
3986
- // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
3987
- var React50 = __toESM(require("react"));
3988
-
3989
- // ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
3990
- var currentNonce;
3991
- var getNonce = function() {
3992
- if (currentNonce) {
3993
- return currentNonce;
3994
- }
3995
- if (typeof __webpack_nonce__ !== "undefined") {
3996
- return __webpack_nonce__;
3997
- }
3998
- return void 0;
3999
- };
4000
-
4001
- // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js
4002
- function makeStyleTag() {
4003
- if (!document)
4004
- return null;
4005
- var tag = document.createElement("style");
4006
- tag.type = "text/css";
4007
- var nonce = getNonce();
4008
- if (nonce) {
4009
- tag.setAttribute("nonce", nonce);
4010
- }
4011
- return tag;
4012
- }
4013
- function injectStyles(tag, css) {
4014
- if (tag.styleSheet) {
4015
- tag.styleSheet.cssText = css;
4016
- } else {
4017
- tag.appendChild(document.createTextNode(css));
4018
- }
4019
- }
4020
- function insertStyleTag(tag) {
4021
- var head = document.head || document.getElementsByTagName("head")[0];
4022
- head.appendChild(tag);
4023
- }
4024
- var stylesheetSingleton = function() {
4025
- var counter = 0;
4026
- var stylesheet = null;
4027
- return {
4028
- add: function(style) {
4029
- if (counter == 0) {
4030
- if (stylesheet = makeStyleTag()) {
4031
- injectStyles(stylesheet, style);
4032
- insertStyleTag(stylesheet);
4033
- }
4034
- }
4035
- counter++;
4036
- },
4037
- remove: function() {
4038
- counter--;
4039
- if (!counter && stylesheet) {
4040
- stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
4041
- stylesheet = null;
4042
- }
4043
- }
4044
- };
4045
- };
4046
-
4047
- // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
4048
- var styleHookSingleton = function() {
4049
- var sheet = stylesheetSingleton();
4050
- return function(styles, isDynamic) {
4051
- React50.useEffect(function() {
4052
- sheet.add(styles);
4053
- return function() {
4054
- sheet.remove();
4055
- };
4056
- }, [styles && isDynamic]);
4057
- };
4058
- };
4059
-
4060
- // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js
4061
- var styleSingleton = function() {
4062
- var useStyle = styleHookSingleton();
4063
- var Sheet = function(_a) {
4064
- var styles = _a.styles, dynamic = _a.dynamic;
4065
- useStyle(styles, dynamic);
4066
- return null;
4067
- };
4068
- return Sheet;
4069
- };
4070
-
4071
- // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
4072
- var zeroGap = {
4073
- left: 0,
4074
- top: 0,
4075
- right: 0,
4076
- gap: 0
4077
- };
4078
- var parse = function(x) {
4079
- return parseInt(x || "", 10) || 0;
4080
- };
4081
- var getOffset = function(gapMode) {
4082
- var cs = window.getComputedStyle(document.body);
4083
- var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
4084
- var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
4085
- var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
4086
- return [parse(left), parse(top), parse(right)];
4087
- };
4088
- var getGapWidth = function(gapMode) {
4089
- if (gapMode === void 0) {
4090
- gapMode = "margin";
4091
- }
4092
- if (typeof window === "undefined") {
4093
- return zeroGap;
4094
- }
4095
- var offsets = getOffset(gapMode);
4096
- var documentWidth = document.documentElement.clientWidth;
4097
- var windowWidth = window.innerWidth;
4098
- return {
4099
- left: offsets[0],
4100
- top: offsets[1],
4101
- right: offsets[2],
4102
- gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
4103
- };
4104
- };
4105
-
4106
- // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
4107
- var Style = styleSingleton();
4108
- var lockAttribute = "data-scroll-locked";
4109
- var getStyles = function(_a, allowRelative, gapMode, important) {
4110
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
4111
- if (gapMode === void 0) {
4112
- gapMode = "margin";
4113
- }
4114
- return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
4115
- allowRelative && "position: relative ".concat(important, ";"),
4116
- gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
4117
- gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
4118
- ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
4119
- };
4120
- var getCurrentUseCounter = function() {
4121
- var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
4122
- return isFinite(counter) ? counter : 0;
4123
- };
4124
- var useLockAttribute = function() {
4125
- React51.useEffect(function() {
4126
- document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
4127
- return function() {
4128
- var newCounter = getCurrentUseCounter() - 1;
4129
- if (newCounter <= 0) {
4130
- document.body.removeAttribute(lockAttribute);
4131
- } else {
4132
- document.body.setAttribute(lockAttribute, newCounter.toString());
4133
- }
4134
- };
4135
- }, []);
4136
- };
4137
- var RemoveScrollBar = function(_a) {
4138
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
4139
- useLockAttribute();
4140
- var gap = React51.useMemo(function() {
4141
- return getGapWidth(gapMode);
4142
- }, [gapMode]);
4143
- return React51.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
4144
- };
4145
-
4146
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
4147
- var passiveSupported = false;
4148
- if (typeof window !== "undefined") {
4149
- try {
4150
- options = Object.defineProperty({}, "passive", {
4151
- get: function() {
4152
- passiveSupported = true;
4153
- return true;
4154
- }
4155
- });
4156
- window.addEventListener("test", options, options);
4157
- window.removeEventListener("test", options, options);
4158
- } catch (err) {
4159
- passiveSupported = false;
4160
- }
4161
- }
4162
- var options;
4163
- var nonPassive = passiveSupported ? { passive: false } : false;
4164
-
4165
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
4166
- var alwaysContainsScroll = function(node) {
4167
- return node.tagName === "TEXTAREA";
4168
- };
4169
- var elementCanBeScrolled = function(node, overflow) {
4170
- if (!(node instanceof Element)) {
4171
- return false;
4172
- }
4173
- var styles = window.getComputedStyle(node);
4174
- return (
4175
- // not-not-scrollable
4176
- styles[overflow] !== "hidden" && // contains scroll inside self
4177
- !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
4178
- );
4179
- };
4180
- var elementCouldBeVScrolled = function(node) {
4181
- return elementCanBeScrolled(node, "overflowY");
4182
- };
4183
- var elementCouldBeHScrolled = function(node) {
4184
- return elementCanBeScrolled(node, "overflowX");
4185
- };
4186
- var locationCouldBeScrolled = function(axis, node) {
4187
- var ownerDocument = node.ownerDocument;
4188
- var current = node;
4189
- do {
4190
- if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
4191
- current = current.host;
4192
- }
4193
- var isScrollable = elementCouldBeScrolled(axis, current);
4194
- if (isScrollable) {
4195
- var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
4196
- if (scrollHeight > clientHeight) {
4197
- return true;
4198
- }
4199
- }
4200
- current = current.parentNode;
4201
- } while (current && current !== ownerDocument.body);
4202
- return false;
4203
- };
4204
- var getVScrollVariables = function(_a) {
4205
- var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
4206
- return [
4207
- scrollTop,
4208
- scrollHeight,
4209
- clientHeight
4210
- ];
4211
- };
4212
- var getHScrollVariables = function(_a) {
4213
- var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
4214
- return [
4215
- scrollLeft,
4216
- scrollWidth,
4217
- clientWidth
4218
- ];
4219
- };
4220
- var elementCouldBeScrolled = function(axis, node) {
4221
- return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
4222
- };
4223
- var getScrollVariables = function(axis, node) {
4224
- return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
4225
- };
4226
- var getDirectionFactor = function(axis, direction) {
4227
- return axis === "h" && direction === "rtl" ? -1 : 1;
4228
- };
4229
- var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
4230
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
4231
- var delta = directionFactor * sourceDelta;
4232
- var target = event.target;
4233
- var targetInLock = endTarget.contains(target);
4234
- var shouldCancelScroll = false;
4235
- var isDeltaPositive = delta > 0;
4236
- var availableScroll = 0;
4237
- var availableScrollTop = 0;
4238
- do {
4239
- if (!target) {
4240
- break;
4241
- }
4242
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
4243
- var elementScroll = scroll_1 - capacity - directionFactor * position;
4244
- if (position || elementScroll) {
4245
- if (elementCouldBeScrolled(axis, target)) {
4246
- availableScroll += elementScroll;
4247
- availableScrollTop += position;
4248
- }
4249
- }
4250
- var parent_1 = target.parentNode;
4251
- target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
4252
- } while (
4253
- // portaled content
4254
- !targetInLock && target !== document.body || // self content
4255
- targetInLock && (endTarget.contains(target) || endTarget === target)
4256
- );
4257
- if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
4258
- shouldCancelScroll = true;
4259
- } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
4260
- shouldCancelScroll = true;
4261
- }
4262
- return shouldCancelScroll;
4263
- };
4264
-
4265
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
4266
- var getTouchXY = function(event) {
4267
- return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
4268
- };
4269
- var getDeltaXY = function(event) {
4270
- return [event.deltaX, event.deltaY];
4271
- };
4272
- var extractRef = function(ref) {
4273
- return ref && "current" in ref ? ref.current : ref;
4274
- };
4275
- var deltaCompare = function(x, y) {
4276
- return x[0] === y[0] && x[1] === y[1];
4277
- };
4278
- var generateStyle = function(id) {
4279
- return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
4280
- };
4281
- var idCounter = 0;
4282
- var lockStack = [];
4283
- function RemoveScrollSideCar(props) {
4284
- var shouldPreventQueue = React52.useRef([]);
4285
- var touchStartRef = React52.useRef([0, 0]);
4286
- var activeAxis = React52.useRef();
4287
- var id = React52.useState(idCounter++)[0];
4288
- var Style2 = React52.useState(styleSingleton)[0];
4289
- var lastProps = React52.useRef(props);
4290
- React52.useEffect(function() {
4291
- lastProps.current = props;
4292
- }, [props]);
4293
- React52.useEffect(function() {
4294
- if (props.inert) {
4295
- document.body.classList.add("block-interactivity-".concat(id));
4296
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
4297
- allow_1.forEach(function(el) {
4298
- return el.classList.add("allow-interactivity-".concat(id));
4299
- });
4300
- return function() {
4301
- document.body.classList.remove("block-interactivity-".concat(id));
4302
- allow_1.forEach(function(el) {
4303
- return el.classList.remove("allow-interactivity-".concat(id));
4304
- });
4305
- };
4306
- }
4307
- return;
4308
- }, [props.inert, props.lockRef.current, props.shards]);
4309
- var shouldCancelEvent = React52.useCallback(function(event, parent) {
4310
- if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
4311
- return !lastProps.current.allowPinchZoom;
4312
- }
4313
- var touch = getTouchXY(event);
4314
- var touchStart = touchStartRef.current;
4315
- var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
4316
- var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
4317
- var currentAxis;
4318
- var target = event.target;
4319
- var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
4320
- if ("touches" in event && moveDirection === "h" && target.type === "range") {
4321
- return false;
4322
- }
4323
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4324
- if (!canBeScrolledInMainDirection) {
4325
- return true;
4326
- }
4327
- if (canBeScrolledInMainDirection) {
4328
- currentAxis = moveDirection;
4329
- } else {
4330
- currentAxis = moveDirection === "v" ? "h" : "v";
4331
- canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4332
- }
4333
- if (!canBeScrolledInMainDirection) {
4334
- return false;
4335
- }
4336
- if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
4337
- activeAxis.current = currentAxis;
4338
- }
4339
- if (!currentAxis) {
4340
- return true;
4341
- }
4342
- var cancelingAxis = activeAxis.current || currentAxis;
4343
- return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
4344
- }, []);
4345
- var shouldPrevent = React52.useCallback(function(_event) {
4346
- var event = _event;
4347
- if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
4348
- return;
4349
- }
4350
- var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
4351
- var sourceEvent = shouldPreventQueue.current.filter(function(e) {
4352
- return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
4353
- })[0];
4354
- if (sourceEvent && sourceEvent.should) {
4355
- if (event.cancelable) {
4356
- event.preventDefault();
4357
- }
4358
- return;
4359
- }
4360
- if (!sourceEvent) {
4361
- var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
4362
- return node.contains(event.target);
4363
- });
4364
- var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
4365
- if (shouldStop) {
4366
- if (event.cancelable) {
4367
- event.preventDefault();
4368
- }
4369
- }
4370
- }
4371
- }, []);
4372
- var shouldCancel = React52.useCallback(function(name, delta, target, should) {
4373
- var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
4374
- shouldPreventQueue.current.push(event);
4375
- setTimeout(function() {
4376
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
4377
- return e !== event;
4378
- });
4379
- }, 1);
4380
- }, []);
4381
- var scrollTouchStart = React52.useCallback(function(event) {
4382
- touchStartRef.current = getTouchXY(event);
4383
- activeAxis.current = void 0;
4384
- }, []);
4385
- var scrollWheel = React52.useCallback(function(event) {
4386
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4387
- }, []);
4388
- var scrollTouchMove = React52.useCallback(function(event) {
4389
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4390
- }, []);
4391
- React52.useEffect(function() {
4392
- lockStack.push(Style2);
4393
- props.setCallbacks({
4394
- onScrollCapture: scrollWheel,
4395
- onWheelCapture: scrollWheel,
4396
- onTouchMoveCapture: scrollTouchMove
4397
- });
4398
- document.addEventListener("wheel", shouldPrevent, nonPassive);
4399
- document.addEventListener("touchmove", shouldPrevent, nonPassive);
4400
- document.addEventListener("touchstart", scrollTouchStart, nonPassive);
4401
- return function() {
4402
- lockStack = lockStack.filter(function(inst) {
4403
- return inst !== Style2;
4404
- });
4405
- document.removeEventListener("wheel", shouldPrevent, nonPassive);
4406
- document.removeEventListener("touchmove", shouldPrevent, nonPassive);
4407
- document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
4408
- };
4409
- }, []);
4410
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
4411
- return React52.createElement(
4412
- React52.Fragment,
4413
- null,
4414
- inert ? React52.createElement(Style2, { styles: generateStyle(id) }) : null,
4415
- removeScrollBar ? React52.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
4416
- );
4417
- }
4418
- function getOutermostShadowParent(node) {
4419
- var shadowParent = null;
4420
- while (node !== null) {
4421
- if (node instanceof ShadowRoot) {
4422
- shadowParent = node.host;
4423
- node = node.host;
4424
- }
4425
- node = node.parentNode;
4426
- }
4427
- return shadowParent;
4428
- }
4429
-
4430
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
4431
- var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
4432
-
4433
- // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
4434
- var ReactRemoveScroll = React53.forwardRef(function(props, ref) {
4435
- return React53.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
4436
- });
4437
- ReactRemoveScroll.classNames = RemoveScroll.classNames;
4438
- var Combination_default = ReactRemoveScroll;
4439
-
4440
- // ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
4441
- var getDefaultParent = function(originalTarget) {
4442
- if (typeof document === "undefined") {
4443
- return null;
4444
- }
4445
- var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
4446
- return sampleTarget.ownerDocument.body;
4447
- };
4448
- var counterMap = /* @__PURE__ */ new WeakMap();
4449
- var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
4450
- var markerMap = {};
4451
- var lockCount = 0;
4452
- var unwrapHost = function(node) {
4453
- return node && (node.host || unwrapHost(node.parentNode));
4454
- };
4455
- var correctTargets = function(parent, targets) {
4456
- return targets.map(function(target) {
4457
- if (parent.contains(target)) {
4458
- return target;
4459
- }
4460
- var correctedTarget = unwrapHost(target);
4461
- if (correctedTarget && parent.contains(correctedTarget)) {
4462
- return correctedTarget;
4463
- }
4464
- console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
4465
- return null;
4466
- }).filter(function(x) {
4467
- return Boolean(x);
4468
- });
4469
- };
4470
- var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
4471
- var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
4472
- if (!markerMap[markerName]) {
4473
- markerMap[markerName] = /* @__PURE__ */ new WeakMap();
4474
- }
4475
- var markerCounter = markerMap[markerName];
4476
- var hiddenNodes = [];
4477
- var elementsToKeep = /* @__PURE__ */ new Set();
4478
- var elementsToStop = new Set(targets);
4479
- var keep = function(el) {
4480
- if (!el || elementsToKeep.has(el)) {
4481
- return;
4482
- }
4483
- elementsToKeep.add(el);
4484
- keep(el.parentNode);
4485
- };
4486
- targets.forEach(keep);
4487
- var deep = function(parent) {
4488
- if (!parent || elementsToStop.has(parent)) {
4489
- return;
4490
- }
4491
- Array.prototype.forEach.call(parent.children, function(node) {
4492
- if (elementsToKeep.has(node)) {
4493
- deep(node);
4494
- } else {
4495
- try {
4496
- var attr = node.getAttribute(controlAttribute);
4497
- var alreadyHidden = attr !== null && attr !== "false";
4498
- var counterValue = (counterMap.get(node) || 0) + 1;
4499
- var markerValue = (markerCounter.get(node) || 0) + 1;
4500
- counterMap.set(node, counterValue);
4501
- markerCounter.set(node, markerValue);
4502
- hiddenNodes.push(node);
4503
- if (counterValue === 1 && alreadyHidden) {
4504
- uncontrolledNodes.set(node, true);
4505
- }
4506
- if (markerValue === 1) {
4507
- node.setAttribute(markerName, "true");
4508
- }
4509
- if (!alreadyHidden) {
4510
- node.setAttribute(controlAttribute, "true");
4511
- }
4512
- } catch (e) {
4513
- console.error("aria-hidden: cannot operate on ", node, e);
4514
- }
4515
- }
4516
- });
4517
- };
4518
- deep(parentNode);
4519
- elementsToKeep.clear();
4520
- lockCount++;
4521
- return function() {
4522
- hiddenNodes.forEach(function(node) {
4523
- var counterValue = counterMap.get(node) - 1;
4524
- var markerValue = markerCounter.get(node) - 1;
4525
- counterMap.set(node, counterValue);
4526
- markerCounter.set(node, markerValue);
4527
- if (!counterValue) {
4528
- if (!uncontrolledNodes.has(node)) {
4529
- node.removeAttribute(controlAttribute);
4530
- }
4531
- uncontrolledNodes.delete(node);
4532
- }
4533
- if (!markerValue) {
4534
- node.removeAttribute(markerName);
4535
- }
4536
- });
4537
- lockCount--;
4538
- if (!lockCount) {
4539
- counterMap = /* @__PURE__ */ new WeakMap();
4540
- counterMap = /* @__PURE__ */ new WeakMap();
4541
- uncontrolledNodes = /* @__PURE__ */ new WeakMap();
4542
- markerMap = {};
4543
- }
4544
- };
4545
- };
4546
- var hideOthers = function(originalTarget, parentNode, markerName) {
4547
- if (markerName === void 0) {
4548
- markerName = "data-aria-hidden";
4549
- }
4550
- var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
4551
- var activeParentNode = parentNode || getDefaultParent(originalTarget);
4552
- if (!activeParentNode) {
4553
- return function() {
4554
- return null;
4555
- };
4556
- }
4557
- targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
4558
- return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
4559
- };
4560
-
4561
- // ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
4562
- var import_jsx_runtime39 = require("react/jsx-runtime");
4563
- var DIALOG_NAME = "Dialog";
4564
- var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
4565
- var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
4566
- var Dialog = (props) => {
4567
- const {
4568
- __scopeDialog,
4569
- children,
4570
- open: openProp,
4571
- defaultOpen,
4572
- onOpenChange,
4573
- modal = true
4574
- } = props;
4575
- const triggerRef = React54.useRef(null);
4576
- const contentRef = React54.useRef(null);
4577
- const [open, setOpen] = useControllableState({
4578
- prop: openProp,
4579
- defaultProp: defaultOpen != null ? defaultOpen : false,
4580
- onChange: onOpenChange,
4581
- caller: DIALOG_NAME
4582
- });
4583
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4584
- DialogProvider,
4585
- {
4586
- scope: __scopeDialog,
4587
- triggerRef,
4588
- contentRef,
4589
- contentId: useId(),
4590
- titleId: useId(),
4591
- descriptionId: useId(),
4592
- open,
4593
- onOpenChange: setOpen,
4594
- onOpenToggle: React54.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
4595
- modal,
4596
- children
4597
- }
4598
- );
4599
- };
4600
- Dialog.displayName = DIALOG_NAME;
4601
- var TRIGGER_NAME = "DialogTrigger";
4602
- var DialogTrigger = React54.forwardRef(
4603
- (props, forwardedRef) => {
4604
- const _a = props, { __scopeDialog } = _a, triggerProps = __objRest(_a, ["__scopeDialog"]);
4605
- const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
4606
- const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
4607
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4608
- Primitive.button,
4609
- __spreadProps(__spreadValues({
4610
- type: "button",
4611
- "aria-haspopup": "dialog",
4612
- "aria-expanded": context.open,
4613
- "aria-controls": context.contentId,
4614
- "data-state": getState(context.open)
4615
- }, triggerProps), {
4616
- ref: composedTriggerRef,
4617
- onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
4618
- })
4619
- );
4620
- }
4621
- );
4622
- DialogTrigger.displayName = TRIGGER_NAME;
4623
- var PORTAL_NAME2 = "DialogPortal";
4624
- var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
4625
- forceMount: void 0
4626
- });
4627
- var DialogPortal = (props) => {
4628
- const { __scopeDialog, forceMount, children, container } = props;
4629
- const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
4630
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React54.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Portal, { asChild: true, container, children: child }) })) });
4631
- };
4632
- DialogPortal.displayName = PORTAL_NAME2;
4633
- var OVERLAY_NAME = "DialogOverlay";
4634
- var DialogOverlay = React54.forwardRef(
4635
- (props, forwardedRef) => {
4636
- const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
4637
- const _a = props, { forceMount = portalContext.forceMount } = _a, overlayProps = __objRest(_a, ["forceMount"]);
4638
- const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
4639
- return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogOverlayImpl, __spreadProps(__spreadValues({}, overlayProps), { ref: forwardedRef })) }) : null;
4640
- }
4641
- );
4642
- DialogOverlay.displayName = OVERLAY_NAME;
4643
- var Slot2 = createSlot("DialogOverlay.RemoveScroll");
4644
- var DialogOverlayImpl = React54.forwardRef(
4645
- (props, forwardedRef) => {
4646
- const _a = props, { __scopeDialog } = _a, overlayProps = __objRest(_a, ["__scopeDialog"]);
4647
- const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
4648
- return (
4649
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
4650
- // ie. when `Overlay` and `Content` are siblings
4651
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4652
- Primitive.div,
4653
- __spreadProps(__spreadValues({
4654
- "data-state": getState(context.open)
4655
- }, overlayProps), {
4656
- ref: forwardedRef,
4657
- style: __spreadValues({ pointerEvents: "auto" }, overlayProps.style)
4658
- })
4659
- ) })
4660
- );
4661
- }
4662
- );
4663
- var CONTENT_NAME = "DialogContent";
4664
- var DialogContent = React54.forwardRef(
4665
- (props, forwardedRef) => {
4666
- const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
4667
- const _a = props, { forceMount = portalContext.forceMount } = _a, contentProps = __objRest(_a, ["forceMount"]);
4668
- const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
4669
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogContentModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogContentNonModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) });
4670
- }
4671
- );
4672
- DialogContent.displayName = CONTENT_NAME;
4673
- var DialogContentModal = React54.forwardRef(
4674
- (props, forwardedRef) => {
4675
- const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
4676
- const contentRef = React54.useRef(null);
4677
- const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
4678
- React54.useEffect(() => {
4679
- const content = contentRef.current;
4680
- if (content) return hideOthers(content);
4681
- }, []);
4682
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4683
- DialogContentImpl,
4684
- __spreadProps(__spreadValues({}, props), {
4685
- ref: composedRefs,
4686
- trapFocus: context.open,
4687
- disableOutsidePointerEvents: true,
4688
- onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
4689
- var _a;
4690
- event.preventDefault();
4691
- (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
4692
- }),
4693
- onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
4694
- const originalEvent = event.detail.originalEvent;
4695
- const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
4696
- const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
4697
- if (isRightClick) event.preventDefault();
4698
- }),
4699
- onFocusOutside: composeEventHandlers(
4700
- props.onFocusOutside,
4701
- (event) => event.preventDefault()
4702
- )
4703
- })
4704
- );
4705
- }
4706
- );
4707
- var DialogContentNonModal = React54.forwardRef(
4708
- (props, forwardedRef) => {
4709
- const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
4710
- const hasInteractedOutsideRef = React54.useRef(false);
4711
- const hasPointerDownOutsideRef = React54.useRef(false);
4712
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4713
- DialogContentImpl,
4714
- __spreadProps(__spreadValues({}, props), {
4715
- ref: forwardedRef,
4716
- trapFocus: false,
4717
- disableOutsidePointerEvents: false,
4718
- onCloseAutoFocus: (event) => {
4719
- var _a, _b;
4720
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
4721
- if (!event.defaultPrevented) {
4722
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
4723
- event.preventDefault();
4724
- }
4725
- hasInteractedOutsideRef.current = false;
4726
- hasPointerDownOutsideRef.current = false;
4727
- },
4728
- onInteractOutside: (event) => {
4729
- var _a, _b;
4730
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
4731
- if (!event.defaultPrevented) {
4732
- hasInteractedOutsideRef.current = true;
4733
- if (event.detail.originalEvent.type === "pointerdown") {
4734
- hasPointerDownOutsideRef.current = true;
4735
- }
4736
- }
4737
- const target = event.target;
4738
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
4739
- if (targetIsTrigger) event.preventDefault();
4740
- if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
4741
- event.preventDefault();
4742
- }
4743
- }
4744
- })
4745
- );
4746
- }
4747
- );
4748
- var DialogContentImpl = React54.forwardRef(
4749
- (props, forwardedRef) => {
4750
- const _a = props, { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus } = _a, contentProps = __objRest(_a, ["__scopeDialog", "trapFocus", "onOpenAutoFocus", "onCloseAutoFocus"]);
4751
- const context = useDialogContext(CONTENT_NAME, __scopeDialog);
4752
- const contentRef = React54.useRef(null);
4753
- const composedRefs = useComposedRefs(forwardedRef, contentRef);
4754
- useFocusGuards();
4755
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
4756
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4757
- FocusScope,
4758
- {
4759
- asChild: true,
4760
- loop: true,
4761
- trapped: trapFocus,
4762
- onMountAutoFocus: onOpenAutoFocus,
4763
- onUnmountAutoFocus: onCloseAutoFocus,
4764
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4765
- DismissableLayer,
4766
- __spreadProps(__spreadValues({
4767
- role: "dialog",
4768
- id: context.contentId,
4769
- "aria-describedby": context.descriptionId,
4770
- "aria-labelledby": context.titleId,
4771
- "data-state": getState(context.open)
4772
- }, contentProps), {
4773
- ref: composedRefs,
4774
- onDismiss: () => context.onOpenChange(false)
4775
- })
4776
- )
4777
- }
4778
- ),
4779
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
4780
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TitleWarning, { titleId: context.titleId }),
4781
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
4782
- ] })
4783
- ] });
4784
- }
4785
- );
4786
- var TITLE_NAME = "DialogTitle";
4787
- var DialogTitle = React54.forwardRef(
4788
- (props, forwardedRef) => {
4789
- const _a = props, { __scopeDialog } = _a, titleProps = __objRest(_a, ["__scopeDialog"]);
4790
- const context = useDialogContext(TITLE_NAME, __scopeDialog);
4791
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Primitive.h2, __spreadProps(__spreadValues({ id: context.titleId }, titleProps), { ref: forwardedRef }));
4792
- }
4793
- );
4794
- DialogTitle.displayName = TITLE_NAME;
4795
- var DESCRIPTION_NAME = "DialogDescription";
4796
- var DialogDescription = React54.forwardRef(
4797
- (props, forwardedRef) => {
4798
- const _a = props, { __scopeDialog } = _a, descriptionProps = __objRest(_a, ["__scopeDialog"]);
4799
- const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
4800
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Primitive.p, __spreadProps(__spreadValues({ id: context.descriptionId }, descriptionProps), { ref: forwardedRef }));
4801
- }
4802
- );
4803
- DialogDescription.displayName = DESCRIPTION_NAME;
4804
- var CLOSE_NAME = "DialogClose";
4805
- var DialogClose = React54.forwardRef(
4806
- (props, forwardedRef) => {
4807
- const _a = props, { __scopeDialog } = _a, closeProps = __objRest(_a, ["__scopeDialog"]);
4808
- const context = useDialogContext(CLOSE_NAME, __scopeDialog);
4809
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4810
- Primitive.button,
4811
- __spreadProps(__spreadValues({
4812
- type: "button"
4813
- }, closeProps), {
4814
- ref: forwardedRef,
4815
- onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
4816
- })
4817
- );
4818
- }
4819
- );
4820
- DialogClose.displayName = CLOSE_NAME;
4821
- function getState(open) {
4822
- return open ? "open" : "closed";
4823
- }
4824
- var TITLE_WARNING_NAME = "DialogTitleWarning";
4825
- var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
4826
- contentName: CONTENT_NAME,
4827
- titleName: TITLE_NAME,
4828
- docsSlug: "dialog"
4829
- });
4830
- var TitleWarning = ({ titleId }) => {
4831
- const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
4832
- const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
4833
-
4834
- If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
4835
-
4836
- For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
4837
- React54.useEffect(() => {
4838
- if (titleId) {
4839
- const hasTitle = document.getElementById(titleId);
4840
- if (!hasTitle) console.error(MESSAGE);
4841
- }
4842
- }, [MESSAGE, titleId]);
4843
- return null;
4844
- };
4845
- var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
4846
- var DescriptionWarning = ({ contentRef, descriptionId }) => {
4847
- const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
4848
- const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
4849
- React54.useEffect(() => {
4850
- var _a;
4851
- const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
4852
- if (descriptionId && describedById) {
4853
- const hasDescription = document.getElementById(descriptionId);
4854
- if (!hasDescription) console.warn(MESSAGE);
4855
- }
4856
- }, [MESSAGE, contentRef, descriptionId]);
4857
- return null;
4858
- };
4859
- var Root = Dialog;
4860
- var Trigger = DialogTrigger;
4861
- var Portal2 = DialogPortal;
4862
- var Overlay = DialogOverlay;
4863
- var Content = DialogContent;
4864
- var Title = DialogTitle;
4865
- var Description = DialogDescription;
4866
- var Close = DialogClose;
4867
-
4868
- // ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
4869
- var import_jsx_runtime40 = require("react/jsx-runtime");
4870
- var ROOT_NAME = "AlertDialog";
4871
- var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
4872
- createDialogScope
4873
- ]);
4874
- var useDialogScope = createDialogScope();
4875
- var AlertDialog = (props) => {
4876
- const _a = props, { __scopeAlertDialog } = _a, alertDialogProps = __objRest(_a, ["__scopeAlertDialog"]);
4877
- const dialogScope = useDialogScope(__scopeAlertDialog);
4878
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Root, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), alertDialogProps), { modal: true }));
4879
- };
4880
- AlertDialog.displayName = ROOT_NAME;
4881
- var TRIGGER_NAME2 = "AlertDialogTrigger";
4882
- var AlertDialogTrigger = React55.forwardRef(
4883
- (props, forwardedRef) => {
4884
- const _a = props, { __scopeAlertDialog } = _a, triggerProps = __objRest(_a, ["__scopeAlertDialog"]);
4885
- const dialogScope = useDialogScope(__scopeAlertDialog);
4886
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Trigger, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), triggerProps), { ref: forwardedRef }));
4887
- }
4888
- );
4889
- AlertDialogTrigger.displayName = TRIGGER_NAME2;
4890
- var PORTAL_NAME3 = "AlertDialogPortal";
4891
- var AlertDialogPortal = (props) => {
4892
- const _a = props, { __scopeAlertDialog } = _a, portalProps = __objRest(_a, ["__scopeAlertDialog"]);
4893
- const dialogScope = useDialogScope(__scopeAlertDialog);
4894
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Portal2, __spreadValues(__spreadValues({}, dialogScope), portalProps));
4895
- };
4896
- AlertDialogPortal.displayName = PORTAL_NAME3;
4897
- var OVERLAY_NAME2 = "AlertDialogOverlay";
4898
- var AlertDialogOverlay = React55.forwardRef(
4899
- (props, forwardedRef) => {
4900
- const _a = props, { __scopeAlertDialog } = _a, overlayProps = __objRest(_a, ["__scopeAlertDialog"]);
4901
- const dialogScope = useDialogScope(__scopeAlertDialog);
4902
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Overlay, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), overlayProps), { ref: forwardedRef }));
4903
- }
4904
- );
4905
- AlertDialogOverlay.displayName = OVERLAY_NAME2;
4906
- var CONTENT_NAME2 = "AlertDialogContent";
4907
- var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME2);
4908
- var Slottable = createSlottable("AlertDialogContent");
4909
- var AlertDialogContent = React55.forwardRef(
4910
- (props, forwardedRef) => {
4911
- const _a = props, { __scopeAlertDialog, children } = _a, contentProps = __objRest(_a, ["__scopeAlertDialog", "children"]);
4912
- const dialogScope = useDialogScope(__scopeAlertDialog);
4913
- const contentRef = React55.useRef(null);
4914
- const composedRefs = useComposedRefs(forwardedRef, contentRef);
4915
- const cancelRef = React55.useRef(null);
4916
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4917
- WarningProvider,
4918
- {
4919
- contentName: CONTENT_NAME2,
4920
- titleName: TITLE_NAME2,
4921
- docsSlug: "alert-dialog",
4922
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4923
- Content,
4924
- __spreadProps(__spreadValues(__spreadValues({
4925
- role: "alertdialog"
4926
- }, dialogScope), contentProps), {
4927
- ref: composedRefs,
4928
- onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
4929
- var _a2;
4930
- event.preventDefault();
4931
- (_a2 = cancelRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
4932
- }),
4933
- onPointerDownOutside: (event) => event.preventDefault(),
4934
- onInteractOutside: (event) => event.preventDefault(),
4935
- children: [
4936
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Slottable, { children }),
4937
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DescriptionWarning2, { contentRef })
4938
- ]
4939
- })
4940
- ) })
4941
- }
4942
- );
4943
- }
4944
- );
4945
- AlertDialogContent.displayName = CONTENT_NAME2;
4946
- var TITLE_NAME2 = "AlertDialogTitle";
4947
- var AlertDialogTitle = React55.forwardRef(
4948
- (props, forwardedRef) => {
4949
- const _a = props, { __scopeAlertDialog } = _a, titleProps = __objRest(_a, ["__scopeAlertDialog"]);
4950
- const dialogScope = useDialogScope(__scopeAlertDialog);
4951
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Title, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), titleProps), { ref: forwardedRef }));
4952
- }
4953
- );
4954
- AlertDialogTitle.displayName = TITLE_NAME2;
4955
- var DESCRIPTION_NAME2 = "AlertDialogDescription";
4956
- var AlertDialogDescription = React55.forwardRef((props, forwardedRef) => {
4957
- const _a = props, { __scopeAlertDialog } = _a, descriptionProps = __objRest(_a, ["__scopeAlertDialog"]);
4958
- const dialogScope = useDialogScope(__scopeAlertDialog);
4959
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Description, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), descriptionProps), { ref: forwardedRef }));
4960
- });
4961
- AlertDialogDescription.displayName = DESCRIPTION_NAME2;
4962
- var ACTION_NAME = "AlertDialogAction";
4963
- var AlertDialogAction = React55.forwardRef(
4964
- (props, forwardedRef) => {
4965
- const _a = props, { __scopeAlertDialog } = _a, actionProps = __objRest(_a, ["__scopeAlertDialog"]);
4966
- const dialogScope = useDialogScope(__scopeAlertDialog);
4967
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Close, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), actionProps), { ref: forwardedRef }));
4968
- }
4969
- );
4970
- AlertDialogAction.displayName = ACTION_NAME;
4971
- var CANCEL_NAME = "AlertDialogCancel";
4972
- var AlertDialogCancel = React55.forwardRef(
4973
- (props, forwardedRef) => {
4974
- const _a = props, { __scopeAlertDialog } = _a, cancelProps = __objRest(_a, ["__scopeAlertDialog"]);
4975
- const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
4976
- const dialogScope = useDialogScope(__scopeAlertDialog);
4977
- const ref = useComposedRefs(forwardedRef, cancelRef);
4978
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Close, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), cancelProps), { ref }));
4979
- }
4980
- );
4981
- AlertDialogCancel.displayName = CANCEL_NAME;
4982
- var DescriptionWarning2 = ({ contentRef }) => {
4983
- const MESSAGE = `\`${CONTENT_NAME2}\` requires a description for the component to be accessible for screen reader users.
4984
-
4985
- You can add a description to the \`${CONTENT_NAME2}\` by passing a \`${DESCRIPTION_NAME2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4986
-
4987
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME2}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
4988
-
4989
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
4990
- React55.useEffect(() => {
4991
- var _a;
4992
- const hasDescription = document.getElementById(
4993
- (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby")
4994
- );
4995
- if (!hasDescription) console.warn(MESSAGE);
4996
- }, [MESSAGE, contentRef]);
4997
- return null;
4998
- };
4999
- var Root2 = AlertDialog;
5000
- var Portal22 = AlertDialogPortal;
5001
- var Overlay2 = AlertDialogOverlay;
5002
- var Content2 = AlertDialogContent;
5003
- var Action = AlertDialogAction;
5004
- var Cancel = AlertDialogCancel;
5005
- var Title2 = AlertDialogTitle;
5006
- var Description2 = AlertDialogDescription;
5007
-
5008
- // ../lib/src/utils.ts
5009
- var import_clsx = require("clsx");
5010
- var import_tailwind_merge = require("tailwind-merge");
5011
- function cn(...inputs) {
5012
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
5013
- }
5014
-
5015
- // ../base-ui/src/ui/button.tsx
5016
- var React56 = __toESM(require("react"), 1);
5017
- var import_class_variance_authority = require("class-variance-authority");
5018
- var import_jsx_runtime41 = require("react/jsx-runtime");
5019
- var buttonVariants = (0, import_class_variance_authority.cva)(
5020
- "inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
5021
- {
5022
- variants: {
5023
- variant: {
5024
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
5025
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
5026
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
5027
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
5028
- ghost: "hover:bg-accent hover:text-accent-foreground",
5029
- link: "text-primary underline-offset-4 hover:underline"
5030
- },
5031
- size: {
5032
- default: "h-10 px-4 py-2",
5033
- sm: "h-9 rounded-md px-3",
5034
- lg: "h-11 rounded-md px-8",
5035
- icon: "h-10 w-10"
5036
- }
5037
- },
5038
- defaultVariants: {
5039
- variant: "default",
5040
- size: "default"
5041
- }
5042
- }
5043
- );
5044
- var Button = React56.forwardRef(
5045
- (_a, ref) => {
5046
- var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
5047
- const Comp = asChild ? Slot : "button";
5048
- if (asChild) {
5049
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5050
- Comp,
5051
- __spreadProps(__spreadValues({
5052
- className: cn(buttonVariants({ variant, size, className })),
5053
- ref,
5054
- disabled: loading || props.disabled
5055
- }, props), {
5056
- children
5057
- })
5058
- );
5059
- }
5060
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
5061
- Comp,
5062
- __spreadProps(__spreadValues({
5063
- className: cn(buttonVariants({ variant, size, className })),
5064
- ref,
5065
- disabled: loading || props.disabled
5066
- }, props), {
5067
- children: [
5068
- children,
5069
- loading && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
5070
- ]
5071
- })
5072
- );
5073
- }
5074
- );
5075
- Button.displayName = "Button";
5076
-
5077
- // ../base-ui/src/ui/alert-dialog.tsx
5078
- var import_jsx_runtime42 = require("react/jsx-runtime");
5079
- var AlertDialog2 = Root2;
5080
- var AlertDialogPortal2 = Portal22;
5081
- var AlertDialogOverlay2 = React57.forwardRef((_a, ref) => {
5082
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5083
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5084
- Overlay2,
5085
- __spreadProps(__spreadValues({
5086
- className: cn(
5087
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
5088
- className
5089
- )
5090
- }, props), {
5091
- ref
5092
- })
5093
- );
5094
- });
5095
- AlertDialogOverlay2.displayName = Overlay2.displayName;
5096
- var AlertDialogContent2 = React57.forwardRef((_a, ref) => {
5097
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5098
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(AlertDialogPortal2, { children: [
5099
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(AlertDialogOverlay2, {}),
5100
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5101
- Content2,
5102
- __spreadValues({
5103
- ref,
5104
- className: cn(
5105
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
5106
- className
5107
- )
5108
- }, props)
5109
- )
5110
- ] });
5111
- });
5112
- AlertDialogContent2.displayName = Content2.displayName;
5113
- var AlertDialogHeader = (_a) => {
5114
- var _b = _a, {
5115
- className
5116
- } = _b, props = __objRest(_b, [
5117
- "className"
5118
- ]);
5119
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5120
- "div",
5121
- __spreadValues({
5122
- className: cn(
5123
- "flex flex-col space-y-2 text-center sm:text-left",
5124
- className
5125
- )
5126
- }, props)
5127
- );
5128
- };
5129
- AlertDialogHeader.displayName = "AlertDialogHeader";
5130
- var AlertDialogFooter = (_a) => {
5131
- var _b = _a, {
5132
- className
5133
- } = _b, props = __objRest(_b, [
5134
- "className"
5135
- ]);
5136
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5137
- "div",
5138
- __spreadValues({
5139
- className: cn(
5140
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
5141
- className
5142
- )
5143
- }, props)
5144
- );
5145
- };
5146
- AlertDialogFooter.displayName = "AlertDialogFooter";
5147
- var AlertDialogTitle2 = React57.forwardRef((_a, ref) => {
5148
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5149
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5150
- Title2,
5151
- __spreadValues({
5152
- ref,
5153
- className: cn("text-lg font-semibold", className)
5154
- }, props)
5155
- );
5156
- });
5157
- AlertDialogTitle2.displayName = Title2.displayName;
5158
- var AlertDialogDescription2 = React57.forwardRef((_a, ref) => {
5159
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5160
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5161
- Description2,
5162
- __spreadValues({
5163
- ref,
5164
- className: cn("text-sm text-muted-foreground", className)
5165
- }, props)
5166
- );
5167
- });
5168
- AlertDialogDescription2.displayName = Description2.displayName;
5169
- var AlertDialogAction2 = React57.forwardRef((_a, ref) => {
5170
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5171
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5172
- Action,
5173
- __spreadValues({
5174
- ref,
5175
- className: cn(buttonVariants(), className)
5176
- }, props)
5177
- );
5178
- });
5179
- AlertDialogAction2.displayName = Action.displayName;
5180
- var AlertDialogCancel2 = React57.forwardRef((_a, ref) => {
5181
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5182
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5183
- Cancel,
5184
- __spreadValues({
5185
- ref,
5186
- className: cn(
5187
- buttonVariants({ variant: "outline" }),
5188
- "mt-2 sm:mt-0",
5189
- className
5190
- )
5191
- }, props)
5192
- );
5193
- });
5194
- AlertDialogCancel2.displayName = Cancel.displayName;
5195
-
5196
2740
  // src/fuma/mdx/mermaid.tsx
5197
2741
  var import_next_themes = require("next-themes");
5198
- var import_react36 = require("react");
5199
- var import_jsx_runtime43 = require("react/jsx-runtime");
2742
+ var import_react35 = require("react");
2743
+ var import_jsx_runtime33 = require("react/jsx-runtime");
5200
2744
  function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview = true }) {
5201
- const id = (0, import_react36.useId)();
5202
- const [svg, setSvg] = (0, import_react36.useState)("");
2745
+ const id = (0, import_react35.useId)();
2746
+ const [svg, setSvg] = (0, import_react35.useState)("");
5203
2747
  const { resolvedTheme } = (0, import_next_themes.useTheme)();
5204
- const [open, setOpen] = (0, import_react36.useState)(false);
5205
- const [scale, setScale] = (0, import_react36.useState)(1);
5206
- const [translate, setTranslate] = (0, import_react36.useState)({ x: 0, y: 0 });
5207
- const isPanningRef = (0, import_react36.useRef)(false);
5208
- const startPointRef = (0, import_react36.useRef)({ x: 0, y: 0 });
5209
- const startTranslateRef = (0, import_react36.useRef)({ x: 0, y: 0 });
5210
- (0, import_react36.useEffect)(() => {
2748
+ const [open, setOpen] = (0, import_react35.useState)(false);
2749
+ const [scale, setScale] = (0, import_react35.useState)(1);
2750
+ const [translate, setTranslate] = (0, import_react35.useState)({ x: 0, y: 0 });
2751
+ const isPanningRef = (0, import_react35.useRef)(false);
2752
+ const startPointRef = (0, import_react35.useRef)({ x: 0, y: 0 });
2753
+ const startTranslateRef = (0, import_react35.useRef)({ x: 0, y: 0 });
2754
+ (0, import_react35.useEffect)(() => {
5211
2755
  let isMounted = true;
5212
2756
  void renderChart();
5213
2757
  function renderChart() {
@@ -5242,14 +2786,14 @@ function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview
5242
2786
  };
5243
2787
  }, [chart, id, resolvedTheme, watermarkEnabled, watermarkText]);
5244
2788
  const clamp = (v, min, max) => Math.min(Math.max(v, min), max);
5245
- const resetTransform = (0, import_react36.useCallback)(() => {
2789
+ const resetTransform = (0, import_react35.useCallback)(() => {
5246
2790
  setScale(1);
5247
2791
  setTranslate({ x: 0, y: 0 });
5248
2792
  }, []);
5249
- const zoomBy = (0, import_react36.useCallback)((delta) => {
2793
+ const zoomBy = (0, import_react35.useCallback)((delta) => {
5250
2794
  setScale((prev) => clamp(prev + delta, 0.25, 6));
5251
2795
  }, []);
5252
- const onWheel = (0, import_react36.useCallback)((e) => {
2796
+ const onWheel = (0, import_react35.useCallback)((e) => {
5253
2797
  if (e.metaKey || e.ctrlKey) {
5254
2798
  e.preventDefault();
5255
2799
  const delta = e.deltaY > 0 ? -0.1 : 0.1;
@@ -5258,125 +2802,139 @@ function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview
5258
2802
  setTranslate((prev) => ({ x: prev.x, y: prev.y - e.deltaY }));
5259
2803
  }
5260
2804
  }, []);
5261
- const onPointerDown = (0, import_react36.useCallback)((e) => {
2805
+ const onPointerDown = (0, import_react35.useCallback)((e) => {
5262
2806
  isPanningRef.current = true;
5263
2807
  startPointRef.current = { x: e.clientX, y: e.clientY };
5264
2808
  startTranslateRef.current = __spreadValues({}, translate);
5265
2809
  e.currentTarget.setPointerCapture(e.pointerId);
5266
2810
  }, [translate]);
5267
- const onPointerMove = (0, import_react36.useCallback)((e) => {
2811
+ const onPointerMove = (0, import_react35.useCallback)((e) => {
5268
2812
  if (!isPanningRef.current) return;
5269
2813
  const dx = e.clientX - startPointRef.current.x;
5270
2814
  const dy = e.clientY - startPointRef.current.y;
5271
2815
  setTranslate({ x: startTranslateRef.current.x + dx, y: startTranslateRef.current.y + dy });
5272
2816
  }, []);
5273
- const onPointerUp = (0, import_react36.useCallback)((e) => {
2817
+ const onPointerUp = (0, import_react35.useCallback)((e) => {
5274
2818
  isPanningRef.current = false;
5275
2819
  e.currentTarget.releasePointerCapture(e.pointerId);
5276
2820
  }, []);
5277
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
5278
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2821
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
2822
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
5279
2823
  "div",
5280
2824
  {
5281
2825
  className: enablePreview ? "group relative cursor-zoom-in" : void 0,
5282
2826
  onClick: () => enablePreview && svg && setOpen(true),
5283
2827
  children: [
5284
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { dangerouslySetInnerHTML: { __html: svg } }),
5285
- enablePreview && svg && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "pointer-events-none absolute right-2 top-2 hidden rounded bg-black/50 px-2 py-0.5 text-[12px] text-white group-hover:block", children: "Preview Chart" })
2828
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { dangerouslySetInnerHTML: { __html: svg } }),
2829
+ enablePreview && svg && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pointer-events-none absolute right-2 top-2 hidden rounded bg-black/50 px-2 py-0.5 text-[12px] text-white group-hover:block", children: "Preview Chart" })
5286
2830
  ]
5287
2831
  }
5288
2832
  ),
5289
- title && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2833
+ title && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
5290
2834
  "div",
5291
2835
  {
5292
2836
  className: "mt-2 flex items-center justify-center text-center text-[13px] font-italic text-[#AC62FD]",
5293
2837
  children: [
5294
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(globalLucideIcons.Mmd, { className: "mr-1 h-4 w-4" }),
5295
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: title })
2838
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(globalLucideIcons.Mmd, { className: "mr-1 h-4 w-4" }),
2839
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: title })
5296
2840
  ]
5297
2841
  }
5298
2842
  ),
5299
- enablePreview && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AlertDialog2, { open, onOpenChange: (o) => {
5300
- setOpen(o);
5301
- if (!o) resetTransform();
5302
- }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(AlertDialogContent2, { className: "z-50 max-w-[95vw] w-[95vw] h-[88vh] p-0 bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700", children: [
5303
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AlertDialogTitle2, { className: "sr-only", children: title != null ? title : "Mermaid Preview" }),
5304
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-200 dark:border-neutral-700", children: [
5305
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-2 text-sm text-neutral-600 dark:text-neutral-300", children: [
5306
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(globalLucideIcons.Mmd, { className: "h-4 w-4" }),
5307
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "truncate max-w-[50vw]", children: title != null ? title : "Mermaid Preview" })
5308
- ] }),
5309
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-0.5", children: [
5310
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5311
- "button",
5312
- {
5313
- "aria-label": "Zoom out",
5314
- className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
5315
- onClick: () => zoomBy(-0.2),
5316
- children: "\uFF0D"
5317
- }
5318
- ),
5319
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "mx-0.5 text-[12px] w-12 text-center select-none", children: [
5320
- Math.round(scale * 100),
5321
- "%"
5322
- ] }),
5323
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5324
- "button",
5325
- {
5326
- "aria-label": "Zoom in",
5327
- className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
5328
- onClick: () => zoomBy(0.2),
5329
- children: "\uFF0B"
5330
- }
5331
- ),
5332
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5333
- "button",
5334
- {
5335
- "aria-label": "Reset",
5336
- className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
5337
- onClick: resetTransform,
5338
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(globalLucideIcons.RefreshCcw, { className: "h-3.5 w-3.5" })
5339
- }
5340
- ),
5341
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5342
- "button",
5343
- {
5344
- "aria-label": "Close",
5345
- className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
5346
- onClick: () => setOpen(false),
5347
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(globalLucideIcons.X, { className: "h-3.5 w-3.5" })
5348
- }
5349
- )
5350
- ] })
5351
- ] }),
5352
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
5353
- "div",
5354
- {
5355
- className: "relative h-[calc(88vh-40px)] w-full overflow-hidden bg-white dark:bg-neutral-900",
5356
- onWheel,
5357
- onPointerDown,
5358
- onPointerMove,
5359
- onPointerUp,
5360
- children: [
5361
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5362
- "div",
5363
- {
5364
- className: "absolute left-1/2 top-1/2",
5365
- style: { transform: `translate(-50%, -50%) translate(${translate.x}px, ${translate.y}px)` },
5366
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5367
- "div",
2843
+ enablePreview && open && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2844
+ "div",
2845
+ {
2846
+ role: "dialog",
2847
+ "aria-modal": "true",
2848
+ "aria-label": typeof title === "string" ? title : "Mermaid Preview",
2849
+ className: "fixed inset-0 z-[9999] flex items-center justify-center",
2850
+ children: [
2851
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute inset-0 bg-black/60", onClick: () => {
2852
+ setOpen(false);
2853
+ resetTransform();
2854
+ } }),
2855
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative z-[1] max-w-[95vw] w-[95vw] h-[88vh] p-0 bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-md shadow-2xl overflow-hidden", children: [
2856
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-200 dark:border-neutral-700", children: [
2857
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 text-sm text-neutral-600 dark:text-neutral-300", children: [
2858
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(globalLucideIcons.Mmd, { className: "h-4 w-4" }),
2859
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate max-w-[50vw]", children: title != null ? title : "Mermaid Preview" })
2860
+ ] }),
2861
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-0.5", children: [
2862
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2863
+ "button",
2864
+ {
2865
+ "aria-label": "Zoom out",
2866
+ className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
2867
+ onClick: () => zoomBy(-0.2),
2868
+ children: "\uFF0D"
2869
+ }
2870
+ ),
2871
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "mx-0.5 text-[12px] w-12 text-center select-none", children: [
2872
+ Math.round(scale * 100),
2873
+ "%"
2874
+ ] }),
2875
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2876
+ "button",
5368
2877
  {
5369
- style: { transform: `scale(${scale})`, transformOrigin: "50% 50%" },
5370
- dangerouslySetInnerHTML: { __html: svg }
2878
+ "aria-label": "Zoom in",
2879
+ className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
2880
+ onClick: () => zoomBy(0.2),
2881
+ children: "\uFF0B"
2882
+ }
2883
+ ),
2884
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2885
+ "button",
2886
+ {
2887
+ "aria-label": "Reset",
2888
+ className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
2889
+ onClick: resetTransform,
2890
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(globalLucideIcons.RefreshCcw, { className: "h-3.5 w-3.5" })
2891
+ }
2892
+ ),
2893
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2894
+ "button",
2895
+ {
2896
+ "aria-label": "Close",
2897
+ className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
2898
+ onClick: () => {
2899
+ setOpen(false);
2900
+ resetTransform();
2901
+ },
2902
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(globalLucideIcons.X, { className: "h-3.5 w-3.5" })
5371
2903
  }
5372
2904
  )
2905
+ ] })
2906
+ ] }),
2907
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2908
+ "div",
2909
+ {
2910
+ className: "relative h-[calc(88vh-40px)] w-full overflow-hidden bg-white dark:bg-neutral-900",
2911
+ onWheel,
2912
+ onPointerDown,
2913
+ onPointerMove,
2914
+ onPointerUp,
2915
+ children: [
2916
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2917
+ "div",
2918
+ {
2919
+ className: "absolute left-1/2 top-1/2",
2920
+ style: { transform: `translate(-50%, -50%) translate(${translate.x}px, ${translate.y}px)` },
2921
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2922
+ "div",
2923
+ {
2924
+ style: { transform: `scale(${scale})`, transformOrigin: "50% 50%" },
2925
+ dangerouslySetInnerHTML: { __html: svg }
2926
+ }
2927
+ )
2928
+ }
2929
+ ),
2930
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pointer-events-none absolute bottom-2 right-3 rounded bg-black/40 px-2 py-1 text-xs text-white", children: "Drag to pan, hold Cmd/Ctrl + scroll to zoom" })
2931
+ ]
5373
2932
  }
5374
- ),
5375
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "pointer-events-none absolute bottom-2 right-3 rounded bg-black/40 px-2 py-1 text-xs text-white", children: "Drag to pan, hold Cmd/Ctrl + scroll to zoom" })
5376
- ]
5377
- }
5378
- )
5379
- ] }) })
2933
+ )
2934
+ ] })
2935
+ ]
2936
+ }
2937
+ )
5380
2938
  ] });
5381
2939
  }
5382
2940
  function addWatermarkToSvg(svg, watermark) {
@@ -5399,9 +2957,9 @@ function addWatermarkToSvg(svg, watermark) {
5399
2957
 
5400
2958
  // src/fuma/mdx/image-zoom.tsx
5401
2959
  var import_framework = require("fumadocs-core/framework");
5402
- var import_react37 = require("react");
2960
+ var import_react36 = require("react");
5403
2961
  var import_react_medium_image_zoom = __toESM(require("react-medium-image-zoom"));
5404
- var import_jsx_runtime44 = require("react/jsx-runtime");
2962
+ var import_jsx_runtime34 = require("react/jsx-runtime");
5405
2963
  function getImageSrc(src) {
5406
2964
  if (typeof src === "string") return src;
5407
2965
  if (typeof src === "object") {
@@ -5424,14 +2982,14 @@ function ImageZoom(_a) {
5424
2982
  "fallbackSrc"
5425
2983
  ]);
5426
2984
  var _a2;
5427
- const [imgSrc, setImgSrc] = (0, import_react37.useState)(getImageSrc(props.src));
2985
+ const [imgSrc, setImgSrc] = (0, import_react36.useState)(getImageSrc(props.src));
5428
2986
  const handleError = () => {
5429
2987
  console.warn("ImageZoom check error:", imgSrc, fallbackSrc);
5430
2988
  if (imgSrc !== fallbackSrc) {
5431
2989
  setImgSrc(fallbackSrc);
5432
2990
  }
5433
2991
  };
5434
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2992
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5435
2993
  import_react_medium_image_zoom.default,
5436
2994
  __spreadProps(__spreadValues({
5437
2995
  zoomMargin: 20,
@@ -5443,7 +3001,7 @@ function ImageZoom(_a) {
5443
3001
  }, zoomInProps), {
5444
3002
  onError: handleError
5445
3003
  }),
5446
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3004
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5447
3005
  import_framework.Image,
5448
3006
  __spreadProps(__spreadValues({}, props), {
5449
3007
  src: imgSrc,
@@ -5460,36 +3018,36 @@ function ImageZoom(_a) {
5460
3018
  }
5461
3019
 
5462
3020
  // src/fuma/mdx/trophy-card.tsx
5463
- var import_jsx_runtime45 = require("react/jsx-runtime");
3021
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5464
3022
  function TrophyCard({
5465
- icon = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(globalLucideIcons.Star, {}),
3023
+ icon = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.Star, {}),
5466
3024
  title,
5467
3025
  children
5468
3026
  }) {
5469
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3027
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
5470
3028
  "div",
5471
3029
  {
5472
3030
  className: "\n border-2 rounded-xl px-4 py-2\n border-purple-200 dark:border-gray-500\n ",
5473
3031
  children: [
5474
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center font-bold text-sm", children: [
5475
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "mr-2", children: icon }),
5476
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: title })
3032
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center font-bold text-sm", children: [
3033
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "mr-2", children: icon }),
3034
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: title })
5477
3035
  ] }),
5478
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "text-sm -mt-1 leading-none", children })
3036
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "text-sm -mt-1 leading-none", children })
5479
3037
  ]
5480
3038
  }
5481
3039
  );
5482
3040
  }
5483
3041
 
5484
3042
  // src/fuma/mdx/image-grid.tsx
5485
- var import_jsx_runtime46 = require("react/jsx-runtime");
3043
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5486
3044
  function ImageGrid({
5487
3045
  type = "url",
5488
3046
  images,
5489
3047
  altPrefix = "",
5490
3048
  cdnBaseUrl
5491
3049
  }) {
5492
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3050
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5493
3051
  "div",
5494
3052
  {
5495
3053
  style: {
@@ -5499,7 +3057,7 @@ function ImageGrid({
5499
3057
  justifyItems: "center",
5500
3058
  alignItems: "center"
5501
3059
  },
5502
- children: images.map((img, idx) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3060
+ children: images.map((img, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5503
3061
  ImageZoom,
5504
3062
  {
5505
3063
  src: img.startsWith("http://") || img.startsWith("https://") ? img : type === "url" ? `${cdnBaseUrl == null ? void 0 : cdnBaseUrl.replace(/\/+$/, "")}/${img.replace(/^\/+/, "")}` : img,
@@ -5511,15 +3069,22 @@ function ImageGrid({
5511
3069
  );
5512
3070
  }
5513
3071
 
3072
+ // ../lib/src/utils.ts
3073
+ var import_clsx = require("clsx");
3074
+ var import_tailwind_merge = require("tailwind-merge");
3075
+ function cn(...inputs) {
3076
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
3077
+ }
3078
+
5514
3079
  // src/fuma/mdx/zia-card.tsx
5515
3080
  var import_link2 = __toESM(require("next/link"));
5516
- var import_jsx_runtime47 = require("react/jsx-runtime");
3081
+ var import_jsx_runtime37 = require("react/jsx-runtime");
5517
3082
  function ZiaCard(_a) {
5518
3083
  var _b = _a, { icon, title, description } = _b, props = __objRest(_b, ["icon", "title", "description"]);
5519
3084
  const validHref = typeof props.href === "string" && props.href.trim() !== "";
5520
3085
  const validDescription = typeof description === "string" && (description == null ? void 0 : description.trim()) !== "";
5521
3086
  if (validHref) {
5522
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
3087
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
5523
3088
  import_link2.default,
5524
3089
  __spreadProps(__spreadValues({
5525
3090
  href: props.href,
@@ -5531,15 +3096,15 @@ function ZiaCard(_a) {
5531
3096
  )
5532
3097
  }, props), {
5533
3098
  children: [
5534
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(globalLucideIcons.CircleSmall, {}) }),
5535
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
5536
- validDescription ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
5537
- props.children ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
3099
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(globalLucideIcons.CircleSmall, {}) }),
3100
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
3101
+ validDescription ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
3102
+ props.children ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
5538
3103
  ]
5539
3104
  })
5540
3105
  );
5541
3106
  }
5542
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
3107
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
5543
3108
  "div",
5544
3109
  __spreadProps(__spreadValues({
5545
3110
  "data-card": true,
@@ -5549,19 +3114,207 @@ function ZiaCard(_a) {
5549
3114
  )
5550
3115
  }, props), {
5551
3116
  children: [
5552
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(globalLucideIcons.CircleSmall, {}) }),
5553
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
5554
- validDescription ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
5555
- props.children ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
3117
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(globalLucideIcons.CircleSmall, {}) }),
3118
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
3119
+ validDescription ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
3120
+ props.children ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
5556
3121
  ]
5557
3122
  })
5558
3123
  );
5559
3124
  }
5560
3125
 
3126
+ // ../base-ui/src/ui/button.tsx
3127
+ var React35 = __toESM(require("react"), 1);
3128
+
3129
+ // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
3130
+ var React34 = __toESM(require("react"), 1);
3131
+
3132
+ // ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
3133
+ var React33 = __toESM(require("react"), 1);
3134
+ function setRef(ref, value) {
3135
+ if (typeof ref === "function") {
3136
+ return ref(value);
3137
+ } else if (ref !== null && ref !== void 0) {
3138
+ ref.current = value;
3139
+ }
3140
+ }
3141
+ function composeRefs(...refs) {
3142
+ return (node) => {
3143
+ let hasCleanup = false;
3144
+ const cleanups = refs.map((ref) => {
3145
+ const cleanup = setRef(ref, node);
3146
+ if (!hasCleanup && typeof cleanup == "function") {
3147
+ hasCleanup = true;
3148
+ }
3149
+ return cleanup;
3150
+ });
3151
+ if (hasCleanup) {
3152
+ return () => {
3153
+ for (let i = 0; i < cleanups.length; i++) {
3154
+ const cleanup = cleanups[i];
3155
+ if (typeof cleanup == "function") {
3156
+ cleanup();
3157
+ } else {
3158
+ setRef(refs[i], null);
3159
+ }
3160
+ }
3161
+ };
3162
+ }
3163
+ };
3164
+ }
3165
+
3166
+ // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
3167
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3168
+ // @__NO_SIDE_EFFECTS__
3169
+ function createSlot(ownerName) {
3170
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
3171
+ const Slot2 = React34.forwardRef((props, forwardedRef) => {
3172
+ const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
3173
+ const childrenArray = React34.Children.toArray(children);
3174
+ const slottable = childrenArray.find(isSlottable);
3175
+ if (slottable) {
3176
+ const newElement = slottable.props.children;
3177
+ const newChildren = childrenArray.map((child) => {
3178
+ if (child === slottable) {
3179
+ if (React34.Children.count(newElement) > 1) return React34.Children.only(null);
3180
+ return React34.isValidElement(newElement) ? newElement.props.children : null;
3181
+ } else {
3182
+ return child;
3183
+ }
3184
+ });
3185
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
3186
+ }
3187
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
3188
+ });
3189
+ Slot2.displayName = `${ownerName}.Slot`;
3190
+ return Slot2;
3191
+ }
3192
+ var Slot = /* @__PURE__ */ createSlot("Slot");
3193
+ // @__NO_SIDE_EFFECTS__
3194
+ function createSlotClone(ownerName) {
3195
+ const SlotClone = React34.forwardRef((props, forwardedRef) => {
3196
+ const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
3197
+ if (React34.isValidElement(children)) {
3198
+ const childrenRef = getElementRef(children);
3199
+ const props2 = mergeProps(slotProps, children.props);
3200
+ if (children.type !== React34.Fragment) {
3201
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
3202
+ }
3203
+ return React34.cloneElement(children, props2);
3204
+ }
3205
+ return React34.Children.count(children) > 1 ? React34.Children.only(null) : null;
3206
+ });
3207
+ SlotClone.displayName = `${ownerName}.SlotClone`;
3208
+ return SlotClone;
3209
+ }
3210
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
3211
+ function isSlottable(child) {
3212
+ return React34.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
3213
+ }
3214
+ function mergeProps(slotProps, childProps) {
3215
+ const overrideProps = __spreadValues({}, childProps);
3216
+ for (const propName in childProps) {
3217
+ const slotPropValue = slotProps[propName];
3218
+ const childPropValue = childProps[propName];
3219
+ const isHandler = /^on[A-Z]/.test(propName);
3220
+ if (isHandler) {
3221
+ if (slotPropValue && childPropValue) {
3222
+ overrideProps[propName] = (...args) => {
3223
+ const result = childPropValue(...args);
3224
+ slotPropValue(...args);
3225
+ return result;
3226
+ };
3227
+ } else if (slotPropValue) {
3228
+ overrideProps[propName] = slotPropValue;
3229
+ }
3230
+ } else if (propName === "style") {
3231
+ overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
3232
+ } else if (propName === "className") {
3233
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
3234
+ }
3235
+ }
3236
+ return __spreadValues(__spreadValues({}, slotProps), overrideProps);
3237
+ }
3238
+ function getElementRef(element) {
3239
+ var _a, _b;
3240
+ let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
3241
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3242
+ if (mayWarn) {
3243
+ return element.ref;
3244
+ }
3245
+ getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
3246
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3247
+ if (mayWarn) {
3248
+ return element.props.ref;
3249
+ }
3250
+ return element.props.ref || element.ref;
3251
+ }
3252
+
3253
+ // ../base-ui/src/ui/button.tsx
3254
+ var import_class_variance_authority = require("class-variance-authority");
3255
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3256
+ var buttonVariants = (0, import_class_variance_authority.cva)(
3257
+ "inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
3258
+ {
3259
+ variants: {
3260
+ variant: {
3261
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
3262
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
3263
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
3264
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
3265
+ ghost: "hover:bg-accent hover:text-accent-foreground",
3266
+ link: "text-primary underline-offset-4 hover:underline"
3267
+ },
3268
+ size: {
3269
+ default: "h-10 px-4 py-2",
3270
+ sm: "h-9 rounded-md px-3",
3271
+ lg: "h-11 rounded-md px-8",
3272
+ icon: "h-10 w-10"
3273
+ }
3274
+ },
3275
+ defaultVariants: {
3276
+ variant: "default",
3277
+ size: "default"
3278
+ }
3279
+ }
3280
+ );
3281
+ var Button = React35.forwardRef(
3282
+ (_a, ref) => {
3283
+ var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
3284
+ const Comp = asChild ? Slot : "button";
3285
+ if (asChild) {
3286
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3287
+ Comp,
3288
+ __spreadProps(__spreadValues({
3289
+ className: cn(buttonVariants({ variant, size, className })),
3290
+ ref,
3291
+ disabled: loading || props.disabled
3292
+ }, props), {
3293
+ children
3294
+ })
3295
+ );
3296
+ }
3297
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3298
+ Comp,
3299
+ __spreadProps(__spreadValues({
3300
+ className: cn(buttonVariants({ variant, size, className })),
3301
+ ref,
3302
+ disabled: loading || props.disabled
3303
+ }, props), {
3304
+ children: [
3305
+ children,
3306
+ loading && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
3307
+ ]
3308
+ })
3309
+ );
3310
+ }
3311
+ );
3312
+ Button.displayName = "Button";
3313
+
5561
3314
  // src/fuma/mdx/gradient-button.tsx
5562
3315
  var import_link3 = __toESM(require("next/link"));
5563
- var import_react38 = __toESM(require("react"));
5564
- var import_jsx_runtime48 = require("react/jsx-runtime");
3316
+ var import_react37 = __toESM(require("react"));
3317
+ var import_jsx_runtime40 = require("react/jsx-runtime");
5565
3318
  function GradientButton({
5566
3319
  title,
5567
3320
  icon,
@@ -5574,7 +3327,7 @@ function GradientButton({
5574
3327
  loadingText,
5575
3328
  preventDoubleClick = true
5576
3329
  }) {
5577
- const [isLoading, setIsLoading] = (0, import_react38.useState)(false);
3330
+ const [isLoading, setIsLoading] = (0, import_react37.useState)(false);
5578
3331
  const actualLoadingText = loadingText || (title == null ? void 0 : title.toString().trim()) || "Loading...";
5579
3332
  const getAlignmentClass = () => {
5580
3333
  switch (align) {
@@ -5609,15 +3362,15 @@ function GradientButton({
5609
3362
  });
5610
3363
  const isDisabled = disabled || isLoading;
5611
3364
  const displayTitle = isLoading ? actualLoadingText : title;
5612
- const displayIcon = isLoading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(globalLucideIcons.Loader2, { className: "h-4 w-4 text-white animate-spin" }) : icon ? import_react38.default.cloneElement(icon, {
3365
+ const displayIcon = isLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(globalLucideIcons.Loader2, { className: "h-4 w-4 text-white animate-spin" }) : icon ? import_react37.default.cloneElement(icon, {
5613
3366
  className: "h-4 w-4 text-white"
5614
- }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(globalLucideIcons.ArrowRight, { className: "h-4 w-4 text-white" });
5615
- const buttonContent = onClick ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: displayIcon }),
5617
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ml-1", children: displayTitle })
5618
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
5619
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: displayTitle }),
5620
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ml-1", children: displayIcon })
3367
+ }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(globalLucideIcons.ArrowRight, { className: "h-4 w-4 text-white" });
3368
+ const buttonContent = onClick ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
3369
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: displayIcon }),
3370
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ml-1", children: displayTitle })
3371
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
3372
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: displayTitle }),
3373
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ml-1", children: displayIcon })
5621
3374
  ] });
5622
3375
  const buttonClassName = `
5623
3376
  bg-gradient-to-r
@@ -5631,9 +3384,9 @@ function GradientButton({
5631
3384
  ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}
5632
3385
  ${className}
5633
3386
  `;
5634
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: `flex flex-col sm:flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
3387
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `flex flex-col sm:flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
5635
3388
  // for click
5636
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3389
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5637
3390
  Button,
5638
3391
  {
5639
3392
  size: "lg",
@@ -5645,14 +3398,14 @@ function GradientButton({
5645
3398
  )
5646
3399
  ) : (
5647
3400
  // for Link
5648
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3401
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5649
3402
  Button,
5650
3403
  {
5651
3404
  asChild: true,
5652
3405
  size: "lg",
5653
3406
  className: buttonClassName,
5654
3407
  disabled: isDisabled,
5655
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3408
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5656
3409
  import_link3.default,
5657
3410
  __spreadProps(__spreadValues({
5658
3411
  href: href || "#",
@@ -5668,14 +3421,14 @@ function GradientButton({
5668
3421
  }
5669
3422
 
5670
3423
  // src/fuma/mdx/toc-base.tsx
5671
- var import_react39 = require("react");
3424
+ var import_react38 = require("react");
5672
3425
  var import_navigation = require("next/navigation");
5673
3426
  var import_use_copy_button = require("fumadocs-ui/utils/use-copy-button");
5674
3427
  var import_link4 = __toESM(require("fumadocs-core/link"));
5675
- var import_jsx_runtime49 = require("react/jsx-runtime");
3428
+ var import_jsx_runtime41 = require("react/jsx-runtime");
5676
3429
  var cache = /* @__PURE__ */ new Map();
5677
3430
  function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
5678
- const [isLoading, setLoading] = (0, import_react39.useState)(false);
3431
+ const [isLoading, setLoading] = (0, import_react38.useState)(false);
5679
3432
  const params = (0, import_navigation.useParams)();
5680
3433
  const locale = params.locale;
5681
3434
  const slug = params.slug;
@@ -5710,7 +3463,7 @@ function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
5710
3463
  setLoading(false);
5711
3464
  }
5712
3465
  }));
5713
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3466
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5714
3467
  Button,
5715
3468
  {
5716
3469
  variant: "ghost",
@@ -5718,32 +3471,32 @@ function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
5718
3471
  loading: isLoading,
5719
3472
  className: "justify-start px-0 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300",
5720
3473
  onClick,
5721
- children: checked ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
5722
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(globalLucideIcons.Check, {}),
3474
+ children: checked ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
3475
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.Check, {}),
5723
3476
  "Copied!"
5724
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
5725
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(globalLucideIcons.Markdown, {}),
3477
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
3478
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.Markdown, {}),
5726
3479
  "Copy page as Markdown"
5727
3480
  ] })
5728
3481
  }
5729
3482
  );
5730
3483
  }
5731
3484
  function EditOnGitHub({ url }) {
5732
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
3485
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
5733
3486
  import_link4.default,
5734
3487
  {
5735
3488
  className: "flex items-center gap-x-2 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300 text-sm",
5736
3489
  href: url,
5737
3490
  children: [
5738
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(globalLucideIcons.GitHub, {}),
3491
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.GitHub, {}),
5739
3492
  "Edit this page on GitHub"
5740
3493
  ]
5741
3494
  }
5742
3495
  );
5743
3496
  }
5744
3497
  function LastUpdatedDate({ date }) {
5745
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
5746
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(globalLucideIcons.LastUpdated, {}),
3498
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
3499
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.LastUpdated, {}),
5747
3500
  "Lastest on ",
5748
3501
  date ? date : "Ages ago"
5749
3502
  ] });
@@ -5754,8 +3507,8 @@ var import_next_intl = require("next-intl");
5754
3507
 
5755
3508
  // src/fuma/mdx/banner.tsx
5756
3509
  var import_class_variance_authority2 = require("class-variance-authority");
5757
- var import_react40 = require("react");
5758
- var import_jsx_runtime50 = require("react/jsx-runtime");
3510
+ var import_react39 = require("react");
3511
+ var import_jsx_runtime42 = require("react/jsx-runtime");
5759
3512
  var buttonVariants2 = (0, import_class_variance_authority2.cva)(
5760
3513
  "inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50",
5761
3514
  {
@@ -5786,15 +3539,15 @@ function Banner(_a) {
5786
3539
  "changeLayout",
5787
3540
  "height"
5788
3541
  ]);
5789
- const [open, setOpen] = (0, import_react40.useState)(true);
3542
+ const [open, setOpen] = (0, import_react39.useState)(true);
5790
3543
  const globalKey = id ? `nd-banner-${id}` : null;
5791
3544
  const bannerHeight = `${height}rem`;
5792
3545
  const headerStartHeight = `${height + 5.5}rem`;
5793
- (0, import_react40.useEffect)(() => {
3546
+ (0, import_react39.useEffect)(() => {
5794
3547
  if (globalKey) setOpen(localStorage.getItem(globalKey) !== "true");
5795
3548
  }, [globalKey]);
5796
3549
  if (!open) return null;
5797
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
3550
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
5798
3551
  "div",
5799
3552
  __spreadProps(__spreadValues({
5800
3553
  id
@@ -5819,8 +3572,8 @@ function Banner(_a) {
5819
3572
  borderRadius: 0
5820
3573
  },
5821
3574
  children: [
5822
- globalKey ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
5823
- globalKey ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3575
+ globalKey ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
3576
+ globalKey ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5824
3577
  "script",
5825
3578
  {
5826
3579
  dangerouslySetInnerHTML: {
@@ -5830,7 +3583,7 @@ function Banner(_a) {
5830
3583
  ) : null,
5831
3584
  variant === "rainbow" ? rainbowLayer : null,
5832
3585
  props.children,
5833
- id ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3586
+ id ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5834
3587
  "button",
5835
3588
  {
5836
3589
  type: "button",
@@ -5846,7 +3599,7 @@ function Banner(_a) {
5846
3599
  size: "icon"
5847
3600
  })
5848
3601
  ),
5849
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(globalLucideIcons.X, {})
3602
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(globalLucideIcons.X, {})
5850
3603
  }
5851
3604
  ) : null
5852
3605
  ]
@@ -5854,8 +3607,8 @@ function Banner(_a) {
5854
3607
  );
5855
3608
  }
5856
3609
  var maskImage = "linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)";
5857
- var rainbowLayer = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
5858
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3610
+ var rainbowLayer = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
3611
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5859
3612
  "div",
5860
3613
  {
5861
3614
  className: "absolute inset-0 z-[-1]",
@@ -5874,7 +3627,7 @@ var rainbowLayer = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_run
5874
3627
  }
5875
3628
  }
5876
3629
  ),
5877
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3630
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5878
3631
  "div",
5879
3632
  {
5880
3633
  className: "absolute inset-0 z-[-1]",
@@ -5892,19 +3645,19 @@ var rainbowLayer = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_run
5892
3645
  }
5893
3646
  }
5894
3647
  ),
5895
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("style", { children: `@keyframes fd-moving-banner {
3648
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("style", { children: `@keyframes fd-moving-banner {
5896
3649
  from { background-position: 0% 0; }
5897
3650
  to { background-position: 100% 0; }
5898
3651
  }` })
5899
3652
  ] });
5900
3653
 
5901
3654
  // src/fuma/mdx/fuma-banner-suit.tsx
5902
- var import_jsx_runtime51 = require("react/jsx-runtime");
3655
+ var import_jsx_runtime43 = require("react/jsx-runtime");
5903
3656
  function FumaBannerSuit({ showBanner }) {
5904
3657
  const t = (0, import_next_intl.useTranslations)("home");
5905
3658
  const heightValue = showBanner ? 3 : 0.5;
5906
3659
  const height = `${heightValue}rem`;
5907
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: showBanner ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-xl", children: t("banner") }) }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3660
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: showBanner ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-xl", children: t("banner") }) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5908
3661
  "div",
5909
3662
  {
5910
3663
  className: "fixed top-0 left-0 w-screen z-[1001] m-0 rounded-none bg-neutral-100 dark:bg-neutral-900",
@@ -5918,19 +3671,19 @@ function FumaBannerSuit({ showBanner }) {
5918
3671
  }
5919
3672
 
5920
3673
  // src/fuma/mdx/fuma-github-info.tsx
5921
- var import_react41 = require("react");
5922
- var import_jsx_runtime52 = require("react/jsx-runtime");
3674
+ var import_react40 = require("react");
3675
+ var import_jsx_runtime44 = require("react/jsx-runtime");
5923
3676
  function GitHubInfoSkeleton({ owner, repo, className }) {
5924
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 lg:flex-row lg:items-center animate-pulse ${className}`, children: [
5925
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-2", children: [
5926
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "size-3.5 bg-fd-muted rounded" }),
5927
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "h-4 bg-fd-muted rounded w-20" })
3677
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 lg:flex-row lg:items-center animate-pulse ${className}`, children: [
3678
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
3679
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "size-3.5 bg-fd-muted rounded" }),
3680
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "h-4 bg-fd-muted rounded w-20" })
5928
3681
  ] }),
5929
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "h-3 bg-fd-muted rounded w-8" })
3682
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "h-3 bg-fd-muted rounded w-8" })
5930
3683
  ] });
5931
3684
  }
5932
3685
  function GitHubInfoFallback({ owner, repo, className }) {
5933
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
3686
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5934
3687
  "a",
5935
3688
  {
5936
3689
  href: `https://github.com/${owner}/${repo}`,
@@ -5938,17 +3691,17 @@ function GitHubInfoFallback({ owner, repo, className }) {
5938
3691
  target: "_blank",
5939
3692
  className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
5940
3693
  children: [
5941
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
5942
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
5943
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("title", { children: "GitHub" }),
5944
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
3694
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
3695
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
3696
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("title", { children: "GitHub" }),
3697
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
5945
3698
  ] }),
5946
3699
  owner,
5947
3700
  "/",
5948
3701
  repo
5949
3702
  ] }),
5950
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
5951
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(globalLucideIcons.ExternalLink, { className: "size-3" }),
3703
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
3704
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(globalLucideIcons.ExternalLink, { className: "size-3" }),
5952
3705
  "GitHub"
5953
3706
  ] })
5954
3707
  ]
@@ -5962,7 +3715,7 @@ function GitHubInfoSuccess({
5962
3715
  className
5963
3716
  }) {
5964
3717
  const humanizedStars = humanizeNumber(stars);
5965
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
3718
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5966
3719
  "a",
5967
3720
  {
5968
3721
  href: `https://github.com/${owner}/${repo}`,
@@ -5970,17 +3723,17 @@ function GitHubInfoSuccess({
5970
3723
  target: "_blank",
5971
3724
  className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
5972
3725
  children: [
5973
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
5974
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
5975
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("title", { children: "GitHub" }),
5976
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
3726
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
3727
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
3728
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("title", { children: "GitHub" }),
3729
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
5977
3730
  ] }),
5978
3731
  owner,
5979
3732
  "/",
5980
3733
  repo
5981
3734
  ] }),
5982
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
5983
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(globalLucideIcons.Star, { className: "size-3" }),
3735
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
3736
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(globalLucideIcons.Star, { className: "size-3" }),
5984
3737
  humanizedStars
5985
3738
  ] })
5986
3739
  ]
@@ -6002,10 +3755,10 @@ function humanizeNumber(num) {
6002
3755
  return num.toString();
6003
3756
  }
6004
3757
  function FumaGithubInfo({ owner, repo, token, className }) {
6005
- const [data, setData] = (0, import_react41.useState)(null);
6006
- const [loading, setLoading] = (0, import_react41.useState)(true);
6007
- const [error, setError] = (0, import_react41.useState)(null);
6008
- (0, import_react41.useEffect)(() => {
3758
+ const [data, setData] = (0, import_react40.useState)(null);
3759
+ const [loading, setLoading] = (0, import_react40.useState)(true);
3760
+ const [error, setError] = (0, import_react40.useState)(null);
3761
+ (0, import_react40.useEffect)(() => {
6009
3762
  const fetchRepoData = () => __async(null, null, function* () {
6010
3763
  try {
6011
3764
  setLoading(true);
@@ -6049,12 +3802,12 @@ function FumaGithubInfo({ owner, repo, token, className }) {
6049
3802
  fetchRepoData();
6050
3803
  }, [owner, repo, token]);
6051
3804
  if (loading) {
6052
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(GitHubInfoSkeleton, { owner, repo, className });
3805
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(GitHubInfoSkeleton, { owner, repo, className });
6053
3806
  }
6054
3807
  if (error || !data) {
6055
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(GitHubInfoFallback, { owner, repo, className });
3808
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(GitHubInfoFallback, { owner, repo, className });
6056
3809
  }
6057
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3810
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6058
3811
  GitHubInfoSuccess,
6059
3812
  {
6060
3813
  owner,
@@ -6067,7 +3820,7 @@ function FumaGithubInfo({ owner, repo, token, className }) {
6067
3820
 
6068
3821
  // src/fuma/mdx/site-x.tsx
6069
3822
  var import_next_intl2 = require("next-intl");
6070
- var import_jsx_runtime53 = require("react/jsx-runtime");
3823
+ var import_jsx_runtime45 = require("react/jsx-runtime");
6071
3824
  function SiteX(_a) {
6072
3825
  var _b = _a, { type, namespace, tKey, className } = _b, props = __objRest(_b, ["type", "namespace", "tKey", "className"]);
6073
3826
  let ns = namespace;
@@ -6081,7 +3834,7 @@ function SiteX(_a) {
6081
3834
  const t = (0, import_next_intl2.useTranslations)(ns);
6082
3835
  const text = t(key, { defaultValue: type === "site" ? "Site----" : "----@example.com" });
6083
3836
  if (type === "site") {
6084
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3837
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
6085
3838
  "strong",
6086
3839
  __spreadProps(__spreadValues({}, props), {
6087
3840
  className: cn(
@@ -6093,7 +3846,7 @@ function SiteX(_a) {
6093
3846
  );
6094
3847
  }
6095
3848
  if (type === "email") {
6096
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3849
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
6097
3850
  "a",
6098
3851
  __spreadProps(__spreadValues({}, props), {
6099
3852
  href: `mailto:${text}`,
@@ -6109,16 +3862,16 @@ function SiteX(_a) {
6109
3862
  }
6110
3863
 
6111
3864
  // src/fuma/mdx/zia-file.tsx
6112
- var import_react42 = require("react");
3865
+ var import_react41 = require("react");
6113
3866
  var import_collapsible = require("fumadocs-ui/components/ui/collapsible");
6114
3867
  var import_link5 = __toESM(require("next/link"));
6115
- var import_jsx_runtime54 = require("react/jsx-runtime");
3868
+ var import_jsx_runtime46 = require("react/jsx-runtime");
6116
3869
  var itemVariants = "flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4";
6117
3870
  var anotionClass = "ms-2 px-2 py-0.5 rounded text-xs font-semibold bg-fd-accent/80 text-fd-accent-foreground dark:bg-white/20 dark:text-white";
6118
3871
  function ZiaFile(_a) {
6119
3872
  var _b = _a, {
6120
3873
  name,
6121
- icon = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(globalLucideIcons.File, {}),
3874
+ icon = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.File, {}),
6122
3875
  className,
6123
3876
  anotion,
6124
3877
  href
@@ -6132,16 +3885,16 @@ function ZiaFile(_a) {
6132
3885
  const validHref = typeof href === "string" && href.trim() !== "";
6133
3886
  const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
6134
3887
  if (validHref) {
6135
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_link5.default, { href, className: cn(itemVariants, className), children: [
3888
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_link5.default, { href, className: cn(itemVariants, className), children: [
6136
3889
  icon,
6137
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: name }),
6138
- validAnotion && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: anotionClass, children: anotion })
3890
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
3891
+ validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
6139
3892
  ] });
6140
3893
  }
6141
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", __spreadProps(__spreadValues({ className: cn(itemVariants, className) }, rest), { children: [
3894
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", __spreadProps(__spreadValues({ className: cn(itemVariants, className) }, rest), { children: [
6142
3895
  icon,
6143
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: name }),
6144
- validAnotion && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: anotionClass, children: anotion })
3896
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
3897
+ validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
6145
3898
  ] }));
6146
3899
  }
6147
3900
  function ZiaFolder(_a) {
@@ -6158,26 +3911,26 @@ function ZiaFolder(_a) {
6158
3911
  "className",
6159
3912
  "children"
6160
3913
  ]);
6161
- const [open, setOpen] = (0, import_react42.useState)(defaultOpen);
3914
+ const [open, setOpen] = (0, import_react41.useState)(defaultOpen);
6162
3915
  const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
6163
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_collapsible.Collapsible, __spreadProps(__spreadValues({ open, onOpenChange: setOpen }, props), { children: [
6164
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_collapsible.CollapsibleTrigger, { className: cn(itemVariants, className, "w-full"), children: [
6165
- open ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(globalLucideIcons.FolderOpen, {}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(globalLucideIcons.Folder, {}),
6166
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: name }),
6167
- validAnotion && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: anotionClass, children: anotion })
3916
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_collapsible.Collapsible, __spreadProps(__spreadValues({ open, onOpenChange: setOpen }, props), { children: [
3917
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_collapsible.CollapsibleTrigger, { className: cn(itemVariants, className, "w-full"), children: [
3918
+ open ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.FolderOpen, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.Folder, {}),
3919
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
3920
+ validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
6168
3921
  ] }),
6169
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ms-2 flex flex-col border-l ps-2", children }) })
3922
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ms-2 flex flex-col border-l ps-2", children }) })
6170
3923
  ] }));
6171
3924
  }
6172
3925
 
6173
3926
  // src/fuma/mdx/toc-footer-wrapper.tsx
6174
- var import_jsx_runtime55 = require("react/jsx-runtime");
3927
+ var import_jsx_runtime47 = require("react/jsx-runtime");
6175
3928
  function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
6176
3929
  const showEdit = githubBaseUrl && editPath;
6177
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
6178
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LastUpdatedDate, { date: lastModified }),
3930
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
3931
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LastUpdatedDate, { date: lastModified }),
6179
3932
  copyButtonComponent,
6180
- showEdit && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
3933
+ showEdit && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
6181
3934
  ] });
6182
3935
  }
6183
3936
  // Annotate the CommonJS export names for ESM import in node: