@womp/kookie-ui 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/components.css +145 -26
  2. package/dist/cjs/components/app-bar.d.ts +49 -0
  3. package/dist/cjs/components/app-bar.d.ts.map +1 -0
  4. package/dist/cjs/components/app-bar.js +2 -0
  5. package/dist/cjs/components/app-bar.js.map +7 -0
  6. package/dist/cjs/components/chatbar.js +2 -2
  7. package/dist/cjs/components/chatbar.js.map +4 -4
  8. package/dist/cjs/components/context-menu.js +1 -1
  9. package/dist/cjs/components/context-menu.js.map +4 -4
  10. package/dist/cjs/components/dropdown-menu.js +1 -1
  11. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  12. package/dist/cjs/components/index.d.ts +2 -1
  13. package/dist/cjs/components/index.d.ts.map +1 -1
  14. package/dist/cjs/components/index.js +5 -5
  15. package/dist/cjs/components/index.js.map +4 -4
  16. package/dist/cjs/components/message-scroller.d.ts +6 -0
  17. package/dist/cjs/components/message-scroller.d.ts.map +1 -1
  18. package/dist/cjs/components/message-scroller.js +2 -2
  19. package/dist/cjs/components/message-scroller.js.map +4 -4
  20. package/dist/cjs/components/scroll-area.d.ts.map +1 -1
  21. package/dist/cjs/components/scroll-area.js +1 -1
  22. package/dist/cjs/components/scroll-area.js.map +4 -4
  23. package/dist/cjs/components/scroll-area.props.d.ts +10 -0
  24. package/dist/cjs/components/scroll-area.props.d.ts.map +1 -1
  25. package/dist/cjs/components/scroll-area.props.js +1 -1
  26. package/dist/cjs/components/scroll-area.props.js.map +2 -2
  27. package/dist/cjs/components/sidebar.js +1 -1
  28. package/dist/cjs/components/sidebar.js.map +4 -4
  29. package/dist/cjs/components/table.js +1 -1
  30. package/dist/cjs/components/table.js.map +4 -4
  31. package/dist/cjs/components/theme-panel.js +3 -3
  32. package/dist/cjs/components/theme-panel.js.map +4 -4
  33. package/dist/cjs/components/toolbar.d.ts +88 -36
  34. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  35. package/dist/cjs/components/toolbar.js +4 -1
  36. package/dist/cjs/components/toolbar.js.map +4 -4
  37. package/dist/cjs/components/toolbar.props.d.ts +28 -0
  38. package/dist/cjs/components/toolbar.props.d.ts.map +1 -0
  39. package/dist/cjs/components/toolbar.props.js +2 -0
  40. package/dist/cjs/components/toolbar.props.js.map +7 -0
  41. package/dist/cjs/hooks/use-scroll-edges.d.ts +12 -0
  42. package/dist/cjs/hooks/use-scroll-edges.d.ts.map +1 -0
  43. package/dist/cjs/hooks/use-scroll-edges.js +2 -0
  44. package/dist/cjs/hooks/use-scroll-edges.js.map +7 -0
  45. package/dist/cjs/index.js +5 -5
  46. package/dist/cjs/index.js.map +4 -4
  47. package/dist/cjs/props/index.js +1 -1
  48. package/dist/cjs/props/index.js.map +2 -2
  49. package/dist/esm/{chunk-ABSKRHVM.js → chunk-36A5BYCN.js} +2 -2
  50. package/dist/esm/{chunk-73QGEY2I.js → chunk-3R4YLW4A.js} +2 -2
  51. package/dist/esm/{chunk-ZZLZGHZQ.js → chunk-4LDVSTXI.js} +2 -2
  52. package/dist/esm/{chunk-YQRSAP46.js → chunk-53SZ4Y23.js} +2 -2
  53. package/dist/esm/chunk-54JFIP5S.js +2 -0
  54. package/dist/esm/chunk-54JFIP5S.js.map +7 -0
  55. package/dist/esm/chunk-5BWLY27A.js +2 -0
  56. package/dist/esm/chunk-5BWLY27A.js.map +7 -0
  57. package/dist/esm/{chunk-X3JM2565.js → chunk-6G3MPL4A.js} +2 -2
  58. package/dist/esm/{chunk-DSJY5RI3.js → chunk-7JJT42J2.js} +2 -2
  59. package/dist/esm/chunk-C7EVYSWK.js +1 -0
  60. package/dist/esm/chunk-COWZAUZR.js +2 -0
  61. package/dist/esm/chunk-COWZAUZR.js.map +7 -0
  62. package/dist/esm/{chunk-ERY5TH2M.js → chunk-CYU6BLZ5.js} +2 -2
  63. package/dist/esm/{chunk-MWIIGYAJ.js → chunk-D6PHTHF2.js} +2 -2
  64. package/dist/esm/{chunk-YTD3AJAU.js → chunk-ENLFKWYV.js} +2 -2
  65. package/dist/esm/{chunk-4XGGX2V2.js → chunk-ISOLUTZF.js} +2 -2
  66. package/dist/esm/{chunk-LXWPEDPZ.js → chunk-IYCPYN4Z.js} +2 -2
  67. package/dist/esm/{chunk-RJP5QUXO.js → chunk-L5PID6BU.js} +2 -2
  68. package/dist/esm/{chunk-BW5CO4PZ.js → chunk-METRW4HG.js} +2 -2
  69. package/dist/esm/{chunk-PYHEBG5I.js → chunk-MJOXEUBT.js} +2 -2
  70. package/dist/esm/{chunk-PHC3QBV3.js → chunk-MZXHKM4V.js} +2 -2
  71. package/dist/esm/chunk-OIUCV5HK.js +2 -0
  72. package/dist/esm/chunk-OIUCV5HK.js.map +7 -0
  73. package/dist/esm/{chunk-NIM7DIVH.js → chunk-PQKJNRMR.js} +2 -2
  74. package/dist/esm/{chunk-65GAANJD.js → chunk-UYCPDGWA.js} +2 -2
  75. package/dist/esm/chunk-XLMTTSRO.js +2 -0
  76. package/dist/esm/chunk-XLMTTSRO.js.map +7 -0
  77. package/dist/esm/chunk-XPRPYCII.js +2 -0
  78. package/dist/esm/{chunk-5KICSAT7.js.map → chunk-XPRPYCII.js.map} +2 -2
  79. package/dist/esm/{chunk-QWVU2TW4.js → chunk-ZK7A2MZZ.js} +2 -2
  80. package/dist/esm/chunk-ZUOK3KFY.js +2 -0
  81. package/dist/esm/chunk-ZUOK3KFY.js.map +7 -0
  82. package/dist/esm/components/_internal/base-button.js +1 -1
  83. package/dist/esm/components/alert-dialog.js +1 -1
  84. package/dist/esm/components/app-bar.d.ts +49 -0
  85. package/dist/esm/components/app-bar.d.ts.map +1 -0
  86. package/dist/esm/components/app-bar.js +2 -0
  87. package/dist/esm/components/app-bar.js.map +7 -0
  88. package/dist/esm/components/button.js +1 -1
  89. package/dist/esm/components/chatbar.js +1 -1
  90. package/dist/esm/components/checkbox-cards.js +1 -1
  91. package/dist/esm/components/context-menu.js +1 -1
  92. package/dist/esm/components/dialog.js +1 -1
  93. package/dist/esm/components/dropdown-menu.js +1 -1
  94. package/dist/esm/components/icon-button.js +1 -1
  95. package/dist/esm/components/index.d.ts +2 -1
  96. package/dist/esm/components/index.d.ts.map +1 -1
  97. package/dist/esm/components/index.js +1 -1
  98. package/dist/esm/components/message-scroller.d.ts +6 -0
  99. package/dist/esm/components/message-scroller.d.ts.map +1 -1
  100. package/dist/esm/components/message-scroller.js +1 -1
  101. package/dist/esm/components/notice.js +1 -1
  102. package/dist/esm/components/scroll-area.d.ts.map +1 -1
  103. package/dist/esm/components/scroll-area.js +1 -1
  104. package/dist/esm/components/scroll-area.props.d.ts +10 -0
  105. package/dist/esm/components/scroll-area.props.d.ts.map +1 -1
  106. package/dist/esm/components/scroll-area.props.js +1 -1
  107. package/dist/esm/components/sheet.js +1 -1
  108. package/dist/esm/components/shell.js +1 -1
  109. package/dist/esm/components/sidebar.js +1 -1
  110. package/dist/esm/components/table.js +1 -1
  111. package/dist/esm/components/theme-panel.js +1 -1
  112. package/dist/esm/components/toggle-button.js +1 -1
  113. package/dist/esm/components/toggle-icon-button.js +1 -1
  114. package/dist/esm/components/toolbar.d.ts +88 -36
  115. package/dist/esm/components/toolbar.d.ts.map +1 -1
  116. package/dist/esm/components/toolbar.js +1 -1
  117. package/dist/esm/components/toolbar.props.d.ts +28 -0
  118. package/dist/esm/components/toolbar.props.d.ts.map +1 -0
  119. package/dist/esm/components/toolbar.props.js +2 -0
  120. package/dist/esm/components/toolbar.props.js.map +7 -0
  121. package/dist/esm/components/user-card.js +1 -1
  122. package/dist/esm/hooks/use-scroll-edges.d.ts +12 -0
  123. package/dist/esm/hooks/use-scroll-edges.d.ts.map +1 -0
  124. package/dist/esm/hooks/use-scroll-edges.js +2 -0
  125. package/dist/esm/hooks/use-scroll-edges.js.map +7 -0
  126. package/dist/esm/index.js +1 -1
  127. package/dist/esm/props/index.js +1 -1
  128. package/package.json +1 -1
  129. package/src/components/app-bar.css +204 -0
  130. package/src/components/app-bar.tsx +256 -0
  131. package/src/components/index.css +2 -0
  132. package/src/components/index.tsx +13 -1
  133. package/src/components/message-scroller.tsx +24 -5
  134. package/src/components/scroll-area.css +44 -0
  135. package/src/components/scroll-area.props.tsx +8 -0
  136. package/src/components/scroll-area.tsx +7 -1
  137. package/src/components/toolbar.css +87 -160
  138. package/src/components/toolbar.props.tsx +27 -0
  139. package/src/components/toolbar.tsx +259 -193
  140. package/src/hooks/use-scroll-edges.ts +46 -0
  141. package/src/styles/tokens/color.css +19 -0
  142. package/styles.css +159 -26
  143. package/tokens/base.css +14 -0
  144. package/tokens.css +14 -0
  145. package/dist/esm/chunk-47LMOIW3.js +0 -2
  146. package/dist/esm/chunk-47LMOIW3.js.map +0 -7
  147. package/dist/esm/chunk-5KICSAT7.js +0 -2
  148. package/dist/esm/chunk-CTA5ODAO.js +0 -2
  149. package/dist/esm/chunk-CTA5ODAO.js.map +0 -7
  150. package/dist/esm/chunk-JKS2YXMS.js +0 -1
  151. package/dist/esm/chunk-W4WWN3RC.js +0 -2
  152. package/dist/esm/chunk-W4WWN3RC.js.map +0 -7
  153. /package/dist/esm/{chunk-ABSKRHVM.js.map → chunk-36A5BYCN.js.map} +0 -0
  154. /package/dist/esm/{chunk-73QGEY2I.js.map → chunk-3R4YLW4A.js.map} +0 -0
  155. /package/dist/esm/{chunk-ZZLZGHZQ.js.map → chunk-4LDVSTXI.js.map} +0 -0
  156. /package/dist/esm/{chunk-YQRSAP46.js.map → chunk-53SZ4Y23.js.map} +0 -0
  157. /package/dist/esm/{chunk-X3JM2565.js.map → chunk-6G3MPL4A.js.map} +0 -0
  158. /package/dist/esm/{chunk-DSJY5RI3.js.map → chunk-7JJT42J2.js.map} +0 -0
  159. /package/dist/esm/{chunk-JKS2YXMS.js.map → chunk-C7EVYSWK.js.map} +0 -0
  160. /package/dist/esm/{chunk-ERY5TH2M.js.map → chunk-CYU6BLZ5.js.map} +0 -0
  161. /package/dist/esm/{chunk-MWIIGYAJ.js.map → chunk-D6PHTHF2.js.map} +0 -0
  162. /package/dist/esm/{chunk-YTD3AJAU.js.map → chunk-ENLFKWYV.js.map} +0 -0
  163. /package/dist/esm/{chunk-4XGGX2V2.js.map → chunk-ISOLUTZF.js.map} +0 -0
  164. /package/dist/esm/{chunk-LXWPEDPZ.js.map → chunk-IYCPYN4Z.js.map} +0 -0
  165. /package/dist/esm/{chunk-RJP5QUXO.js.map → chunk-L5PID6BU.js.map} +0 -0
  166. /package/dist/esm/{chunk-BW5CO4PZ.js.map → chunk-METRW4HG.js.map} +0 -0
  167. /package/dist/esm/{chunk-PYHEBG5I.js.map → chunk-MJOXEUBT.js.map} +0 -0
  168. /package/dist/esm/{chunk-PHC3QBV3.js.map → chunk-MZXHKM4V.js.map} +0 -0
  169. /package/dist/esm/{chunk-NIM7DIVH.js.map → chunk-PQKJNRMR.js.map} +0 -0
  170. /package/dist/esm/{chunk-65GAANJD.js.map → chunk-UYCPDGWA.js.map} +0 -0
  171. /package/dist/esm/{chunk-QWVU2TW4.js.map → chunk-ZK7A2MZZ.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/app-bar.tsx", "../../../src/components/card.tsx", "../../../src/props/as-child.prop.ts", "../../../src/components/card.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/margin.props.ts", "../../../src/components/flex.tsx", "../../../src/props/padding.props.ts", "../../../src/props/height.props.ts", "../../../src/props/width.props.ts", "../../../src/props/layout.props.ts", "../../../src/components/slot.tsx", "../../../src/props/gap.props.ts", "../../../src/components/flex.props.tsx", "../../../src/components/heading.tsx", "../../../src/props/color.prop.ts", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/heading.props.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { FlexProps } from './flex.js';\n\n// ============================================================================\n// AppBar Root\n// ============================================================================\n\ntype AppBarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface AppBarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\n/**\n * An app bar: the band anchored to one edge of a pane, with left, center and right sections\n * and a title. It publishes its height (or width) to its parent as `--rt-app-bar-height`\n * (`--rt-app-bar-width`) so content can pad itself clear of it.\n *\n * This component was called `Toolbar` until 0.11.0. It is not a `role=\"toolbar\"`: for a row of\n * controls with one tab stop and arrow-key navigation, use `Toolbar`.\n */\nconst AppBarRoot = React.forwardRef<AppBarRootElement, AppBarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n // `--rt-toolbar-*` are the names this bar published while it was called Toolbar.\n // They are still written so existing layouts keep their offset; prefer `--rt-app-bar-*`.\n if (isHorizontal) {\n parent.style.setProperty('--rt-app-bar-height', `${dimension}px`);\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-app-bar-width', `${dimension}px`);\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-AppBar', className)}\n style={computedStyle}\n {...restProps}\n >\n <div className=\"rt-AppBarInner\">\n {children}\n </div>\n </Card>\n );\n },\n);\nAppBarRoot.displayName = 'AppBar.Root';\n\n// ============================================================================\n// AppBar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype AppBarSectionElement = React.ElementRef<'div'>;\ntype AppBarSectionProps = FlexProps;\n\nconst AppBarLeft = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarLeft.displayName = 'AppBar.Left';\n\n// ============================================================================\n// AppBar Center\n// ============================================================================\n\nconst AppBarCenter = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarCenter.displayName = 'AppBar.Center';\n\n// ============================================================================\n// AppBar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst AppBarRight = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarRight.displayName = 'AppBar.Right';\n\n// ============================================================================\n// AppBar Title\n// ============================================================================\n\ntype AppBarTitleElement = React.ElementRef<typeof Heading>;\ntype AppBarTitleProps = React.ComponentPropsWithoutRef<typeof Heading>;\n\nconst AppBarTitle = React.forwardRef<AppBarTitleElement, AppBarTitleProps>(\n ({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-AppBarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nAppBarTitle.displayName = 'AppBar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst AppBar = AppBarRoot as typeof AppBarRoot & {\n Root: typeof AppBarRoot;\n Left: typeof AppBarLeft;\n Center: typeof AppBarCenter;\n Right: typeof AppBarRight;\n Title: typeof AppBarTitle;\n};\n\nAppBar.Root = AppBarRoot;\nAppBar.Left = AppBarLeft;\nAppBar.Center = AppBarCenter;\nAppBar.Right = AppBarRight;\nAppBar.Title = AppBarTitle;\n\nexport {\n AppBar,\n AppBarRoot as Root,\n AppBarLeft as Left,\n AppBarCenter as Center,\n AppBarRight as Right,\n AppBarTitle as Title,\n};\nexport type {\n AppBarRootProps as RootProps,\n AppBarSectionProps as LeftProps,\n AppBarSectionProps as CenterProps,\n AppBarSectionProps as RightProps,\n AppBarTitleProps as TitleProps,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { Slot } from './slot.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { FlexOwnProps } from './flex.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\n\ntype FlexElement = React.ElementRef<'div'>;\ninterface CommonFlexProps extends MarginProps, LayoutProps, FlexOwnProps {}\ntype FlexDivProps = { as?: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype FlexSpanProps = { as: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype FlexProps = CommonFlexProps & (FlexSpanProps | FlexDivProps);\n\nconst Flex = React.forwardRef<FlexElement, FlexProps>((props, forwardedRef) => {\n const {\n className,\n asChild,\n as: Tag = 'div',\n ...flexProps\n } = extractProps(props, flexPropDefs, layoutPropDefs, marginPropDefs);\n const Comp = asChild ? Slot : Tag;\n return <Comp {...flexProps} ref={forwardedRef} className={classNames('rt-Flex', className)} />;\n});\nFlex.displayName = 'Flex';\n\nexport { Flex };\nexport type { FlexProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst paddingValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst paddingPropDefs = {\n /**\n * Sets the CSS **padding** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * p=\"4\"\n * p=\"100px\"\n * p={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n */\n p: {\n type: 'enum | string',\n className: 'rt-r-p',\n customProperties: ['--p'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** and **padding-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * px=\"4\"\n * px=\"100px\"\n * px={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n px: {\n type: 'enum | string',\n className: 'rt-r-px',\n customProperties: ['--pl', '--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** and **padding-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * py=\"4\"\n * py=\"100px\"\n * py={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n py: {\n type: 'enum | string',\n className: 'rt-r-py',\n customProperties: ['--pt', '--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pt=\"4\"\n * pt=\"100px\"\n * pt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n */\n pt: {\n type: 'enum | string',\n className: 'rt-r-pt',\n customProperties: ['--pt'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pr=\"4\"\n * pr=\"100px\"\n * pr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n pr: {\n type: 'enum | string',\n className: 'rt-r-pr',\n customProperties: ['--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pb=\"4\"\n * pb=\"100px\"\n * pb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n pb: {\n type: 'enum | string',\n className: 'rt-r-pb',\n customProperties: ['--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pl=\"4\"\n * pl=\"100px\"\n * pl={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n */\n pl: {\n type: 'enum | string',\n className: 'rt-r-pl',\n customProperties: ['--pl'],\n values: paddingValues,\n responsive: true,\n },\n} satisfies {\n p: PropDef<(typeof paddingValues)[number]>;\n px: PropDef<(typeof paddingValues)[number]>;\n py: PropDef<(typeof paddingValues)[number]>;\n pt: PropDef<(typeof paddingValues)[number]>;\n pr: PropDef<(typeof paddingValues)[number]>;\n pb: PropDef<(typeof paddingValues)[number]>;\n pl: PropDef<(typeof paddingValues)[number]>;\n};\n\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'rt-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'rt-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'rt-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'rt-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'rt-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'rt-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import { paddingPropDefs } from './padding.props.js';\nimport { heightPropDefs } from './height.props.js';\nimport { widthPropDefs } from './width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst overflowValues = ['visible', 'hidden', 'clip', 'scroll', 'auto'] as const;\nconst positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as const;\n// prettier-ignore\nconst positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;\nconst flexShrinkValues = ['0', '1'] as const;\nconst flexGrowValues = ['0', '1'] as const;\nconst alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\n\nconst layoutPropDefs = {\n ...paddingPropDefs,\n ...widthPropDefs,\n ...heightPropDefs,\n /**\n * Sets the CSS **position** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * position=\"absolute\"\n * position={{ sm: 'absolute', lg: 'sticky' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/position\n */\n position: {\n type: 'enum',\n className: 'rt-r-position',\n values: positionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **inset** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * inset=\"4\"\n * inset=\"100px\"\n * inset={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: {\n type: 'enum | string',\n className: 'rt-r-inset',\n customProperties: ['--inset'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * top=\"4\"\n * top=\"100px\"\n * top={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/top\n */\n top: {\n type: 'enum | string',\n className: 'rt-r-top',\n customProperties: ['--top'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * right=\"4\"\n * right=\"100px\"\n * right={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/right\n */\n right: {\n type: 'enum | string',\n className: 'rt-r-right',\n customProperties: ['--right'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * bottom=\"4\"\n * bottom=\"100px\"\n * bottom={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n */\n bottom: {\n type: 'enum | string',\n className: 'rt-r-bottom',\n customProperties: ['--bottom'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * left=\"4\"\n * left=\"100px\"\n * left={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/left\n */\n left: {\n type: 'enum | string',\n className: 'rt-r-left',\n customProperties: ['--left'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflow=\"hidden\"\n * overflow={{ sm: 'hidden', lg: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflow: {\n type: 'enum',\n className: 'rt-r-overflow',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-x** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowX=\"hidden\"\n * overflowX={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowX: {\n type: 'enum',\n className: 'rt-r-ox',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-y** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowY=\"hidden\"\n * overflowY={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowY: {\n type: 'enum',\n className: 'rt-r-oy',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-basis** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexBasis=\"0\"\n * flexBasis=\"100%\"\n * flexBasis={{ sm: '200px', lg: 'auto' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis\n */\n flexBasis: {\n type: 'string',\n className: 'rt-r-fb',\n customProperties: ['--flex-basis'],\n responsive: true,\n },\n /**\n * Sets the CSS **flex-shrink** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexShrink=\"0\"\n * flexShrink=\"1\"\n * flexShrink={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink\n */\n flexShrink: {\n type: 'enum | string',\n className: 'rt-r-fs',\n customProperties: ['--flex-shrink'],\n values: flexShrinkValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-grow** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexGrow=\"0\"\n * flexGrow=\"1\"\n * flexGrow={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow\n */\n flexGrow: {\n type: 'enum | string',\n className: 'rt-r-fg',\n customProperties: ['--flex-grow'],\n values: flexGrowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **grid-area** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridArea=\"header\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area\n */\n gridArea: {\n type: 'string',\n className: 'rt-r-ga',\n customProperties: ['--grid-area'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumn=\"1\"\n * gridColumn=\"1 / -1\"\n * gridColumn={{ sm: '1 / 3', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column\n */\n gridColumn: {\n type: 'string',\n className: 'rt-r-gc',\n customProperties: ['--grid-column'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnStart=\"1\"\n * gridColumnStart=\"auto\"\n * gridColumnStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start\n */\n gridColumnStart: {\n type: 'string',\n className: 'rt-r-gcs',\n customProperties: ['--grid-column-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnEnd=\"1\"\n * gridColumnEnd=\"auto\"\n * gridColumnEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end\n */\n gridColumnEnd: {\n type: 'string',\n className: 'rt-r-gce',\n customProperties: ['--grid-column-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRow=\"1\"\n * gridRow=\"auto\"\n * gridRow={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row\n */\n gridRow: {\n type: 'string',\n className: 'rt-r-gr',\n customProperties: ['--grid-row'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowStart=\"1\"\n * gridRowStart=\"auto\"\n * gridRowStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start\n */\n gridRowStart: {\n type: 'string',\n className: 'rt-r-grs',\n customProperties: ['--grid-row-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowEnd=\"1\"\n * gridRowEnd=\"auto\"\n * gridRowEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end\n */\n gridRowEnd: {\n type: 'string',\n className: 'rt-r-gre',\n customProperties: ['--grid-row-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **align-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * alignSelf=\"center\"\n * alignSelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n */\n alignSelf: {\n type: 'enum',\n className: 'rt-r-as',\n values: alignSelfValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justifySelf=\"center\"\n * justifySelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self\n */\n justifySelf: {\n type: 'enum',\n className: 'rt-r-js',\n values: justifySelfValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n inset: PropDef<(typeof positionEdgeValues)[number]>;\n top: PropDef<(typeof positionEdgeValues)[number]>;\n right: PropDef<(typeof positionEdgeValues)[number]>;\n bottom: PropDef<(typeof positionEdgeValues)[number]>;\n left: PropDef<(typeof positionEdgeValues)[number]>;\n overflow: PropDef<(typeof overflowValues)[number]>;\n overflowX: PropDef<(typeof overflowValues)[number]>;\n overflowY: PropDef<(typeof overflowValues)[number]>;\n flexBasis: PropDef<string>;\n flexShrink: PropDef<(typeof flexShrinkValues)[number]>;\n flexGrow: PropDef<(typeof flexGrowValues)[number]>;\n gridColumn: PropDef<string>;\n gridColumnStart: PropDef<string>;\n gridColumnEnd: PropDef<string>;\n gridRow: PropDef<string>;\n gridRowStart: PropDef<string>;\n gridRowEnd: PropDef<string>;\n gridArea: PropDef<string>;\n alignSelf: PropDef<(typeof alignSelfValues)[number]>;\n justifySelf: PropDef<(typeof justifySelfValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype LayoutProps = GetPropDefTypes<\n typeof paddingPropDefs & typeof widthPropDefs & typeof heightPropDefs & typeof layoutPropDefs\n>;\n\nexport { layoutPropDefs };\nexport type { LayoutProps };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "import type { PropDef } from './prop-def.js';\n\nconst gapValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst gapPropDefs = {\n /**\n * Sets the CSS **gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gap=\"4\"\n * gap=\"20px\"\n * gap={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/gap\n */\n gap: {\n type: 'enum | string',\n className: 'rt-r-gap',\n customProperties: ['--gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **row-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapX=\"4\"\n * gapX=\"20px\"\n * gapX={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap\n */\n gapX: {\n type: 'enum | string',\n className: 'rt-r-cg',\n customProperties: ['--column-gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **column-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapY=\"4\"\n * gapY=\"20px\"\n * gapY={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap\n */\n gapY: {\n type: 'enum | string',\n className: 'rt-r-rg',\n customProperties: ['--row-gap'],\n values: gapValues,\n responsive: true,\n },\n} satisfies {\n gap: PropDef<(typeof gapValues)[number]>;\n gapX: PropDef<(typeof gapValues)[number]>;\n gapY: PropDef<(typeof gapValues)[number]>;\n};\n\nexport { gapPropDefs };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { gapPropDefs } from '../props/gap.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst as = ['div', 'span'] as const;\nconst displayValues = ['none', 'inline-flex', 'flex'] as const;\nconst directionValues = ['row', 'column', 'row-reverse', 'column-reverse'] as const;\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\nconst wrapValues = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\nconst flexPropDefs = {\n /**\n * Controls whether to render **div** or **span**\n *\n * @example\n * as=\"div\"\n * as=\"span\"\n */\n as: { type: 'enum', values: as, default: 'div' },\n ...asChildPropDef,\n /**\n * Sets the CSS **display** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * display=\"inline-flex\"\n * display={{ sm: 'none', lg: 'flex' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/display\n */\n display: {\n type: 'enum',\n className: 'rt-r-display',\n values: displayValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-direction** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * direction=\"column\"\n * direction={{ sm: 'column', lg: 'row' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n */\n direction: {\n type: 'enum',\n className: 'rt-r-fd',\n values: directionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **align-items** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * align=\"center\"\n * align={{ sm: 'baseline', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n */\n align: {\n type: 'enum',\n className: 'rt-r-ai',\n values: alignValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-content** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justify=\"between\"\n * justify={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n */\n justify: {\n type: 'enum',\n className: 'rt-r-jc',\n values: justifyValues,\n parseValue: parseJustifyValue,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-wrap** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * wrap=\"wrap\"\n * wrap={{ sm: 'wrap', lg: 'nowrap' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n */\n wrap: {\n type: 'enum',\n className: 'rt-r-fw',\n values: wrapValues,\n responsive: true,\n },\n ...gapPropDefs,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n display: PropDef<(typeof displayValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n align: PropDef<(typeof alignValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n wrap: PropDef<(typeof wrapValues)[number]>;\n};\n\nfunction parseJustifyValue(value: string) {\n return value === 'between' ? 'space-between' : value;\n}\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype FlexOwnProps = GetPropDefTypes<\n typeof flexPropDefs & typeof gapPropDefs & typeof asChildPropDef\n>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { headingPropDefs } from './heading.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype HeadingElement = React.ElementRef<'h1'>;\ntype HeadingOwnProps = GetPropDefTypes<typeof headingPropDefs>;\ninterface CommonHeadingProps extends MarginProps, HeadingOwnProps {}\ntype HeadingH1Props = { as?: 'h1' } & ComponentPropsWithout<'h1', RemovedProps>;\ntype HeadingH2Props = { as: 'h2' } & ComponentPropsWithout<'h2', RemovedProps>;\ntype HeadingH3Props = { as: 'h3' } & ComponentPropsWithout<'h3', RemovedProps>;\ntype HeadingH4Props = { as: 'h4' } & ComponentPropsWithout<'h4', RemovedProps>;\ntype HeadingH5Props = { as: 'h5' } & ComponentPropsWithout<'h5', RemovedProps>;\ntype HeadingH6Props = { as: 'h6' } & ComponentPropsWithout<'h6', RemovedProps>;\ntype HeadingProps = CommonHeadingProps &\n (HeadingH1Props | HeadingH2Props | HeadingH3Props | HeadingH4Props | HeadingH5Props | HeadingH6Props);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\nconst mergedPropDefs = { ...headingPropDefs, ...marginPropDefs };\n\nconst Heading = React.memo(\n React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'h1',\n color,\n ...headingProps\n } = extractProps(props, mergedPropDefs);\n\n const combinedClassName = className ? `rt-Heading ${className}` : 'rt-Heading';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...headingProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(headingProps as React.HTMLAttributes<HTMLHeadingElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nHeading.displayName = 'Heading';\n\nexport { Heading };\nexport type { HeadingProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code, DataList.Label).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default (DataList.Label: 'medium') spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'rt-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'rt-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'rt-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'rt-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'rt-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'rt-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst weights = ['thin', 'extralight', 'light', 'regular', 'medium', 'semibold', 'bold', 'extrabold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'rt-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nconst sizes = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst headingPropDefs = {\n as: { type: 'enum', values: as, default: 'h1' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'rt-r-size',\n values: sizes,\n default: '6',\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { headingPropDefs };\n"],
5
+ "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,EAAA,WAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,IAAA,eAAAC,GAAAR,IAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBCDvB,IAAAC,EAAuB,oBACvBC,GAAuB,yBACvBC,GAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,GAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,GAAmB,CAAC,QAAS,aAAa,EAC1CC,GAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQL,GAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,GAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,GAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQ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AAW,mBAAoB,iBAAkBhB,CAAS,EACpE,GAAGR,GAEHU,CACH,CAEJ,EACAqB,EAAY,YAAc,eAS1B,IAAMC,EAAoB,aACxB,CAAC,CAAE,UAAAxB,EAAW,KAAAH,EAAO,IAAK,OAAA4B,EAAS,SAAU,SAAAC,EAAW,GAAM,SAAAxB,EAAU,GAAGV,CAAM,EAAGC,IAClF,gBAACkC,EAAA,CACC,IAAKlC,EACL,KAAMI,EACN,OAAQ4B,EACR,SAAUC,EACV,aAAW,EAAAV,SAAW,iBAAkBhB,CAAS,EAChD,GAAGR,GAEHU,CACH,CAEJ,EACAsB,EAAY,YAAc,eAM1B,IAAMI,EAASrC,EAQfqC,EAAO,KAAOrC,EACdqC,EAAO,KAAOX,EACdW,EAAO,OAASP,EAChBO,EAAO,MAAQL,EACfK,EAAO,MAAQJ",
6
+ "names": ["app_bar_exports", "__export", "AppBar", "AppBarCenter", "AppBarLeft", "AppBarRight", "AppBarRoot", "AppBarTitle", "__toCommonJS", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs", "asChildPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "marginValues", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "extractProps", "cardPropDefs", "marginPropDefs", "effectiveMaterial", "Comp", "classNames", "React", "import_classnames", "paddingValues", "paddingPropDefs", "heightPropDefs", "widthPropDefs", "overflowValues", "positionValues", "positionEdgeValues", "flexShrinkValues", "flexGrowValues", "alignSelfValues", "justifySelfValues", "layoutPropDefs", "paddingPropDefs", "widthPropDefs", "heightPropDefs", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "gapValues", "gapPropDefs", "as", "displayValues", "directionValues", "alignValues", "justifyValues", "wrapValues", "flexPropDefs", "asChildPropDef", "parseJustifyValue", "gapPropDefs", "value", "Flex", "props", "forwardedRef", "className", "asChild", "Tag", "flexProps", "extractProps", "flexPropDefs", "layoutPropDefs", "marginPropDefs", "Slot", "classNames", "React", "import_radix_ui", "accentColors", "colorPropDef", "accentColors", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "headingPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "mergedPropDefs", "headingPropDefs", "marginPropDefs", "Heading", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "headingProps", "extractProps", "combinedClassName", "AppBarRoot", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "Card", "classNames", "AppBarLeft", "gap", "align", "Flex", "AppBarCenter", "justify", "AppBarRight", "AppBarTitle", "weight", "truncate", "Heading", "AppBar"]
7
+ }
@@ -1,5 +1,5 @@
1
- "use strict";var Sr=Object.create;var at=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Br=Object.getPrototypeOf,Ar=Object.prototype.hasOwnProperty;var Er=(e,t)=>{for(var o in t)at(e,o,{get:t[o],enumerable:!0})},po=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of kr(t))!Ar.call(e,n)&&n!==o&&at(e,n,{get:()=>t[n],enumerable:!(a=Nr(t,n))||a.enumerable});return e};var T=(e,t,o)=>(o=e!=null?Sr(Br(e)):{},po(t||!e||!e.__esModule?at(o,"default",{value:e,enumerable:!0}):o,e)),Fr=e=>po(at({},"__esModule",{value:!0}),e);var zn={};Er(zn,{AttachTrigger:()=>lr,Attachment:()=>Jt,AttachmentsRow:()=>pr,InlineEnd:()=>ir,InlineStart:()=>ar,Root:()=>nr,Row:()=>cr,RowEnd:()=>mr,RowStart:()=>ur,Send:()=>dr,Textarea:()=>sr});module.exports=Fr(zn);var r=T(require("react")),K=T(require("classnames")),Z=require("motion/react"),Zt=require("radix-ui/internal"),tr=require("react-dropzone");var _e=T(require("react")),Uo=T(require("classnames"));var O=T(require("react")),No=T(require("classnames")),ko=require("radix-ui");var te={asChild:{type:"boolean"}};var it=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],lo=["auto","gray","mauve","slate","sage","olive","sand"],co={color:{type:"enum",values:it,default:void 0}},uo={color:{type:"enum",values:it,default:""}};var Ft=["none","small","medium","large","full"],pt={radius:{type:"enum",values:Ft,default:void 0}};var Or=["1","2","3","4"],Vr=["classic","solid","soft","surface","outline","ghost","override"],Mr=["solid","translucent"],Ir=["solid","translucent"],Ot={...te,size:{type:"enum",className:"rt-r-size",values:Or,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:Vr,default:"solid"},...uo,...pt,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:Ir,default:void 0},panelBackground:{type:"enum",values:Mr,default:void 0},flush:{type:"boolean",default:!1}};var mt=T(require("react")),Co=T(require("classnames"));var go=T(require("classnames"));var Lr=[],jr=new Set;function zr(e){let t=Object.assign({},...e),o=[],a=[],n=new Set;for(let p in t){let s=t[p],i=s.values??Lr,c={key:p,type:s.type,default:s.default,hasDefault:s.default!==void 0,responsive:"responsive"in s,className:s.className,customProperties:s.customProperties,parseValue:s.parseValue,values:i,valueSet:i.length>0?new Set(i):jr,enumValueSet:s.type==="enum"?new Set([s.default,...i]):void 0};s.className?(o.push(c),n.add(p)):(c.hasDefault||s.type==="enum")&&a.push(c)}return{styling:o,passthrough:a,stylingKeys:n}}var Hr={children:new WeakMap};function mo(e){let t=Hr;for(let o=0;o<e.length;o++){let a=e[o],n=t.children.get(a);n===void 0&&(n={children:new WeakMap},t.children.set(a,n)),t=n}return t.compiled??(t.compiled=zr(e))}var Wr=["initial","xs","sm","md","lg","xl"],Vt=new Set(Wr);function Mt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Gr=new Set(["initial","xs","sm","md","lg","xl"]);function be(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(Gr.has(t))return!0;return!1}function lt(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function ct({className:e,customProperties:t,...o}){let a=Be({allowArbitraryValues:!0,className:e,...o}),n=$r({customProperties:t,...o});return[a,n]}function Be({allowArbitraryValues:e,value:t,className:o,propValues:a,propValueSet:n,parseValue:p=s=>s}){if(t){if(typeof t=="string")return lt(a,n,t)?fo(o,t,p):e?o:void 0;if(be(t)){let s=t,i=[];for(let c in s){if(!Mt(s,c)||!Vt.has(c))continue;let l=s[c];if(l!==void 0){if(lt(a,n,l)){let u=fo(o,l,p),g=c==="initial"?u:`${c}:${u}`;i.push(g)}else if(e){let u=c==="initial"?o:`${c}:${o}`;i.push(u)}}}return i.length>0?i.join(" "):""}if(e)return o}}function fo(e,t,o){let a=e?"-":"",n=o(t),p=n?.startsWith("-"),s=p?"-":"",i=p?n?.substring(1):n;return`${s}${e}${a}${i}`}function $r({customProperties:e,value:t,propValues:o,propValueSet:a,parseValue:n=p=>p}){if(!t||typeof t=="string"&&lt(o,a,t))return;let p;if(typeof t=="string"){let s=n(t);p={};for(let i of e)p[i]=s;return p}if(be(t)){let s=t;for(let i in s){if(!Mt(s,i)||!Vt.has(i))continue;let c=s[i];if(c===void 0||lt(o,a,c))continue;let l=n(c);p??(p={});for(let u of e){let g=i==="initial"?u:`${u}-${i}`;p[g]=l}}}return p??{}}function ve(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function Ur(e,t){let o=e.initial,a=!1;return t.hasDefault&&o===void 0&&(o=t.default,a=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,a=!0),a?{...e,initial:o}:e}function oe(e,...t){let{styling:o,passthrough:a,stylingKeys:n}=mo(t),p={};for(let c in e)n.has(c)||(p[c]=e[c]);for(let c=0;c<a.length;c++){let l=a[c],u=p[l.key];if(u===void 0){l.hasDefault&&(p[l.key]=l.default);continue}l.enumValueSet!==void 0&&!l.enumValueSet.has(u)&&!be(u)&&(p[l.key]=l.default)}let s,i=[];for(let c=0;c<o.length;c++){let l=o[c],u=e[l.key];if(u===void 0&&l.hasDefault&&(u=l.default),l.enumValueSet!==void 0&&!l.enumValueSet.has(u)&&!be(u)&&(u=l.default),!!u){if(be(u)){if(!l.responsive)continue;u=Ur(u,l)}if(l.type==="enum"){let g=Be({allowArbitraryValues:!1,value:u,className:l.className,propValues:l.values,propValueSet:l.valueSet,parseValue:l.parseValue});g&&i.push(g);continue}if(l.type==="string"||l.type==="enum | string"){let[g,f]=ct({className:l.className,customProperties:l.customProperties,propValues:l.type==="string"?[]:l.values,propValueSet:l.type==="string"?void 0:l.valueSet,parseValue:l.parseValue,value:u});f&&(s=ve(s,f)),g&&i.push(g);continue}if(l.type==="boolean"){i.push(l.className);continue}}}return p.className=(0,go.default)(i.length>0?i.join(" "):void 0,e.className),p.style=ve(s,e.style),p}var Ce=["0","1","2","3","4","5","6","7","8","9","10","11","12"],yo={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Ce,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Ce,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Ce,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Ce,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Ce,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Ce,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Ce,responsive:!0}};var ho={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Ae={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var It=["visible","hidden","clip","scroll","auto"],Kr=["static","relative","absolute","fixed","sticky"],We=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],_r=["0","1"],qr=["0","1"],Yr=["start","center","end","baseline","stretch"],Zr=["start","center","end","baseline","stretch"],Po={...yo,...Ae,...ho,position:{type:"enum",className:"rt-r-position",values:Kr,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:We,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:We,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:We,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:We,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:We,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:It,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:It,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:It,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:_r,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:qr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:Yr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:Zr,responsive:!0}};var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],re={m:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var ut=require("radix-ui"),hs=ut.Slot.Root,ne=ut.Slot.Root,Ps=ut.Slot.Slottable;var Lt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],bo={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:Lt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:Lt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:Lt,responsive:!0}};var Xr=["div","span"],Jr=["none","inline-flex","flex"],Qr=["row","column","row-reverse","column-reverse"],en=["start","center","end","baseline","stretch"],tn=["start","center","end","between"],on=["nowrap","wrap","wrap-reverse"],vo={as:{type:"enum",values:Xr,default:"div"},...te,display:{type:"enum",className:"rt-r-display",values:Jr,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:Qr,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:en,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:tn,parseValue:rn,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:on,responsive:!0},...bo};function rn(e){return e==="between"?"space-between":e}var ee=mt.forwardRef((e,t)=>{let{className:o,asChild:a,as:n="div",...p}=oe(e,vo,Po,re);return mt.createElement(a?ne:n,{...p,ref:t,className:(0,Co.default)("rt-Flex",o)})});ee.displayName="Flex";var j=T(require("react")),xo=T(require("classnames"));var nn=["1","2","3"],Ro={size:{type:"enum",className:"rt-r-size",values:nn,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var Ge=j.forwardRef((e,t)=>{let{className:o,children:a,loading:n,...p}=oe(e,Ro,re);if(!n)return a;let s=j.createElement("span",{...p,ref:t,className:(0,xo.default)("rt-Spinner",o)},j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}));return a===void 0?s:j.createElement(ee,{asChild:!0,position:"relative",align:"center",justify:"center"},j.createElement("span",null,j.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},a),j.createElement(ee,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},j.createElement("span",null,s))))});Ge.displayName="Spinner";var jt=require("radix-ui"),$e=jt.VisuallyHidden.Root,Ms=jt.VisuallyHidden.Root;var wo=T(require("react")),sn="Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.",Do=new Set;function an(e){Do.has(e)||(Do.add(e),console.warn(e))}function dt(e){wo.useEffect(()=>{},[e])}function To(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([o,a])=>[o,t(a)]))}function So(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var Ue=O.forwardRef((e,t)=>{let{size:o=Ot.size.default}=e,{className:a,children:n,asChild:p,as:s,color:i,radius:c,material:l,panelBackground:u,flush:g,disabled:f=e.loading,...D}=oe(e,Ot,re);dt(e.panelBackground);let S=l??u,y=p?ko.Slot.Root:s||"button",x=p||!s||["button","input","textarea","select"].includes(s),v=!p&&(!s||s==="button"),C="type"in D,R=O.useId(),b=e.loading?`${R}-loading`:void 0,M=O.useMemo(()=>typeof n=="string"?n:O.isValidElement(n)&&typeof n.props?.children=="string"?n.props.children:"button",[n]),N=O.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":b,"aria-label":`${M} (loading)`}:{},[e.loading,b,M]);return O.createElement(y,{"data-disabled":f||void 0,"data-accent-color":i,"data-radius":c,"data-material":S,"data-panel-background":S,"data-flush":g?"true":void 0,...D,...N,ref:t,className:(0,No.default)("rt-reset","rt-BaseButton",a),...x&&{disabled:f},...v&&!C?{type:"button"}:{}},e.loading?O.createElement(O.Fragment,null,O.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},n),O.createElement($e,null,O.createElement("span",{id:b},M," is loading, please wait..."),n),O.createElement(ee,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},O.createElement("span",null,O.createElement(Ge,{size:To(o,So),"aria-hidden":"true"})))):n)});Ue.displayName="BaseButton";var ie=T(require("react")),$o=T(require("classnames")),Fe=require("radix-ui");var xe=T(require("react")),Lo=require("radix-ui");var pn=["loud","medium","quiet"],Bo={emphasis:{type:"enum",className:"rt-emphasis",values:pn,default:void 0}};var ln=["normal","start","end","both"],Ao={trim:{type:"enum",className:"rt-r-lt",values:ln,responsive:!0}};var cn=["left","center","right"],Eo={align:{type:"enum",className:"rt-r-ta",values:cn,responsive:!0}};var un=["wrap","nowrap","pretty","balance"],Fo={wrap:{type:"enum",className:"rt-r-tw",values:un,responsive:!0}};var Oo={truncate:{type:"boolean",className:"rt-truncate"}};var mn=["sans","mono","serif"],Vo={font:{type:"enum",className:"rt-r-ff",values:mn}};var dn=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],Mo={weight:{type:"enum",className:"rt-r-weight",values:dn,responsive:!0}};var fn=["span","div","label","p"],gn=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Io={as:{type:"enum",values:fn,default:"span"},...te,size:{type:"enum",className:"rt-r-size",values:gn,responsive:!0},...Vo,...Mo,...Eo,...Ao,...Oo,...Fo,...co,...Bo};var yn={...Io,...re},se=xe.memo(xe.forwardRef((e,t)=>{let{children:o,className:a,asChild:n,as:p="span",color:s,...i}=oe(e,yn),c=a?`rt-Text ${a}`:"rt-Text";return n?xe.createElement(Lo.Slot.Root,{"data-accent-color":s,...i,ref:t,className:c},o):xe.createElement(p,{"data-accent-color":s,...i,ref:t,className:c},o)}));se.displayName="Text";var F=T(require("react")),Ho=T(require("classnames")),Ee=require("radix-ui"),ft=require("radix-ui/internal");function jo(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var zt=T(require("react"));function ae(e){let[t,o]=zt.useState(e),[a,n]=zt.useState(e);return Object.is(e,a)||(n(e),o(e)),[t,o]}var hn=["inherit","light","dark"],Pn=["solid","translucent"],bn=["solid","translucent"],vn=["90%","95%","100%","105%","110%"],zo=["sans","mono","serif"],w={...te,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:hn,default:"inherit"},accentColor:{type:"enum",values:it,default:"blue"},grayColor:{type:"enum",values:lo,default:"slate"},material:{type:"enum",values:bn,default:"translucent"},panelBackground:{type:"enum",values:Pn,default:"translucent"},radius:{type:"enum",values:Ft,default:"full"},scaling:{type:"enum",values:vn,default:"100%"},fontFamily:{type:"enum",values:zo,default:"sans"},headingFontFamily:{type:"enum",values:zo}};var I=()=>{},Ta={appearance:w.appearance.default,accentColor:w.accentColor.default,grayColor:w.grayColor.default,resolvedGrayColor:w.grayColor.default,material:w.material.default,panelBackground:w.panelBackground.default,radius:w.radius.default,scaling:w.scaling.default,fontFamily:w.fontFamily.default,headingFontFamily:void 0,onAppearanceChange:I,onAccentColorChange:I,onGrayColorChange:I,onMaterialChange:I,onPanelBackgroundChange:I,onRadiusChange:I,onScalingChange:I,onFontFamilyChange:I,onHeadingFontFamilyChange:I},Ht=F.createContext(void 0);var Wt=F.forwardRef((e,t)=>F.useContext(Ht)===void 0?F.createElement(Ee.Tooltip.Provider,{delayDuration:200},F.createElement(Ee.Direction.Provider,{dir:"ltr"},F.createElement(Wo,{...e,ref:t}))):F.createElement(Gt,{...e,ref:t}));Wt.displayName="Theme";var Wo=F.forwardRef((e,t)=>{let{appearance:o=w.appearance.default,accentColor:a=w.accentColor.default,grayColor:n=w.grayColor.default,material:p=w.material.default,panelBackground:s=w.panelBackground.default,radius:i=w.radius.default,scaling:c=w.scaling.default,fontFamily:l=w.fontFamily.default,headingFontFamily:u,hasBackground:g=w.hasBackground.default,...f}=e;dt(e.panelBackground);let[D,S]=ae(o),[y,x]=ae(a),[v,C]=ae(n),R=p!==w.material.default?p:s,[b,M]=ae(R),[N,z]=ae(b),[H,pe]=ae(i),[B,U]=ae(c),[X,le]=ae(l),[W,_]=ae(u);return F.createElement(Gt,{...f,ref:t,isRoot:!0,hasBackground:g,appearance:D,accentColor:y,grayColor:v,material:b,panelBackground:N,radius:H,scaling:B,fontFamily:X,headingFontFamily:W,onAppearanceChange:S,onAccentColorChange:x,onGrayColorChange:C,onMaterialChange:M,onPanelBackgroundChange:z,onRadiusChange:pe,onScalingChange:U,onFontFamilyChange:le,onHeadingFontFamilyChange:_})});Wo.displayName="ThemeRoot";function Cn(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var Gt=F.forwardRef((e,t)=>{let o=F.useContext(Ht),{asChild:a,isRoot:n,hasBackground:p,appearance:s=e.appearance??o?.appearance??w.appearance.default,accentColor:i=e.accentColor??o?.accentColor??w.accentColor.default,grayColor:c=e.grayColor??o?.resolvedGrayColor??w.grayColor.default,material:l=e.material??o?.material??w.material.default,panelBackground:u=e.panelBackground??o?.panelBackground??w.panelBackground.default,radius:g=e.radius??o?.radius??w.radius.default,scaling:f=e.scaling??o?.scaling??w.scaling.default,fontFamily:D=e.fontFamily??o?.fontFamily??w.fontFamily.default,headingFontFamily:S=e.headingFontFamily??o?.headingFontFamily,onAppearanceChange:y=I,onAccentColorChange:x=I,onGrayColorChange:v=I,onMaterialChange:C=I,onPanelBackgroundChange:R=I,onRadiusChange:b=I,onScalingChange:M=I,onFontFamilyChange:N=I,onHeadingFontFamilyChange:z=I,...H}=e,pe=a?Ee.Slot.Root:"div",B=c==="auto"?jo(i):c,U=e.appearance==="light"||e.appearance==="dark",X=p===void 0?n||U:p,le=F.useRef(null),W=(0,ft.useComposedRefs)(t,le),_="data-os"in H;return(0,ft.useLayoutEffect)(()=>{if(!n||_)return;let J=le.current;if(!J)return;let q=Cn();if(q)return J.setAttribute("data-os",q),()=>J.removeAttribute("data-os")},[n,_]),F.createElement(Ht.Provider,{value:F.useMemo(()=>({appearance:s,accentColor:i,grayColor:c,resolvedGrayColor:B,material:l,panelBackground:u,radius:g,scaling:f,fontFamily:D,headingFontFamily:S,onAppearanceChange:y,onAccentColorChange:x,onGrayColorChange:v,onMaterialChange:C,onPanelBackgroundChange:R,onRadiusChange:b,onScalingChange:M,onFontFamilyChange:N,onHeadingFontFamilyChange:z}),[s,i,c,B,l,u,g,f,D,S,y,x,v,C,R,b,M,N,z])},F.createElement(pe,{"data-is-root-theme":n?"true":"false","data-accent-color":i,"data-gray-color":B,"data-has-background":X?"true":"false","data-material":l,"data-panel-background":u,"data-radius":g,"data-scaling":f,"data-font-family":D,"data-heading-font-family":S,ref:W,...H,className:(0,Ho.default)("radix-themes",{light:s==="light",dark:s==="dark"},H.className)}))});Gt.displayName="ThemeImpl";var Go={content:{type:"ReactNode",required:!0},width:Ae.width,minWidth:Ae.minWidth,maxWidth:{...Ae.maxWidth,default:"360px"}};var Ke=ie.forwardRef((e,t)=>{let{children:o,className:a,open:n,defaultOpen:p,onOpenChange:s,delayDuration:i,disableHoverableContent:c,content:l,container:u,forceMount:g,...f}=oe(e,Go),D={open:n,defaultOpen:p,onOpenChange:s,delayDuration:i,disableHoverableContent:c};return ie.createElement(Fe.Tooltip.Root,{...D},ie.createElement(Fe.Tooltip.Trigger,{asChild:!0},o),ie.createElement(Fe.Tooltip.Portal,{container:u,forceMount:g},ie.createElement(Wt,{asChild:!0},ie.createElement(Fe.Tooltip.Content,{sideOffset:4,collisionPadding:10,...f,asChild:!1,ref:t,className:(0,$o.default)("rt-TooltipContent",a)},ie.createElement(se,{as:"p",className:"rt-TooltipText",size:"1"},l),ie.createElement(Fe.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Ke.displayName="Tooltip";var gt=T(require("react"));function yt(e){let t=gt.useId(),o=!!e,a=gt.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:a}}var Oe=_e.forwardRef(({className:e,tooltip:t,tooltipSide:o="top",tooltipAlign:a="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:p,...s},i)=>{let{tooltipId:c,hasTooltip:l,accessibilityProps:u}=yt(t),g="aria-label"in s&&s["aria-label"],f="aria-labelledby"in s&&s["aria-labelledby"],D="children"in s&&s.children;!g&&!f&&!D&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
1
+ "use strict";var Br=Object.create;var at=Object.defineProperty;var Ar=Object.getOwnPropertyDescriptor;var Er=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,Or=Object.prototype.hasOwnProperty;var Mr=(e,t)=>{for(var o in t)at(e,o,{get:t[o],enumerable:!0})},lo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Er(t))!Or.call(e,a)&&a!==o&&at(e,a,{get:()=>t[a],enumerable:!(n=Ar(t,a))||n.enumerable});return e};var w=(e,t,o)=>(o=e!=null?Br(Fr(e)):{},lo(t||!e||!e.__esModule?at(o,"default",{value:e,enumerable:!0}):o,e)),Vr=e=>lo(at({},"__esModule",{value:!0}),e);var Gn={};Mr(Gn,{AttachTrigger:()=>mr,Attachment:()=>Qt,AttachmentsRow:()=>ur,InlineEnd:()=>cr,InlineStart:()=>lr,Root:()=>ir,Row:()=>dr,RowEnd:()=>yr,RowStart:()=>fr,Send:()=>gr,Textarea:()=>pr});module.exports=Vr(Gn);var r=w(require("react")),K=w(require("classnames")),Z=require("motion/react"),Xt=require("radix-ui/internal"),nr=require("react-dropzone");var _e=w(require("react")),Ko=w(require("classnames"));var O=w(require("react")),ko=w(require("classnames")),Bo=require("radix-ui");var te={asChild:{type:"boolean"}};var it=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],co=["auto","gray","mauve","slate","sage","olive","sand"],uo={color:{type:"enum",values:it,default:void 0}},mo={color:{type:"enum",values:it,default:""}};var Ot=["none","small","medium","large","full"],pt={radius:{type:"enum",values:Ot,default:void 0}};var Lr=["1","2","3","4"],Ir=["classic","solid","soft","surface","outline","ghost","override"],jr=["solid","translucent"],zr=["solid","translucent"],Mt={...te,size:{type:"enum",className:"rt-r-size",values:Lr,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:Ir,default:"solid"},...mo,...pt,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:zr,default:void 0},panelBackground:{type:"enum",values:jr,default:void 0},flush:{type:"boolean",default:!1}};var mt=w(require("react")),Ro=w(require("classnames"));var go=w(require("classnames"));var Hr=[],Wr=new Set;function Gr(e){let t=Object.assign({},...e),o=[],n=[],a=new Set;for(let p in t){let s=t[p],i=s.values??Hr,c={key:p,type:s.type,default:s.default,hasDefault:s.default!==void 0,responsive:"responsive"in s,className:s.className,customProperties:s.customProperties,parseValue:s.parseValue,values:i,valueSet:i.length>0?new Set(i):Wr,enumValueSet:s.type==="enum"?new Set([s.default,...i]):void 0};s.className?(o.push(c),a.add(p)):(c.hasDefault||s.type==="enum")&&n.push(c)}return{styling:o,passthrough:n,stylingKeys:a}}var $r={children:new WeakMap};function fo(e){let t=$r;for(let o=0;o<e.length;o++){let n=e[o],a=t.children.get(n);a===void 0&&(a={children:new WeakMap},t.children.set(n,a)),t=a}return t.compiled??(t.compiled=Gr(e))}var Ur=["initial","xs","sm","md","lg","xl"],Vt=new Set(Ur);function Lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Kr=new Set(["initial","xs","sm","md","lg","xl"]);function be(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(Kr.has(t))return!0;return!1}function lt(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function ct({className:e,customProperties:t,...o}){let n=Ae({allowArbitraryValues:!0,className:e,...o}),a=_r({customProperties:t,...o});return[n,a]}function Ae({allowArbitraryValues:e,value:t,className:o,propValues:n,propValueSet:a,parseValue:p=s=>s}){if(t){if(typeof t=="string")return lt(n,a,t)?yo(o,t,p):e?o:void 0;if(be(t)){let s=t,i=[];for(let c in s){if(!Lt(s,c)||!Vt.has(c))continue;let l=s[c];if(l!==void 0){if(lt(n,a,l)){let u=yo(o,l,p),y=c==="initial"?u:`${c}:${u}`;i.push(y)}else if(e){let u=c==="initial"?o:`${c}:${o}`;i.push(u)}}}return i.length>0?i.join(" "):""}if(e)return o}}function yo(e,t,o){let n=e?"-":"",a=o(t),p=a?.startsWith("-"),s=p?"-":"",i=p?a?.substring(1):a;return`${s}${e}${n}${i}`}function _r({customProperties:e,value:t,propValues:o,propValueSet:n,parseValue:a=p=>p}){if(!t||typeof t=="string"&&lt(o,n,t))return;let p;if(typeof t=="string"){let s=a(t);p={};for(let i of e)p[i]=s;return p}if(be(t)){let s=t;for(let i in s){if(!Lt(s,i)||!Vt.has(i))continue;let c=s[i];if(c===void 0||lt(o,n,c))continue;let l=a(c);p??(p={});for(let u of e){let y=i==="initial"?u:`${u}-${i}`;p[y]=l}}}return p??{}}function ve(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function qr(e,t){let o=e.initial,n=!1;return t.hasDefault&&o===void 0&&(o=t.default,n=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,n=!0),n?{...e,initial:o}:e}function oe(e,...t){let{styling:o,passthrough:n,stylingKeys:a}=fo(t),p={};for(let c in e)a.has(c)||(p[c]=e[c]);for(let c=0;c<n.length;c++){let l=n[c],u=p[l.key];if(u===void 0){l.hasDefault&&(p[l.key]=l.default);continue}l.enumValueSet!==void 0&&!l.enumValueSet.has(u)&&!be(u)&&(p[l.key]=l.default)}let s,i=[];for(let c=0;c<o.length;c++){let l=o[c],u=e[l.key];if(u===void 0&&l.hasDefault&&(u=l.default),l.enumValueSet!==void 0&&!l.enumValueSet.has(u)&&!be(u)&&(u=l.default),!!u){if(be(u)){if(!l.responsive)continue;u=qr(u,l)}if(l.type==="enum"){let y=Ae({allowArbitraryValues:!1,value:u,className:l.className,propValues:l.values,propValueSet:l.valueSet,parseValue:l.parseValue});y&&i.push(y);continue}if(l.type==="string"||l.type==="enum | string"){let[y,f]=ct({className:l.className,customProperties:l.customProperties,propValues:l.type==="string"?[]:l.values,propValueSet:l.type==="string"?void 0:l.valueSet,parseValue:l.parseValue,value:u});f&&(s=ve(s,f)),y&&i.push(y);continue}if(l.type==="boolean"){i.push(l.className);continue}}}return p.className=(0,go.default)(i.length>0?i.join(" "):void 0,e.className),p.style=ve(s,e.style),p}var Ce=["0","1","2","3","4","5","6","7","8","9","10","11","12"],ho={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Ce,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Ce,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Ce,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Ce,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Ce,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Ce,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Ce,responsive:!0}};var Po={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Ee={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var It=["visible","hidden","clip","scroll","auto"],Yr=["static","relative","absolute","fixed","sticky"],We=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Zr=["0","1"],Xr=["0","1"],Jr=["start","center","end","baseline","stretch"],Qr=["start","center","end","baseline","stretch"],bo={...ho,...Ee,...Po,position:{type:"enum",className:"rt-r-position",values:Yr,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:We,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:We,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:We,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:We,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:We,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:It,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:It,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:It,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:Zr,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:Xr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:Jr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:Qr,responsive:!0}};var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],re={m:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:Re,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var ut=require("radix-ui"),vs=ut.Slot.Root,ne=ut.Slot.Root,Cs=ut.Slot.Slottable;var jt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],vo={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:jt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:jt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:jt,responsive:!0}};var en=["div","span"],tn=["none","inline-flex","flex"],on=["row","column","row-reverse","column-reverse"],rn=["start","center","end","baseline","stretch"],nn=["start","center","end","between"],sn=["nowrap","wrap","wrap-reverse"],Co={as:{type:"enum",values:en,default:"div"},...te,display:{type:"enum",className:"rt-r-display",values:tn,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:on,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:rn,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:nn,parseValue:an,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:sn,responsive:!0},...vo};function an(e){return e==="between"?"space-between":e}var ee=mt.forwardRef((e,t)=>{let{className:o,asChild:n,as:a="div",...p}=oe(e,Co,bo,re);return mt.createElement(n?ne:a,{...p,ref:t,className:(0,Ro.default)("rt-Flex",o)})});ee.displayName="Flex";var j=w(require("react")),Do=w(require("classnames"));var pn=["1","2","3"],xo={size:{type:"enum",className:"rt-r-size",values:pn,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var Ge=j.forwardRef((e,t)=>{let{className:o,children:n,loading:a,...p}=oe(e,xo,re);if(!a)return n;let s=j.createElement("span",{...p,ref:t,className:(0,Do.default)("rt-Spinner",o)},j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}),j.createElement("span",{className:"rt-SpinnerLeaf"}));return n===void 0?s:j.createElement(ee,{asChild:!0,position:"relative",align:"center",justify:"center"},j.createElement("span",null,j.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},n),j.createElement(ee,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},j.createElement("span",null,s))))});Ge.displayName="Spinner";var zt=require("radix-ui"),$e=zt.VisuallyHidden.Root,js=zt.VisuallyHidden.Root;var To=w(require("react")),ln="Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.",wo=new Set;function cn(e){wo.has(e)||(wo.add(e),console.warn(e))}function dt(e){To.useEffect(()=>{},[e])}function So(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([o,n])=>[o,t(n)]))}function No(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var Ue=O.forwardRef((e,t)=>{let{size:o=Mt.size.default}=e,{className:n,children:a,asChild:p,as:s,color:i,radius:c,material:l,panelBackground:u,flush:y,disabled:f=e.loading,...D}=oe(e,Mt,re);dt(e.panelBackground);let S=l??u,g=p?Bo.Slot.Root:s||"button",x=p||!s||["button","input","textarea","select"].includes(s),R=!p&&(!s||s==="button"),v="type"in D,C=O.useId(),P=e.loading?`${C}-loading`:void 0,V=O.useMemo(()=>typeof a=="string"?a:O.isValidElement(a)&&typeof a.props?.children=="string"?a.props.children:"button",[a]),N=O.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":P,"aria-label":`${V} (loading)`}:{},[e.loading,P,V]);return O.createElement(g,{"data-disabled":f||void 0,"data-accent-color":i,"data-radius":c,"data-material":S,"data-panel-background":S,"data-flush":y?"true":void 0,...D,...N,ref:t,className:(0,ko.default)("rt-reset","rt-BaseButton",n),...x&&{disabled:f},...R&&!v?{type:"button"}:{}},e.loading?O.createElement(O.Fragment,null,O.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},a),O.createElement($e,null,O.createElement("span",{id:P},V," is loading, please wait..."),a),O.createElement(ee,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},O.createElement("span",null,O.createElement(Ge,{size:So(o,No),"aria-hidden":"true"})))):a)});Ue.displayName="BaseButton";var ie=w(require("react")),Uo=w(require("classnames")),Oe=require("radix-ui");var xe=w(require("react")),jo=require("radix-ui");var un=["loud","medium","quiet"],Ao={emphasis:{type:"enum",className:"rt-emphasis",values:un,default:void 0}};var mn=["normal","start","end","both"],Eo={trim:{type:"enum",className:"rt-r-lt",values:mn,responsive:!0}};var dn=["left","center","right"],Fo={align:{type:"enum",className:"rt-r-ta",values:dn,responsive:!0}};var fn=["wrap","nowrap","pretty","balance"],Oo={wrap:{type:"enum",className:"rt-r-tw",values:fn,responsive:!0}};var Mo={truncate:{type:"boolean",className:"rt-truncate"}};var yn=["sans","mono","serif"],Vo={font:{type:"enum",className:"rt-r-ff",values:yn}};var gn=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],Lo={weight:{type:"enum",className:"rt-r-weight",values:gn,responsive:!0}};var hn=["span","div","label","p"],Pn=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Io={as:{type:"enum",values:hn,default:"span"},...te,size:{type:"enum",className:"rt-r-size",values:Pn,responsive:!0},...Vo,...Lo,...Fo,...Eo,...Mo,...Oo,...uo,...Ao};var bn={...Io,...re},se=xe.memo(xe.forwardRef((e,t)=>{let{children:o,className:n,asChild:a,as:p="span",color:s,...i}=oe(e,bn),c=n?`rt-Text ${n}`:"rt-Text";return a?xe.createElement(jo.Slot.Root,{"data-accent-color":s,...i,ref:t,className:c},o):xe.createElement(p,{"data-accent-color":s,...i,ref:t,className:c},o)}));se.displayName="Text";var F=w(require("react")),Wo=w(require("classnames")),Fe=require("radix-ui"),ft=require("radix-ui/internal");function zo(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Ht=w(require("react"));function ae(e){let[t,o]=Ht.useState(e),[n,a]=Ht.useState(e);return Object.is(e,n)||(a(e),o(e)),[t,o]}var vn=["inherit","light","dark"],Cn=["solid","translucent"],Rn=["solid","translucent"],xn=["90%","95%","100%","105%","110%"],Ho=["sans","mono","serif"],T={...te,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:vn,default:"inherit"},accentColor:{type:"enum",values:it,default:"blue"},grayColor:{type:"enum",values:co,default:"slate"},material:{type:"enum",values:Rn,default:"translucent"},panelBackground:{type:"enum",values:Cn,default:"translucent"},radius:{type:"enum",values:Ot,default:"full"},scaling:{type:"enum",values:xn,default:"100%"},fontFamily:{type:"enum",values:Ho,default:"sans"},headingFontFamily:{type:"enum",values:Ho}};var L=()=>{},ka={appearance:T.appearance.default,accentColor:T.accentColor.default,grayColor:T.grayColor.default,resolvedGrayColor:T.grayColor.default,material:T.material.default,panelBackground:T.panelBackground.default,radius:T.radius.default,scaling:T.scaling.default,fontFamily:T.fontFamily.default,headingFontFamily:void 0,onAppearanceChange:L,onAccentColorChange:L,onGrayColorChange:L,onMaterialChange:L,onPanelBackgroundChange:L,onRadiusChange:L,onScalingChange:L,onFontFamilyChange:L,onHeadingFontFamilyChange:L},Wt=F.createContext(void 0);var Gt=F.forwardRef((e,t)=>F.useContext(Wt)===void 0?F.createElement(Fe.Tooltip.Provider,{delayDuration:200},F.createElement(Fe.Direction.Provider,{dir:"ltr"},F.createElement(Go,{...e,ref:t}))):F.createElement($t,{...e,ref:t}));Gt.displayName="Theme";var Go=F.forwardRef((e,t)=>{let{appearance:o=T.appearance.default,accentColor:n=T.accentColor.default,grayColor:a=T.grayColor.default,material:p=T.material.default,panelBackground:s=T.panelBackground.default,radius:i=T.radius.default,scaling:c=T.scaling.default,fontFamily:l=T.fontFamily.default,headingFontFamily:u,hasBackground:y=T.hasBackground.default,...f}=e;dt(e.panelBackground);let[D,S]=ae(o),[g,x]=ae(n),[R,v]=ae(a),C=p!==T.material.default?p:s,[P,V]=ae(C),[N,z]=ae(P),[H,pe]=ae(i),[B,U]=ae(c),[X,le]=ae(l),[W,_]=ae(u);return F.createElement($t,{...f,ref:t,isRoot:!0,hasBackground:y,appearance:D,accentColor:g,grayColor:R,material:P,panelBackground:N,radius:H,scaling:B,fontFamily:X,headingFontFamily:W,onAppearanceChange:S,onAccentColorChange:x,onGrayColorChange:v,onMaterialChange:V,onPanelBackgroundChange:z,onRadiusChange:pe,onScalingChange:U,onFontFamilyChange:le,onHeadingFontFamilyChange:_})});Go.displayName="ThemeRoot";function Dn(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var $t=F.forwardRef((e,t)=>{let o=F.useContext(Wt),{asChild:n,isRoot:a,hasBackground:p,appearance:s=e.appearance??o?.appearance??T.appearance.default,accentColor:i=e.accentColor??o?.accentColor??T.accentColor.default,grayColor:c=e.grayColor??o?.resolvedGrayColor??T.grayColor.default,material:l=e.material??o?.material??T.material.default,panelBackground:u=e.panelBackground??o?.panelBackground??T.panelBackground.default,radius:y=e.radius??o?.radius??T.radius.default,scaling:f=e.scaling??o?.scaling??T.scaling.default,fontFamily:D=e.fontFamily??o?.fontFamily??T.fontFamily.default,headingFontFamily:S=e.headingFontFamily??o?.headingFontFamily,onAppearanceChange:g=L,onAccentColorChange:x=L,onGrayColorChange:R=L,onMaterialChange:v=L,onPanelBackgroundChange:C=L,onRadiusChange:P=L,onScalingChange:V=L,onFontFamilyChange:N=L,onHeadingFontFamilyChange:z=L,...H}=e,pe=n?Fe.Slot.Root:"div",B=c==="auto"?zo(i):c,U=e.appearance==="light"||e.appearance==="dark",X=p===void 0?a||U:p,le=F.useRef(null),W=(0,ft.useComposedRefs)(t,le),_="data-os"in H;return(0,ft.useLayoutEffect)(()=>{if(!a||_)return;let J=le.current;if(!J)return;let q=Dn();if(q)return J.setAttribute("data-os",q),()=>J.removeAttribute("data-os")},[a,_]),F.createElement(Wt.Provider,{value:F.useMemo(()=>({appearance:s,accentColor:i,grayColor:c,resolvedGrayColor:B,material:l,panelBackground:u,radius:y,scaling:f,fontFamily:D,headingFontFamily:S,onAppearanceChange:g,onAccentColorChange:x,onGrayColorChange:R,onMaterialChange:v,onPanelBackgroundChange:C,onRadiusChange:P,onScalingChange:V,onFontFamilyChange:N,onHeadingFontFamilyChange:z}),[s,i,c,B,l,u,y,f,D,S,g,x,R,v,C,P,V,N,z])},F.createElement(pe,{"data-is-root-theme":a?"true":"false","data-accent-color":i,"data-gray-color":B,"data-has-background":X?"true":"false","data-material":l,"data-panel-background":u,"data-radius":y,"data-scaling":f,"data-font-family":D,"data-heading-font-family":S,ref:W,...H,className:(0,Wo.default)("radix-themes",{light:s==="light",dark:s==="dark"},H.className)}))});$t.displayName="ThemeImpl";var $o={content:{type:"ReactNode",required:!0},width:Ee.width,minWidth:Ee.minWidth,maxWidth:{...Ee.maxWidth,default:"360px"}};var Ke=ie.forwardRef((e,t)=>{let{children:o,className:n,open:a,defaultOpen:p,onOpenChange:s,delayDuration:i,disableHoverableContent:c,content:l,container:u,forceMount:y,...f}=oe(e,$o),D={open:a,defaultOpen:p,onOpenChange:s,delayDuration:i,disableHoverableContent:c};return ie.createElement(Oe.Tooltip.Root,{...D},ie.createElement(Oe.Tooltip.Trigger,{asChild:!0},o),ie.createElement(Oe.Tooltip.Portal,{container:u,forceMount:y},ie.createElement(Gt,{asChild:!0},ie.createElement(Oe.Tooltip.Content,{sideOffset:4,collisionPadding:10,...f,asChild:!1,ref:t,className:(0,Uo.default)("rt-TooltipContent",n)},ie.createElement(se,{as:"p",className:"rt-TooltipText",size:"1"},l),ie.createElement(Oe.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Ke.displayName="Tooltip";var yt=w(require("react"));function gt(e){let t=yt.useId(),o=!!e,n=yt.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:n}}var Me=_e.forwardRef(({className:e,tooltip:t,tooltipSide:o="top",tooltipAlign:n="center",tooltipDelayDuration:a,tooltipDisableHoverableContent:p,...s},i)=>{let{tooltipId:c,hasTooltip:l,accessibilityProps:u}=gt(t),y="aria-label"in s&&s["aria-label"],f="aria-labelledby"in s&&s["aria-labelledby"],D="children"in s&&s.children;!y&&!f&&!D&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
2
2
  - aria-label prop with descriptive text
3
3
  - aria-labelledby prop referencing a label element
4
- - or visible text children`);let S=_e.createElement(Ue,{...s,...u,ref:i,className:(0,Uo.default)("rt-IconButton",e)});return l?_e.createElement(Ke,{content:t,side:o,align:a,delayDuration:n,disableHoverableContent:p,id:c},S):S});Oe.displayName="IconButton";var h=T(require("react")),Rn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));Rn.displayName="ThickDividerHorizontalIcon";var xn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));xn.displayName="ThickCheckIcon";var Dn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Dn.displayName="ChevronDownIcon";var wn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));wn.displayName="ThickChevronRightIcon";var Tn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));Tn.displayName="ThickChevronLeftIcon";var Sn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Sn.displayName="ThickDotIcon";var $t=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M18 6 6 18"}),h.default.createElement("path",{d:"m6 6 12 12"})));$t.displayName="CloseIcon";var Nn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));Nn.displayName="PaperclipIcon";var kn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));kn.displayName="FileIcon";var Ut=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),h.default.createElement("path",{d:"M10 9H8"}),h.default.createElement("path",{d:"M16 13H8"}),h.default.createElement("path",{d:"M16 17H8"})));Ut.displayName="FileTextIcon";var $=T(require("react")),Pt=T(require("classnames")),de=require("radix-ui");var Bn=["1","2","3"],An=["vertical","horizontal","both"],Ve={...te,size:{type:"enum",className:"rt-r-size",values:Bn,default:"1",responsive:!0},...pt,scrollbars:{type:"enum",values:An,default:"both"}};function Ko(e){let{m:t,mx:o,my:a,mt:n,mr:p,mb:s,ml:i,...c}=e;return{m:t,mx:o,my:a,mt:n,mr:p,mb:s,ml:i,rest:c}}var qo=re.m.values,En=new Set(qo),_o=[{key:"m",className:"rt-r-m",customProperties:["--margin"]},{key:"mx",className:"rt-r-mx",customProperties:["--margin-left","--margin-right"]},{key:"my",className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"]},{key:"mt",className:"rt-r-mt",customProperties:["--margin-top"]},{key:"mr",className:"rt-r-mr",customProperties:["--margin-right"]},{key:"mb",className:"rt-r-mb",customProperties:["--margin-bottom"]},{key:"ml",className:"rt-r-ml",customProperties:["--margin-left"]}];function Yo(e){let t,o;for(let a=0;a<_o.length;a++){let{key:n,className:p,customProperties:s}=_o[a],i=e[n];if(i===void 0)continue;let[c,l]=ct({className:p,customProperties:s,propValues:qo,propValueSet:En,value:i});c&&(t??(t=[])).push(c),l&&(o=ve(o,l))}return[t!==void 0?t.join(" "):"",o]}var ht=T(require("react"));function Zo(e,t){let{asChild:o,children:a}=e;if(!o)return typeof t=="function"?t(a):t;let n=ht.Children.only(a);return ht.cloneElement(n,{children:typeof t=="function"?t(n.props.children):t})}var Kt=$.forwardRef((e,t)=>{let{rest:o,...a}=Ko(e),[n,p]=Yo(a),{asChild:s,children:i,className:c,style:l,type:u,scrollHideDelay:g=u!=="scroll"?0:void 0,dir:f,size:D=Ve.size.default,radius:S=Ve.radius.default,scrollbars:y=Ve.scrollbars.default,...x}=o;return $.createElement(de.ScrollArea.Root,{type:u,scrollHideDelay:g,className:(0,Pt.default)("rt-ScrollAreaRoot",n,c),style:ve(p,l),asChild:s},Zo({asChild:s,children:i},v=>$.createElement($.Fragment,null,$.createElement(de.ScrollArea.Viewport,{...x,ref:t,className:"rt-ScrollAreaViewport"},v),$.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),y!=="vertical"?$.createElement(de.ScrollArea.Scrollbar,{"data-radius":S,orientation:"horizontal",className:(0,Pt.default)("rt-ScrollAreaScrollbar",Be({className:"rt-r-size",value:D,propValues:Ve.size.values}))},$.createElement(de.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,y!=="horizontal"?$.createElement(de.ScrollArea.Scrollbar,{"data-radius":S,orientation:"vertical",className:(0,Pt.default)("rt-ScrollAreaScrollbar",Be({className:"rt-r-size",value:D,propValues:Ve.size.values}))},$.createElement(de.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,y==="both"?$.createElement(de.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});Kt.displayName="ScrollArea";var E=T(require("react")),Jo=T(require("classnames"));var fe=T(require("react")),Xo=T(require("classnames"));var bt=fe.forwardRef(({className:e,style:t,tooltip:o,tooltipSide:a="top",tooltipAlign:n="center",tooltipDelayDuration:p,tooltipDisableHoverableContent:s,overrideStyles:i,...c},l)=>{let{tooltipId:u,hasTooltip:g,accessibilityProps:f}=yt(o),D=fe.useMemo(()=>{if(!i)return;let x={},v=(R,b)=>{b!==void 0&&(x[R]=b)},C=(R,b)=>{b&&(v(`--button-override-${R}color`,b.color),v(`--button-override-${R}background`,b.background),v(`--button-override-${R}background-color`,b.backgroundColor),v(`--button-override-${R}box-shadow`,b.boxShadow),v(`--button-override-${R}filter`,b.filter),v(`--button-override-${R}outline`,b.outline),v(`--button-override-${R}outline-offset`,b.outlineOffset),v(`--button-override-${R}opacity`,b.opacity))};return C("",i.normal),C("hover-",i.hover),C("active-",i.active),C("pressed-",i.pressed),C("open-",i.open),C("disabled-",i.disabled),i.focus&&(v("--button-override-focus-outline",i.focus.outline),v("--button-override-focus-outline-offset",i.focus.outlineOffset)),x},[i]),S=fe.useMemo(()=>D?{...D,...t}:t,[D,t]),y=fe.createElement(Ue,{...c,...f,ref:l,className:(0,Xo.default)("rt-Button",e),style:S});return g?fe.createElement(Ke,{content:o,side:a,align:n,delayDuration:p,disableHoverableContent:s,id:u},y):y});bt.displayName="Button";var vt=E.createContext(void 0),_t=E.forwardRef(({kind:e,size:t="2",color:o="gray",material:a,className:n,children:p,trailing:s,leading:i,...c},l)=>E.createElement("div",{role:"status","aria-live":"polite",...c,ref:l,className:(0,Jo.default)("rt-NoticeRoot",`rt-r-size-${t}`,n),"data-kind":e,"data-accent-color":o,"data-material":a},i?E.createElement("span",{className:"rt-NoticeIcon","aria-hidden":!0},i):null,E.createElement(se,{as:"div",size:t,className:"rt-NoticeText"},p),s));_t.displayName="Strip";var Fn=E.forwardRef(({icon:e,action:t,onDismiss:o,dismissLabel:a="Dismiss",size:n,...p},s)=>{let i=E.useContext(vt),c=n??i??"2";return E.createElement(_t,{...p,size:c,ref:s,kind:"notice",leading:e,trailing:t||o?E.createElement("span",{className:"rt-NoticeActions"},t,o?E.createElement(Oe,{size:c,variant:"ghost",color:"gray","aria-label":a,className:"rt-NoticeDismiss",onClick:o},E.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},E.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null})});Fn.displayName="Notice";var On=E.forwardRef(({confirmLabel:e,cancelLabel:t="Not now",onConfirm:o,onCancel:a,busy:n=!1,size:p,color:s="gray",...i},c)=>{let l=E.useContext(vt),u=p??l??"2";return E.createElement(_t,{...i,size:u,color:s,ref:c,kind:"confirmation",trailing:E.createElement("span",{className:"rt-NoticeActions"},E.createElement(bt,{size:u,variant:"ghost",color:"gray",disabled:n,onClick:a},t),E.createElement(bt,{size:u,variant:"solid",color:s,loading:n,onClick:o},e))})});On.displayName="Confirmation";var qt=typeof window<"u"?r.useLayoutEffect:r.useEffect;function Qo(e,t){let{placeholder:o}=e;if(!o){t();return}e.placeholder="";try{t()}finally{e.placeholder=o}}var Ye={layout:{type:"spring",visualDuration:.15,bounce:.1}},or=r.createContext(null),Xt=r.createContext(""),ge=()=>{let e=r.useContext(or);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},qe=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(t=>t.trim()).filter(Boolean):[],Vn=(e,t)=>{if(t.length===0)return!0;let o=e.type.toLowerCase(),a=e.name.toLowerCase();for(let n of t){let p=n.toLowerCase();if(p.includes("/")){let[s,i]=p.split("/"),[c,l]=o.split("/");if(s==="*"||s===c&&(i==="*"||i===l))return!0}else if(p.startsWith(".")&&a.endsWith(p))return!0}return!1},Mn=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,rr=(e,t)=>(t||"").toLowerCase().startsWith("image/")||Mn.test(e),Yt=e=>e.trim().length>0,er=(e,t)=>`${e} ${t}${e===1?"":"s"}`,In=0,Ln=()=>`chatbar-attachment-${Date.now()}-${++In}`,nr=r.forwardRef((e,t)=>{let{className:o,style:a,children:n,value:p,defaultValue:s="",onValueChange:i,open:c,defaultOpen:l=!1,onOpenChange:u,expandOn:g="both",minLines:f=3,maxLines:D=6,sendMode:S="whenDirty",disabled:y,readOnly:x,onSubmit:v,size:C="2",variant:R,color:b,radius:M,panelBackground:N,material:z,width:H,maxWidth:pe,attachments:B,defaultAttachments:U,onAttachmentsChange:X,accept:le,multiple:W=!0,maxAttachments:_,maxFileSize:J,paste:q=!0,pasteAccept:Q,clearOnSubmit:ye=!0,onAttachmentReject:Ct,dropzone:Me=!0,apiRef:Rt,onBlurCapture:Ze,notices:Xe,context:Je,...xt}=e,m=z||N,V=p!=null,[G,Ie]=r.useState(s),ce=V?p:G,he=c!=null,[Dt,Le]=r.useState(l),De=he?c:Dt,we="attachments"in e,[Qt,fr]=r.useState(()=>U??[]),je=r.useMemo(()=>we?B??[]:Qt,[we,B,Qt]),[eo,gr]=r.useState({text:"",id:0}),ze=r.useCallback(d=>gr(P=>({text:d,id:P.id+1})),[]),to=r.useRef(null),yr=(0,Zt.useComposedRefs)(t,to),wt=r.useRef(null),Tt=r.useRef(null),He=r.useRef(!1),Qe=r.useRef(!1),et=r.useRef(void 0),St=r.useRef(null),oo=qe(le).join(","),Nt=qe(Q).join(","),kt=r.useMemo(()=>qe(oo),[oo]),hr=r.useMemo(()=>Nt?qe(Nt):kt,[Nt,kt]),ro={value:ce,attachments:je,accepts:kt,pasteAccepts:hr,multiple:W,maxAttachments:_,maxFileSize:J,disabled:y,readOnly:x,expandOn:g,isValueControlled:V,isOpenControlled:he,isAttachmentsControlled:we,onValueChange:i,onOpenChange:u,onAttachmentsChange:X,onAttachmentReject:Ct,onSubmit:v},L=r.useRef(ro);L.current=ro;let Bt=r.useRef(null),ue=r.useCallback(()=>Bt.current??L.current.attachments,[]),Te=r.useCallback(d=>{L.current.isOpenControlled||Le(d),L.current.onOpenChange?.(d)},[]),tt=r.useCallback(d=>{L.current.isValueControlled||Ie(d),L.current.onValueChange?.(d)},[]),Se=r.useCallback(d=>{Bt.current=d,queueMicrotask(()=>{Bt.current=null}),L.current.isAttachmentsControlled||fr(d),L.current.onAttachmentsChange?.(d)},[]),ot=r.useRef(new Set),Ne=r.useCallback((d,P,k=L.current.multiple)=>{let A=L.current;if(A.disabled||A.readOnly||d.length===0)return 0;let me=ue(),Pe=[],ke=[],wr=typeof A.maxAttachments=="number"?Math.max(A.maxAttachments-me.length,0):1/0,Tr=k?1/0:1;for(let Y of d){if(Pe.length>=wr||Pe.length>=Tr){ke.push({file:Y,reason:"count"});continue}if(typeof A.maxFileSize=="number"&&Y.size>A.maxFileSize){ke.push({file:Y,reason:"size"});continue}if(!Vn(Y,P)){ke.push({file:Y,reason:"type"});continue}let Et=rr(Y.name,Y.type)?URL.createObjectURL(Y):void 0;Et&&ot.current.add(Et),Pe.push({id:Ln(),name:Y.name,size:Y.size,type:Y.type,file:Y,url:Et,status:"idle"})}let st=[];return Pe.length>0&&(Se(me.concat(Pe)),A.expandOn!=="none"&&Te(!0),st.push(`${er(Pe.length,"file")} attached.`)),ke.length>0&&(A.onAttachmentReject?.(ke),st.push(`${er(ke.length,"file")} could not be attached.`)),st.length>0&&ze(st.join(" ")),Pe.length},[ue,Se,Te,ze]),rt=r.useCallback(d=>Ne(d,L.current.accepts),[Ne]),no=r.useCallback(d=>Ne(d,L.current.pasteAccepts),[Ne]),so=r.useCallback(d=>{let P=ue(),k=P.find(A=>A.id===d);k&&(Se(P.filter(A=>A.id!==d)),ze(`Removed ${k.name}.`))},[ue,Se,ze]),ao=r.useCallback(d=>{let P=L.current;if(P.disabled||P.readOnly)return!1;let k=ue();if(!Yt(P.value)&&k.length===0)return!1;let A={value:P.value,attachments:k};if(d&&P.onSubmit)for(let me of k)me.url&&ot.current.delete(me.url);return P.onSubmit?.(A),d&&(tt(""),Se([])),!0},[ue,tt,Se]);r.useEffect(()=>{let d=ot.current;if(d.size===0)return;let P=new Set(je.map(k=>k.url));for(let k of Array.from(d))P.has(k)||(URL.revokeObjectURL(k),d.delete(k))},[je]),r.useEffect(()=>{let d=ot.current;return()=>{if(!L.current.isAttachmentsControlled){for(let P of Array.from(d))URL.revokeObjectURL(P);d.clear()}}},[]);let nt=r.useCallback(d=>{let P=L.current,k=Tt.current;if(clearTimeout(et.current),Qe.current=!1,!k||P.disabled||P.readOnly)return;let A=d?.accept!=null?qe(d.accept):P.accepts,me=d?.multiple??P.multiple;St.current={patterns:A,multiple:me},k.accept=A.join(","),k.multiple=me,He.current=!0,k.click(),setTimeout(()=>{document.hasFocus()&&(He.current=!1)},1e3)},[]),io=r.useCallback(()=>{Qe.current=!0,clearTimeout(et.current),et.current=setTimeout(()=>{Qe.current=!1},800)},[]);r.useEffect(()=>()=>clearTimeout(et.current),[]),r.useEffect(()=>{let d=Tt.current,P=()=>{He.current=!1};return window.addEventListener("focus",P),d?.addEventListener("cancel",P),()=>{window.removeEventListener("focus",P),d?.removeEventListener("cancel",P)}},[]);let Pr=r.useCallback(d=>{let P=d.currentTarget,k=Array.from(P.files??[]),A=St.current;Ne(k,A?.patterns??L.current.accepts,A?.multiple),He.current=!1,St.current=null,P.value=""},[Ne]),br=r.useCallback(d=>{Ze?.(d);let P=L.current,k=to.current;if(!k||P.expandOn==="none")return;let A=d.relatedTarget;A&&k.contains(A)||He.current||Qe.current||!Yt(P.value)&&ue().length===0&&Te(!1)},[Ze,Te,ue]),vr=r.useCallback(d=>{rt(d)},[rt]),{getRootProps:Cr,isDragActive:Rr}=(0,tr.useDropzone)({onDrop:vr,onDragEnter:()=>ze(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!Me||y||x}),At=Me&&Rr;r.useImperativeHandle(Rt,()=>({focusTextarea:()=>wt.current?.focus({preventScroll:!0}),openFilePicker:()=>nt()}),[nt]);let xr=r.useCallback(d=>{if(y||d.pointerType==="mouse"&&d.button!==0)return;let P=d.target;P instanceof Element&&P.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(d.preventDefault(),wt.current?.focus({preventScroll:!0}))},[y]),Dr=r.useMemo(()=>({open:De,setOpen:Te,setValue:tt,size:C,expandOn:g,minLines:f,maxLines:D,sendMode:S,disabled:y,readOnly:x,paste:q,clearOnSubmit:ye,multiple:W,textareaRef:wt,attachments:je,removeAttachment:so,submit:ao,appendFiles:rt,appendFilesFromPaste:no,openFilePicker:nt,beginFilePickerPress:io}),[De,Te,tt,C,g,f,D,S,y,x,q,ye,W,je,so,ao,rt,no,nt,io]);return r.createElement(or.Provider,{value:Dr},r.createElement(Xt.Provider,{value:ce},r.createElement(Z.LazyMotion,{features:Z.domAnimation},r.createElement(Z.MotionConfig,{reducedMotion:"user"},r.createElement("div",{...xt,ref:yr,className:(0,K.default)("rt-ChatbarRoot",`rt-r-size-${C}`,o),style:{position:"relative",width:H,maxWidth:pe,...a},"data-state":De?"open":"closed","data-disabled":y?"":void 0,"data-readonly":x?"":void 0,"data-drop-active":At?"":void 0,"data-accent-color":b,"data-radius":M,"data-panel-background":m,"data-material":m,onBlurCapture:br},r.createElement("input",{ref:Tt,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:Pr}),Xe?r.createElement("div",{className:"rt-ChatbarNotices"},r.createElement(vt.Provider,{value:C},Xe)):null,r.createElement("div",{...Me?Cr():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:xr},r.createElement(Z.m.div,{className:(0,K.default)("rt-ChatbarBox",`rt-variant-${R??"surface"}`),style:{position:"relative"},"data-accent-color":b,"data-radius":M,"data-panel-background":m,"data-material":m,layout:!0,transition:Ye},r.createElement(Z.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:Ye},n),At&&r.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},r.createElement("div",{className:"rt-ChatbarDropContent"},r.createElement(se,{emphasis:"medium",size:C,weight:"medium"},"Drop files here to attach"))))),Je?r.createElement(se,{as:"div",size:C==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},Je):null,r.createElement($e,{role:"status","aria-live":"polite"},At?"Drop files here to attach.":r.createElement("span",{key:eo.id},eo.text)))))))});nr.displayName="Chatbar.Root";var sr=r.forwardRef((e,t)=>{let{className:o,style:a,asChild:n,onFocus:p,onChange:s,onPaste:i,onKeyDown:c,onCompositionStart:l,onCompositionEnd:u,submitOnEnter:g=!1,...f}=e,D=ge(),S=r.useContext(Xt),{open:y,minLines:x,maxLines:v,expandOn:C,disabled:R,readOnly:b,setOpen:M,setValue:N,textareaRef:z,paste:H,appendFilesFromPaste:pe,size:B,submit:U,clearOnSubmit:X}=D,le=(0,Zt.useComposedRefs)(t,z),W=r.useRef(0),_=r.useRef(0),J=r.useRef(!1),q=r.useRef({open:y,minLines:x,maxLines:v});qt(()=>{q.current={open:y,minLines:x,maxLines:v}},[y,x,v]);let Q=r.useCallback(()=>{let m=z.current;if(!m)return;let V=window.getComputedStyle(m);W.current=parseFloat(V.lineHeight)||20,_.current=(parseFloat(V.paddingTop)||0)+(parseFloat(V.paddingBottom)||0)},[z]),ye=r.useCallback((m,V)=>{let{minLines:G,maxLines:Ie}=q.current,ce=W.current,he=_.current,Dt=Math.ceil((V?G:1)*ce)+he,Le=Math.ceil((V?Ie:1)*ce)+he,De=Math.max(m.scrollHeight,Dt);m.style.height=`${Math.min(De,Le)}px`;let we=De>Le;m.style.overflowY=we?"auto":"hidden",m.style.maxHeight=we?`${Le}px`:"none"},[]);qt(()=>{Q()},[Q,B]),qt(()=>{let m=z.current;m&&(W.current===0&&Q(),Qo(m,()=>{m.style.height="auto";let V=y;if(!y&&(C==="overflow"||C==="both")){let G=Math.ceil(W.current)+_.current;m.scrollHeight>G+1&&(V=!0,M(!0))}ye(m,V)}))},[S,y,C,x,v,B,M,z,Q,ye]),r.useEffect(()=>{let m=z.current;if(!m||typeof ResizeObserver>"u")return;let V=-1,G=new ResizeObserver(Ie=>{let ce=Ie[0]?.contentRect.width??0;if(ce===V)return;let he=V===-1;V=ce,!he&&(Q(),Qo(m,()=>{m.style.height="auto",ye(m,q.current.open)}))});return G.observe(m),()=>G.disconnect()},[z,Q,ye]),r.useEffect(()=>{},[]);let Ct=r.useCallback(m=>{p?.(m),!(R||b)&&(C==="focus"||C==="both")&&!y&&M(!0)},[R,b,C,y,M,p]),Me=r.useCallback(m=>{N(m.currentTarget.value),s?.(m)},[N,s]),Rt=r.useCallback(m=>{if(i?.(m),m.defaultPrevented||!H||R||b)return;let V=Array.from(m.clipboardData?.items??[]).filter(G=>G.kind==="file").map(G=>G.getAsFile()).filter(G=>!!G);V.length!==0&&pe(V)>0&&m.preventDefault()},[H,R,b,i,pe]),Ze=r.useCallback(m=>{J.current=!0,l?.(m)},[l]),Xe=r.useCallback(m=>{J.current=!1,u?.(m)},[u]),Je=r.useCallback(m=>{c?.(m),!(m.defaultPrevented||!g)&&(m.key!=="Enter"||m.shiftKey||m.altKey||m.ctrlKey||m.metaKey||J.current||m.nativeEvent.isComposing||m.nativeEvent.keyCode===229||(m.preventDefault(),U(X)))},[g,c,U,X]),xt=n?ne:"textarea";return r.createElement(Z.m.div,{className:(0,K.default)("rt-ChatbarField","rt-ChatbarTextarea",o),layout:"position",transition:Ye},r.createElement(xt,{...f,ref:le,className:"rt-ChatbarInput",value:S,onChange:Me,onFocus:Ct,onPaste:Rt,onKeyDown:Je,onCompositionStart:Ze,onCompositionEnd:Xe,disabled:R,readOnly:b,rows:y?x:1,spellCheck:f.spellCheck??!0,autoCorrect:f.autoCorrect??"on",style:a}))});sr.displayName="Chatbar.Textarea";var ar=r.forwardRef((e,t)=>{let{children:o,asChild:a,className:n,...p}=e;return ge().open?null:r.createElement(a?ne:"div",{...p,ref:t,className:(0,K.default)("rt-ChatbarInlineStart",n)},o)});ar.displayName="Chatbar.InlineStart";var ir=r.forwardRef((e,t)=>{let{children:o,asChild:a,className:n,...p}=e;return ge().open?null:r.createElement(a?ne:"div",{...p,ref:t,className:(0,K.default)("rt-ChatbarInlineEnd",n)},o)});ir.displayName="Chatbar.InlineEnd";var pr=r.forwardRef((e,t)=>{let{asChild:o,forceMount:a,renderAttachment:n,className:p,...s}=e,i=ge();if(i.attachments.length===0&&!a)return null;let c=o?ne:"div";return r.createElement(Z.m.div,{layout:"position",transition:Ye},r.createElement(c,{...s,ref:t,className:(0,K.default)("rt-ChatbarAttachmentsRow",p),role:"list","aria-label":s["aria-label"]??"Attachments"},r.createElement(Kt,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},r.createElement(ee,{align:"center",gap:"2",minWidth:"fit-content"},i.attachments.map(l=>r.createElement(Jt,{key:l.id,attachment:l,asChild:!!n},n?.(l)))))))});pr.displayName="Chatbar.AttachmentsRow";var jn={uploading:"uploading",error:"failed to upload"},Jt=r.forwardRef((e,t)=>{let{attachment:o,asChild:a,className:n,children:p,...s}=e,i=ge(),c=a?ne:"div",l=!!o.url&&rr(o.name,o.type),u=`${Math.ceil(o.size/1024)} KB`,g=o.status?jn[o.status]:void 0,f=i.disabled||i.readOnly,D=S=>{let y=S.currentTarget.closest('[role="listitem"]'),x=y?.parentElement?Array.from(y.parentElement.children):[],v=y?x.indexOf(y):-1,R=(x[v+1]??x[v-1])?.querySelector(".rt-ChatbarAttachmentRemove");R?R.focus():i.textareaRef.current?.focus({preventScroll:!0}),i.removeAttachment(o.id)};return r.createElement(c,{...s,ref:t,className:(0,K.default)("rt-ChatbarAttachment",n),role:"listitem","data-kind":l?"image":"file","data-status":o.status,title:o.name},p??r.createElement(ee,{align:"center",gap:"2",pr:l?void 0:"6"},r.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},l?r.createElement("img",{className:"rt-ChatbarAttachmentImage",src:o.url,alt:""}):r.createElement(Ut,null)),l?r.createElement($e,null,o.name,", ",u,g?`, ${g}`:""):r.createElement(ee,{direction:"column",gap:"0",minWidth:"0"},r.createElement(se,{size:i.size,weight:"medium",truncate:!0},o.name),r.createElement(se,{size:"1",color:o.status==="error"?"red":void 0,emphasis:o.status==="error"?void 0:"medium"},u,g?` \xB7 ${g}`:"")),!f&&r.createElement(Oe,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${o.name}`,size:"1",variant:"classic",color:"gray",onClick:D},r.createElement($t,null))))});Jt.displayName="Chatbar.Attachment";var lr=r.forwardRef((e,t)=>{let{asChild:o,accept:a,multiple:n,disabled:p,onPointerDown:s,onClick:i,...c}=e,l=ge(),u=p||l.disabled||l.readOnly;return r.createElement(o?ne:"button",{...c,ref:t,className:(0,K.default)("rt-ChatbarAttachTrigger",c.className),type:c.type??"button","aria-label":c["aria-label"]??"Add attachments",disabled:u,onPointerDown:f=>{s?.(f),!u&&!f.defaultPrevented&&l.beginFilePickerPress()},onClick:f=>{i?.(f),!(u||f.defaultPrevented)&&l.openFilePicker({accept:a,multiple:n})}})});lr.displayName="Chatbar.AttachTrigger";var cr=r.forwardRef((e,t)=>{let{asChild:o,children:a,className:n,...p}=e;if(!ge().open)return null;let i=o?ne:"div";return r.createElement(Z.m.div,{layout:"position",transition:Ye},r.createElement(i,{...p,ref:t,className:(0,K.default)("rt-ChatbarRow",n)},r.createElement(ee,{align:"center",justify:"between",width:"100%"},a)))});cr.displayName="Chatbar.Row";var ur=r.forwardRef((e,t)=>{let{className:o,...a}=e;return r.createElement("div",{...a,ref:t,className:(0,K.default)("rt-ChatbarRowStart",o)})});ur.displayName="Chatbar.RowStart";var mr=r.forwardRef((e,t)=>{let{className:o,...a}=e;return r.createElement("div",{...a,ref:t,className:(0,K.default)("rt-ChatbarRowEnd",o)})});mr.displayName="Chatbar.RowEnd";var dr=r.forwardRef((e,t)=>{let{asChild:o,clearOnSend:a,disabled:n,children:p,style:s,className:i,size:c,variant:l,tabIndex:u,onClick:g,status:f="ready",onStop:D,onRetry:S,stopLabel:y="Stop",retryLabel:x="Retry",stopIcon:v,retryIcon:C,"aria-label":R,"aria-labelledby":b,...M}=e,N=ge(),z=r.useContext(Xt),H=Yt(z)||N.attachments.length>0,B=H?"send":f==="submitted"||f==="streaming"?"stop":f==="error"?"retry":"send";if(N.sendMode==="never"&&B==="send")return null;let U=B!=="send"||N.sendMode==="always"||H,X=B==="send"?n||N.disabled||N.readOnly||!H:n||N.disabled,W=B==="stop"?{"aria-label":y}:B==="retry"?{"aria-label":x}:b?{"aria-labelledby":b}:{"aria-label":R??"Send"},_=q=>{if(g?.(q),q.defaultPrevented||X)return;if(B==="stop"){D?.();return}if(B==="retry"){S?.();return}let Q=a??N.clearOnSubmit;N.submit(Q)&&Q&&N.textareaRef.current?.focus({preventScroll:!0})},J=B==="stop"?v??(f==="submitted"?r.createElement(Ge,{size:N.size}):r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},r.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):B==="retry"?C??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},r.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),r.createElement("path",{d:"M3 3v5h5"})):p??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},r.createElement("path",{d:"M5 12h14"}),r.createElement("path",{d:"m12 5 7 7-7 7"}));return r.createElement(Oe,{...M,ref:t,size:c??N.size,variant:l??(N.open||B!=="send"?"solid":"ghost"),disabled:X,className:(0,K.default)("rt-ChatbarSend",i),style:{opacity:U?1:0,pointerEvents:U?void 0:"none",...s},"aria-hidden":U?void 0:!0,tabIndex:U?u:-1,asChild:o,onClick:_,"data-status":f,"data-mode":B,...W},J)});dr.displayName="Chatbar.Send";
4
+ - or visible text children`);let S=_e.createElement(Ue,{...s,...u,ref:i,className:(0,Ko.default)("rt-IconButton",e)});return l?_e.createElement(Ke,{content:t,side:o,align:n,delayDuration:a,disableHoverableContent:p,id:c},S):S});Me.displayName="IconButton";var h=w(require("react")),wn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));wn.displayName="ThickDividerHorizontalIcon";var Tn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Tn.displayName="ThickCheckIcon";var Sn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Sn.displayName="ChevronDownIcon";var Nn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Nn.displayName="ThickChevronRightIcon";var kn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));kn.displayName="ThickChevronLeftIcon";var Bn=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Bn.displayName="ThickDotIcon";var Ut=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M18 6 6 18"}),h.default.createElement("path",{d:"m6 6 12 12"})));Ut.displayName="CloseIcon";var An=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));An.displayName="PaperclipIcon";var En=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));En.displayName="FileIcon";var Kt=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),h.default.createElement("path",{d:"M10 9H8"}),h.default.createElement("path",{d:"M16 13H8"}),h.default.createElement("path",{d:"M16 17H8"})));Kt.displayName="FileTextIcon";var $=w(require("react")),bt=w(require("classnames")),de=require("radix-ui"),Qo=require("radix-ui/internal");var Fn=["1","2","3"],On=["vertical","horizontal","both"],De={...te,size:{type:"enum",className:"rt-r-size",values:Fn,default:"1",responsive:!0},...pt,scrollbars:{type:"enum",values:On,default:"both"},fade:{type:"boolean",default:!1}};var ht=w(require("react"));function _o(e){let[t,o]=ht.useState(null);return ht.useEffect(()=>{if(!e||!t)return;let n=0,a=()=>{n=0;let c=Math.max(0,t.scrollTop),l=Math.max(0,t.scrollHeight-t.clientHeight-t.scrollTop);t.style.setProperty("--scroll-overflow-start",`${c}px`),t.style.setProperty("--scroll-overflow-end",`${l}px`)},p=()=>{n||(n=requestAnimationFrame(a))};a(),t.addEventListener("scroll",p,{passive:!0});let s=typeof ResizeObserver>"u"?null:new ResizeObserver(p);s?.observe(t);for(let c of Array.from(t.children))s?.observe(c);let i=typeof MutationObserver>"u"?null:new MutationObserver(p);return i?.observe(t,{childList:!0}),()=>{n&&cancelAnimationFrame(n),t.removeEventListener("scroll",p),s?.disconnect(),i?.disconnect(),t.style.removeProperty("--scroll-overflow-start"),t.style.removeProperty("--scroll-overflow-end")}},[e,t]),o}function qo(e){let{m:t,mx:o,my:n,mt:a,mr:p,mb:s,ml:i,...c}=e;return{m:t,mx:o,my:n,mt:a,mr:p,mb:s,ml:i,rest:c}}var Zo=re.m.values,Mn=new Set(Zo),Yo=[{key:"m",className:"rt-r-m",customProperties:["--margin"]},{key:"mx",className:"rt-r-mx",customProperties:["--margin-left","--margin-right"]},{key:"my",className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"]},{key:"mt",className:"rt-r-mt",customProperties:["--margin-top"]},{key:"mr",className:"rt-r-mr",customProperties:["--margin-right"]},{key:"mb",className:"rt-r-mb",customProperties:["--margin-bottom"]},{key:"ml",className:"rt-r-ml",customProperties:["--margin-left"]}];function Xo(e){let t,o;for(let n=0;n<Yo.length;n++){let{key:a,className:p,customProperties:s}=Yo[n],i=e[a];if(i===void 0)continue;let[c,l]=ct({className:p,customProperties:s,propValues:Zo,propValueSet:Mn,value:i});c&&(t??(t=[])).push(c),l&&(o=ve(o,l))}return[t!==void 0?t.join(" "):"",o]}var Pt=w(require("react"));function Jo(e,t){let{asChild:o,children:n}=e;if(!o)return typeof t=="function"?t(n):t;let a=Pt.Children.only(n);return Pt.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}var _t=$.forwardRef((e,t)=>{let{rest:o,...n}=qo(e),[a,p]=Xo(n),{asChild:s,children:i,className:c,style:l,type:u,scrollHideDelay:y=u!=="scroll"?0:void 0,dir:f,size:D=De.size.default,radius:S=De.radius.default,scrollbars:g=De.scrollbars.default,fade:x=De.fade.default,...R}=o,v=_o(x),C=(0,Qo.useComposedRefs)(t,v);return $.createElement(de.ScrollArea.Root,{type:u,scrollHideDelay:y,className:(0,bt.default)("rt-ScrollAreaRoot",a,c),"data-fade":x?"":void 0,style:ve(p,l),asChild:s},Jo({asChild:s,children:i},P=>$.createElement($.Fragment,null,$.createElement(de.ScrollArea.Viewport,{...R,ref:C,className:"rt-ScrollAreaViewport"},P),$.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),g!=="vertical"?$.createElement(de.ScrollArea.Scrollbar,{"data-radius":S,orientation:"horizontal",className:(0,bt.default)("rt-ScrollAreaScrollbar",Ae({className:"rt-r-size",value:D,propValues:De.size.values}))},$.createElement(de.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,g!=="horizontal"?$.createElement(de.ScrollArea.Scrollbar,{"data-radius":S,orientation:"vertical",className:(0,bt.default)("rt-ScrollAreaScrollbar",Ae({className:"rt-r-size",value:D,propValues:De.size.values}))},$.createElement(de.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,g==="both"?$.createElement(de.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});_t.displayName="ScrollArea";var E=w(require("react")),tr=w(require("classnames"));var fe=w(require("react")),er=w(require("classnames"));var vt=fe.forwardRef(({className:e,style:t,tooltip:o,tooltipSide:n="top",tooltipAlign:a="center",tooltipDelayDuration:p,tooltipDisableHoverableContent:s,overrideStyles:i,...c},l)=>{let{tooltipId:u,hasTooltip:y,accessibilityProps:f}=gt(o),D=fe.useMemo(()=>{if(!i)return;let x={},R=(C,P)=>{P!==void 0&&(x[C]=P)},v=(C,P)=>{P&&(R(`--button-override-${C}color`,P.color),R(`--button-override-${C}background`,P.background),R(`--button-override-${C}background-color`,P.backgroundColor),R(`--button-override-${C}box-shadow`,P.boxShadow),R(`--button-override-${C}filter`,P.filter),R(`--button-override-${C}outline`,P.outline),R(`--button-override-${C}outline-offset`,P.outlineOffset),R(`--button-override-${C}opacity`,P.opacity))};return v("",i.normal),v("hover-",i.hover),v("active-",i.active),v("pressed-",i.pressed),v("open-",i.open),v("disabled-",i.disabled),i.focus&&(R("--button-override-focus-outline",i.focus.outline),R("--button-override-focus-outline-offset",i.focus.outlineOffset)),x},[i]),S=fe.useMemo(()=>D?{...D,...t}:t,[D,t]),g=fe.createElement(Ue,{...c,...f,ref:l,className:(0,er.default)("rt-Button",e),style:S});return y?fe.createElement(Ke,{content:o,side:n,align:a,delayDuration:p,disableHoverableContent:s,id:u},g):g});vt.displayName="Button";var Ct=E.createContext(void 0),qt=E.forwardRef(({kind:e,size:t="2",color:o="gray",material:n,className:a,children:p,trailing:s,leading:i,...c},l)=>E.createElement("div",{role:"status","aria-live":"polite",...c,ref:l,className:(0,tr.default)("rt-NoticeRoot",`rt-r-size-${t}`,a),"data-kind":e,"data-accent-color":o,"data-material":n},i?E.createElement("span",{className:"rt-NoticeIcon","aria-hidden":!0},i):null,E.createElement(se,{as:"div",size:t,className:"rt-NoticeText"},p),s));qt.displayName="Strip";var Vn=E.forwardRef(({icon:e,action:t,onDismiss:o,dismissLabel:n="Dismiss",size:a,...p},s)=>{let i=E.useContext(Ct),c=a??i??"2";return E.createElement(qt,{...p,size:c,ref:s,kind:"notice",leading:e,trailing:t||o?E.createElement("span",{className:"rt-NoticeActions"},t,o?E.createElement(Me,{size:c,variant:"ghost",color:"gray","aria-label":n,className:"rt-NoticeDismiss",onClick:o},E.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},E.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null})});Vn.displayName="Notice";var Ln=E.forwardRef(({confirmLabel:e,cancelLabel:t="Not now",onConfirm:o,onCancel:n,busy:a=!1,size:p,color:s="gray",...i},c)=>{let l=E.useContext(Ct),u=p??l??"2";return E.createElement(qt,{...i,size:u,color:s,ref:c,kind:"confirmation",trailing:E.createElement("span",{className:"rt-NoticeActions"},E.createElement(vt,{size:u,variant:"ghost",color:"gray",disabled:a,onClick:n},t),E.createElement(vt,{size:u,variant:"solid",color:s,loading:a,onClick:o},e))})});Ln.displayName="Confirmation";var Yt=typeof window<"u"?r.useLayoutEffect:r.useEffect;function or(e,t){let{placeholder:o}=e;if(!o){t();return}e.placeholder="";try{t()}finally{e.placeholder=o}}var Ye={layout:{type:"spring",visualDuration:.15,bounce:.1}},sr=r.createContext(null),Jt=r.createContext(""),ye=()=>{let e=r.useContext(sr);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},qe=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(t=>t.trim()).filter(Boolean):[],In=(e,t)=>{if(t.length===0)return!0;let o=e.type.toLowerCase(),n=e.name.toLowerCase();for(let a of t){let p=a.toLowerCase();if(p.includes("/")){let[s,i]=p.split("/"),[c,l]=o.split("/");if(s==="*"||s===c&&(i==="*"||i===l))return!0}else if(p.startsWith(".")&&n.endsWith(p))return!0}return!1},jn=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,ar=(e,t)=>(t||"").toLowerCase().startsWith("image/")||jn.test(e),Zt=e=>e.trim().length>0,rr=(e,t)=>`${e} ${t}${e===1?"":"s"}`,zn=0,Hn=()=>`chatbar-attachment-${Date.now()}-${++zn}`,ir=r.forwardRef((e,t)=>{let{className:o,style:n,children:a,value:p,defaultValue:s="",onValueChange:i,open:c,defaultOpen:l=!1,onOpenChange:u,expandOn:y="both",minLines:f=3,maxLines:D=6,sendMode:S="whenDirty",disabled:g,readOnly:x,onSubmit:R,size:v="2",variant:C,color:P,radius:V,panelBackground:N,material:z,width:H,maxWidth:pe,attachments:B,defaultAttachments:U,onAttachmentsChange:X,accept:le,multiple:W=!0,maxAttachments:_,maxFileSize:J,paste:q=!0,pasteAccept:Q,clearOnSubmit:ge=!0,onAttachmentReject:Rt,dropzone:Ve=!0,apiRef:xt,onBlurCapture:Ze,notices:Xe,context:Je,...Dt}=e,m=z||N,M=p!=null,[G,Le]=r.useState(s),ce=M?p:G,he=c!=null,[wt,Ie]=r.useState(l),we=he?c:wt,Te="attachments"in e,[eo,hr]=r.useState(()=>U??[]),je=r.useMemo(()=>Te?B??[]:eo,[Te,B,eo]),[to,Pr]=r.useState({text:"",id:0}),ze=r.useCallback(d=>Pr(b=>({text:d,id:b.id+1})),[]),oo=r.useRef(null),br=(0,Xt.useComposedRefs)(t,oo),Tt=r.useRef(null),St=r.useRef(null),He=r.useRef(!1),Qe=r.useRef(!1),et=r.useRef(void 0),Nt=r.useRef(null),ro=qe(le).join(","),kt=qe(Q).join(","),Bt=r.useMemo(()=>qe(ro),[ro]),vr=r.useMemo(()=>kt?qe(kt):Bt,[kt,Bt]),no={value:ce,attachments:je,accepts:Bt,pasteAccepts:vr,multiple:W,maxAttachments:_,maxFileSize:J,disabled:g,readOnly:x,expandOn:y,isValueControlled:M,isOpenControlled:he,isAttachmentsControlled:Te,onValueChange:i,onOpenChange:u,onAttachmentsChange:X,onAttachmentReject:Rt,onSubmit:R},I=r.useRef(no);I.current=no;let At=r.useRef(null),ue=r.useCallback(()=>At.current??I.current.attachments,[]),Se=r.useCallback(d=>{I.current.isOpenControlled||Ie(d),I.current.onOpenChange?.(d)},[]),tt=r.useCallback(d=>{I.current.isValueControlled||Le(d),I.current.onValueChange?.(d)},[]),Ne=r.useCallback(d=>{At.current=d,queueMicrotask(()=>{At.current=null}),I.current.isAttachmentsControlled||hr(d),I.current.onAttachmentsChange?.(d)},[]),ot=r.useRef(new Set),ke=r.useCallback((d,b,k=I.current.multiple)=>{let A=I.current;if(A.disabled||A.readOnly||d.length===0)return 0;let me=ue(),Pe=[],Be=[],Nr=typeof A.maxAttachments=="number"?Math.max(A.maxAttachments-me.length,0):1/0,kr=k?1/0:1;for(let Y of d){if(Pe.length>=Nr||Pe.length>=kr){Be.push({file:Y,reason:"count"});continue}if(typeof A.maxFileSize=="number"&&Y.size>A.maxFileSize){Be.push({file:Y,reason:"size"});continue}if(!In(Y,b)){Be.push({file:Y,reason:"type"});continue}let Ft=ar(Y.name,Y.type)?URL.createObjectURL(Y):void 0;Ft&&ot.current.add(Ft),Pe.push({id:Hn(),name:Y.name,size:Y.size,type:Y.type,file:Y,url:Ft,status:"idle"})}let st=[];return Pe.length>0&&(Ne(me.concat(Pe)),A.expandOn!=="none"&&Se(!0),st.push(`${rr(Pe.length,"file")} attached.`)),Be.length>0&&(A.onAttachmentReject?.(Be),st.push(`${rr(Be.length,"file")} could not be attached.`)),st.length>0&&ze(st.join(" ")),Pe.length},[ue,Ne,Se,ze]),rt=r.useCallback(d=>ke(d,I.current.accepts),[ke]),so=r.useCallback(d=>ke(d,I.current.pasteAccepts),[ke]),ao=r.useCallback(d=>{let b=ue(),k=b.find(A=>A.id===d);k&&(Ne(b.filter(A=>A.id!==d)),ze(`Removed ${k.name}.`))},[ue,Ne,ze]),io=r.useCallback(d=>{let b=I.current;if(b.disabled||b.readOnly)return!1;let k=ue();if(!Zt(b.value)&&k.length===0)return!1;let A={value:b.value,attachments:k};if(d&&b.onSubmit)for(let me of k)me.url&&ot.current.delete(me.url);return b.onSubmit?.(A),d&&(tt(""),Ne([])),!0},[ue,tt,Ne]);r.useEffect(()=>{let d=ot.current;if(d.size===0)return;let b=new Set(je.map(k=>k.url));for(let k of Array.from(d))b.has(k)||(URL.revokeObjectURL(k),d.delete(k))},[je]),r.useEffect(()=>{let d=ot.current;return()=>{if(!I.current.isAttachmentsControlled){for(let b of Array.from(d))URL.revokeObjectURL(b);d.clear()}}},[]);let nt=r.useCallback(d=>{let b=I.current,k=St.current;if(clearTimeout(et.current),Qe.current=!1,!k||b.disabled||b.readOnly)return;let A=d?.accept!=null?qe(d.accept):b.accepts,me=d?.multiple??b.multiple;Nt.current={patterns:A,multiple:me},k.accept=A.join(","),k.multiple=me,He.current=!0,k.click(),setTimeout(()=>{document.hasFocus()&&(He.current=!1)},1e3)},[]),po=r.useCallback(()=>{Qe.current=!0,clearTimeout(et.current),et.current=setTimeout(()=>{Qe.current=!1},800)},[]);r.useEffect(()=>()=>clearTimeout(et.current),[]),r.useEffect(()=>{let d=St.current,b=()=>{He.current=!1};return window.addEventListener("focus",b),d?.addEventListener("cancel",b),()=>{window.removeEventListener("focus",b),d?.removeEventListener("cancel",b)}},[]);let Cr=r.useCallback(d=>{let b=d.currentTarget,k=Array.from(b.files??[]),A=Nt.current;ke(k,A?.patterns??I.current.accepts,A?.multiple),He.current=!1,Nt.current=null,b.value=""},[ke]),Rr=r.useCallback(d=>{Ze?.(d);let b=I.current,k=oo.current;if(!k||b.expandOn==="none")return;let A=d.relatedTarget;A&&k.contains(A)||He.current||Qe.current||!Zt(b.value)&&ue().length===0&&Se(!1)},[Ze,Se,ue]),xr=r.useCallback(d=>{rt(d)},[rt]),{getRootProps:Dr,isDragActive:wr}=(0,nr.useDropzone)({onDrop:xr,onDragEnter:()=>ze(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!Ve||g||x}),Et=Ve&&wr;r.useImperativeHandle(xt,()=>({focusTextarea:()=>Tt.current?.focus({preventScroll:!0}),openFilePicker:()=>nt()}),[nt]);let Tr=r.useCallback(d=>{if(g||d.pointerType==="mouse"&&d.button!==0)return;let b=d.target;b instanceof Element&&b.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(d.preventDefault(),Tt.current?.focus({preventScroll:!0}))},[g]),Sr=r.useMemo(()=>({open:we,setOpen:Se,setValue:tt,size:v,expandOn:y,minLines:f,maxLines:D,sendMode:S,disabled:g,readOnly:x,paste:q,clearOnSubmit:ge,multiple:W,textareaRef:Tt,attachments:je,removeAttachment:ao,submit:io,appendFiles:rt,appendFilesFromPaste:so,openFilePicker:nt,beginFilePickerPress:po}),[we,Se,tt,v,y,f,D,S,g,x,q,ge,W,je,ao,io,rt,so,nt,po]);return r.createElement(sr.Provider,{value:Sr},r.createElement(Jt.Provider,{value:ce},r.createElement(Z.LazyMotion,{features:Z.domAnimation},r.createElement(Z.MotionConfig,{reducedMotion:"user"},r.createElement("div",{...Dt,ref:br,className:(0,K.default)("rt-ChatbarRoot",`rt-r-size-${v}`,o),style:{position:"relative",width:H,maxWidth:pe,...n},"data-state":we?"open":"closed","data-disabled":g?"":void 0,"data-readonly":x?"":void 0,"data-drop-active":Et?"":void 0,"data-accent-color":P,"data-radius":V,"data-panel-background":m,"data-material":m,onBlurCapture:Rr},r.createElement("input",{ref:St,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:Cr}),Xe?r.createElement("div",{className:"rt-ChatbarNotices"},r.createElement(Ct.Provider,{value:v},Xe)):null,r.createElement("div",{...Ve?Dr():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Tr},r.createElement(Z.m.div,{className:(0,K.default)("rt-ChatbarBox",`rt-variant-${C??"surface"}`),style:{position:"relative"},"data-accent-color":P,"data-radius":V,"data-panel-background":m,"data-material":m,layout:!0,transition:Ye},r.createElement(Z.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:Ye},a),Et&&r.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},r.createElement("div",{className:"rt-ChatbarDropContent"},r.createElement(se,{emphasis:"medium",size:v,weight:"medium"},"Drop files here to attach"))))),Je?r.createElement(se,{as:"div",size:v==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},Je):null,r.createElement($e,{role:"status","aria-live":"polite"},Et?"Drop files here to attach.":r.createElement("span",{key:to.id},to.text)))))))});ir.displayName="Chatbar.Root";var pr=r.forwardRef((e,t)=>{let{className:o,style:n,asChild:a,onFocus:p,onChange:s,onPaste:i,onKeyDown:c,onCompositionStart:l,onCompositionEnd:u,submitOnEnter:y=!1,...f}=e,D=ye(),S=r.useContext(Jt),{open:g,minLines:x,maxLines:R,expandOn:v,disabled:C,readOnly:P,setOpen:V,setValue:N,textareaRef:z,paste:H,appendFilesFromPaste:pe,size:B,submit:U,clearOnSubmit:X}=D,le=(0,Xt.useComposedRefs)(t,z),W=r.useRef(0),_=r.useRef(0),J=r.useRef(!1),q=r.useRef({open:g,minLines:x,maxLines:R});Yt(()=>{q.current={open:g,minLines:x,maxLines:R}},[g,x,R]);let Q=r.useCallback(()=>{let m=z.current;if(!m)return;let M=window.getComputedStyle(m);W.current=parseFloat(M.lineHeight)||20,_.current=(parseFloat(M.paddingTop)||0)+(parseFloat(M.paddingBottom)||0)},[z]),ge=r.useCallback((m,M)=>{let{minLines:G,maxLines:Le}=q.current,ce=W.current,he=_.current,wt=Math.ceil((M?G:1)*ce)+he,Ie=Math.ceil((M?Le:1)*ce)+he,we=Math.max(m.scrollHeight,wt);m.style.height=`${Math.min(we,Ie)}px`;let Te=we>Ie;m.style.overflowY=Te?"auto":"hidden",m.style.maxHeight=Te?`${Ie}px`:"none"},[]);Yt(()=>{Q()},[Q,B]),Yt(()=>{let m=z.current;m&&(W.current===0&&Q(),or(m,()=>{m.style.height="auto";let M=g;if(!g&&(v==="overflow"||v==="both")){let G=Math.ceil(W.current)+_.current;m.scrollHeight>G+1&&(M=!0,V(!0))}ge(m,M)}))},[S,g,v,x,R,B,V,z,Q,ge]),r.useEffect(()=>{let m=z.current;if(!m||typeof ResizeObserver>"u")return;let M=-1,G=new ResizeObserver(Le=>{let ce=Le[0]?.contentRect.width??0;if(ce===M)return;let he=M===-1;M=ce,!he&&(Q(),or(m,()=>{m.style.height="auto",ge(m,q.current.open)}))});return G.observe(m),()=>G.disconnect()},[z,Q,ge]),r.useEffect(()=>{},[]);let Rt=r.useCallback(m=>{p?.(m),!(C||P)&&(v==="focus"||v==="both")&&!g&&V(!0)},[C,P,v,g,V,p]),Ve=r.useCallback(m=>{N(m.currentTarget.value),s?.(m)},[N,s]),xt=r.useCallback(m=>{if(i?.(m),m.defaultPrevented||!H||C||P)return;let M=Array.from(m.clipboardData?.items??[]).filter(G=>G.kind==="file").map(G=>G.getAsFile()).filter(G=>!!G);M.length!==0&&pe(M)>0&&m.preventDefault()},[H,C,P,i,pe]),Ze=r.useCallback(m=>{J.current=!0,l?.(m)},[l]),Xe=r.useCallback(m=>{J.current=!1,u?.(m)},[u]),Je=r.useCallback(m=>{c?.(m),!(m.defaultPrevented||!y)&&(m.key!=="Enter"||m.shiftKey||m.altKey||m.ctrlKey||m.metaKey||J.current||m.nativeEvent.isComposing||m.nativeEvent.keyCode===229||(m.preventDefault(),U(X)))},[y,c,U,X]),Dt=a?ne:"textarea";return r.createElement(Z.m.div,{className:(0,K.default)("rt-ChatbarField","rt-ChatbarTextarea",o),layout:"position",transition:Ye},r.createElement(Dt,{...f,ref:le,className:"rt-ChatbarInput",value:S,onChange:Ve,onFocus:Rt,onPaste:xt,onKeyDown:Je,onCompositionStart:Ze,onCompositionEnd:Xe,disabled:C,readOnly:P,rows:g?x:1,spellCheck:f.spellCheck??!0,autoCorrect:f.autoCorrect??"on",style:n}))});pr.displayName="Chatbar.Textarea";var lr=r.forwardRef((e,t)=>{let{children:o,asChild:n,className:a,...p}=e;return ye().open?null:r.createElement(n?ne:"div",{...p,ref:t,className:(0,K.default)("rt-ChatbarInlineStart",a)},o)});lr.displayName="Chatbar.InlineStart";var cr=r.forwardRef((e,t)=>{let{children:o,asChild:n,className:a,...p}=e;return ye().open?null:r.createElement(n?ne:"div",{...p,ref:t,className:(0,K.default)("rt-ChatbarInlineEnd",a)},o)});cr.displayName="Chatbar.InlineEnd";var ur=r.forwardRef((e,t)=>{let{asChild:o,forceMount:n,renderAttachment:a,className:p,...s}=e,i=ye();if(i.attachments.length===0&&!n)return null;let c=o?ne:"div";return r.createElement(Z.m.div,{layout:"position",transition:Ye},r.createElement(c,{...s,ref:t,className:(0,K.default)("rt-ChatbarAttachmentsRow",p),role:"list","aria-label":s["aria-label"]??"Attachments"},r.createElement(_t,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},r.createElement(ee,{align:"center",gap:"2",minWidth:"fit-content"},i.attachments.map(l=>r.createElement(Qt,{key:l.id,attachment:l,asChild:!!a},a?.(l)))))))});ur.displayName="Chatbar.AttachmentsRow";var Wn={uploading:"uploading",error:"failed to upload"},Qt=r.forwardRef((e,t)=>{let{attachment:o,asChild:n,className:a,children:p,...s}=e,i=ye(),c=n?ne:"div",l=!!o.url&&ar(o.name,o.type),u=`${Math.ceil(o.size/1024)} KB`,y=o.status?Wn[o.status]:void 0,f=i.disabled||i.readOnly,D=S=>{let g=S.currentTarget.closest('[role="listitem"]'),x=g?.parentElement?Array.from(g.parentElement.children):[],R=g?x.indexOf(g):-1,C=(x[R+1]??x[R-1])?.querySelector(".rt-ChatbarAttachmentRemove");C?C.focus():i.textareaRef.current?.focus({preventScroll:!0}),i.removeAttachment(o.id)};return r.createElement(c,{...s,ref:t,className:(0,K.default)("rt-ChatbarAttachment",a),role:"listitem","data-kind":l?"image":"file","data-status":o.status,title:o.name},p??r.createElement(ee,{align:"center",gap:"2",pr:l?void 0:"6"},r.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},l?r.createElement("img",{className:"rt-ChatbarAttachmentImage",src:o.url,alt:""}):r.createElement(Kt,null)),l?r.createElement($e,null,o.name,", ",u,y?`, ${y}`:""):r.createElement(ee,{direction:"column",gap:"0",minWidth:"0"},r.createElement(se,{size:i.size,weight:"medium",truncate:!0},o.name),r.createElement(se,{size:"1",color:o.status==="error"?"red":void 0,emphasis:o.status==="error"?void 0:"medium"},u,y?` \xB7 ${y}`:"")),!f&&r.createElement(Me,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${o.name}`,size:"1",variant:"classic",color:"gray",onClick:D},r.createElement(Ut,null))))});Qt.displayName="Chatbar.Attachment";var mr=r.forwardRef((e,t)=>{let{asChild:o,accept:n,multiple:a,disabled:p,onPointerDown:s,onClick:i,...c}=e,l=ye(),u=p||l.disabled||l.readOnly;return r.createElement(o?ne:"button",{...c,ref:t,className:(0,K.default)("rt-ChatbarAttachTrigger",c.className),type:c.type??"button","aria-label":c["aria-label"]??"Add attachments",disabled:u,onPointerDown:f=>{s?.(f),!u&&!f.defaultPrevented&&l.beginFilePickerPress()},onClick:f=>{i?.(f),!(u||f.defaultPrevented)&&l.openFilePicker({accept:n,multiple:a})}})});mr.displayName="Chatbar.AttachTrigger";var dr=r.forwardRef((e,t)=>{let{asChild:o,children:n,className:a,...p}=e;if(!ye().open)return null;let i=o?ne:"div";return r.createElement(Z.m.div,{layout:"position",transition:Ye},r.createElement(i,{...p,ref:t,className:(0,K.default)("rt-ChatbarRow",a)},r.createElement(ee,{align:"center",justify:"between",width:"100%"},n)))});dr.displayName="Chatbar.Row";var fr=r.forwardRef((e,t)=>{let{className:o,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowStart",o)})});fr.displayName="Chatbar.RowStart";var yr=r.forwardRef((e,t)=>{let{className:o,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowEnd",o)})});yr.displayName="Chatbar.RowEnd";var gr=r.forwardRef((e,t)=>{let{asChild:o,clearOnSend:n,disabled:a,children:p,style:s,className:i,size:c,variant:l,tabIndex:u,onClick:y,status:f="ready",onStop:D,onRetry:S,stopLabel:g="Stop",retryLabel:x="Retry",stopIcon:R,retryIcon:v,"aria-label":C,"aria-labelledby":P,...V}=e,N=ye(),z=r.useContext(Jt),H=Zt(z)||N.attachments.length>0,B=H?"send":f==="submitted"||f==="streaming"?"stop":f==="error"?"retry":"send";if(N.sendMode==="never"&&B==="send")return null;let U=B!=="send"||N.sendMode==="always"||H,X=B==="send"?a||N.disabled||N.readOnly||!H:a||N.disabled,W=B==="stop"?{"aria-label":g}:B==="retry"?{"aria-label":x}:P?{"aria-labelledby":P}:{"aria-label":C??"Send"},_=q=>{if(y?.(q),q.defaultPrevented||X)return;if(B==="stop"){D?.();return}if(B==="retry"){S?.();return}let Q=n??N.clearOnSubmit;N.submit(Q)&&Q&&N.textareaRef.current?.focus({preventScroll:!0})},J=B==="stop"?R??(f==="submitted"?r.createElement(Ge,{size:N.size}):r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},r.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):B==="retry"?v??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},r.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),r.createElement("path",{d:"M3 3v5h5"})):p??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},r.createElement("path",{d:"M5 12h14"}),r.createElement("path",{d:"m12 5 7 7-7 7"}));return r.createElement(Me,{...V,ref:t,size:c??N.size,variant:l??(N.open||B!=="send"?"solid":"ghost"),disabled:X,className:(0,K.default)("rt-ChatbarSend",i),style:{opacity:U?1:0,pointerEvents:U?void 0:"none",...s},"aria-hidden":U?void 0:!0,tabIndex:U?u:-1,asChild:o,onClick:_,"data-status":f,"data-mode":B,...W},J)});gr.displayName="Chatbar.Send";
5
5
  //# sourceMappingURL=chatbar.js.map