@jerry-fd/ui 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -7,8 +7,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { Command as Command$1 } from 'cmdk';
8
8
  import { Tabs as Tabs$1, Popover as Popover$1, Switch as Switch$1, DropdownMenu as DropdownMenu$2, Collapsible as Collapsible$1, Tooltip as Tooltip$1, ScrollArea as ScrollArea$1, HoverCard as HoverCard$1 } from 'radix-ui';
9
9
  import { DialogProps } from 'vaul';
10
- import { B as ButtonSharedProps } from './button-DMIeJ1gB.js';
11
- export { a as Button, b as baseButtonStyle, c as buttonVariants } from './button-DMIeJ1gB.js';
10
+ import { B as ButtonProps, a as ButtonSharedProps } from './button-BNFX2JB5.js';
11
+ export { b as Button, c as baseButtonStyle, d as buttonVariants } from './button-BNFX2JB5.js';
12
12
  import { I as IconType } from './icon-BmaneZ4I.js';
13
13
  import * as tailwind_merge from 'tailwind-merge';
14
14
  import { Variants, Transition } from 'motion/react';
@@ -923,29 +923,6 @@ declare function Switch({ className, size, disabled, loading, onChange, ...props
923
923
  onChange?: RootProps['onCheckedChange'];
924
924
  }): react_jsx_runtime.JSX.Element;
925
925
 
926
- type DrawerProps = Omit<DialogProps, 'onOpenChange'> & {
927
- className?: string;
928
- footerClassName?: string;
929
- headerClassName?: string;
930
- bodyClassName?: string;
931
- title?: React__default.ReactNode;
932
- description?: React__default.ReactNode;
933
- footer?: React__default.ReactNode;
934
- trigger?: React__default.ReactNode;
935
- loading?: boolean;
936
- skeletonItemCount?: number;
937
- width?: string | number;
938
- style?: React__default.CSSProperties;
939
- onOpenChange?: (open: boolean) => void;
940
- onClose?: () => void;
941
- onOk?: () => void | Promise<void>;
942
- };
943
- declare function Drawer({ direction, dismissible, skeletonItemCount, className, footerClassName, bodyClassName, headerClassName, title, description, footer, trigger, container, children, open: openProp, onOpenChange: onOpenChangeProp, loading, handleOnly, style, width, onClose, onOk, ...rootProps }: DrawerProps): react_jsx_runtime.JSX.Element;
944
-
945
- type InternalDrawerProps = 'open' | 'onOpenChange' | 'trigger' | 'children';
946
- type UseDrawerOptions = Omit<DrawerProps, InternalDrawerProps>;
947
- declare function useDrawer<TData = unknown>(options?: UseDrawerOptions): readonly [DrawerProps, TData | null, (record: TData) => void, () => void];
948
-
949
926
  declare const fancyButtonVariants: tailwind_variants.TVReturnType<{
950
927
  variant: {
951
928
  neutral: {
@@ -1205,6 +1182,65 @@ declare const FancyButtonRoot: React$1.ForwardRefExoticComponent<VariantProps<ta
1205
1182
  endContent?: React$1.ReactNode;
1206
1183
  } & React$1.RefAttributes<HTMLButtonElement>>;
1207
1184
 
1185
+ type DrawerClassNames = {
1186
+ header?: string;
1187
+ body?: string;
1188
+ footer?: string;
1189
+ };
1190
+ type DrawerProps = Omit<DialogProps, 'onOpenChange' | 'container'> & {
1191
+ className?: string;
1192
+ classNames?: DrawerClassNames;
1193
+ title?: React__default.ReactNode;
1194
+ description?: React__default.ReactNode;
1195
+ footer?: React__default.ReactNode;
1196
+ trigger?: React__default.ReactNode;
1197
+ loading?: boolean;
1198
+ /** 是否显示右上角关闭按钮 */
1199
+ closeable?: boolean;
1200
+ /** 启用内容动画 */
1201
+ animation?: boolean;
1202
+ /** loading 时显示的骨架屏 */
1203
+ skeleton?: React__default.ReactNode;
1204
+ width?: string | number;
1205
+ /** Drawer 与容器边缘的间距,默认 8px */
1206
+ gutter?: number | string;
1207
+ style?: React__default.CSSProperties;
1208
+ /** Drawer 锚点容器 */
1209
+ anchorContainer?: HTMLElement | null;
1210
+ okButtonProps?: ButtonProps;
1211
+ closeButtonProps?: ButtonProps;
1212
+ onOpenChange?: (open: boolean) => void;
1213
+ onClose?: () => void;
1214
+ onOk?: () => unknown | void | Promise<unknown | void>;
1215
+ };
1216
+ declare function Drawer({ direction, dismissible, closeable, skeleton, className, classNames, title, description, footer, trigger, anchorContainer, children, open: openProp, onOpenChange: onOpenChangeProp, loading, handleOnly, style, width, gutter, okButtonProps, closeButtonProps, animation, onClose, onOk, ...rootProps }: DrawerProps): react_jsx_runtime.JSX.Element;
1217
+
1218
+ type InternalDrawerProps = 'open' | 'defaultOpen' | 'loading' | 'onOpenChange' | 'trigger' | 'children';
1219
+ type DrawerOptionsWithOpenHandle<TData = unknown, TResult = unknown> = DrawerSharedOptions<TData, TResult> & {
1220
+ loading?: never;
1221
+ /** Drawer 打开时的回调,signal 可用于取消异步操作 */
1222
+ onOpen: (data?: TData, signal?: AbortSignal) => TResult | Promise<TResult>;
1223
+ };
1224
+ type DrawerOptionsWithoutOpenHandle<TData = unknown, TResult = unknown> = DrawerSharedOptions<TData, TResult> & {
1225
+ loading?: boolean;
1226
+ onOpen?: never;
1227
+ };
1228
+ type DrawerSharedOptions<TData = unknown, TResult = unknown> = Omit<DrawerProps, InternalDrawerProps> & {
1229
+ onOpenChange?: (open: boolean) => void;
1230
+ /** 关闭时是否销毁 payload,默认 true */
1231
+ destroyPayloadOnClose?: boolean;
1232
+ /** 动态计算 Drawer 标题,优先级高于 title */
1233
+ getTitle?: (loading: boolean, data: {
1234
+ payload?: TData;
1235
+ result?: TResult;
1236
+ }) => DrawerProps['title'];
1237
+ };
1238
+ type UseDrawerOptions<TData = unknown, TResult = unknown> = DrawerOptionsWithOpenHandle<TData, TResult> | DrawerOptionsWithoutOpenHandle<TData, TResult>;
1239
+ declare function useDrawer<TData = unknown, TResult = unknown>(options?: UseDrawerOptions<TData, TResult>): readonly [DrawerProps, {
1240
+ payload: TData | undefined;
1241
+ result: TResult | undefined;
1242
+ }, (record?: TData) => Promise<void>, () => void];
1243
+
1208
1244
  type CopyableTextProps = Omit<ButtonSharedProps, 'loading'> & {
1209
1245
  className?: string;
1210
1246
  content: string;
@@ -1459,14 +1495,14 @@ declare const dropdownMenuStyles: {
1459
1495
  } & {};
1460
1496
  type DropdownMenuVariants = VariantProps<typeof menu>;
1461
1497
 
1462
- declare function Skeleton({ className, ...props }: React__default.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
1463
-
1464
1498
  type OwnProps = {
1465
1499
  stroke?: number | string;
1466
1500
  className?: string;
1467
1501
  };
1468
1502
  declare function Spinner({ stroke, className }: OwnProps): react_jsx_runtime.JSX.Element;
1469
1503
 
1504
+ declare function Skeleton({ className, ...props }: React__default.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
1505
+
1470
1506
  declare const colorPanelVariants: tailwind_variants.TVReturnType<{
1471
1507
  variant: {
1472
1508
  filled: string;
@@ -2005,4 +2041,4 @@ declare const useFlag: (initial?: boolean) => [boolean, NoneToVoidFunction, None
2005
2041
 
2006
2042
  declare const useToggle: (initial?: boolean) => [boolean, NoneToVoidFunction];
2007
2043
 
2008
- export { AnimationCard, type AnimationCardProps, type AnimationName$1 as AnimationName, index as Avatar, Badge, type BadgeProps, ButtonSharedProps, card as Card, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPanel, command as Command, CopyableText, type CopyableTextProps, type DebouncedFunction, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItemProps, type DropdownMenuProps, type DropdownMenuVariants, FancyButtonRoot as FancyButton, HoverCard, type MenuPropBase, PopConfirm, type PopConfirmProps, popover as Popover, PopoverPreset, type PopoverPresetProps, type Scheduler, ScrollArea, Skeleton, Spinner, StateSwitcher, Swap, Switch, tabs as Tabs, type ThrottledFunction, Tooltip, TooltipArrow, TooltipProvider, TooltipRoot, TooltipTrigger, UIMorphingModal, type UIMorphingModalContentAnimationState, type UIMorphingModalProps, UIProvider, UIScreen, type UIScreenControls, type UIScreenNavigateFn, type UIScreenNavigateOptions, type UIScreenProps, type UIScreenValue, type UIScreenViewProps, UIViewTransition, type UIViewTransitionProps, type UseDrawerOptions, cn, compact, debounce, dropdownMenuStyles, fancyButtonVariants, findOption, formatCurrency, formatIntegerCompact, formatNumber, getFirstLetters, mergeRefs, omit, pick, throttle, tooltipVariants, tv, twMergeConfig, unique, useDisableContentMenu, useDrawer, useFlag, useForceUpdate, usePrevious, useToggle, useUIScreen };
2044
+ export { AnimationCard, type AnimationCardProps, type AnimationName$1 as AnimationName, index as Avatar, Badge, type BadgeProps, ButtonProps, ButtonSharedProps, card as Card, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPanel, command as Command, CopyableText, type CopyableTextProps, type DebouncedFunction, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItemProps, type DropdownMenuProps, type DropdownMenuVariants, FancyButtonRoot as FancyButton, HoverCard, type MenuPropBase, PopConfirm, type PopConfirmProps, popover as Popover, PopoverPreset, type PopoverPresetProps, type Scheduler, ScrollArea, Skeleton, Spinner, StateSwitcher, Swap, Switch, tabs as Tabs, type ThrottledFunction, Tooltip, TooltipArrow, TooltipProvider, TooltipRoot, TooltipTrigger, UIMorphingModal, type UIMorphingModalContentAnimationState, type UIMorphingModalProps, UIProvider, UIScreen, type UIScreenControls, type UIScreenNavigateFn, type UIScreenNavigateOptions, type UIScreenProps, type UIScreenValue, type UIScreenViewProps, UIViewTransition, type UIViewTransitionProps, type UseDrawerOptions, cn, compact, debounce, dropdownMenuStyles, fancyButtonVariants, findOption, formatCurrency, formatIntegerCompact, formatNumber, getFirstLetters, mergeRefs, omit, pick, throttle, tooltipVariants, tv, twMergeConfig, unique, useDisableContentMenu, useDrawer, useFlag, useForceUpdate, usePrevious, useToggle, useUIScreen };
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-J3QLREON.js';import {a as a$1,k,o,r}from'./chunk-6IEX6NJ5.js';export{q as DropdownMenu,o as Skeleton,n as Switch,j as Tabs,b as UIProvider,d as debounce,p as dropdownMenuStyles,f as mergeRefs,e as throttle,r as useFlag}from'./chunk-6IEX6NJ5.js';import {b,c,F,J,G,H,I,P,S,i,E}from'./chunk-2CZQBNNA.js';export{P as Button,v as Card,D as Command,R as FancyButton,K as Popover,M as Spinner,i as Tooltip,f as TooltipArrow,h as TooltipProvider,d as TooltipRoot,e as TooltipTrigger,N as baseButtonStyle,O as buttonVariants,c as cn,Q as fancyButtonVariants,g as tooltipVariants,b as tv,a as twMergeConfig,L as useDisableContentMenu}from'./chunk-2CZQBNNA.js';import {a}from'./chunk-M7AD2PUT.js';import {Slot,Collapsible,ScrollArea,HoverCard,Portal}from'radix-ui';import*as C from'react';import C__default,{useRef,useState,useLayoutEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {CircleAlert,Copy,CheckCheck}from'lucide-react';import {m,AnimatePresence}from'motion/react';import {Drawer}from'vaul';import io from'react-use-measure';var tt=new WeakMap;function rt(e){return((...t)=>{let r=tt.get(e),o=t.map(String).join("_");if(r){let i=r.get(o);if(i)return i}else r=new Map,tt.set(e,r);let a=e(...t);return r.set(o,a),a})}function ma(e,t,r="zh-CN"){return new Intl.NumberFormat(r,t).format(e)}function ua(e,t,r="zh-CN"){return new Intl.NumberFormat(r,{style:"currency",...t}).format(e)}function fa(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",compactDisplay:"short"}).format(e)}var ga=rt((e,t=2)=>e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(r=>{if(!r.length)return "";if(/\s+/.test(e))return r.match(/./u)?.[0].toUpperCase();let o=new RegExp(".".repeat(t),"u"),a=r.match(o)?.[0];return a?a.charAt(0).toUpperCase()+a.slice(1):e.charAt(0).toUpperCase()+e.slice(1,2)}).join(""));function ya(e,t){return Array.isArray(t)?e.filter(r=>t.some(o=>o===r.value)):e.find(r=>r.value===t)}function ba(e){return Array.from(new Set(e))}function Ra(e){return e.filter(vr)}function vr(e){return !!e}function hr(e,t){return t.reduce((r,o)=>(r[o]=e[o],r),{})}function Ca(e,t){let r=new Set(t.map(String)),o=Object.keys(e).filter(a=>!r.has(a));return hr(e,o)}var vt={};a(vt,{AVATAR_ROOT_NAME:()=>nt,Badge:()=>gt,BrandLogo:()=>ut,Image:()=>Me,Indicator:()=>pt,Notification:()=>ft,Root:()=>ct,Status:()=>mt,avatarRingVariants:()=>lt,avatarStatusVariants:()=>dt,avatarVariants:()=>we});function ie(e,t,r,o,a){let i=C__default.Children.map(e,(s,l)=>{if(!C__default.isValidElement(s))return s;let f=s.type?.displayName||"",c=r.includes(f)?t:{},p=s.props;return C__default.cloneElement(s,{...c,key:`${o}-${l}`},ie(p?.children,t,r,o,p?.asChild))});return a?i?.[0]:i}function ot(e){let t=C.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 80",...e,children:[jsxs("g",{fill:"#fff",clipPath:`url(#${t})`,children:[jsx("ellipse",{cx:40,cy:78,fillOpacity:.72,rx:32,ry:24}),jsx("circle",{cx:40,cy:32,r:16,opacity:.9})]}),jsx("defs",{children:jsx("clipPath",{id:t,children:jsx("rect",{width:80,height:80,fill:"#fff",rx:40})})})]})}function at(e){let t=C.useId(),r=C.useId(),o=C.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none",viewBox:"0 0 56 56",...e,children:[jsxs("g",{clipPath:`url(#${t})`,children:[jsx("rect",{width:56,height:56,className:"fill-bg-soft",rx:28}),jsx("path",{className:"fill-bg-soft",d:"M0 0h56v56H0z"}),jsx("g",{filter:`url(#${r})`,opacity:.48,children:jsx("path",{fill:"#fff",d:"M7 24.9a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 017 73.9v-49z"})}),jsx("path",{className:"fill-bg-soft",d:"M12.6 28.7a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"}),jsx("g",{filter:`url(#${o})`,children:jsx("path",{fill:"#fff",fillOpacity:.8,d:"M21 14a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 0121 63V14z"})}),jsx("path",{className:"fill-bg-soft",d:"M26.6 17.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm9.8-29.4a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"})]}),jsxs("defs",{children:[jsxs("filter",{id:r,width:34.6,height:62.6,x:3,y:18.1,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:2}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"})]}),jsxs("filter",{id:o,width:42.6,height:70.6,x:13,y:3.2,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:4}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"}),jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),jsx("feOffset",{dy:4}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",k2:-1,k3:1,operator:"arithmetic"}),jsx("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsx("feBlend",{in2:"shape",result:"effect2_innerShadow_36237_4888"})]}),jsx("clipPath",{id:t,children:jsx("rect",{width:56,height:56,fill:"#fff",rx:28})})]})]})}var nt="AvatarRoot",it="AvatarImage",st="AvatarIndicator",yr="AvatarStatus",br="AvatarBrandLogo",Rr="AvatarNotification",Cr="AvatarBadge",ke=Slot.Root,we=b({slots:{root:["relative flex shrink-0 items-center justify-center rounded-full","text-center uppercase select-none"],image:"size-full rounded-full object-cover",indicator:"absolute flex size-32 items-center justify-center drop-shadow-[0_2px_4px_#1b1c1d0a]"},variants:{withRing:{true:""},size:{80:{root:"size-80 text-title-h5"},72:{root:"size-72 text-title-h5"},64:{root:"size-64 text-title-h5"},56:{root:"size-56 text-label-lg"},48:{root:"size-48 text-label-lg"},42:{root:"size-42 text-label-md"},38:{root:"size-38 text-label-md"},32:{root:"size-32 text-label-sm"},24:{root:"size-24 text-label-xs"},20:{root:"size-20 text-label-xs"}},color:{gray:{root:"bg-bg-soft text-static-black/80"},yellow:{root:"bg-yellow-500 text-static-white"},blue:{root:"bg-blue-500 text-static-white"},sky:{root:"bg-sky-500 text-static-white"},purple:{root:"bg-purple-500 text-static-white"},red:{root:"bg-red-500 text-static-white"},green:{root:"bg-green-500 text-static-white"},teal:{root:"bg-teal-500 text-static-white"},violet:{root:"bg-violet-500 text-static-white"},pink:{root:"bg-pink-500 text-static-white"},orange:{root:"bg-orange-500 text-static-white"}}},compoundVariants:[{size:["80","72"],class:{indicator:"-right-8"}},{size:"64",class:{indicator:"-right-8 scale-[.875]"}},{size:"56",class:{indicator:"-right-6 scale-75"}},{size:"48",class:{indicator:"-right-6 scale-[.625]"}},{size:"42",class:{indicator:"-right-6 scale-[.5725]"}},{size:"38",class:{indicator:"-right-6 scale-[.5625]"}},{size:"32",class:{indicator:"-right-6 scale-50"}},{size:"24",class:{indicator:"-right-4 scale-[.375]"}},{size:"20",class:{indicator:"-right-4 scale-[.3125]"}},{withRing:true,size:"80",class:{indicator:"-right-12"}},{withRing:true,size:"72",class:{indicator:"-right-13"}},{withRing:true,size:"64",class:{indicator:"-right-12"}},{withRing:true,size:"56",class:{indicator:"-right-10"}},{withRing:true,size:["48","42","38","32"],class:{indicator:"-right-9"}},{withRing:true,size:["24","20"],class:{indicator:"-right-7"}}],defaultVariants:{size:"48",color:"gray"}}),lt=b({base:"ring-2 ring-offset-2",variants:{color:{gray:"ring-black/10",yellow:"ring-yellow-500",blue:"ring-blue-500",sky:"ring-sky-500",purple:"ring-purple-500",red:"ring-red-500",green:"ring-green-500",teal:"ring-teal-500",violet:"ring-violet-500",pink:"ring-pink-500",orange:"ring-orange-500",white:"ring-static-white",black:"ring-static-black"}},defaultVariants:{color:"gray"}}),Me=C.forwardRef(({asChild:e,className:t,size:r,color:o,...a},i)=>{let s=e?ke:"img",{image:l}=we({size:r,color:o});return jsx(s,{ref:i,className:l({class:t}),...a})});Me.displayName=it;var ct=C.forwardRef(({asChild:e,children:t,size:r,color:o,ring:a,className:i,placeholderType:s="user",...l},f)=>{let c$1=C.useId(),p=e?ke:"div",d=a?lt({color:a===true?o:typeof a=="string"?a:void 0}):void 0,{root:v}=we({size:r,color:o}),u=c(v(),d,i),y={size:r,color:o};if(!t)return jsx("div",{className:u,...l,children:jsx(Me,{asChild:true,children:s==="company"?jsx(at,{}):jsx(ot,{})})});let m=ie(t,y,[it,st],c$1,e);return jsx(p,{ref:f,className:u,...l,children:m})});ct.displayName=nt;function pt({size:e,color:t,className:r,position:o="bottom",withRing:a,...i}){let{indicator:s}=we({size:e,color:t,withRing:a});return jsx("div",{className:c(s({class:r}),{"top-0 origin-top-right":o==="top","bottom-0 origin-bottom-right":o==="bottom"}),...i})}pt.displayName=st;var dt=b({base:"box-content size-12 rounded-full border-4 border-bg-white",variants:{status:{online:"bg-success-base",offline:"bg-gray-500",busy:"bg-error-base",away:"bg-away-base"}},defaultVariants:{status:"online"}});function mt({status:e,className:t,...r}){return jsx("div",{className:dt({status:e,class:t}),...r})}mt.displayName=yr;var ut=C.forwardRef(({asChild:e,className:t,...r},o)=>jsx(e?ke:"img",{draggable:false,ref:o,className:c("box-content size-24 rounded-full border-2 border-bg-white",t),...r}));ut.displayName=br;function ft({className:e,...t}){return jsx("div",{className:c("box-content size-12 rounded-full border-2 border-bg-white bg-error-base",e),...t})}ft.displayName=Rr;function gt({className:e,...t}){return jsx("div",{className:c("box-content rounded-full border-2 border-bg-white bg-error-base px-6 text-static-white",e),...t})}gt.displayName=Cr;function le({className:e,variant:t="neutral",mode:r="stroke",size:o="small",...a}){return jsx(P,{variant:t,mode:r,size:o,className:c("absolute top-12 right-10 z-10 m-auto aspect-square rounded-full border-transparent text-text-soft hover:text-text-strong",e),...a,children:jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M10.4854 1.99998L2.00007 10.4853",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.4854 10.4844L2.00007 1.99908",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}var Oe=b({slots:{root:"relative flex w-fit max-w-xl flex-col rounded-[12px] border border-stroke-soft p-0 text-md",content:"text-md",arrowCls:"",header:"flex items-center select-none",close:"absolute rounded-full"},variants:{variant:{default:{root:"gap-8 bg-bg-white p-16",close:"top-12 right-12 hover:bg-bg-weak"},accent:{root:"bg-bg-weak p-4",content:"rounded-[8px] bg-bg-white px-12 py-8 shadow-sm",header:"px-12 py-4 pb-6",close:"top-9 right-8 hover:bg-bg-white",arrowCls:"bg-bg-weak"}}},defaultVariants:{variant:"default"}});function Pr({variant:e,className:t,contentClassName:r,closeableClassName:o,side:a="bottom",align:i="start",arrow:s=true,unstyled:l=true,closeable:f=true,sideOffset:c$1=1,title:p,content:d,children:v,asChild:u,defaultOpen:y,open:m,onOpenChange:I$1,onClose:S,...x}){let{root:h,content:b,header:w,close:T,arrowCls:R}=Oe({variant:e}),[V,N]=C__default.useState(y??false),A=m!==void 0,U=A?m:V,E=C__default.useCallback(K=>{A||N(K),I$1?.(K);},[A,I$1]);return jsxs(F,{open:U,onOpenChange:E,children:[A&&U&&jsx(J,{}),jsx(G,{className:c(A&&U&&"relative z-20"),asChild:u,children:v}),jsxs(H,{className:h({className:t}),arrowClassName:R(),unstyled:l,side:a,align:i,sideOffset:c$1,arrow:s,...x,children:[p&&jsx("header",{className:w({className:f&&"pe-28"}),children:typeof p=="string"?jsx("h3",{className:"m-0 text-title-h6 text-text-strong",children:p}):p}),f&&jsx(I,{asChild:true,onClick:S,children:jsx(le,{size:"xsmall",mode:"ghost",className:T({class:c("size-24 p-0",o)})})}),jsx("div",{className:b({className:r}),children:d})]})]})}function Ar({variant:e="default",title:t,content:r,children:o,defaultOpen:a,className:i,side:s="top",align:l="center",sideOffset:f=1,arrow:c$1=true,open:p,contentClassName:d,onOpenChange:v,onConfirm:u,onCancel:y,...m$1}){let{root:I$1,content:S,header:x,arrowCls:h}=Oe({variant:e}),[b,w]=C__default.useState(a??false),T=p!==void 0,R=T?p:b,V=C__default.useCallback(E=>{T||w(E),v?.(E);},[T,v]),[N,A]=C__default.useState(false),U=C__default.useCallback(async()=>{V(false);try{A(!0),await u?.();}catch{}finally{A(false);}},[V,u]);return jsxs(F,{open:R,onOpenChange:V,children:[jsx(AnimatePresence,{children:R&&jsx(J,{as:m.div,...k,className:"bg-black/5"})}),jsx(G,{className:c(R&&"relative z-20"),children:jsx("div",{className:"inline-flex items-center",children:C__default.isValidElement(o)?C__default.cloneElement(o,{loading:N}):o})}),jsxs(H,{className:I$1({className:c("max-w-lg",i)}),arrowClassName:h(),unstyled:true,side:s,align:l,sideOffset:f,arrow:c$1,...m$1,children:[t&&jsxs("header",{className:x({className:"gap-6"}),children:[jsx(CircleAlert,{className:"text-red-500",size:16}),jsx("h4",{className:"m-0 text-15 leading-26 font-medium text-text-strong",children:t})]}),jsxs("div",{className:S({className:d}),children:[r,jsxs("div",{className:"mt-8 flex justify-end gap-12",children:[jsx(I,{unstyled:true,onClick:y,asChild:true,children:jsx(P,{size:"xsmall",variant:"neutral",mode:"stroke",className:"h-26",children:"Cancel"})}),jsx(P,{size:"xsmall",mode:"stroke",className:"h-26",onClick:U,children:"Confirm"})]})]})]})]})}function bt({...e}){return jsx(Drawer.Root,{"data-slot":"drawer",...e})}function Rt({...e}){return jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Nr({...e}){return jsx(Drawer.Portal,{"data-slot":"drawer-portal",...e})}function Be({...e}){return jsx(Drawer.Close,{"data-slot":"drawer-close",...e})}function Vr({className:e,...t}){return jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:c("fixed inset-0 z-50 bg-black/10 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0",e),...t})}var Dr={top:"inset-x-8 top-8 max-h-[80vh]",bottom:"inset-x-8 bottom-8 mt-96 max-h-[80vh]",left:"inset-y-8 left-8 w-3/5",right:"inset-y-8 right-8 w-3/5"};function Ct({className:e,direction:t,children:r,...o}){let a=C.useRef({"--initial-transform":"calc(100% + 8px)"});return jsxs(Nr,{"data-slot":"drawer-portal",children:[jsx(Vr,{}),jsx(Drawer.Content,{"data-slot":"drawer-content",style:a.current,className:c("group/drawer-content fixed z-50 flex h-auto flex-col rounded-[12px] bg-static-white outline-none",t&&Dr[t],e),...o,children:r})]})}function wt({className:e,...t}){return jsx("div",{"data-slot":"drawer-header",className:c("flex flex-col px-16 py-12",e),...t})}function Pt({className:e,...t}){return jsx("div",{"data-slot":"drawer-body",className:c("scrollbar-thin overflow-y-auto p-16 select-text",e),...t})}function It({className:e,...t}){return jsx("div",{"data-slot":"drawer-footer",className:c("mt-auto flex flex-col gap-8 px-16 py-18",e),...t})}function St({className:e,...t}){return jsx(Drawer.Title,{"data-slot":"drawer-title",className:c("m-0 text-xl leading-32 font-medium text-text-strong",e),...t})}function Tt({className:e,...t}){return jsx(Drawer.Description,{"data-slot":"drawer-description",className:c("m-0 text-md text-text-sub",e),...t})}function kr({direction:e="right",dismissible:t=true,skeletonItemCount:r=5,className:o,footerClassName:a,bodyClassName:i,headerClassName:s,title:l="Title",description:f,footer:c$1,trigger:p,container:d,children:v,open:u,onOpenChange:y,loading:m,handleOnly:I=true,style:S$1,width:x,onClose:h,onOk:b,...w}){let T=S(),R=C__default.useRef({...S$1,width:x}),[V,N]=C__default.useState(false),[A,U]=C__default.useState(false),E=u!==void 0,K=E?u:V,$=C__default.useCallback(H=>{!H&&A||(E||N(H),y?.(H));},[E,y,A]),J=C__default.useCallback(async()=>{if(!b){$(false);return}let H=b();if(H instanceof Promise){U(true);try{await H,$(!1);}catch{}finally{U(false);}}else $(false);},[b,$]),W=!A&&t;return jsxs(bt,{container:d,direction:e,dismissible:W,handleOnly:I,autoFocus:true,open:K,onOpenChange:$,...w,children:[p&&jsx(Rt,{asChild:true,children:p}),jsxs(Ct,{direction:e,className:c(d&&d!==document.body&&"absolute",o),style:R.current,children:[t&&jsx(Be,{asChild:true,children:jsx(le,{disabled:!W})}),t===false&&jsx(le,{disabled:!W,onClick:h}),jsxs(wt,{className:c("border-b border-b-stroke-antd",s),children:[jsx(St,{className:"pe-42",asChild:true,children:typeof l=="string"?jsx("h3",{children:l}):jsx("div",{children:l})}),jsx(Tt,{className:c(!f&&"sr-only"),children:f})]}),jsxs(Pt,{className:i,children:[m&&jsx(Mr,{count:r}),!m&&v]}),jsxs(It,{className:c("flex-row border-t border-t-stroke-antd",a),children:[c$1,!c$1&&jsxs(Fragment,{children:[t&&jsx(Be,{asChild:true,children:jsx(P,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!W,children:T("close")})}),t===false&&jsx(P,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!W,onClick:h,children:T("close")}),jsx(P,{variant:"neutral",mode:"filled",className:"w-3/5",loading:m||A,onClick:J,children:T("ok")})]})]})]})]})}function Mr({count:e=5}){let t=Array.from({length:e});return jsxs("div",{className:"flex flex-col gap-16",children:[jsxs("div",{className:"flex flex-row items-center gap-12",children:[jsx(o,{className:"size-58 rounded-2xl"}),jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsx(o,{className:"mb-4 h-14 w-3/10"}),jsx(o,{className:"h-10 w-7/10"}),jsx(o,{className:"h-10 w-9/10"})]})]}),t.map((r,o$1)=>jsxs("div",{className:"flex flex-col gap-8",children:[jsx(o,{className:"h-12 w-5/10"}),jsx(o,{className:"h-12 w-7/10"}),jsx(o,{className:"h-12 w-full"})]},o$1))]})}function Or(e){let[t,r]=C__default.useState(false),[o,a]=C__default.useState(null),i=C__default.useCallback(c=>{a(c),r(true);},[]),s=C__default.useCallback(()=>{r(false),a(null);},[]),l=C__default.useCallback(c=>{r(c),c||a(null);},[]);return [{...e,open:t,onOpenChange:l,onClose:s},o,i,s]}var At=async e=>{if(!e)return;if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement("textarea");t.setAttribute("readonly",""),t.tabIndex=-1,t.style.position="fixed",t.style.left="-9999px",t.value=e,document.body.appendChild(t);let r=document.getSelection();if(r){let o=r.rangeCount>0&&r.getRangeAt(0);t.select(),document.execCommand("copy"),o&&(r.removeAllRanges(),r.addRange(o));}document.body.removeChild(t);};var Lr={initial:{scale:.5,opacity:0,filter:"blur(2px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:.5,opacity:0,filter:"blur(2px)"}},_r={opacity:{duration:.25},filter:{duration:.25},scale:{duration:.35,ease:[.34,1.56,.64,1]}},Hr={variants:Lr,initial:"initial",animate:"animate",exit:"exit",transition:_r};function Le({initial:e=false,state:t,states:r,asDiv:o,className:a,style:i,...s}){let l=o?m.div:m.span;return jsx(AnimatePresence,{initial:e,mode:"popLayout",children:jsx(l,{className:c("inline-flex items-center justify-center",a),...Hr,style:i,...s,children:r[t]},t)})}function _e({swap:e,on:t,off:r,className:o}){return jsx(Le,{state:e?"on":"off",states:{on:t,off:r},className:o})}function $r({content:e,delay:t=700,tooltipDelayDuration:r=700,variant:o="neutral",mode:a="stroke",size:i$1="small",as:s="button",children:l,onCopy:f,className:c$1}){let p=S(),[d,v]=C__default.useState(false),[u,y]=C__default.useState(false),[m,I]=C__default.useState(false),S$1=C__default.useRef(null),x=C__default.useRef(null);C__default.useEffect(()=>()=>{S$1.current&&clearTimeout(S$1.current),x.current&&clearTimeout(x.current);},[]);let h=C__default.useCallback(async()=>{d||(v(true),I(true),await At(e),f?.(e),S$1.current=setTimeout(()=>{I(false),x.current=setTimeout(()=>v(false),150);},t));},[d,t,e,f]),b=jsx(_e,{swap:d,on:jsx(CheckCheck,{width:"1em",height:"1em"}),off:jsx(Copy,{width:"1em",height:"1em"})}),w=(()=>{switch(s){case "text":return jsx("span",{className:c("relative cursor-pointer before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",c$1),onClick:h,children:jsx("span",{className:"relative z-1",children:l??e})});case "inline":return jsxs("span",{className:c("relative inline-flex cursor-pointer items-center gap-6 before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",c$1),onClick:h,children:[jsx("span",{className:"relative z-1",children:l??e}),jsx("span",{className:c("inline-flex items-center text-zinc-500",d&&"text-primary-base"),children:b})]});default:return jsx(P,{variant:o,mode:a,size:i$1,className:c(d&&"cursor-not-allowed",c$1),onClick:h,startContent:b})}})();return jsx(i,{content:p(d?"copied":"copy"),size:i$1,open:m||u,delayDuration:r,onOpenChange:y,hideWhenDetached:true,children:w})}var qr=b({base:"flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset",variants:{variant:{filled:"text-static-white",lighter:"",outline:"ring-current"},ring:{true:""},color:{neutral:"",slate:"",red:"",orange:"",amber:"",yellow:"",lime:"",green:"",emerald:"",teal:"",cyan:"",sky:"",blue:"",indigo:"",violet:"",purple:"",fuchsia:"",pink:"",rose:""}},compoundVariants:[{variant:"filled",color:"neutral",class:"bg-black/90"},{variant:"filled",color:"slate",class:"bg-slate-500"},{variant:"filled",color:"red",class:"bg-red-500"},{variant:"filled",color:"orange",class:"bg-orange-500"},{variant:"filled",color:"amber",class:"bg-amber-500"},{variant:"filled",color:"yellow",class:"bg-yellow-500"},{variant:"filled",color:"lime",class:"bg-lime-500"},{variant:"filled",color:"green",class:"bg-green-500"},{variant:"filled",color:"emerald",class:"bg-emerald-500"},{variant:"filled",color:"teal",class:"bg-teal-500"},{variant:"filled",color:"cyan",class:"bg-cyan-500"},{variant:"filled",color:"sky",class:"bg-sky-500"},{variant:"filled",color:"blue",class:"bg-blue-500"},{variant:"filled",color:"indigo",class:"bg-indigo-500"},{variant:"filled",color:"violet",class:"bg-violet-500"},{variant:"filled",color:"purple",class:"bg-purple-500"},{variant:"filled",color:"fuchsia",class:"bg-fuchsia-500"},{variant:"filled",color:"pink",class:"bg-pink-500"},{variant:"filled",color:"rose",class:"bg-rose-500"},{variant:"filled",ring:true,color:"neutral",class:"ring-neutral-700"},{variant:"filled",ring:true,color:"slate",class:"ring-slate-600"},{variant:"filled",ring:true,color:"red",class:"ring-red-700"},{variant:"filled",ring:true,color:"orange",class:"ring-orange-600"},{variant:"filled",ring:true,color:"amber",class:"ring-amber-600"},{variant:"filled",ring:true,color:"yellow",class:"ring-yellow-600"},{variant:"filled",ring:true,color:"lime",class:"ring-lime-600"},{variant:"filled",ring:true,color:"green",class:"ring-green-600"},{variant:"filled",ring:true,color:"emerald",class:"ring-emerald-600"},{variant:"filled",ring:true,color:"teal",class:"ring-teal-600"},{variant:"filled",ring:true,color:"cyan",class:"ring-cyan-600"},{variant:"filled",ring:true,color:"sky",class:"ring-sky-600"},{variant:"filled",ring:true,color:"blue",class:"ring-blue-700"},{variant:"filled",ring:true,color:"indigo",class:"ring-indigo-600"},{variant:"filled",ring:true,color:"violet",class:"ring-violet-600"},{variant:"filled",ring:true,color:"purple",class:"ring-purple-600"},{variant:"filled",ring:true,color:"fuchsia",class:"ring-fuchsia-600"},{variant:"filled",ring:true,color:"pink",class:"ring-pink-600"},{variant:"filled",ring:true,color:"rose",class:"ring-rose-600"},{variant:"lighter",color:"neutral",class:"bg-neutral-100 text-neutral-600"},{variant:"lighter",color:"slate",class:"bg-slate-100 text-slate-500"},{variant:"lighter",color:"red",class:"bg-red-50 text-red-500"},{variant:"lighter",color:"orange",class:"bg-orange-50 text-orange-500"},{variant:"lighter",color:"amber",class:"bg-amber-50 text-amber-500"},{variant:"lighter",color:"yellow",class:"bg-yellow-50 text-yellow-500"},{variant:"lighter",color:"lime",class:"bg-lime-50 text-lime-500"},{variant:"lighter",color:"green",class:"bg-green-50 text-green-500"},{variant:"lighter",color:"emerald",class:"bg-emerald-50 text-emerald-500"},{variant:"lighter",color:"teal",class:"bg-teal-50 text-teal-500"},{variant:"lighter",color:"cyan",class:"bg-cyan-50 text-cyan-500"},{variant:"lighter",color:"sky",class:"bg-sky-50 text-sky-500"},{variant:"lighter",color:"blue",class:"bg-blue-50 text-blue-500"},{variant:"lighter",color:"indigo",class:"bg-indigo-50 text-indigo-500"},{variant:"lighter",color:"violet",class:"bg-violet-50 text-violet-500"},{variant:"lighter",color:"purple",class:"bg-purple-50 text-purple-500"},{variant:"lighter",color:"fuchsia",class:"bg-fuchsia-50 text-fuchsia-500"},{variant:"lighter",color:"pink",class:"bg-pink-50 text-pink-500"},{variant:"lighter",color:"rose",class:"bg-rose-50 text-rose-500"},{variant:["lighter","outline"],ring:true,color:"neutral",class:"ring-neutral-200"},{variant:["lighter","outline"],ring:true,color:"slate",class:"ring-slate-200"},{variant:["lighter","outline"],ring:true,color:"red",class:"ring-red-200"},{variant:["lighter","outline"],ring:true,color:"orange",class:"ring-orange-200"},{variant:["lighter","outline"],ring:true,color:"amber",class:"ring-amber-200"},{variant:["lighter","outline"],ring:true,color:"yellow",class:"ring-yellow-200"},{variant:["lighter","outline"],ring:true,color:"lime",class:"ring-lime-200"},{variant:["lighter","outline"],ring:true,color:"green",class:"ring-green-200"},{variant:["lighter","outline"],ring:true,color:"emerald",class:"ring-emerald-200"},{variant:["lighter","outline"],ring:true,color:"teal",class:"ring-teal-200"},{variant:["lighter","outline"],ring:true,color:"cyan",class:"ring-cyan-200"},{variant:["lighter","outline"],ring:true,color:"sky",class:"ring-sky-200"},{variant:["lighter","outline"],ring:true,color:"blue",class:"ring-blue-200"},{variant:["lighter","outline"],ring:true,color:"indigo",class:"ring-indigo-200"},{variant:["lighter","outline"],ring:true,color:"violet",class:"ring-violet-200"},{variant:["lighter","outline"],ring:true,color:"purple",class:"ring-purple-200"},{variant:["lighter","outline"],ring:true,color:"fuchsia",class:"ring-fuchsia-200"},{variant:["lighter","outline"],ring:true,color:"pink",class:"ring-pink-200"},{variant:["lighter","outline"],ring:true,color:"rose",class:"ring-rose-200"},{variant:"outline",color:"neutral",class:"text-neutral-500"},{variant:"outline",color:"slate",class:"text-slate-400"},{variant:"outline",color:"red",class:"text-red-500"},{variant:"outline",color:"orange",class:"text-orange-500"},{variant:"outline",color:"amber",class:"text-amber-500"},{variant:"outline",color:"yellow",class:"text-yellow-500"},{variant:"outline",color:"lime",class:"text-lime-500"},{variant:"outline",color:"green",class:"text-green-500"},{variant:"outline",color:"emerald",class:"text-emerald-500"},{variant:"outline",color:"teal",class:"text-teal-500"},{variant:"outline",color:"cyan",class:"text-cyan-500"},{variant:"outline",color:"sky",class:"text-sky-500"},{variant:"outline",color:"blue",class:"text-blue-500"},{variant:"outline",color:"indigo",class:"text-indigo-500"},{variant:"outline",color:"violet",class:"text-violet-500"},{variant:"outline",color:"purple",class:"text-purple-500"},{variant:"outline",color:"fuchsia",class:"text-fuchsia-500"},{variant:"outline",color:"pink",class:"text-pink-500"},{variant:"outline",color:"rose",class:"text-rose-500"}],defaultVariants:{variant:"outline",color:"slate"}});function En({asChild:e,children:t,className:r,color:o,variant:a,ring:i,...s}){let l=e?Slot.Root:"div",f=qr({variant:a,color:o,ring:i,className:r});return jsx(l,{className:f,...s,children:t})}function Bn({...e}){return jsx(Collapsible.Root,{"data-slot":"collapsible",...e})}function Ln({...e}){return jsx(Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function _n({className:e,...t}){return jsx(Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",className:c("collapsible-content",e),...t})}var jr="BadgeRoot",Ut="BadgeIcon",Et="BadgeDot",Ge=b({slots:{root:"inline-flex w-fit appearance-none items-center justify-center border-none leading-none font-medium whitespace-nowrap transition duration-200 ease-out select-none",icon:"uicon shrink-0",dot:["uidot flex items-center justify-center","before:size-4 before:rounded-full before:bg-current"]},variants:{size:{medium:{root:"h-24 gap-4 px-10 text-md has-[>.uicon]:gap-6 has-[>.uidot]:gap-4",icon:"-mx-2 size-14",dot:"-mx-4 size-16 before:size-6"},small:{root:"h-20 gap-4 px-8 text-sm has-[>.uicon]:gap-4 has-[>.uidot]:gap-3",icon:"-mx-px size-12",dot:"-mx-4 size-16 before:size-5"},xsmall:{root:"h-16 gap-3 px-7 text-xs has-[>.uicon]:gap-4 has-[>.uidot]:gap-4",icon:"-mx-px size-10",dot:"-mx-5 size-16"}},variant:{filled:{root:"text-static-white"},outline:{root:"ring-1 ring-current ring-inset"},lighter:"",ghost:""},color:{primary:"",info:"",success:"",warning:"",error:"",neutral:""},shape:{default:"",circle:{root:"rounded-full"}},disabled:{true:{root:"cursor-not-allowed opacity-75"}}},compoundVariants:[{shape:"default",size:"xsmall",class:{root:"rounded-[3px] px-5"}},{shape:"default",size:"small",class:{root:"rounded-[4px] px-6"}},{shape:"default",size:"medium",class:{root:"rounded-lg px-7",icon:"ms-0"}},{variant:"filled",color:"primary",class:{root:"bg-primary-base"}},{variant:"filled",color:"info",class:{root:"bg-cyan-500"}},{variant:"filled",color:"success",class:{root:"bg-emerald-500"}},{variant:"filled",color:"warning",class:{root:"bg-orange-500"}},{variant:"filled",color:"error",class:{root:"bg-red-600"}},{variant:"filled",color:"neutral",class:{root:"bg-black/90"}},{variant:"outline",color:"primary",class:{root:"text-primary-base"}},{variant:"outline",color:"info",class:{root:"text-cyan-600"}},{variant:"outline",color:"success",class:{root:"text-emerald-500"}},{variant:"outline",color:"warning",class:{root:"text-orange-500"}},{variant:"outline",color:"error",class:{root:"text-red-600"}},{variant:"outline",color:"neutral",class:{root:"text-neutral-600 ring-neutral-200"}},{variant:"lighter",color:"primary",class:{root:"bg-blue-50 text-primary-base"}},{variant:"lighter",color:"info",class:{root:"bg-cyan-50 text-cyan-600"}},{variant:"lighter",color:"success",class:{root:"bg-emerald-50 text-emerald-600"}},{variant:"lighter",color:"warning",class:{root:"bg-orange-50 text-orange-600"}},{variant:"lighter",color:"error",class:{root:"bg-red-50 text-red-600"}},{variant:"lighter",color:"neutral",class:{root:"bg-neutral-100 text-neutral-600"}},{variant:"ghost",color:"primary",class:{root:"text-primary-base"}},{variant:"ghost",color:"info",class:{root:"text-cyan-600"}},{variant:"ghost",color:"success",class:{root:"text-emerald-600"}},{variant:"ghost",color:"warning",class:{root:"text-orange-600"}},{variant:"ghost",color:"error",class:{root:"text-red-600"}},{variant:"ghost",color:"neutral",class:{root:"text-neutral-600"}}],defaultVariants:{variant:"filled",color:"primary",size:"medium",shape:"default"}}),kt=({asChild:e,size:t,variant:r,color:o,shape:a,children:i,className:s,disabled:l,...f})=>{let c=C.useId(),p=e?Slot.Root:"div",{root:d}=Ge({variant:r,color:o,size:t,shape:a,disabled:l}),u=ie(i,{size:t,variant:r,color:o},[Ut,Et],c,e);return jsx(p,{"data-slot":"badge",className:d({class:s}),...f,children:u})};kt.displayName=jr;function Mt({className:e,size:t,variant:r,color:o,as:a,...i}){let s=a||"div",{icon:l}=Ge({size:t,variant:r,color:o});return jsx(s,{"data-slot":"icon",className:l({class:e}),...i})}Mt.displayName=Ut;function zt({size:e,variant:t,color:r,className:o,...a}){let{dot:i}=Ge({size:e,variant:t,color:r});return jsx("div",{"data-slot":"dot",className:i({class:o}),...a})}zt.displayName=Et;function Wn({icon:e,dot:t,children:r,asChild:o,...a}){return jsxs(kt,{asChild:o,...a,children:[e&&!o&&jsx(Mt,{as:e}),t&&!o&&jsx(zt,{}),r]})}function Qr({className:e,scrollBarClassName:t,children:r,...o}){return jsxs(ScrollArea.Root,{"data-slot":"scroll-area",className:c("relative",e),...o,children:[jsx(ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary-base focus-visible:outline-1",children:r}),jsx(Ot,{orientation:"vertical",className:t}),jsx(Ot,{orientation:"horizontal",className:t}),jsx(ScrollArea.Corner,{})]})}function Ot({className:e,orientation:t="vertical",...r}){return jsx(ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:c("flex touch-none p-2 transition-colors select-none data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-10 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",e),...r,children:jsx(ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-stroke-sub"})})}function to({open:e,defaultOpen:t,openDelay:r=300,closeDelay:o,asChild:a=true,arrow:i=true,content:s,children:l,onOpenChange:f,...c}){return jsxs(ro,{"data-slot":"hover-card",open:e,defaultOpen:t,openDelay:r,closeDelay:o,onOpenChange:f,children:[jsx(oo,{asChild:a,children:l}),jsxs(ao,{...c,children:[s,i&&jsx(HoverCard.Arrow,{asChild:true,children:jsx(E,{className:"-translate-y-6.5"})})]})]})}function ro({...e}){return jsx(HoverCard.Root,{"data-slot":"hover-card",...e})}function oo({...e}){return jsx(HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function ao({className:e,align:t="center",sideOffset:r=4,collisionPadding:o=16,...a}){return jsx(HoverCard.Portal,{"data-slot":"hover-card-portal",children:jsx(HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:r,collisionPadding:o,className:c("z-50 rounded-2xl bg-bg-white px-10 py-6 text-md text-text-strong shadow-regular-md ring-1 ring-stroke-soft outline-hidden duration-100 ring-inset","origin-(--radix-hover-card-content-transform-origin) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a})})}var so={initial:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},exit:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"}},lo={type:"spring",bounce:.1,duration:.25},co={ease:[.26,.08,.25,1],duration:.27};function po({activeKey:e,children:t,className:r,rootClassName:o,defaultCardHeight:a,initialKey:i,variants:s=so,transition:l=co,rootTransition:f=lo}){let[c,{height:p}]=io(),d=C.useRef(a??0);p>0&&(d.current=p);let v=e===i?a:p||d.current;return jsx(a$1,{children:jsx(m.div,{"data-slot":"animation-root",className:o,initial:false,animate:{height:v},transition:f,children:jsx("div",{ref:c,"data-slot":"animation-container",children:jsx(AnimatePresence,{mode:"popLayout",initial:false,children:jsx(m.div,{"data-slot":"animation-page",variants:s,transition:l,initial:"initial",animate:"animate",exit:"exit",className:r,children:t},e)})})})})}function j(e,t){let r=C.useRef(void 0),{current:o}=r;return C.useEffect(()=>{(!t||e!==void 0)&&(r.current=e);},[e,t]),o}var fo={type:"tween",duration:.3,ease:[.25,1,.5,1]},go={type:"tween",duration:.38,ease:[.25,1,.5,1]},Ie={type:"spring",stiffness:260,damping:30},vo={type:"tween",duration:.35,ease:"easeIn"},ho={type:"tween",duration:.35,ease:"easeOut"},xo={type:"tween",duration:.35,ease:"linear"},ae={type:"tween",duration:.25,ease:"easeInOut"},We=[.25,.1,.25,1],Kt=1.12,yo=.93,Se={type:"tween",duration:.22,ease:We},bo={scale:{type:"tween",duration:.22,ease:We},opacity:{type:"tween",duration:.16,ease:We}},Ro={type:"spring",stiffness:260,damping:30},Co=.7,wo=.9,Po="bg-white";function $t(e){return e?Co:wo}function $e(e,t){return e==="x"?{x:t}:{y:t}}function Wt(e,t=fo){return {supportsDimmed:false,variants:{enterFrom:({direction:r})=>({...$e(e,r===0?0:r>0?"100%":"-100%"),zIndex:1,transition:t}),active:{...$e(e,0),zIndex:1,transition:t},exit:({direction:r})=>({...$e(e,r<0?"100%":"-100%"),zIndex:0,transition:t})}}}function Io(){return {supportsDimmed:true,variants:{enterFrom:({direction:e,dimmed:t})=>e===0?{x:0,opacity:1,transition:Ie}:{x:e>0?"100%":"-20%",opacity:e>0?1:$t(t),zIndex:1,transition:Ie},active:{x:0,opacity:1,zIndex:1,transition:Ie},exit:({direction:e,dimmed:t})=>({x:e<0?"100%":"-20%",opacity:e<0?1:$t(t),zIndex:e<0?5:0,transition:Ie})}}}function So(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>({clipPath:e>0?"inset(0 100% 0 0)":"inset(0 0 0 0)",zIndex:1}),active:({direction:e})=>({clipPath:"inset(0 0 0 0)",zIndex:1,transition:e>0?vo:void 0}),exit:({direction:e})=>e<0?{clipPath:"inset(0 100% 0 0)",zIndex:2,transition:ho}:{opacity:.999,zIndex:0,transition:xo}}}}function To(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{x:0,scale:1,opacity:1,zIndex:1,transition:ae}:e>0?{x:"200%",opacity:1,zIndex:2,transition:ae}:{scale:.7,opacity:0,zIndex:0,transition:ae},active:{x:0,scale:1,opacity:1,zIndex:1,transition:ae},exit:({direction:e})=>e<0?{x:"200%",opacity:1,zIndex:2,transition:ae}:{x:0,scale:.7,opacity:0,zIndex:0,transition:ae}}}}function Ao(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{scale:1,opacity:1,zIndex:1,transition:Se}:{scale:e>0?Kt:yo,opacity:0,zIndex:e>0?1:0,transition:Se},active:{scale:1,opacity:1,zIndex:1,transition:Se},exit:({direction:e})=>e<0?{scale:Kt,opacity:0,zIndex:2,transition:bo}:{scale:1,opacity:0,zIndex:0,transition:Se}}}}var qt={slide:Wt("x"),slideVertical:Wt("y",go),slideLayers:Io(),reveal:So(),pushSlide:To(),zoomFade:Ao()},No={enterFrom:{position:"relative",width:"100%"},active:{position:"relative",width:"100%"},exit:{position:"absolute",top:0,left:0,right:0,width:"100%"}};function Te(e,t){let r=qt[e.animation].variants[t],o=No[t];if(typeof r=="function"){let s=r(e,{},{});return {...o,...s}}return typeof r=="string"?r:{...o,...r}}var Vo={enterFrom:e=>Te(e,"enterFrom"),active:e=>Te(e,"active"),exit:e=>Te(e,"exit")};function Zt({activeKey:e,animation:t="slideLayers",dimmed:r=false,measureHeight:o=true,lockPointerDuringTransition:a=true,className:i,viewClassName:s,children:l},f){let c$1=j(e),p=c$1!==void 0&&e!==c$1,d=p?e>c$1?1:-1:0,v=useRef(null),[u,y]=useState(false),m$1=qt[t],I={animation:t,direction:d,dimmed:!!(r&&m$1.supportsDimmed)},S=Te(I,"active"),x=typeof S=="string"?S:{...S,transition:{duration:0}},h=useRef(new Map),[b,w]=io(),[T,R]=useState(void 0);useLayoutEffect(()=>{if(!o||!w.height)return;let N=h.current.get(e);(!N||Math.abs(N-w.height)>1)&&(h.current.set(e,w.height),R(w.height));},[o,w.height,e]),useLayoutEffect(()=>{if(!o){R(void 0);return}let N=h.current.get(e);N&&R(N);},[o,e]),useLayoutEffect(()=>{if(!a){v.current=null,y(false);return}p&&(v.current=e,y(true));},[e,p,a]);let V=C__default.useCallback(()=>{v.current===e&&(v.current=null,y(false));},[e]);return jsx(a$1,{children:jsx(m.div,{"data-slot":"ui-transition-root",ref:f,className:c("relative w-full overflow-hidden",I.dimmed&&"bg-black",u&&"pointer-events-none",i),initial:false,animate:o&&T!==void 0?{height:T}:void 0,style:o&&T!==void 0?{height:T}:void 0,transition:Ro,children:jsx("div",{ref:o?b:void 0,className:"relative w-full",children:jsx(AnimatePresence,{initial:false,custom:I,mode:"sync",children:jsx(m.div,{"data-slot":"ui-transition-item",custom:I,variants:Vo,initial:d===0?false:"enterFrom",animate:p?"active":x,exit:"exit",onAnimationComplete:V,className:c("w-full",Po,s),children:l},e)})})})})}Zt.displayName="UIViewTransition";var Ye=C__default.forwardRef(Zt);function jt(e,t){let r=j(e);C.useEffect(()=>{t&&!r&&e?Do(t):t&&!e&&r&&Xt(t);},[t,e,r]),C.useEffect(()=>()=>{t&&e&&Xt(t);},[t,e]);}function Do(e){if(e){let r=e.clientHeight,o=(r-24)/r;e.style.overflow="hidden",e.style.willChange="transform",e.style.transition="transform 250ms linear",e.style.transform=`translateY(calc(env(safe-area-inset-top, 0) - 24px)) scale(${o})`;}}function Xt(e){function t(){e.style.removeProperty("overflow"),e.style.removeProperty("will-change"),e.style.removeProperty("transition"),e.removeEventListener("transitionend",t);}e&&(e.style.removeProperty("transform"),e.addEventListener("transitionend",t));}var Eo={variants:{initial:{opacity:0},animate:{opacity:.08},exit:{opacity:0}},initial:"initial",animate:"animate",exit:"exit"},ko={initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24}},Mo={variants:ko,initial:"initial",animate:"animate",exit:"exit"},zo={duration:.3,delay:.35},Oo={variants:{initial:{borderRadius:24,opacity:0},exit:{borderRadius:24,opacity:0},animate:{borderRadius:24,opacity:1}},initial:"initial",animate:"animate",exit:"exit"},Bo=100,Lo=300,_o={width:420,height:"auto"};function Ne(e){return typeof e=="number"?`${e}px`:e}function Qt(e){return typeof e=="object"?e:{width:e,height:e}}function Ho({open:e,loading:t,visual:r$1,backgroundViewRef:o,children:a,className:i,containerClassName:s,defaultSize:l=Bo,expandedSize:f=_o,onBackdropClick:c$1,onCloseComplete:p,onContentAnimationComplete:d,onExpandedChangeComplete:v}){let[u,y]=C.useState(!!e),[m$1,I,S]=r(false),[x,h]=C.useState(false),b=C.useRef(false),w=C.useRef(null),T=C.useRef(false),R=C.useRef(null),V=Qt(l),N=Qt(f),A=Ne(V.width),U=Ne(V.height),E=Ne(N.width),K=Ne(N.height),$=C.useMemo(()=>m$1?{width:E,height:K}:{width:A,height:U},[U,A,m$1,K,E]);jt(!!(e&&m$1&&o?.current),o?.current);let J=C.useCallback(()=>{R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{R.current=null,y(false);},Lo);},[]),W=C.useCallback(()=>{if(w.current!==null&&(v?.(w.current),w.current=null),!b.current){e&&!t&&(!m$1||!a)&&h(true);return}b.current=false,J();},[a,m$1,t,v,e,J]),H=C.useCallback(()=>{h(false),T.current&&(T.current=false,p?.());},[p]),ar=C.useCallback(Q=>{if(Q==="animate"){e&&!t&&h(true),d?.("entered");return}Q==="exit"&&(h(false),d?.("exited"));},[t,d,e]),je=C.useCallback(Q=>{Q==="animate"&&e&&!t&&!m$1&&!b.current&&h(true);},[m$1,t,e]),nr=C.useCallback(Q=>{x&&c$1?.(Q);},[x,c$1]);return C.useEffect(()=>{e&&(R.current&&(clearTimeout(R.current),R.current=null),b.current=false,T.current=false,h(false),y(true));},[e]),C.useEffect(()=>{if(u){if(e){if(t){m$1&&(w.current=false,h(false)),S();return}m$1||(w.current=true,h(false)),I();return}if(T.current=true,h(false),!b.current){if(m$1){w.current=false,b.current=true,S();return}J();}}},[S,m$1,t,e,u,J,I]),C.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),jsx(a$1,{children:jsx(AnimatePresence,{onExitComplete:H,children:u&&jsxs(Portal.Root,{"data-slot":"ui-modal-root",children:[jsx(m.div,{"data-slot":"ui-modal-backdrop",className:"fixed inset-0 z-10 bg-black",onClick:nr,onAnimationComplete:je,...Eo}),jsxs(m.div,{layout:true,"data-slot":"ui-modal-container","data-state":m$1&&"expanded",className:c("flex flex-col items-center justify-start bg-white p-16 ring-1 ring-stone-950/6","fixed top-1/2 left-1/2 z-20 -translate-x-1/2 -translate-y-1/2",s),style:$,onAnimationComplete:je,onLayoutAnimationComplete:W,...Oo,children:[jsx(m.div,{"data-slot":"ui-modal-visual",layout:true,children:r$1}),jsx(AnimatePresence,{children:m$1&&jsx(m.div,{"data-slot":"ui-modal-content",onAnimationComplete:ar,...Mo,transition:zo,className:c("flex w-full flex-col overflow-hidden",i),children:a},"content")})]})]})})})}var tr=C__default.createContext(null);function Fo(){let e=C__default.useContext(tr);if(!e)throw new Error("useUIScreen must be used within <UIScreen>");return e}function Xe({value:e,animation:t,className:r,children:o}){return jsx(Fragment,{children:o})}Xe.displayName="UIScreen.View";function Go(e){return C__default.isValidElement(e)&&e.type===Xe}function rr(e,t=[]){return C__default.Children.forEach(e,r=>{if(C__default.isValidElement(r)&&r.type===C__default.Fragment){rr(r.props.children,t);return}if(!Go(r))return;let o=r.props.value,a=Array.isArray(o)?Array.from(o):[o];t.push({values:a,animation:r.props.animation,className:r.props.className,activeKey:t.length,children:r.props.children});}),t}function Ko(e){let t=new Set;e.forEach(({values:r})=>{if(!r.length)throw new Error("UIScreen.View value must not be an empty array.");r.forEach(o=>{if(t.has(o))throw new Error(`Duplicate UIScreen.View value "${String(o)}".`);t.add(o);});});}function or({screen:e,defaultScreen:t,onScreenChange:r,children:o,...a},i){let s=e!==void 0,[l,f]=C__default.useState(t),c$1=e??l,p=j(c$1),d=C__default.useRef(null),v=rr(o);if(!v.length)throw new Error("UIScreen requires at least one UIScreen.View child.");if(e!==void 0&&t!==void 0)throw new Error("UIScreen accepts either screen or defaultScreen, but not both.");if(c$1===void 0)throw new Error("UIScreen requires either a screen or defaultScreen prop.");let u=c$1;Ko(v);let y=v.find(x=>x.values.includes(u));if(!y)throw new Error(`UIScreen could not find a UIScreen.View matching screen "${String(u)}".`);let m=d.current,I=m!==null&&p===m.from&&u===m.to;C__default.useLayoutEffect(()=>{let x=d.current;x&&u!==x.from&&(d.current=null);},[u]);let S=C__default.useMemo(()=>({screen:u,navigate:(x,h)=>{let b=h?.animation;d.current=x!==u&&b?{from:u,to:x,animation:b}:null,s||f(x),r?.(x);}}),[s,r,u]);return jsx(tr.Provider,{value:S,children:jsx(Ye,{ref:i,...a,animation:(I?m.animation:y.animation)??a.animation,viewClassName:c(a.viewClassName,y.className),activeKey:y.activeKey,children:y.children})})}or.displayName="UIScreen";var $o=C__default.forwardRef(or),Wo=Object.assign($o,{View:Xe});var qo=()=>{let[,e]=C.useState(false);return C.useCallback(()=>{e(t=>!t);},[])};var Zo=(e=false)=>{let[t,r]=C.useState(e),o=C.useCallback(()=>{r(a=>!a);},[]);return [t,o]};
2
- export{po as AnimationCard,vt as Avatar,Wn as Badge,Bn as Collapsible,_n as CollapsibleContent,Ln as CollapsibleTrigger,En as ColorPanel,$r as CopyableText,kr as Drawer,to as HoverCard,Ar as PopConfirm,Pr as PopoverPreset,Qr as ScrollArea,Le as StateSwitcher,_e as Swap,Ho as UIMorphingModal,Wo as UIScreen,Ye as UIViewTransition,Ra as compact,ya as findOption,ua as formatCurrency,fa as formatIntegerCompact,ma as formatNumber,ga as getFirstLetters,Ca as omit,hr as pick,ba as unique,Or as useDrawer,qo as useForceUpdate,j as usePrevious,Zo as useToggle,Fo as useUIScreen};
1
+ import'./chunk-4E3BXPKA.js';import {k,a as a$1,l,p,s}from'./chunk-I55VLHX5.js';export{r as DropdownMenu,p as Skeleton,o as Switch,j as Tabs,b as UIProvider,d as debounce,q as dropdownMenuStyles,f as mergeRefs,e as throttle,s as useFlag}from'./chunk-I55VLHX5.js';import {b,c,F,J,G,H,I as I$1,P,S,i,E}from'./chunk-6KWUEETQ.js';export{P as Button,v as Card,D as Command,R as FancyButton,K as Popover,M as Spinner,i as Tooltip,f as TooltipArrow,h as TooltipProvider,d as TooltipRoot,e as TooltipTrigger,N as baseButtonStyle,O as buttonVariants,c as cn,Q as fancyButtonVariants,g as tooltipVariants,b as tv,a as twMergeConfig,L as useDisableContentMenu}from'./chunk-6KWUEETQ.js';import {a}from'./chunk-M7AD2PUT.js';import {Slot,Collapsible,ScrollArea,HoverCard,Portal}from'radix-ui';import*as I from'react';import I__default,{useRef,useState,useLayoutEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {CircleAlert,Copy,CheckCheck}from'lucide-react';import {m,AnimatePresence}from'motion/react';import {Drawer}from'vaul';import mr from'react-use-measure';var st=new WeakMap;function lt(e){return((...t)=>{let o=st.get(e),r=t.map(String).join("_");if(o){let i=o.get(r);if(i)return i}else o=new Map,st.set(e,o);let a=e(...t);return o.set(r,a),a})}function xa(e,t,o="zh-CN"){return new Intl.NumberFormat(o,t).format(e)}function ya(e,t,o="zh-CN"){return new Intl.NumberFormat(o,{style:"currency",...t}).format(e)}function ba(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",compactDisplay:"short"}).format(e)}var Ra=lt((e,t=2)=>e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(o=>{if(!o.length)return "";if(/\s+/.test(e))return o.match(/./u)?.[0].toUpperCase();let r=new RegExp(".".repeat(t),"u"),a=o.match(r)?.[0];return a?a.charAt(0).toUpperCase()+a.slice(1):e.charAt(0).toUpperCase()+e.slice(1,2)}).join(""));function Ta(e,t){return Array.isArray(t)?e.filter(o=>t.some(r=>r===o.value)):e.find(o=>o.value===t)}function Sa(e){return Array.from(new Set(e))}function Ia(e){return e.filter(xo)}function xo(e){return !!e}function yo(e,t){return t.reduce((o,r)=>(o[r]=e[r],o),{})}function Aa(e,t){let o=new Set(t.map(String)),r=Object.keys(e).filter(a=>!o.has(a));return yo(e,r)}var wt={};a(wt,{AVATAR_ROOT_NAME:()=>dt,Badge:()=>Rt,BrandLogo:()=>yt,Image:()=>Be,Indicator:()=>vt,Notification:()=>bt,Root:()=>gt,Status:()=>xt,avatarRingVariants:()=>ft,avatarStatusVariants:()=>ht,avatarVariants:()=>Pe});function se(e,t,o,r,a){let i=I__default.Children.map(e,(s,l)=>{if(!I__default.isValidElement(s))return s;let f=s.type?.displayName||"",p=o.includes(f)?t:{},c=s.props;return I__default.cloneElement(s,{...p,key:`${r}-${l}`},se(c?.children,t,o,r,c?.asChild))});return a?i?.[0]:i}function ct(e){let t=I.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 80",...e,children:[jsxs("g",{fill:"#fff",clipPath:`url(#${t})`,children:[jsx("ellipse",{cx:40,cy:78,fillOpacity:.72,rx:32,ry:24}),jsx("circle",{cx:40,cy:32,r:16,opacity:.9})]}),jsx("defs",{children:jsx("clipPath",{id:t,children:jsx("rect",{width:80,height:80,fill:"#fff",rx:40})})})]})}function pt(e){let t=I.useId(),o=I.useId(),r=I.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none",viewBox:"0 0 56 56",...e,children:[jsxs("g",{clipPath:`url(#${t})`,children:[jsx("rect",{width:56,height:56,className:"fill-bg-soft",rx:28}),jsx("path",{className:"fill-bg-soft",d:"M0 0h56v56H0z"}),jsx("g",{filter:`url(#${o})`,opacity:.48,children:jsx("path",{fill:"#fff",d:"M7 24.9a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 017 73.9v-49z"})}),jsx("path",{className:"fill-bg-soft",d:"M12.6 28.7a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"}),jsx("g",{filter:`url(#${r})`,children:jsx("path",{fill:"#fff",fillOpacity:.8,d:"M21 14a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 0121 63V14z"})}),jsx("path",{className:"fill-bg-soft",d:"M26.6 17.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm9.8-29.4a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"})]}),jsxs("defs",{children:[jsxs("filter",{id:o,width:34.6,height:62.6,x:3,y:18.1,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:2}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"})]}),jsxs("filter",{id:r,width:42.6,height:70.6,x:13,y:3.2,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:4}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"}),jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),jsx("feOffset",{dy:4}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",k2:-1,k3:1,operator:"arithmetic"}),jsx("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsx("feBlend",{in2:"shape",result:"effect2_innerShadow_36237_4888"})]}),jsx("clipPath",{id:t,children:jsx("rect",{width:56,height:56,fill:"#fff",rx:28})})]})]})}var dt="AvatarRoot",ut="AvatarImage",mt="AvatarIndicator",Ro="AvatarStatus",wo="AvatarBrandLogo",Co="AvatarNotification",Po="AvatarBadge",ze=Slot.Root,Pe=b({slots:{root:["relative flex shrink-0 items-center justify-center rounded-full","text-center uppercase select-none"],image:"size-full rounded-full object-cover",indicator:"absolute flex size-32 items-center justify-center drop-shadow-[0_2px_4px_#1b1c1d0a]"},variants:{withRing:{true:""},size:{80:{root:"size-80 text-title-h5"},72:{root:"size-72 text-title-h5"},64:{root:"size-64 text-title-h5"},56:{root:"size-56 text-label-lg"},48:{root:"size-48 text-label-lg"},42:{root:"size-42 text-label-md"},38:{root:"size-38 text-label-md"},32:{root:"size-32 text-label-sm"},24:{root:"size-24 text-label-xs"},20:{root:"size-20 text-label-xs"}},color:{gray:{root:"bg-bg-soft text-static-black/80"},yellow:{root:"bg-yellow-500 text-static-white"},blue:{root:"bg-blue-500 text-static-white"},sky:{root:"bg-sky-500 text-static-white"},purple:{root:"bg-purple-500 text-static-white"},red:{root:"bg-red-500 text-static-white"},green:{root:"bg-green-500 text-static-white"},teal:{root:"bg-teal-500 text-static-white"},violet:{root:"bg-violet-500 text-static-white"},pink:{root:"bg-pink-500 text-static-white"},orange:{root:"bg-orange-500 text-static-white"}}},compoundVariants:[{size:["80","72"],class:{indicator:"-right-8"}},{size:"64",class:{indicator:"-right-8 scale-[.875]"}},{size:"56",class:{indicator:"-right-6 scale-75"}},{size:"48",class:{indicator:"-right-6 scale-[.625]"}},{size:"42",class:{indicator:"-right-6 scale-[.5725]"}},{size:"38",class:{indicator:"-right-6 scale-[.5625]"}},{size:"32",class:{indicator:"-right-6 scale-50"}},{size:"24",class:{indicator:"-right-4 scale-[.375]"}},{size:"20",class:{indicator:"-right-4 scale-[.3125]"}},{withRing:true,size:"80",class:{indicator:"-right-12"}},{withRing:true,size:"72",class:{indicator:"-right-13"}},{withRing:true,size:"64",class:{indicator:"-right-12"}},{withRing:true,size:"56",class:{indicator:"-right-10"}},{withRing:true,size:["48","42","38","32"],class:{indicator:"-right-9"}},{withRing:true,size:["24","20"],class:{indicator:"-right-7"}}],defaultVariants:{size:"48",color:"gray"}}),ft=b({base:"ring-2 ring-offset-2",variants:{color:{gray:"ring-black/10",yellow:"ring-yellow-500",blue:"ring-blue-500",sky:"ring-sky-500",purple:"ring-purple-500",red:"ring-red-500",green:"ring-green-500",teal:"ring-teal-500",violet:"ring-violet-500",pink:"ring-pink-500",orange:"ring-orange-500",white:"ring-static-white",black:"ring-static-black"}},defaultVariants:{color:"gray"}}),Be=I.forwardRef(({asChild:e,className:t,size:o,color:r,...a},i)=>{let s=e?ze:"img",{image:l}=Pe({size:o,color:r});return jsx(s,{ref:i,className:l({class:t}),...a})});Be.displayName=ut;var gt=I.forwardRef(({asChild:e,children:t,size:o,color:r,ring:a,className:i,placeholderType:s="user",...l},f)=>{let p=I.useId(),c$1=e?ze:"div",d=a?ft({color:a===true?r:typeof a=="string"?a:void 0}):void 0,{root:v}=Pe({size:o,color:r}),m=c(v(),d,i),g={size:o,color:r};if(!t)return jsx("div",{className:m,...l,children:jsx(Be,{asChild:true,children:s==="company"?jsx(pt,{}):jsx(ct,{})})});let u=se(t,g,[ut,mt],p,e);return jsx(c$1,{ref:f,className:m,...l,children:u})});gt.displayName=dt;function vt({size:e,color:t,className:o,position:r="bottom",withRing:a,...i}){let{indicator:s}=Pe({size:e,color:t,withRing:a});return jsx("div",{className:c(s({class:o}),{"top-0 origin-top-right":r==="top","bottom-0 origin-bottom-right":r==="bottom"}),...i})}vt.displayName=mt;var ht=b({base:"box-content size-12 rounded-full border-4 border-bg-white",variants:{status:{online:"bg-success-base",offline:"bg-gray-500",busy:"bg-error-base",away:"bg-away-base"}},defaultVariants:{status:"online"}});function xt({status:e,className:t,...o}){return jsx("div",{className:ht({status:e,class:t}),...o})}xt.displayName=Ro;var yt=I.forwardRef(({asChild:e,className:t,...o},r)=>jsx(e?ze:"img",{draggable:false,ref:r,className:c("box-content size-24 rounded-full border-2 border-bg-white",t),...o}));yt.displayName=wo;function bt({className:e,...t}){return jsx("div",{className:c("box-content size-12 rounded-full border-2 border-bg-white bg-error-base",e),...t})}bt.displayName=Co;function Rt({className:e,...t}){return jsx("div",{className:c("box-content rounded-full border-2 border-bg-white bg-error-base px-6 text-static-white",e),...t})}Rt.displayName=Po;function Te({className:e,variant:t="neutral",mode:o="stroke",size:r="small",...a}){return jsx(P,{variant:t,mode:o,size:r,className:c("absolute top-12 right-10 z-10 m-auto aspect-square rounded-full border-transparent text-text-soft hover:text-text-strong",e),...a,children:jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M10.4854 1.99998L2.00007 10.4853",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.4854 10.4844L2.00007 1.99908",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}var _e=b({slots:{root:"relative flex w-fit max-w-xl flex-col rounded-[12px] border border-stroke-soft p-0 text-md",content:"text-md",arrowCls:"",header:"flex items-center select-none",close:"absolute rounded-full"},variants:{variant:{default:{root:"gap-8 bg-bg-white p-16",close:"top-12 right-12 hover:bg-bg-weak"},accent:{root:"bg-bg-weak p-4",content:"rounded-[8px] bg-bg-white px-12 py-8 shadow-sm",header:"px-12 py-4 pb-6",close:"top-9 right-8 hover:bg-bg-white",arrowCls:"bg-bg-weak"}}},defaultVariants:{variant:"default"}});function So({variant:e,className:t,contentClassName:o,closeableClassName:r,side:a="bottom",align:i="start",arrow:s=true,unstyled:l=true,closeable:f=true,sideOffset:p=1,title:c$1,content:d,children:v,asChild:m,defaultOpen:g,open:u,onOpenChange:b,onClose:S,...h}){let{root:y,content:P,header:R,close:A,arrowCls:w}=_e({variant:e}),[T,N]=I__default.useState(g??false),D=u!==void 0,M=D?u:T,L=I__default.useCallback(q=>{D||N(q),b?.(q);},[D,b]);return jsxs(F,{open:M,onOpenChange:L,children:[D&&M&&jsx(J,{}),jsx(G,{className:c(D&&M&&"relative z-20"),asChild:m,children:v}),jsxs(H,{className:y({className:t}),arrowClassName:w(),unstyled:l,side:a,align:i,sideOffset:p,arrow:s,...h,children:[c$1&&jsx("header",{className:R({className:f&&"pe-28"}),children:typeof c$1=="string"?jsx("h3",{className:"m-0 text-title-h6 text-text-strong",children:c$1}):c$1}),f&&jsx(I$1,{asChild:true,onClick:S,children:jsx(Te,{size:"xsmall",mode:"ghost",className:A({class:c("size-24 p-0",r)})})}),jsx("div",{className:P({className:o}),children:d})]})]})}function Do({variant:e="default",title:t,content:o,children:r,defaultOpen:a,className:i,side:s="top",align:l$1="center",sideOffset:f=1,arrow:p=true,open:c$1,contentClassName:d,onOpenChange:v,onConfirm:m$1,onCancel:g,...u}){let{root:b,content:S,header:h,arrowCls:y}=_e({variant:e}),[P$1,R]=I__default.useState(a??false),A=c$1!==void 0,w=A?c$1:P$1,T=I__default.useCallback(L=>{A||R(L),v?.(L);},[A,v]),[N,D]=I__default.useState(false),M=I__default.useCallback(async()=>{T(false);try{D(!0),await m$1?.();}catch{}finally{D(false);}},[T,m$1]);return jsxs(F,{open:w,onOpenChange:T,children:[jsx(AnimatePresence,{children:w&&jsx(J,{as:m.div,...l,className:"bg-black/5"})}),jsx(G,{className:c(w&&"relative z-20"),children:jsx("div",{className:"inline-flex items-center",children:I__default.isValidElement(r)?I__default.cloneElement(r,{loading:N}):r})}),jsxs(H,{className:b({className:c("max-w-lg",i)}),arrowClassName:y(),unstyled:true,side:s,align:l$1,sideOffset:f,arrow:p,...u,children:[t&&jsxs("header",{className:h({className:"gap-6"}),children:[jsx(CircleAlert,{className:"text-red-500",size:16}),jsx("h4",{className:"m-0 text-15 leading-26 font-medium text-text-strong",children:t})]}),jsxs("div",{className:S({className:d}),children:[o,jsxs("div",{className:"mt-8 flex justify-end gap-12",children:[jsx(I$1,{unstyled:true,onClick:g,asChild:true,children:jsx(P,{size:"xsmall",variant:"neutral",mode:"stroke",className:"h-26",children:"Cancel"})}),jsx(P,{size:"xsmall",mode:"stroke",className:"h-26",onClick:M,children:"Confirm"})]})]})]})]})}function Tt({...e}){return jsx(Drawer.Root,{"data-slot":"drawer",...e})}function St({...e}){return jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Vo({...e}){return jsx(Drawer.Portal,{"data-slot":"drawer-portal",...e})}function He({...e}){return jsx(Drawer.Close,{"data-slot":"drawer-close",...e})}function Eo({className:e,...t}){return jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:c("fixed inset-0 z-50 bg-black/10 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0",e),...t})}var ko={top:"max-h-[80vh]",bottom:"mt-96 max-h-[80vh]",left:"w-3/5",right:"w-3/5"};function It({className:e,direction:t,children:o,...r}){return jsxs(Vo,{"data-slot":"drawer-portal",children:[jsx(Eo,{}),jsx(Drawer.Content,{"data-slot":"drawer-content",className:c("group/drawer-content @container fixed z-50 m-auto flex h-auto flex-col overflow-clip rounded-3xl bg-static-white outline-none",t&&ko[t],e),...r,children:o})]})}function At({className:e,...t}){return jsx("div",{"data-slot":"drawer-header",className:c("flex flex-col px-16 py-12",e),...t})}function Fe({className:e,...t}){return jsx("div",{"data-slot":"drawer-body",className:c("scrollbar-thin overflow-y-auto overscroll-contain p-16 select-text",e),...t})}function Nt({className:e,...t}){return jsx("div",{"data-slot":"drawer-footer",className:c("mt-auto flex flex-col gap-8 px-16 py-18",e),...t})}function Ge({className:e,...t}){return jsx(Drawer.Title,{"data-slot":"drawer-title",className:c("m-0 text-xl leading-32 font-medium text-text-strong",e),...t})}function We({className:e,...t}){return jsx(Drawer.Description,{"data-slot":"drawer-description",className:c("m-0 text-md text-text-sub",e),...t})}var Bo=k({y:12,scale:.98}),Dt=m.create(Fe);function Lo({direction:e="right",dismissible:t=true,closeable:o=true,skeleton:r,className:a,classNames:i,title:s,description:l$1,footer:f,trigger:p,anchorContainer:c$1,children:d,open:v,onOpenChange:m,loading:g,handleOnly:u=true,style:b,width:S$1,gutter:h=8,okButtonProps:y,closeButtonProps:P$1,animation:R=true,onClose:A,onOk:w,...T}){let N=S(),D=typeof h=="number"?`${h}px`:h,M=I__default.useMemo(()=>({"--initial-transform":`calc(100% + ${D})`,...Ho(e,D),...b,width:S$1}),[e,D,S$1]),[L,q]=I__default.useState(false),[W,Y]=I__default.useState(false),ie=v!==void 0,Oe=ie?v:L,Z=I__default.useCallback(V=>{!V&&W||(ie||q(V),m?.(V));},[ie,m,W]),ve=I__default.useCallback(async()=>{if(!w){Z(false);return}let V=w();if(V instanceof Promise){Y(true);try{await V,Z(!1);}finally{Y(false);}}else Z(false);},[w,Z]);return jsxs(Tt,{container:c$1,direction:e,dismissible:!W&&t,handleOnly:u,autoFocus:true,open:Oe,onOpenChange:Z,...T,children:[p&&jsx(St,{asChild:true,children:p}),jsxs(It,{className:c(c$1&&c$1!==document.body&&"absolute",a),direction:e,style:M,children:[o&&jsx(He,{className:"aspect-square size-32 -translate-y-1 px-8",disabled:W,onClick:t?void 0:A,asChild:true,children:jsx(Te,{})}),jsx(Ge,{className:"sr-only hidden",children:"Drawer"}),jsx(We,{className:"sr-only hidden",children:"Description"}),(s||l$1)&&jsxs(At,{className:c("border-b border-b-stroke-antd",i?.header),children:[s&&jsx(Ge,{className:"pe-42",asChild:typeof s!="string",children:s}),l$1&&jsx(We,{children:l$1})]}),!R&&jsx(Fe,{className:i?.body,children:d}),R&&jsx(a$1,{children:jsx(AnimatePresence,{mode:"wait",children:g?jsx(Dt,{...l,className:c(i?.body,"overflow-hidden"),children:r??jsx(_o,{count:5})},"skeleton"):jsx(Dt,{...Bo,className:i?.body,children:d},"content")})}),f===null?jsx("div",{className:c("mt-auto h-16",i?.footer)}):jsxs(Nt,{className:c("border-t border-t-stroke-antd",!f&&"flex-col gap-8 @[420px]:flex-row-reverse",i?.footer),children:[f,!f&&jsxs(Fragment,{children:[jsx(P,{variant:"neutral",mode:"filled",className:"w-full @[420px]:w-7/10 @[620px]:w-6/10",...y,loading:g||W,onClick:ve,children:y?.children??N("ok")}),jsx(He,{asChild:true,children:jsx(P,{variant:"neutral",mode:"stroke",className:"w-full @[420px]:w-3/10 @[620px]:w-4/10",...P$1,disabled:W,onClick:t?void 0:A,children:P$1?.children??N("close")})})]})]})]})]})}function _o({count:e=5}){let t=Array.from({length:e});return jsxs("div",{className:"flex flex-col gap-16",children:[jsxs("div",{className:"flex flex-row items-center gap-12",children:[jsx(p,{className:"size-58 rounded-2xl"}),jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsx(p,{className:"mb-4 h-14 w-3/10"}),jsx(p,{className:"h-10 w-7/10"}),jsx(p,{className:"h-10 w-9/10"})]})]}),t.map((o,r)=>jsxs("div",{className:"flex flex-col gap-8",children:[jsx(p,{className:"h-12 w-5/10"}),jsx(p,{className:"h-12 w-7/10"}),jsx(p,{className:"h-12 w-full"})]},r))]})}function Ho(e,t){return {top:{left:t,right:t,top:t},bottom:{left:t,right:t,bottom:t},left:{top:t,bottom:t,left:t},right:{top:t,bottom:t,right:t}}[e]??{}}var Go={};function Wo(e){let{destroyPayloadOnClose:t=true,onOpen:o,getTitle:r,title:a,onOpenChange:i,onAnimationEnd:s,...l}=e??Go,[f,p]=I__default.useState(false),[c,d]=I__default.useState(),[v,m]=I__default.useState(),g=I__default.useRef(null),[u,b]=I__default.useState(false),S=I__default.useCallback(async T=>{g.current?.abort();let N=new AbortController;if(g.current=N,T&&d(T),p(true),o){b(true);try{let D=await o(T,N.signal);N.signal.aborted||m(D);}finally{N.signal.aborted||b(false);}}},[o]);I__default.useEffect(()=>()=>{g.current?.abort(),g.current=null;},[]);let h=I__default.useCallback(()=>{g.current?.abort(),g.current=null,b(false),p(false);},[]),y=I__default.useCallback(T=>{T||(g.current?.abort(),g.current=null,b(false)),p(T),i?.(T);},[i]),P=I__default.useCallback(T=>{!T&&t&&(d(void 0),m(void 0)),s?.(T);},[t,s]),R=I__default.useMemo(()=>({payload:c,result:v}),[c,v]),A=r?.(u,R);return [{...l,title:A||a,...o&&{loading:u},open:f,onOpenChange:y,onClose:h,onAnimationEnd:P},R,S,h]}var Vt=async e=>{if(!e)return;if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement("textarea");t.setAttribute("readonly",""),t.tabIndex=-1,t.style.position="fixed",t.style.left="-9999px",t.value=e,document.body.appendChild(t);let o=document.getSelection();if(o){let r=o.rangeCount>0&&o.getRangeAt(0);t.select(),document.execCommand("copy"),r&&(o.removeAllRanges(),o.addRange(r));}document.body.removeChild(t);};var Ko={initial:{scale:.5,opacity:0,filter:"blur(2px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:.5,opacity:0,filter:"blur(2px)"}},qo={opacity:{duration:.25},filter:{duration:.25},scale:{duration:.35,ease:[.34,1.56,.64,1]}},Yo={variants:Ko,initial:"initial",animate:"animate",exit:"exit",transition:qo};function $e({initial:e=false,state:t,states:o,asDiv:r,className:a,style:i,...s}){let l=r?m.div:m.span;return jsx(AnimatePresence,{initial:e,mode:"popLayout",children:jsx(l,{className:c("inline-flex items-center justify-center",a),...Yo,style:i,...s,children:o[t]},t)})}function Ke({swap:e,on:t,off:o,className:r}){return jsx($e,{state:e?"on":"off",states:{on:t,off:o},className:r})}function Jo({content:e,delay:t=700,tooltipDelayDuration:o=700,variant:r="neutral",mode:a="stroke",size:i$1="small",as:s="button",children:l,onCopy:f,className:p}){let c$1=S(),[d,v]=I__default.useState(false),[m,g]=I__default.useState(false),[u,b]=I__default.useState(false),S$1=I__default.useRef(null),h=I__default.useRef(null);I__default.useEffect(()=>()=>{S$1.current&&clearTimeout(S$1.current),h.current&&clearTimeout(h.current);},[]);let y=I__default.useCallback(async()=>{d||(v(true),b(true),await Vt(e),f?.(e),S$1.current=setTimeout(()=>{b(false),h.current=setTimeout(()=>v(false),150);},t));},[d,t,e,f]),P$1=jsx(Ke,{swap:d,on:jsx(CheckCheck,{width:"1em",height:"1em"}),off:jsx(Copy,{width:"1em",height:"1em"})}),R=(()=>{switch(s){case "text":return jsx("span",{className:c("relative cursor-pointer before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",p),onClick:y,children:jsx("span",{className:"relative z-1",children:l??e})});case "inline":return jsxs("span",{className:c("relative inline-flex cursor-pointer items-center gap-6 before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",p),onClick:y,children:[jsx("span",{className:"relative z-1",children:l??e}),jsx("span",{className:c("inline-flex items-center text-zinc-500",d&&"text-primary-base"),children:P$1})]});default:return jsx(P,{variant:r,mode:a,size:i$1,className:c(d&&"cursor-not-allowed",p),onClick:y,startContent:P$1})}})();return jsx(i,{content:c$1(d?"copied":"copy"),size:i$1,open:u||m,delayDuration:o,onOpenChange:g,hideWhenDetached:true,children:R})}var tr=b({base:"flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset",variants:{variant:{filled:"text-static-white",lighter:"",outline:"ring-current"},ring:{true:""},color:{neutral:"",slate:"",red:"",orange:"",amber:"",yellow:"",lime:"",green:"",emerald:"",teal:"",cyan:"",sky:"",blue:"",indigo:"",violet:"",purple:"",fuchsia:"",pink:"",rose:""}},compoundVariants:[{variant:"filled",color:"neutral",class:"bg-black/90"},{variant:"filled",color:"slate",class:"bg-slate-500"},{variant:"filled",color:"red",class:"bg-red-500"},{variant:"filled",color:"orange",class:"bg-orange-500"},{variant:"filled",color:"amber",class:"bg-amber-500"},{variant:"filled",color:"yellow",class:"bg-yellow-500"},{variant:"filled",color:"lime",class:"bg-lime-500"},{variant:"filled",color:"green",class:"bg-green-500"},{variant:"filled",color:"emerald",class:"bg-emerald-500"},{variant:"filled",color:"teal",class:"bg-teal-500"},{variant:"filled",color:"cyan",class:"bg-cyan-500"},{variant:"filled",color:"sky",class:"bg-sky-500"},{variant:"filled",color:"blue",class:"bg-blue-500"},{variant:"filled",color:"indigo",class:"bg-indigo-500"},{variant:"filled",color:"violet",class:"bg-violet-500"},{variant:"filled",color:"purple",class:"bg-purple-500"},{variant:"filled",color:"fuchsia",class:"bg-fuchsia-500"},{variant:"filled",color:"pink",class:"bg-pink-500"},{variant:"filled",color:"rose",class:"bg-rose-500"},{variant:"filled",ring:true,color:"neutral",class:"ring-neutral-700"},{variant:"filled",ring:true,color:"slate",class:"ring-slate-600"},{variant:"filled",ring:true,color:"red",class:"ring-red-700"},{variant:"filled",ring:true,color:"orange",class:"ring-orange-600"},{variant:"filled",ring:true,color:"amber",class:"ring-amber-600"},{variant:"filled",ring:true,color:"yellow",class:"ring-yellow-600"},{variant:"filled",ring:true,color:"lime",class:"ring-lime-600"},{variant:"filled",ring:true,color:"green",class:"ring-green-600"},{variant:"filled",ring:true,color:"emerald",class:"ring-emerald-600"},{variant:"filled",ring:true,color:"teal",class:"ring-teal-600"},{variant:"filled",ring:true,color:"cyan",class:"ring-cyan-600"},{variant:"filled",ring:true,color:"sky",class:"ring-sky-600"},{variant:"filled",ring:true,color:"blue",class:"ring-blue-700"},{variant:"filled",ring:true,color:"indigo",class:"ring-indigo-600"},{variant:"filled",ring:true,color:"violet",class:"ring-violet-600"},{variant:"filled",ring:true,color:"purple",class:"ring-purple-600"},{variant:"filled",ring:true,color:"fuchsia",class:"ring-fuchsia-600"},{variant:"filled",ring:true,color:"pink",class:"ring-pink-600"},{variant:"filled",ring:true,color:"rose",class:"ring-rose-600"},{variant:"lighter",color:"neutral",class:"bg-neutral-100 text-neutral-600"},{variant:"lighter",color:"slate",class:"bg-slate-100 text-slate-500"},{variant:"lighter",color:"red",class:"bg-red-50 text-red-500"},{variant:"lighter",color:"orange",class:"bg-orange-50 text-orange-500"},{variant:"lighter",color:"amber",class:"bg-amber-50 text-amber-500"},{variant:"lighter",color:"yellow",class:"bg-yellow-50 text-yellow-500"},{variant:"lighter",color:"lime",class:"bg-lime-50 text-lime-500"},{variant:"lighter",color:"green",class:"bg-green-50 text-green-500"},{variant:"lighter",color:"emerald",class:"bg-emerald-50 text-emerald-500"},{variant:"lighter",color:"teal",class:"bg-teal-50 text-teal-500"},{variant:"lighter",color:"cyan",class:"bg-cyan-50 text-cyan-500"},{variant:"lighter",color:"sky",class:"bg-sky-50 text-sky-500"},{variant:"lighter",color:"blue",class:"bg-blue-50 text-blue-500"},{variant:"lighter",color:"indigo",class:"bg-indigo-50 text-indigo-500"},{variant:"lighter",color:"violet",class:"bg-violet-50 text-violet-500"},{variant:"lighter",color:"purple",class:"bg-purple-50 text-purple-500"},{variant:"lighter",color:"fuchsia",class:"bg-fuchsia-50 text-fuchsia-500"},{variant:"lighter",color:"pink",class:"bg-pink-50 text-pink-500"},{variant:"lighter",color:"rose",class:"bg-rose-50 text-rose-500"},{variant:["lighter","outline"],ring:true,color:"neutral",class:"ring-neutral-200"},{variant:["lighter","outline"],ring:true,color:"slate",class:"ring-slate-200"},{variant:["lighter","outline"],ring:true,color:"red",class:"ring-red-200"},{variant:["lighter","outline"],ring:true,color:"orange",class:"ring-orange-200"},{variant:["lighter","outline"],ring:true,color:"amber",class:"ring-amber-200"},{variant:["lighter","outline"],ring:true,color:"yellow",class:"ring-yellow-200"},{variant:["lighter","outline"],ring:true,color:"lime",class:"ring-lime-200"},{variant:["lighter","outline"],ring:true,color:"green",class:"ring-green-200"},{variant:["lighter","outline"],ring:true,color:"emerald",class:"ring-emerald-200"},{variant:["lighter","outline"],ring:true,color:"teal",class:"ring-teal-200"},{variant:["lighter","outline"],ring:true,color:"cyan",class:"ring-cyan-200"},{variant:["lighter","outline"],ring:true,color:"sky",class:"ring-sky-200"},{variant:["lighter","outline"],ring:true,color:"blue",class:"ring-blue-200"},{variant:["lighter","outline"],ring:true,color:"indigo",class:"ring-indigo-200"},{variant:["lighter","outline"],ring:true,color:"violet",class:"ring-violet-200"},{variant:["lighter","outline"],ring:true,color:"purple",class:"ring-purple-200"},{variant:["lighter","outline"],ring:true,color:"fuchsia",class:"ring-fuchsia-200"},{variant:["lighter","outline"],ring:true,color:"pink",class:"ring-pink-200"},{variant:["lighter","outline"],ring:true,color:"rose",class:"ring-rose-200"},{variant:"outline",color:"neutral",class:"text-neutral-500"},{variant:"outline",color:"slate",class:"text-slate-400"},{variant:"outline",color:"red",class:"text-red-500"},{variant:"outline",color:"orange",class:"text-orange-500"},{variant:"outline",color:"amber",class:"text-amber-500"},{variant:"outline",color:"yellow",class:"text-yellow-500"},{variant:"outline",color:"lime",class:"text-lime-500"},{variant:"outline",color:"green",class:"text-green-500"},{variant:"outline",color:"emerald",class:"text-emerald-500"},{variant:"outline",color:"teal",class:"text-teal-500"},{variant:"outline",color:"cyan",class:"text-cyan-500"},{variant:"outline",color:"sky",class:"text-sky-500"},{variant:"outline",color:"blue",class:"text-blue-500"},{variant:"outline",color:"indigo",class:"text-indigo-500"},{variant:"outline",color:"violet",class:"text-violet-500"},{variant:"outline",color:"purple",class:"text-purple-500"},{variant:"outline",color:"fuchsia",class:"text-fuchsia-500"},{variant:"outline",color:"pink",class:"text-pink-500"},{variant:"outline",color:"rose",class:"text-rose-500"}],defaultVariants:{variant:"outline",color:"slate"}});function Fn({asChild:e,children:t,className:o,color:r,variant:a,ring:i,...s}){let l=e?Slot.Root:"div",f=tr({variant:a,color:r,ring:i,className:o});return jsx(l,{className:f,...s,children:t})}function qn({...e}){return jsx(Collapsible.Root,{"data-slot":"collapsible",...e})}function Yn({...e}){return jsx(Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Zn({className:e,...t}){return jsx(Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",className:c("collapsible-content",e),...t})}var ar="BadgeRoot",Ut="BadgeIcon",Mt="BadgeDot",Ze=b({slots:{root:"inline-flex w-fit appearance-none items-center justify-center border-none leading-none font-medium whitespace-nowrap transition duration-200 ease-out select-none",icon:"uicon shrink-0",dot:["uidot flex items-center justify-center","before:size-4 before:rounded-full before:bg-current"]},variants:{size:{medium:{root:"h-24 gap-4 px-10 text-md has-[>.uicon]:gap-6 has-[>.uidot]:gap-4",icon:"-mx-2 size-14",dot:"-mx-4 size-16 before:size-6"},small:{root:"h-20 gap-4 px-8 text-sm has-[>.uicon]:gap-4 has-[>.uidot]:gap-3",icon:"-mx-px size-12",dot:"-mx-4 size-16 before:size-5"},xsmall:{root:"h-16 gap-3 px-7 text-xs has-[>.uicon]:gap-4 has-[>.uidot]:gap-4",icon:"-mx-px size-10",dot:"-mx-5 size-16"}},variant:{filled:{root:"text-static-white"},outline:{root:"ring-1 ring-current ring-inset"},lighter:"",ghost:""},color:{primary:"",info:"",success:"",warning:"",error:"",neutral:""},shape:{default:"",circle:{root:"rounded-full"}},disabled:{true:{root:"cursor-not-allowed opacity-75"}}},compoundVariants:[{shape:"default",size:"xsmall",class:{root:"rounded-[3px] px-5"}},{shape:"default",size:"small",class:{root:"rounded-[4px] px-6"}},{shape:"default",size:"medium",class:{root:"rounded-lg px-7",icon:"ms-0"}},{variant:"filled",color:"primary",class:{root:"bg-primary-base"}},{variant:"filled",color:"info",class:{root:"bg-cyan-500"}},{variant:"filled",color:"success",class:{root:"bg-emerald-500"}},{variant:"filled",color:"warning",class:{root:"bg-orange-500"}},{variant:"filled",color:"error",class:{root:"bg-red-600"}},{variant:"filled",color:"neutral",class:{root:"bg-black/90"}},{variant:"outline",color:"primary",class:{root:"text-primary-base"}},{variant:"outline",color:"info",class:{root:"text-cyan-600"}},{variant:"outline",color:"success",class:{root:"text-emerald-500"}},{variant:"outline",color:"warning",class:{root:"text-orange-500"}},{variant:"outline",color:"error",class:{root:"text-red-600"}},{variant:"outline",color:"neutral",class:{root:"text-neutral-600 ring-neutral-200"}},{variant:"lighter",color:"primary",class:{root:"bg-blue-50 text-primary-base"}},{variant:"lighter",color:"info",class:{root:"bg-cyan-50 text-cyan-600"}},{variant:"lighter",color:"success",class:{root:"bg-emerald-50 text-emerald-600"}},{variant:"lighter",color:"warning",class:{root:"bg-orange-50 text-orange-600"}},{variant:"lighter",color:"error",class:{root:"bg-red-50 text-red-600"}},{variant:"lighter",color:"neutral",class:{root:"bg-neutral-100 text-neutral-600"}},{variant:"ghost",color:"primary",class:{root:"text-primary-base"}},{variant:"ghost",color:"info",class:{root:"text-cyan-600"}},{variant:"ghost",color:"success",class:{root:"text-emerald-600"}},{variant:"ghost",color:"warning",class:{root:"text-orange-600"}},{variant:"ghost",color:"error",class:{root:"text-red-600"}},{variant:"ghost",color:"neutral",class:{root:"text-neutral-600"}}],defaultVariants:{variant:"filled",color:"primary",size:"medium",shape:"default"}}),zt=({asChild:e,size:t,variant:o,color:r,shape:a,children:i,className:s,disabled:l,...f})=>{let p=I.useId(),c=e?Slot.Root:"div",{root:d}=Ze({variant:o,color:r,size:t,shape:a,disabled:l}),m=se(i,{size:t,variant:o,color:r},[Ut,Mt],p,e);return jsx(c,{"data-slot":"badge",className:d({class:s}),...f,children:m})};zt.displayName=ar;function Bt({className:e,size:t,variant:o,color:r,as:a,...i}){let s=a||"div",{icon:l}=Ze({size:t,variant:o,color:r});return jsx(s,{"data-slot":"icon",className:l({class:e}),...i})}Bt.displayName=Ut;function Lt({size:e,variant:t,color:o,className:r,...a}){let{dot:i}=Ze({size:e,variant:t,color:o});return jsx("div",{"data-slot":"dot",className:i({class:r}),...a})}Lt.displayName=Mt;function ti({icon:e,dot:t,children:o,asChild:r,...a}){return jsxs(zt,{asChild:r,...a,children:[e&&!r&&jsx(Bt,{as:e}),t&&!r&&jsx(Lt,{}),o]})}function ir({className:e,scrollBarClassName:t,children:o,...r}){return jsxs(ScrollArea.Root,{"data-slot":"scroll-area",className:c("relative",e),...r,children:[jsx(ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary-base focus-visible:outline-1",children:o}),jsx(_t,{orientation:"vertical",className:t}),jsx(_t,{orientation:"horizontal",className:t}),jsx(ScrollArea.Corner,{})]})}function _t({className:e,orientation:t="vertical",...o}){return jsx(ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:c("flex touch-none p-2 transition-colors select-none data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-10 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",e),...o,children:jsx(ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-stroke-sub"})})}function lr({open:e,defaultOpen:t,openDelay:o=300,closeDelay:r,asChild:a=true,arrow:i=true,content:s,children:l,onOpenChange:f,...p}){return jsxs(cr,{"data-slot":"hover-card",open:e,defaultOpen:t,openDelay:o,closeDelay:r,onOpenChange:f,children:[jsx(pr,{asChild:a,children:l}),jsxs(dr,{...p,children:[s,i&&jsx(HoverCard.Arrow,{asChild:true,children:jsx(E,{className:"-translate-y-6.5"})})]})]})}function cr({...e}){return jsx(HoverCard.Root,{"data-slot":"hover-card",...e})}function pr({...e}){return jsx(HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function dr({className:e,align:t="center",sideOffset:o=4,collisionPadding:r=16,...a}){return jsx(HoverCard.Portal,{"data-slot":"hover-card-portal",children:jsx(HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:o,collisionPadding:r,className:c("z-50 rounded-2xl bg-bg-white px-10 py-6 text-md text-text-strong shadow-regular-md ring-1 ring-stroke-soft outline-hidden duration-100 ring-inset","origin-(--radix-hover-card-content-transform-origin) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a})})}var fr={initial:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},exit:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"}},gr={type:"spring",bounce:.1,duration:.25},vr={ease:[.26,.08,.25,1],duration:.27};function hr({activeKey:e,children:t,className:o,rootClassName:r,defaultCardHeight:a,initialKey:i,variants:s=fr,transition:l=vr,rootTransition:f=gr}){let[p,{height:c}]=mr(),d=I.useRef(a??0);c>0&&(d.current=c);let v=e===i?a:c||d.current;return jsx(a$1,{children:jsx(m.div,{"data-slot":"animation-root",className:r,initial:false,animate:{height:v},transition:f,children:jsx("div",{ref:p,"data-slot":"animation-container",children:jsx(AnimatePresence,{mode:"popLayout",initial:false,children:jsx(m.div,{"data-slot":"animation-page",variants:s,transition:l,initial:"initial",animate:"animate",exit:"exit",className:o,children:t},e)})})})})}function ee(e,t){let o=I.useRef(void 0),{current:r}=o;return I.useEffect(()=>{(!t||e!==void 0)&&(o.current=e);},[e,t]),r}var br={type:"tween",duration:.3,ease:[.25,1,.5,1]},Rr={type:"tween",duration:.38,ease:[.25,1,.5,1]},Ie={type:"spring",stiffness:260,damping:30},wr={type:"tween",duration:.35,ease:"easeIn"},Cr={type:"tween",duration:.35,ease:"easeOut"},Pr={type:"tween",duration:.35,ease:"linear"},ae={type:"tween",duration:.25,ease:"easeInOut"},Je=[.25,.1,.25,1],qt=1.12,Tr=.93,Ae={type:"tween",duration:.22,ease:Je},Sr={scale:{type:"tween",duration:.22,ease:Je},opacity:{type:"tween",duration:.16,ease:Je}},Ir={type:"spring",stiffness:260,damping:30},Ar=.7,Nr=.9,Dr="bg-white";function Yt(e){return e?Ar:Nr}function je(e,t){return e==="x"?{x:t}:{y:t}}function Zt(e,t=br){return {supportsDimmed:false,variants:{enterFrom:({direction:o})=>({...je(e,o===0?0:o>0?"100%":"-100%"),zIndex:1,transition:t}),active:{...je(e,0),zIndex:1,transition:t},exit:({direction:o})=>({...je(e,o<0?"100%":"-100%"),zIndex:0,transition:t})}}}function Vr(){return {supportsDimmed:true,variants:{enterFrom:({direction:e,dimmed:t})=>e===0?{x:0,opacity:1,transition:Ie}:{x:e>0?"100%":"-20%",opacity:e>0?1:Yt(t),zIndex:1,transition:Ie},active:{x:0,opacity:1,zIndex:1,transition:Ie},exit:({direction:e,dimmed:t})=>({x:e<0?"100%":"-20%",opacity:e<0?1:Yt(t),zIndex:e<0?5:0,transition:Ie})}}}function Er(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>({clipPath:e>0?"inset(0 100% 0 0)":"inset(0 0 0 0)",zIndex:1}),active:({direction:e})=>({clipPath:"inset(0 0 0 0)",zIndex:1,transition:e>0?wr:void 0}),exit:({direction:e})=>e<0?{clipPath:"inset(0 100% 0 0)",zIndex:2,transition:Cr}:{opacity:.999,zIndex:0,transition:Pr}}}}function kr(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{x:0,scale:1,opacity:1,zIndex:1,transition:ae}:e>0?{x:"200%",opacity:1,zIndex:2,transition:ae}:{scale:.7,opacity:0,zIndex:0,transition:ae},active:{x:0,scale:1,opacity:1,zIndex:1,transition:ae},exit:({direction:e})=>e<0?{x:"200%",opacity:1,zIndex:2,transition:ae}:{x:0,scale:.7,opacity:0,zIndex:0,transition:ae}}}}function Or(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{scale:1,opacity:1,zIndex:1,transition:Ae}:{scale:e>0?qt:Tr,opacity:0,zIndex:e>0?1:0,transition:Ae},active:{scale:1,opacity:1,zIndex:1,transition:Ae},exit:({direction:e})=>e<0?{scale:qt,opacity:0,zIndex:2,transition:Sr}:{scale:1,opacity:0,zIndex:0,transition:Ae}}}}var jt={slide:Zt("x"),slideVertical:Zt("y",Rr),slideLayers:Vr(),reveal:Er(),pushSlide:kr(),zoomFade:Or()},Ur={enterFrom:{position:"relative",width:"100%"},active:{position:"relative",width:"100%"},exit:{position:"absolute",top:0,left:0,right:0,width:"100%"}};function Ne(e,t){let o=jt[e.animation].variants[t],r=Ur[t];if(typeof o=="function"){let s=o(e,{},{});return {...r,...s}}return typeof o=="string"?o:{...r,...o}}var Mr={enterFrom:e=>Ne(e,"enterFrom"),active:e=>Ne(e,"active"),exit:e=>Ne(e,"exit")};function Jt({activeKey:e,animation:t="slideLayers",dimmed:o=false,measureHeight:r=true,lockPointerDuringTransition:a=true,className:i,viewClassName:s,children:l},f){let p=ee(e),c$1=p!==void 0&&e!==p,d=c$1?e>p?1:-1:0,v=useRef(null),[m$1,g]=useState(false),u=jt[t],b={animation:t,direction:d,dimmed:!!(o&&u.supportsDimmed)},S=Ne(b,"active"),h=typeof S=="string"?S:{...S,transition:{duration:0}},y=useRef(new Map),[P,R]=mr(),[A,w]=useState(void 0);useLayoutEffect(()=>{if(!r||!R.height)return;let N=y.current.get(e);(!N||Math.abs(N-R.height)>1)&&(y.current.set(e,R.height),w(R.height));},[r,R.height,e]),useLayoutEffect(()=>{if(!r){w(void 0);return}let N=y.current.get(e);N&&w(N);},[r,e]),useLayoutEffect(()=>{if(!a){v.current=null,g(false);return}c$1&&(v.current=e,g(true));},[e,c$1,a]);let T=I__default.useCallback(()=>{v.current===e&&(v.current=null,g(false));},[e]);return jsx(a$1,{children:jsx(m.div,{"data-slot":"ui-transition-root",ref:f,className:c("relative w-full overflow-hidden",b.dimmed&&"bg-black",m$1&&"pointer-events-none",i),initial:false,animate:r&&A!==void 0?{height:A}:void 0,style:r&&A!==void 0?{height:A}:void 0,transition:Ir,children:jsx("div",{ref:r?P:void 0,className:"relative w-full",children:jsx(AnimatePresence,{initial:false,custom:b,mode:"sync",children:jsx(m.div,{"data-slot":"ui-transition-item",custom:b,variants:Mr,initial:d===0?false:"enterFrom",animate:c$1?"active":h,exit:"exit",onAnimationComplete:T,className:c("w-full",Dr,s),children:l},e)})})})})}Jt.displayName="UIViewTransition";var Qe=I__default.forwardRef(Jt);function eo(e,t){let o=ee(e);I.useEffect(()=>{t&&!o&&e?zr(t):t&&!e&&o&&Qt(t);},[t,e,o]),I.useEffect(()=>()=>{t&&e&&Qt(t);},[t,e]);}function zr(e){if(e){let o=e.clientHeight,r=(o-24)/o;e.style.overflow="hidden",e.style.willChange="transform",e.style.transition="transform 250ms linear",e.style.transform=`translateY(calc(env(safe-area-inset-top, 0) - 24px)) scale(${r})`;}}function Qt(e){function t(){e.style.removeProperty("overflow"),e.style.removeProperty("will-change"),e.style.removeProperty("transition"),e.removeEventListener("transitionend",t);}e&&(e.style.removeProperty("transform"),e.addEventListener("transitionend",t));}var Lr={variants:{initial:{opacity:0},animate:{opacity:.08},exit:{opacity:0}},initial:"initial",animate:"animate",exit:"exit"},_r={initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24}},Hr={variants:_r,initial:"initial",animate:"animate",exit:"exit"},Fr={duration:.3,delay:.35},Gr={variants:{initial:{borderRadius:24,opacity:0},exit:{borderRadius:24,opacity:0},animate:{borderRadius:24,opacity:1}},initial:"initial",animate:"animate",exit:"exit"},Wr=100,$r=300,Kr={width:420,height:"auto"};function Ve(e){return typeof e=="number"?`${e}px`:e}function oo(e){return typeof e=="object"?e:{width:e,height:e}}function qr({open:e,loading:t,visual:o,backgroundViewRef:r,children:a,className:i,containerClassName:s$1,defaultSize:l=Wr,expandedSize:f=Kr,onBackdropClick:p,onCloseComplete:c$1,onContentAnimationComplete:d,onExpandedChangeComplete:v}){let[m$1,g]=I.useState(!!e),[u,b,S]=s(false),[h,y]=I.useState(false),P=I.useRef(false),R=I.useRef(null),A=I.useRef(false),w=I.useRef(null),T=oo(l),N=oo(f),D=Ve(T.width),M=Ve(T.height),L=Ve(N.width),q=Ve(N.height),W=I.useMemo(()=>u?{width:L,height:q}:{width:D,height:M},[M,D,u,q,L]);eo(!!(e&&u&&r?.current),r?.current);let Y=I.useCallback(()=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null,g(false);},$r);},[]),ie=I.useCallback(()=>{if(R.current!==null&&(v?.(R.current),R.current=null),!P.current){e&&!t&&(!u||!a)&&y(true);return}P.current=false,Y();},[a,u,t,v,e,Y]),Oe=I.useCallback(()=>{y(false),A.current&&(A.current=false,c$1?.());},[c$1]),Z=I.useCallback(V=>{if(V==="animate"){e&&!t&&y(true),d?.("entered");return}V==="exit"&&(y(false),d?.("exited"));},[t,d,e]),ve=I.useCallback(V=>{V==="animate"&&e&&!t&&!u&&!P.current&&y(true);},[u,t,e]),rt=I.useCallback(V=>{h&&p?.(V);},[h,p]);return I.useEffect(()=>{e&&(w.current&&(clearTimeout(w.current),w.current=null),P.current=false,A.current=false,y(false),g(true));},[e]),I.useEffect(()=>{if(m$1){if(e){if(t){u&&(R.current=false,y(false)),S();return}u||(R.current=true,y(false)),b();return}if(A.current=true,y(false),!P.current){if(u){R.current=false,P.current=true,S();return}Y();}}},[S,u,t,e,m$1,Y,b]),I.useEffect(()=>()=>{w.current&&clearTimeout(w.current);},[]),jsx(a$1,{children:jsx(AnimatePresence,{onExitComplete:Oe,children:m$1&&jsxs(Portal.Root,{"data-slot":"ui-modal-root",children:[jsx(m.div,{"data-slot":"ui-modal-backdrop",className:"fixed inset-0 z-10 bg-black",onClick:rt,onAnimationComplete:ve,...Lr}),jsxs(m.div,{layout:true,"data-slot":"ui-modal-container","data-state":u&&"expanded",className:c("flex flex-col items-center justify-start bg-white p-16 ring-1 ring-stone-950/6","fixed top-1/2 left-1/2 z-20 -translate-x-1/2 -translate-y-1/2",s$1),style:W,onAnimationComplete:ve,onLayoutAnimationComplete:ie,...Gr,children:[jsx(m.div,{"data-slot":"ui-modal-visual",layout:true,children:o}),jsx(AnimatePresence,{children:u&&jsx(m.div,{"data-slot":"ui-modal-content",onAnimationComplete:Z,...Hr,transition:Fr,className:c("flex w-full flex-col overflow-hidden",i),children:a},"content")})]})]})})})}var ao=I__default.createContext(null);function Yr(){let e=I__default.useContext(ao);if(!e)throw new Error("useUIScreen must be used within <UIScreen>");return e}function ot({value:e,animation:t,className:o,children:r}){return jsx(Fragment,{children:r})}ot.displayName="UIScreen.View";function Zr(e){return I__default.isValidElement(e)&&e.type===ot}function no(e,t=[]){return I__default.Children.forEach(e,o=>{if(I__default.isValidElement(o)&&o.type===I__default.Fragment){no(o.props.children,t);return}if(!Zr(o))return;let r=o.props.value,a=Array.isArray(r)?Array.from(r):[r];t.push({values:a,animation:o.props.animation,className:o.props.className,activeKey:t.length,children:o.props.children});}),t}function Xr(e){let t=new Set;e.forEach(({values:o})=>{if(!o.length)throw new Error("UIScreen.View value must not be an empty array.");o.forEach(r=>{if(t.has(r))throw new Error(`Duplicate UIScreen.View value "${String(r)}".`);t.add(r);});});}function io({screen:e,defaultScreen:t,onScreenChange:o,children:r,...a},i){let s=e!==void 0,[l,f]=I__default.useState(t),p=e??l,c$1=ee(p),d=I__default.useRef(null),v=no(r);if(!v.length)throw new Error("UIScreen requires at least one UIScreen.View child.");if(e!==void 0&&t!==void 0)throw new Error("UIScreen accepts either screen or defaultScreen, but not both.");if(p===void 0)throw new Error("UIScreen requires either a screen or defaultScreen prop.");let m=p;Xr(v);let g=v.find(h=>h.values.includes(m));if(!g)throw new Error(`UIScreen could not find a UIScreen.View matching screen "${String(m)}".`);let u=d.current,b=u!==null&&c$1===u.from&&m===u.to;I__default.useLayoutEffect(()=>{let h=d.current;h&&m!==h.from&&(d.current=null);},[m]);let S=I__default.useMemo(()=>({screen:m,navigate:(h,y)=>{let P=y?.animation;d.current=h!==m&&P?{from:m,to:h,animation:P}:null,s||f(h),o?.(h);}}),[s,o,m]);return jsx(ao.Provider,{value:S,children:jsx(Qe,{ref:i,...a,animation:(b?u.animation:g.animation)??a.animation,viewClassName:c(a.viewClassName,g.className),activeKey:g.activeKey,children:g.children})})}io.displayName="UIScreen";var jr=I__default.forwardRef(io),Jr=Object.assign(jr,{View:ot});var ea=()=>{let[,e]=I.useState(false);return I.useCallback(()=>{e(t=>!t);},[])};var ta=(e=false)=>{let[t,o]=I.useState(e),r=I.useCallback(()=>{o(a=>!a);},[]);return [t,r]};
2
+ export{hr as AnimationCard,wt as Avatar,ti as Badge,qn as Collapsible,Zn as CollapsibleContent,Yn as CollapsibleTrigger,Fn as ColorPanel,Jo as CopyableText,Lo as Drawer,lr as HoverCard,Do as PopConfirm,So as PopoverPreset,ir as ScrollArea,$e as StateSwitcher,Ke as Swap,qr as UIMorphingModal,Jr as UIScreen,Qe as UIViewTransition,Ia as compact,Ta as findOption,ya as formatCurrency,ba as formatIntegerCompact,xa as formatNumber,Ra as getFirstLetters,Aa as omit,yo as pick,Sa as unique,Wo as useDrawer,ea as useForceUpdate,ee as usePrevious,ta as useToggle,Yr as useUIScreen};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jerry-fd/ui",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "UI component library based on Ant Design (Client-side only)",
5
5
  "type": "module",
6
6
  "sideEffects": ["index.js", "*.css"],