ivt 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +9 -0
  2. package/dist/accordion/index.mjs +1 -1
  3. package/dist/alert/index.mjs +1 -1
  4. package/dist/alert-dialog/index.d.ts +17 -0
  5. package/dist/alert-dialog/index.mjs +2 -0
  6. package/dist/alert-dialog/index.mjs.map +1 -0
  7. package/dist/avatar/index.mjs +1 -1
  8. package/dist/avatar/index.mjs.map +1 -1
  9. package/dist/badge/index.mjs +1 -1
  10. package/dist/base/index.d.ts +1 -0
  11. package/dist/base/index.mjs +1 -1
  12. package/dist/base/index.mjs.map +1 -1
  13. package/dist/button/index.mjs +1 -1
  14. package/dist/calendar/index.mjs +1 -1
  15. package/dist/card/index.mjs +1 -1
  16. package/dist/checkbox/index.mjs +1 -1
  17. package/dist/checkbox/index.mjs.map +1 -1
  18. package/dist/chunks/{TextWrap-23P8STqb.mjs → TextWrap-DM8p5RY0.mjs} +2 -2
  19. package/dist/chunks/{TextWrap-23P8STqb.mjs.map → TextWrap-DM8p5RY0.mjs.map} +1 -1
  20. package/dist/chunks/{accordion-pKx1Q4tK.mjs → accordion-CJbwVC50.mjs} +2 -2
  21. package/dist/chunks/{accordion-pKx1Q4tK.mjs.map → accordion-CJbwVC50.mjs.map} +1 -1
  22. package/dist/chunks/{badge-Cy4rR7ko.mjs → badge-Bl0X9ruG.mjs} +2 -2
  23. package/dist/chunks/{badge-Cy4rR7ko.mjs.map → badge-Bl0X9ruG.mjs.map} +1 -1
  24. package/dist/chunks/bundle-mjs-BYGwPY3j.mjs +2 -0
  25. package/dist/chunks/bundle-mjs-BYGwPY3j.mjs.map +1 -0
  26. package/dist/chunks/{button-L19W2fGF.mjs → button-B7K2JEBG.mjs} +2 -2
  27. package/dist/chunks/{button-L19W2fGF.mjs.map → button-B7K2JEBG.mjs.map} +1 -1
  28. package/dist/chunks/calendar-CDaopDjB.mjs +2 -0
  29. package/dist/chunks/calendar-CDaopDjB.mjs.map +1 -0
  30. package/dist/chunks/check-DoBi3iW5.mjs +2 -0
  31. package/dist/chunks/{check-1SKm0QUI.mjs.map → check-DoBi3iW5.mjs.map} +1 -1
  32. package/dist/chunks/chevron-down-BlskY22a.mjs +2 -0
  33. package/dist/chunks/{chevron-down-i6P9lr6K.mjs.map → chevron-down-BlskY22a.mjs.map} +1 -1
  34. package/dist/chunks/chevron-left-BXFDtxhQ.mjs +2 -0
  35. package/dist/chunks/{chevron-left-kY7-JEU4.mjs.map → chevron-left-BXFDtxhQ.mjs.map} +1 -1
  36. package/dist/chunks/chevron-right-DAqTCOj7.mjs +2 -0
  37. package/dist/chunks/{chevron-right-BCy8nVMg.mjs.map → chevron-right-DAqTCOj7.mjs.map} +1 -1
  38. package/dist/chunks/{command-BLs86fLx.mjs → command-DYONarI_.mjs} +2 -2
  39. package/dist/chunks/{command-BLs86fLx.mjs.map → command-DYONarI_.mjs.map} +1 -1
  40. package/dist/chunks/createLucideIcon-CkKdyF_L.mjs +2 -0
  41. package/dist/chunks/{createLucideIcon-NXzoJfn7.mjs.map → createLucideIcon-CkKdyF_L.mjs.map} +1 -1
  42. package/dist/chunks/{dialog-BDBNWwYT.mjs → dialog-Bs3UmyLz.mjs} +2 -2
  43. package/dist/chunks/{dialog-BDBNWwYT.mjs.map → dialog-Bs3UmyLz.mjs.map} +1 -1
  44. package/dist/chunks/{hover-card-BjXLQEhK.mjs → hover-card-CujP4Atn.mjs} +2 -2
  45. package/dist/chunks/{hover-card-BjXLQEhK.mjs.map → hover-card-CujP4Atn.mjs.map} +1 -1
  46. package/dist/chunks/index-BSf-atXx.mjs +2 -0
  47. package/dist/chunks/index-BSf-atXx.mjs.map +1 -0
  48. package/dist/chunks/{index-BkrjWCcN.mjs → index-BX6nSpY1.mjs} +1 -1
  49. package/dist/chunks/index-BX6nSpY1.mjs.map +1 -0
  50. package/dist/chunks/{index-BXYIPnYd.mjs → index-CAVVTG3h.mjs} +2 -2
  51. package/dist/chunks/{index-BXYIPnYd.mjs.map → index-CAVVTG3h.mjs.map} +1 -1
  52. package/dist/chunks/{index-CRTXCtD-.mjs → index-CUXMuJ__.mjs} +2 -2
  53. package/dist/chunks/{index-CRTXCtD-.mjs.map → index-CUXMuJ__.mjs.map} +1 -1
  54. package/dist/chunks/{index-B_Oam-QU.mjs → index-Ck1fOwnt.mjs} +2 -2
  55. package/dist/chunks/{index-B_Oam-QU.mjs.map → index-Ck1fOwnt.mjs.map} +1 -1
  56. package/dist/chunks/{index-DXDEMoyA.mjs → index-DB6P4Tz1.mjs} +1 -1
  57. package/dist/chunks/{index-DXDEMoyA.mjs.map → index-DB6P4Tz1.mjs.map} +1 -1
  58. package/dist/chunks/{index-DFm8Tejm.mjs → index-DZldl4eo.mjs} +2 -2
  59. package/dist/chunks/{index-DFm8Tejm.mjs.map → index-DZldl4eo.mjs.map} +1 -1
  60. package/dist/chunks/index-DdNjMgpV.mjs +2 -0
  61. package/dist/chunks/index-DdNjMgpV.mjs.map +1 -0
  62. package/dist/chunks/index-Dix9fE1x.mjs +2 -0
  63. package/dist/chunks/index-Dix9fE1x.mjs.map +1 -0
  64. package/dist/chunks/index-DuMyb05s.mjs +2 -0
  65. package/dist/chunks/index-DuMyb05s.mjs.map +1 -0
  66. package/dist/chunks/{index-VNeBf_qQ.mjs → index-DyUn0c26.mjs} +2 -2
  67. package/dist/chunks/index-DyUn0c26.mjs.map +1 -0
  68. package/dist/chunks/{index-BzUzK8k1.mjs → index-IXx8l3RV.mjs} +2 -2
  69. package/dist/chunks/index-IXx8l3RV.mjs.map +1 -0
  70. package/dist/chunks/{index-Cj8SbPde.mjs → index-XatPIL6c.mjs} +2 -2
  71. package/dist/chunks/index-XatPIL6c.mjs.map +1 -0
  72. package/dist/chunks/index-qP_a6BiF.mjs +2 -0
  73. package/dist/chunks/index-qP_a6BiF.mjs.map +1 -0
  74. package/dist/chunks/{input-CIOLnRPP.mjs → input-BtSMyTkT.mjs} +2 -2
  75. package/dist/chunks/{input-CIOLnRPP.mjs.map → input-BtSMyTkT.mjs.map} +1 -1
  76. package/dist/chunks/{label-JzY_9HXj.mjs → label-BL5NIn0A.mjs} +2 -2
  77. package/dist/chunks/{label-JzY_9HXj.mjs.map → label-BL5NIn0A.mjs.map} +1 -1
  78. package/dist/chunks/{pagination-Duu8Xw3w.mjs → pagination-BiktkEzi.mjs} +2 -2
  79. package/dist/chunks/{pagination-Duu8Xw3w.mjs.map → pagination-BiktkEzi.mjs.map} +1 -1
  80. package/dist/chunks/popover-CSY_ub7s.mjs +2 -0
  81. package/dist/chunks/popover-CSY_ub7s.mjs.map +1 -0
  82. package/dist/chunks/progress-CmBH1a8S.mjs +2 -0
  83. package/dist/chunks/{progress-sKEf-fjz.mjs.map → progress-CmBH1a8S.mjs.map} +1 -1
  84. package/dist/chunks/{scroll-area-B-ktzHvu.mjs → scroll-area-B-b-oQYr.mjs} +2 -2
  85. package/dist/chunks/{scroll-area-B-ktzHvu.mjs.map → scroll-area-B-b-oQYr.mjs.map} +1 -1
  86. package/dist/chunks/{select-DqeznJec.mjs → select-Co76oy2I.mjs} +2 -2
  87. package/dist/chunks/{select-DqeznJec.mjs.map → select-Co76oy2I.mjs.map} +1 -1
  88. package/dist/chunks/{skeleton-cSOJ-vH8.mjs → skeleton-cvIjllDp.mjs} +2 -2
  89. package/dist/chunks/{skeleton-cSOJ-vH8.mjs.map → skeleton-cvIjllDp.mjs.map} +1 -1
  90. package/dist/chunks/{sortable-BX5MRGOc.mjs → sortable-DaXPlC2-.mjs} +2 -2
  91. package/dist/chunks/{sortable-BX5MRGOc.mjs.map → sortable-DaXPlC2-.mjs.map} +1 -1
  92. package/dist/chunks/{table-BGjJ1DhO.mjs → table-xzX2584j.mjs} +2 -2
  93. package/dist/chunks/{table-BGjJ1DhO.mjs.map → table-xzX2584j.mjs.map} +1 -1
  94. package/dist/chunks/{tslib.es6-DnJNy3VA.mjs → tslib.es6-CC_zzJ2l.mjs} +1 -1
  95. package/dist/chunks/{tslib.es6-DnJNy3VA.mjs.map → tslib.es6-CC_zzJ2l.mjs.map} +1 -1
  96. package/dist/chunks/{utils-C6LYO_CH.mjs → utils-B9uwc_lt.mjs} +2 -2
  97. package/dist/chunks/{utils-C6LYO_CH.mjs.map → utils-B9uwc_lt.mjs.map} +1 -1
  98. package/dist/chunks/x-Bdqqbrz4.mjs +2 -0
  99. package/dist/chunks/{x-DjF9gicP.mjs.map → x-Bdqqbrz4.mjs.map} +1 -1
  100. package/dist/command/index.mjs +1 -1
  101. package/dist/data-table/index.d.ts +4 -4
  102. package/dist/data-table/index.mjs +1 -1
  103. package/dist/data-table/index.mjs.map +1 -1
  104. package/dist/dialog/index.mjs +1 -1
  105. package/dist/dropdown-menu/index.mjs +1 -1
  106. package/dist/dropdown-menu/index.mjs.map +1 -1
  107. package/dist/dropzone/index.mjs +1 -6
  108. package/dist/dropzone/index.mjs.map +1 -1
  109. package/dist/form/index.mjs +1 -1
  110. package/dist/hover-card/index.mjs +1 -1
  111. package/dist/icon/index.mjs +1 -1
  112. package/dist/index.css +1 -1
  113. package/dist/input/index.mjs +1 -1
  114. package/dist/label/index.mjs +1 -1
  115. package/dist/pagination/index.mjs +1 -1
  116. package/dist/popover/index.mjs +1 -1
  117. package/dist/progress/index.mjs +1 -1
  118. package/dist/scroll-area/index.mjs +1 -1
  119. package/dist/select/index.mjs +1 -1
  120. package/dist/separator/index.mjs +1 -1
  121. package/dist/sheet/index.mjs +1 -1
  122. package/dist/sheet/index.mjs.map +1 -1
  123. package/dist/skeleton/index.mjs +1 -1
  124. package/dist/sonner/index.mjs +1 -1
  125. package/dist/sonner/index.mjs.map +1 -1
  126. package/dist/sortable/index.mjs +1 -1
  127. package/dist/table/index.mjs +1 -1
  128. package/dist/tabs/index.mjs +1 -1
  129. package/dist/toast/index.mjs +1 -1
  130. package/dist/toast/index.mjs.map +1 -1
  131. package/dist/tooltip/index.mjs +1 -1
  132. package/dist/tooltip/index.mjs.map +1 -1
  133. package/package.json +11 -5
  134. package/dist/chunks/Combination-CaCdPc0V.mjs +0 -2
  135. package/dist/chunks/Combination-CaCdPc0V.mjs.map +0 -1
  136. package/dist/chunks/bundle-mjs-E0baekTQ.mjs +0 -2
  137. package/dist/chunks/bundle-mjs-E0baekTQ.mjs.map +0 -1
  138. package/dist/chunks/calendar-BQrtnevv.mjs +0 -2
  139. package/dist/chunks/calendar-BQrtnevv.mjs.map +0 -1
  140. package/dist/chunks/check-1SKm0QUI.mjs +0 -2
  141. package/dist/chunks/chevron-down-i6P9lr6K.mjs +0 -2
  142. package/dist/chunks/chevron-left-kY7-JEU4.mjs +0 -2
  143. package/dist/chunks/chevron-right-BCy8nVMg.mjs +0 -2
  144. package/dist/chunks/createLucideIcon-NXzoJfn7.mjs +0 -14
  145. package/dist/chunks/index-5xCD9zck.mjs +0 -2
  146. package/dist/chunks/index-5xCD9zck.mjs.map +0 -1
  147. package/dist/chunks/index-BkrjWCcN.mjs.map +0 -1
  148. package/dist/chunks/index-BzUzK8k1.mjs.map +0 -1
  149. package/dist/chunks/index-CBuWa3V_.mjs +0 -2
  150. package/dist/chunks/index-CBuWa3V_.mjs.map +0 -1
  151. package/dist/chunks/index-Cj8SbPde.mjs.map +0 -1
  152. package/dist/chunks/index-DU2SqYv7.mjs +0 -2
  153. package/dist/chunks/index-DU2SqYv7.mjs.map +0 -1
  154. package/dist/chunks/index-DagWVwpf.mjs +0 -2
  155. package/dist/chunks/index-DagWVwpf.mjs.map +0 -1
  156. package/dist/chunks/index-VNeBf_qQ.mjs.map +0 -1
  157. package/dist/chunks/popover-CstNJ6EN.mjs +0 -2
  158. package/dist/chunks/popover-CstNJ6EN.mjs.map +0 -1
  159. package/dist/chunks/progress-sKEf-fjz.mjs +0 -2
  160. package/dist/chunks/x-DjF9gicP.mjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-toast/dist/index.mjs","../../src/components/ui/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/toast/src/toast.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport * as DismissableLayer from \"@radix-ui/react-dismissable-layer\";\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar PROVIDER_NAME = \"ToastProvider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(\"Toast\");\nvar [createToastContext, createToastScope] = createContextScope(\"Toast\", [createCollectionScope]);\nvar [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME);\nvar ToastProvider = (props) => {\n const {\n __scopeToast,\n label = \"Notification\",\n duration = 5e3,\n swipeDirection = \"right\",\n swipeThreshold = 50,\n children\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [toastCount, setToastCount] = React.useState(0);\n const isFocusedToastEscapeKeyDownRef = React.useRef(false);\n const isClosePausedRef = React.useRef(false);\n if (!label.trim()) {\n console.error(\n `Invalid prop \\`label\\` supplied to \\`${PROVIDER_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n }\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n ToastProviderProvider,\n {\n scope: __scopeToast,\n label,\n duration,\n swipeDirection,\n swipeThreshold,\n toastCount,\n viewport,\n onViewportChange: setViewport,\n onToastAdd: React.useCallback(() => setToastCount((prevCount) => prevCount + 1), []),\n onToastRemove: React.useCallback(() => setToastCount((prevCount) => prevCount - 1), []),\n isFocusedToastEscapeKeyDownRef,\n isClosePausedRef,\n children\n }\n ) });\n};\nToastProvider.displayName = PROVIDER_NAME;\nvar VIEWPORT_NAME = \"ToastViewport\";\nvar VIEWPORT_DEFAULT_HOTKEY = [\"F8\"];\nvar VIEWPORT_PAUSE = \"toast.viewportPause\";\nvar VIEWPORT_RESUME = \"toast.viewportResume\";\nvar ToastViewport = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n hotkey = VIEWPORT_DEFAULT_HOTKEY,\n label = \"Notifications ({hotkey})\",\n ...viewportProps\n } = props;\n const context = useToastProviderContext(VIEWPORT_NAME, __scopeToast);\n const getItems = useCollection(__scopeToast);\n const wrapperRef = React.useRef(null);\n const headFocusProxyRef = React.useRef(null);\n const tailFocusProxyRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n const hotkeyLabel = hotkey.join(\"+\").replace(/Key/g, \"\").replace(/Digit/g, \"\");\n const hasToasts = context.toastCount > 0;\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);\n if (isHotkeyPressed) ref.current?.focus();\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [hotkey]);\n React.useEffect(() => {\n const wrapper = wrapperRef.current;\n const viewport = ref.current;\n if (hasToasts && wrapper && viewport) {\n const handlePause = () => {\n if (!context.isClosePausedRef.current) {\n const pauseEvent = new CustomEvent(VIEWPORT_PAUSE);\n viewport.dispatchEvent(pauseEvent);\n context.isClosePausedRef.current = true;\n }\n };\n const handleResume = () => {\n if (context.isClosePausedRef.current) {\n const resumeEvent = new CustomEvent(VIEWPORT_RESUME);\n viewport.dispatchEvent(resumeEvent);\n context.isClosePausedRef.current = false;\n }\n };\n const handleFocusOutResume = (event) => {\n const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);\n if (isFocusMovingOutside) handleResume();\n };\n const handlePointerLeaveResume = () => {\n const isFocusInside = wrapper.contains(document.activeElement);\n if (!isFocusInside) handleResume();\n };\n wrapper.addEventListener(\"focusin\", handlePause);\n wrapper.addEventListener(\"focusout\", handleFocusOutResume);\n wrapper.addEventListener(\"pointermove\", handlePause);\n wrapper.addEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.addEventListener(\"blur\", handlePause);\n window.addEventListener(\"focus\", handleResume);\n return () => {\n wrapper.removeEventListener(\"focusin\", handlePause);\n wrapper.removeEventListener(\"focusout\", handleFocusOutResume);\n wrapper.removeEventListener(\"pointermove\", handlePause);\n wrapper.removeEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.removeEventListener(\"blur\", handlePause);\n window.removeEventListener(\"focus\", handleResume);\n };\n }\n }, [hasToasts, context.isClosePausedRef]);\n const getSortedTabbableCandidates = React.useCallback(\n ({ tabbingDirection }) => {\n const toastItems = getItems();\n const tabbableCandidates = toastItems.map((toastItem) => {\n const toastNode = toastItem.ref.current;\n const toastTabbableCandidates = [toastNode, ...getTabbableCandidates(toastNode)];\n return tabbingDirection === \"forwards\" ? toastTabbableCandidates : toastTabbableCandidates.reverse();\n });\n return (tabbingDirection === \"forwards\" ? tabbableCandidates.reverse() : tabbableCandidates).flat();\n },\n [getItems]\n );\n React.useEffect(() => {\n const viewport = ref.current;\n if (viewport) {\n const handleKeyDown = (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === \"Tab\" && !isMetaKey;\n if (isTabKey) {\n const focusedElement = document.activeElement;\n const isTabbingBackwards = event.shiftKey;\n const targetIsViewport = event.target === viewport;\n if (targetIsViewport && isTabbingBackwards) {\n headFocusProxyRef.current?.focus();\n return;\n }\n const tabbingDirection = isTabbingBackwards ? \"backwards\" : \"forwards\";\n const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });\n const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);\n if (focusFirst(sortedCandidates.slice(index + 1))) {\n event.preventDefault();\n } else {\n isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();\n }\n }\n };\n viewport.addEventListener(\"keydown\", handleKeyDown);\n return () => viewport.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [getItems, getSortedTabbableCandidates]);\n return /* @__PURE__ */ jsxs(\n DismissableLayer.Branch,\n {\n ref: wrapperRef,\n role: \"region\",\n \"aria-label\": label.replace(\"{hotkey}\", hotkeyLabel),\n tabIndex: -1,\n style: { pointerEvents: hasToasts ? void 0 : \"none\" },\n children: [\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: headFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"forwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: tailFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"backwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n )\n ]\n }\n );\n }\n);\nToastViewport.displayName = VIEWPORT_NAME;\nvar FOCUS_PROXY_NAME = \"ToastFocusProxy\";\nvar FocusProxy = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } = props;\n const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(\n VisuallyHidden,\n {\n \"aria-hidden\": true,\n tabIndex: 0,\n ...proxyProps,\n ref: forwardedRef,\n style: { position: \"fixed\" },\n onFocus: (event) => {\n const prevFocusedElement = event.relatedTarget;\n const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);\n if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();\n }\n }\n );\n }\n);\nFocusProxy.displayName = FOCUS_PROXY_NAME;\nvar TOAST_NAME = \"Toast\";\nvar TOAST_SWIPE_START = \"toast.swipeStart\";\nvar TOAST_SWIPE_MOVE = \"toast.swipeMove\";\nvar TOAST_SWIPE_CANCEL = \"toast.swipeCancel\";\nvar TOAST_SWIPE_END = \"toast.swipeEnd\";\nvar Toast = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;\n const [open = true, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(\n ToastImpl,\n {\n open,\n ...toastProps,\n ref: forwardedRef,\n onClose: () => setOpen(false),\n onPause: useCallbackRef(props.onPause),\n onResume: useCallbackRef(props.onResume),\n onSwipeStart: composeEventHandlers(props.onSwipeStart, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"start\");\n }),\n onSwipeMove: composeEventHandlers(props.onSwipeMove, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"move\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-y\", `${y}px`);\n }),\n onSwipeCancel: composeEventHandlers(props.onSwipeCancel, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"cancel\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-y\");\n }),\n onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"end\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-y\", `${y}px`);\n setOpen(false);\n })\n }\n ) });\n }\n);\nToast.displayName = TOAST_NAME;\nvar [ToastInteractiveProvider, useToastInteractiveContext] = createToastContext(TOAST_NAME, {\n onClose() {\n }\n});\nvar ToastImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n type = \"foreground\",\n duration: durationProp,\n open,\n onClose,\n onEscapeKeyDown,\n onPause,\n onResume,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n ...toastProps\n } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [node, setNode] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const pointerStartRef = React.useRef(null);\n const swipeDeltaRef = React.useRef(null);\n const duration = durationProp || context.duration;\n const closeTimerStartTimeRef = React.useRef(0);\n const closeTimerRemainingTimeRef = React.useRef(duration);\n const closeTimerRef = React.useRef(0);\n const { onToastAdd, onToastRemove } = context;\n const handleClose = useCallbackRef(() => {\n const isFocusInToast = node?.contains(document.activeElement);\n if (isFocusInToast) context.viewport?.focus();\n onClose();\n });\n const startTimer = React.useCallback(\n (duration2) => {\n if (!duration2 || duration2 === Infinity) return;\n window.clearTimeout(closeTimerRef.current);\n closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();\n closeTimerRef.current = window.setTimeout(handleClose, duration2);\n },\n [handleClose]\n );\n React.useEffect(() => {\n const viewport = context.viewport;\n if (viewport) {\n const handleResume = () => {\n startTimer(closeTimerRemainingTimeRef.current);\n onResume?.();\n };\n const handlePause = () => {\n const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;\n closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;\n window.clearTimeout(closeTimerRef.current);\n onPause?.();\n };\n viewport.addEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.addEventListener(VIEWPORT_RESUME, handleResume);\n return () => {\n viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.removeEventListener(VIEWPORT_RESUME, handleResume);\n };\n }\n }, [context.viewport, duration, onPause, onResume, startTimer]);\n React.useEffect(() => {\n if (open && !context.isClosePausedRef.current) startTimer(duration);\n }, [open, duration, context.isClosePausedRef, startTimer]);\n React.useEffect(() => {\n onToastAdd();\n return () => onToastRemove();\n }, [onToastAdd, onToastRemove]);\n const announceTextContent = React.useMemo(() => {\n return node ? getAnnounceTextContent(node) : null;\n }, [node]);\n if (!context.viewport) return null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n announceTextContent && /* @__PURE__ */ jsx(\n ToastAnnounce,\n {\n __scopeToast,\n role: \"status\",\n \"aria-live\": type === \"foreground\" ? \"assertive\" : \"polite\",\n \"aria-atomic\": true,\n children: announceTextContent\n }\n ),\n /* @__PURE__ */ jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM.createPortal(\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n DismissableLayer.Root,\n {\n asChild: true,\n onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {\n if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();\n context.isFocusedToastEscapeKeyDownRef.current = false;\n }),\n children: /* @__PURE__ */ jsx(\n Primitive.li,\n {\n role: \"status\",\n \"aria-live\": \"off\",\n \"aria-atomic\": true,\n tabIndex: 0,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-swipe-direction\": context.swipeDirection,\n ...toastProps,\n ref: composedRefs,\n style: { userSelect: \"none\", touchAction: \"none\", ...props.style },\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key !== \"Escape\") return;\n onEscapeKeyDown?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) {\n context.isFocusedToastEscapeKeyDownRef.current = true;\n handleClose();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (event.button !== 0) return;\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (!pointerStartRef.current) return;\n const x = event.clientX - pointerStartRef.current.x;\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const isHorizontalSwipe = [\"left\", \"right\"].includes(context.swipeDirection);\n const clamp = [\"left\", \"up\"].includes(context.swipeDirection) ? Math.min : Math.max;\n const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;\n const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { x: clampedX, y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {\n discrete: false\n });\n } else if (isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_START, onSwipeStart, eventDetail, {\n discrete: false\n });\n event.target.setPointerCapture(event.pointerId);\n } else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) {\n pointerStartRef.current = null;\n }\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const delta = swipeDeltaRef.current;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const toast = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) {\n handleAndDispatchCustomEvent(TOAST_SWIPE_END, onSwipeEnd, eventDetail, {\n discrete: true\n });\n } else {\n handleAndDispatchCustomEvent(\n TOAST_SWIPE_CANCEL,\n onSwipeCancel,\n eventDetail,\n {\n discrete: true\n }\n );\n }\n toast.addEventListener(\"click\", (event2) => event2.preventDefault(), {\n once: true\n });\n }\n })\n }\n )\n }\n ) }),\n context.viewport\n ) })\n ] });\n }\n);\nvar ToastAnnounce = (props) => {\n const { __scopeToast, children, ...announceProps } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);\n const [isAnnounced, setIsAnnounced] = React.useState(false);\n useNextFrame(() => setRenderAnnounceText(true));\n React.useEffect(() => {\n const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);\n return () => window.clearTimeout(timer);\n }, []);\n return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Fragment, { children: [\n context.label,\n \" \",\n children\n ] }) }) });\n};\nvar TITLE_NAME = \"ToastTitle\";\nvar ToastTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...titleProps, ref: forwardedRef });\n }\n);\nToastTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"ToastDescription\";\nvar ToastDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...descriptionProps, ref: forwardedRef });\n }\n);\nToastDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"ToastAction\";\nvar ToastAction = React.forwardRef(\n (props, forwardedRef) => {\n const { altText, ...actionProps } = props;\n if (!altText.trim()) {\n console.error(\n `Invalid prop \\`altText\\` supplied to \\`${ACTION_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n return null;\n }\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });\n }\n);\nToastAction.displayName = ACTION_NAME;\nvar CLOSE_NAME = \"ToastClose\";\nvar ToastClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props;\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, interactiveContext.onClose)\n }\n ) });\n }\n);\nToastClose.displayName = CLOSE_NAME;\nvar ToastAnnounceExclude = React.forwardRef((props, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-toast-announce-exclude\": \"\",\n \"data-radix-toast-announce-alt\": altText || void 0,\n ...announceExcludeProps,\n ref: forwardedRef\n }\n );\n});\nfunction getAnnounceTextContent(container) {\n const textContent = [];\n const childNodes = Array.from(container.childNodes);\n childNodes.forEach((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);\n if (isHTMLElement(node)) {\n const isHidden = node.ariaHidden || node.hidden || node.style.display === \"none\";\n const isExcluded = node.dataset.radixToastAnnounceExclude === \"\";\n if (!isHidden) {\n if (isExcluded) {\n const altText = node.dataset.radixToastAnnounceAlt;\n if (altText) textContent.push(altText);\n } else {\n textContent.push(...getAnnounceTextContent(node));\n }\n }\n }\n });\n return textContent;\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const currentTarget = detail.originalEvent.currentTarget;\n const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });\n if (handler) currentTarget.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(currentTarget, event);\n } else {\n currentTarget.dispatchEvent(event);\n }\n}\nvar isDeltaInDirection = (delta, direction, threshold = 0) => {\n const deltaX = Math.abs(delta.x);\n const deltaY = Math.abs(delta.y);\n const isDeltaX = deltaX > deltaY;\n if (direction === \"left\" || direction === \"right\") {\n return isDeltaX && deltaX > threshold;\n } else {\n return !isDeltaX && deltaY > threshold;\n }\n};\nfunction useNextFrame(callback = () => {\n}) {\n const fn = useCallbackRef(callback);\n useLayoutEffect(() => {\n let raf1 = 0;\n let raf2 = 0;\n raf1 = window.requestAnimationFrame(() => raf2 = window.requestAnimationFrame(fn));\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [fn]);\n}\nfunction isHTMLElement(node) {\n return node.nodeType === node.ELEMENT_NODE;\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction focusFirst(candidates) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\nvar Provider = ToastProvider;\nvar Viewport = ToastViewport;\nvar Root2 = Toast;\nvar Title = ToastTitle;\nvar Description = ToastDescription;\nvar Action = ToastAction;\nvar Close = ToastClose;\nexport {\n Action,\n Close,\n Description,\n Provider,\n Root2 as Root,\n Title,\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n Viewport,\n createToastScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n\t<ToastPrimitives.Viewport\n\t\tdata-slot=\"toast-viewport\"\n\t\tclassName={cn(\n\t\t\t\"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst toastVariants = cva(\n\t\"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"border bg-background text-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nconst Toast = ({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>) => {\n\treturn (\n\t\t<ToastPrimitives.Root\n\t\t\tdata-slot=\"toast-root\"\n\t\t\tclassName={cn(toastVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nconst ToastAction = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n\t<ToastPrimitives.Action\n\t\tdata-slot=\"toast-action\"\n\t\tclassName={cn(\n\t\t\t\"ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastClose = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n\t<ToastPrimitives.Close\n\t\tdata-slot=\"toast-close\"\n\t\tclassName={cn(\n\t\t\t\"text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n\t\t\tclassName,\n\t\t)}\n\t\ttoast-close=\"\"\n\t\t{...props}\n\t>\n\t\t<X className=\"h-4 w-4\" />\n\t</ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n\t<ToastPrimitives.Title\n\t\tdata-slot=\"toast-title\"\n\t\tclassName={cn(\"text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastDescription = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n\t<ToastPrimitives.Description\n\t\tdata-slot=\"toast-description\"\n\t\tclassName={cn(\"text-sm opacity-90\", className)}\n\t\t{...props}\n\t/>\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n\ttype ToastProps,\n\ttype ToastActionElement,\n\tToastProvider,\n\tToastViewport,\n\tToast,\n\tToastTitle,\n\tToastDescription,\n\tToastClose,\n\tToastAction,\n};\n"],"names":["PROVIDER_NAME","Collection","useCollection","createCollectionScope","createCollection","createToastContext","createToastScope","createContextScope","ToastProviderProvider","useToastProviderContext","ToastProvider","props","__scopeToast","label","duration","swipeDirection","swipeThreshold","children","viewport","setViewport","React","useState","toastCount","setToastCount","isFocusedToastEscapeKeyDownRef","useRef","isClosePausedRef","trim","console","error","jsx","Provider","scope","onViewportChange","onToastAdd","useCallback","prevCount","onToastRemove","displayName","VIEWPORT_NAME","VIEWPORT_DEFAULT_HOTKEY","VIEWPORT_PAUSE","VIEWPORT_RESUME","ToastViewport","forwardRef","forwardedRef","hotkey","viewportProps","context","getItems","wrapperRef","headFocusProxyRef","tailFocusProxyRef","ref","composedRefs","useComposedRefs","hotkeyLabel","join","replace","hasToasts","useEffect","handleKeyDown","event","length","every","key","code","current","focus","document","addEventListener","removeEventListener","wrapper","handlePause","pauseEvent","CustomEvent","dispatchEvent","handleResume","resumeEvent","handleFocusOutResume","contains","relatedTarget","handlePointerLeaveResume","activeElement","window","getSortedTabbableCandidates","tabbingDirection","tabbableCandidates","map","toastItem","toastNode","toastTabbableCandidates","getTabbableCandidates","reverse","flat","isMetaKey","altKey","ctrlKey","metaKey","focusedElement","isTabbingBackwards","shiftKey","target","sortedCandidates","index","findIndex","candidate","focusFirst","slice","preventDefault","jsxs","DismissableLayer.Branch","role","tabIndex","style","pointerEvents","FocusProxy","onFocusFromOutsideViewport","Slot","Primitive","ol","FOCUS_PROXY_NAME","proxyProps","VisuallyHidden","position","onFocus","prevFocusedElement","TOAST_NAME","Toast","forceMount","open","openProp","defaultOpen","onOpenChange","toastProps","setOpen","useControllableState","prop","defaultProp","onChange","Presence","present","ToastImpl","onClose","onPause","useCallbackRef","onResume","onSwipeStart","composeEventHandlers","currentTarget","setAttribute","onSwipeMove","x","y","detail","delta","setProperty","onSwipeCancel","removeProperty","onSwipeEnd","ToastInteractiveProvider","useToastInteractiveContext","type","durationProp","onEscapeKeyDown","node","setNode","pointerStartRef","swipeDeltaRef","closeTimerStartTimeRef","closeTimerRemainingTimeRef","closeTimerRef","handleClose","isFocusInToast","startTimer","Infinity","clearTimeout","Date","getTime","setTimeout","elapsedTime","announceTextContent","useMemo","getAnnounceTextContent","Fragment","ToastAnnounce","ReactDOM","createPortal","ItemSlot","DismissableLayer.Root","asChild","li","userSelect","touchAction","onKeyDown","nativeEvent","defaultPrevented","onPointerDown","button","clientX","clientY","onPointerMove","hasSwipeMoveStarted","Boolean","isHorizontalSwipe","includes","clamp","Math","min","max","clampedX","clampedY","moveStartBuffer","pointerType","eventDetail","originalEvent","handleAndDispatchCustomEvent","discrete","isDeltaInDirection","setPointerCapture","pointerId","abs","onPointerUp","hasPointerCapture","releasePointerCapture","toast","once","announceProps","renderAnnounceText","setRenderAnnounceText","isAnnounced","setIsAnnounced","callback","fn","useLayoutEffect","raf1","raf2","requestAnimationFrame","cancelAnimationFrame","useNextFrame","timer","Portal","ToastTitle","titleProps","div","ToastDescription","descriptionProps","ACTION_NAME","ToastAction","altText","actionProps","ToastAnnounceExclude","ToastClose","CLOSE_NAME","closeProps","interactiveContext","onClick","announceExcludeProps","container","textContent","Array","from","childNodes","forEach","nodeType","TEXT_NODE","push","ELEMENT_NODE","isHTMLElement","isHidden","ariaHidden","hidden","display","isExcluded","dataset","radixToastAnnounceExclude","radixToastAnnounceAlt","name","handler","bubbles","cancelable","dispatchDiscreteCustomEvent","direction","threshold","deltaX","deltaY","isDeltaX","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","disabled","FILTER_SKIP","FILTER_ACCEPT","nextNode","currentNode","candidates","previouslyFocusedElement","some","Viewport","Root","Title","Description","Action","Close","className","ToastPrimitives","data-slot","cn","toastVariants","cva","variants","variant","default","destructive","defaultVariants","createElement","toast-close","X"],"mappings":"u0BAqBA,IAAMA,EAAgB,iBAEfC,EAAYC,EAAeC,GAAyBC,EAA+B,UAkBnFC,EAAoBC,GAAoBC,EAAmB,QAAS,CAACJ,KACrEK,EAAuBC,GAC5BJ,EAA8CL,GA2B1CU,EAA+CC,IACnD,MAAMC,aACJA,EAAAC,MACAA,EAAQ,eAAAC,SACRA,EAAW,IAAAC,eACXA,EAAiB,QAAAC,eACjBA,EAAiB,GAAAC,SACjBA,GACEN,GACGO,EAAUC,GAAqBC,EAAAC,SAAsC,OACrEC,EAAYC,GAAuBH,EAAAC,SAAS,GAC7CG,EAAuCJ,EAAAK,QAAO,GAC9CC,EAAyBN,EAAAK,QAAO,GAQtC,OANKZ,EAAMc,QACTC,QAAQC,MACN,wCAAwC7B,uCAK1C8B,EAAC7B,EAAW8B,SAAX,CAAoBC,MAAOpB,EAC1BK,SAAAa,EAACtB,EAAA,CACCwB,MAAOpB,EACPC,QACAC,WACAC,iBACAC,iBACAM,aACAJ,WACAe,iBAAkBd,EAClBe,WAAkBd,EAAAe,aAAY,IAAMZ,GAAea,GAAcA,EAAY,KAAI,IACjFC,cAAqBjB,EAAAe,aAAY,IAAMZ,GAAea,GAAcA,EAAY,KAAI,IACpFZ,iCACAE,mBAECT,cAEL,EAIJP,EAAc4B,YAActC,EAM5B,IAAMuC,EAAgB,gBAChBC,EAA0B,CAAC,MAC3BC,EAAiB,sBACjBC,EAAkB,uBAkBlBC,EAAsBvB,EAAAwB,YAC1B,CAACjC,EAAwCkC,KACvC,MAAMjC,aACJA,EAAAkC,OACAA,EAASN,EAAA3B,MACTA,EAAQ,8BACLkC,GACDpC,EACEqC,EAAUvC,EAAwB8B,EAAe3B,GACjDqC,EAAW/C,EAAcU,GACzBsC,EA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,cAAAA,GAA2B,CAC3BC,YAAU,oBACVF,UAAWG,EAAG,qBAAsBH,MAChC1S","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-toast/dist/index.mjs","../../src/components/ui/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/toast/src/toast.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport * as DismissableLayer from \"@radix-ui/react-dismissable-layer\";\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar PROVIDER_NAME = \"ToastProvider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(\"Toast\");\nvar [createToastContext, createToastScope] = createContextScope(\"Toast\", [createCollectionScope]);\nvar [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME);\nvar ToastProvider = (props) => {\n const {\n __scopeToast,\n label = \"Notification\",\n duration = 5e3,\n swipeDirection = \"right\",\n swipeThreshold = 50,\n children\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [toastCount, setToastCount] = React.useState(0);\n const isFocusedToastEscapeKeyDownRef = React.useRef(false);\n const isClosePausedRef = React.useRef(false);\n if (!label.trim()) {\n console.error(\n `Invalid prop \\`label\\` supplied to \\`${PROVIDER_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n }\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n ToastProviderProvider,\n {\n scope: __scopeToast,\n label,\n duration,\n swipeDirection,\n swipeThreshold,\n toastCount,\n viewport,\n onViewportChange: setViewport,\n onToastAdd: React.useCallback(() => setToastCount((prevCount) => prevCount + 1), []),\n onToastRemove: React.useCallback(() => setToastCount((prevCount) => prevCount - 1), []),\n isFocusedToastEscapeKeyDownRef,\n isClosePausedRef,\n children\n }\n ) });\n};\nToastProvider.displayName = PROVIDER_NAME;\nvar VIEWPORT_NAME = \"ToastViewport\";\nvar VIEWPORT_DEFAULT_HOTKEY = [\"F8\"];\nvar VIEWPORT_PAUSE = \"toast.viewportPause\";\nvar VIEWPORT_RESUME = \"toast.viewportResume\";\nvar ToastViewport = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n hotkey = VIEWPORT_DEFAULT_HOTKEY,\n label = \"Notifications ({hotkey})\",\n ...viewportProps\n } = props;\n const context = useToastProviderContext(VIEWPORT_NAME, __scopeToast);\n const getItems = useCollection(__scopeToast);\n const wrapperRef = React.useRef(null);\n const headFocusProxyRef = React.useRef(null);\n const tailFocusProxyRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n const hotkeyLabel = hotkey.join(\"+\").replace(/Key/g, \"\").replace(/Digit/g, \"\");\n const hasToasts = context.toastCount > 0;\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);\n if (isHotkeyPressed) ref.current?.focus();\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [hotkey]);\n React.useEffect(() => {\n const wrapper = wrapperRef.current;\n const viewport = ref.current;\n if (hasToasts && wrapper && viewport) {\n const handlePause = () => {\n if (!context.isClosePausedRef.current) {\n const pauseEvent = new CustomEvent(VIEWPORT_PAUSE);\n viewport.dispatchEvent(pauseEvent);\n context.isClosePausedRef.current = true;\n }\n };\n const handleResume = () => {\n if (context.isClosePausedRef.current) {\n const resumeEvent = new CustomEvent(VIEWPORT_RESUME);\n viewport.dispatchEvent(resumeEvent);\n context.isClosePausedRef.current = false;\n }\n };\n const handleFocusOutResume = (event) => {\n const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);\n if (isFocusMovingOutside) handleResume();\n };\n const handlePointerLeaveResume = () => {\n const isFocusInside = wrapper.contains(document.activeElement);\n if (!isFocusInside) handleResume();\n };\n wrapper.addEventListener(\"focusin\", handlePause);\n wrapper.addEventListener(\"focusout\", handleFocusOutResume);\n wrapper.addEventListener(\"pointermove\", handlePause);\n wrapper.addEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.addEventListener(\"blur\", handlePause);\n window.addEventListener(\"focus\", handleResume);\n return () => {\n wrapper.removeEventListener(\"focusin\", handlePause);\n wrapper.removeEventListener(\"focusout\", handleFocusOutResume);\n wrapper.removeEventListener(\"pointermove\", handlePause);\n wrapper.removeEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.removeEventListener(\"blur\", handlePause);\n window.removeEventListener(\"focus\", handleResume);\n };\n }\n }, [hasToasts, context.isClosePausedRef]);\n const getSortedTabbableCandidates = React.useCallback(\n ({ tabbingDirection }) => {\n const toastItems = getItems();\n const tabbableCandidates = toastItems.map((toastItem) => {\n const toastNode = toastItem.ref.current;\n const toastTabbableCandidates = [toastNode, ...getTabbableCandidates(toastNode)];\n return tabbingDirection === \"forwards\" ? toastTabbableCandidates : toastTabbableCandidates.reverse();\n });\n return (tabbingDirection === \"forwards\" ? tabbableCandidates.reverse() : tabbableCandidates).flat();\n },\n [getItems]\n );\n React.useEffect(() => {\n const viewport = ref.current;\n if (viewport) {\n const handleKeyDown = (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === \"Tab\" && !isMetaKey;\n if (isTabKey) {\n const focusedElement = document.activeElement;\n const isTabbingBackwards = event.shiftKey;\n const targetIsViewport = event.target === viewport;\n if (targetIsViewport && isTabbingBackwards) {\n headFocusProxyRef.current?.focus();\n return;\n }\n const tabbingDirection = isTabbingBackwards ? \"backwards\" : \"forwards\";\n const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });\n const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);\n if (focusFirst(sortedCandidates.slice(index + 1))) {\n event.preventDefault();\n } else {\n isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();\n }\n }\n };\n viewport.addEventListener(\"keydown\", handleKeyDown);\n return () => viewport.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [getItems, getSortedTabbableCandidates]);\n return /* @__PURE__ */ jsxs(\n DismissableLayer.Branch,\n {\n ref: wrapperRef,\n role: \"region\",\n \"aria-label\": label.replace(\"{hotkey}\", hotkeyLabel),\n tabIndex: -1,\n style: { pointerEvents: hasToasts ? void 0 : \"none\" },\n children: [\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: headFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"forwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: tailFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"backwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n )\n ]\n }\n );\n }\n);\nToastViewport.displayName = VIEWPORT_NAME;\nvar FOCUS_PROXY_NAME = \"ToastFocusProxy\";\nvar FocusProxy = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } = props;\n const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(\n VisuallyHidden,\n {\n \"aria-hidden\": true,\n tabIndex: 0,\n ...proxyProps,\n ref: forwardedRef,\n style: { position: \"fixed\" },\n onFocus: (event) => {\n const prevFocusedElement = event.relatedTarget;\n const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);\n if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();\n }\n }\n );\n }\n);\nFocusProxy.displayName = FOCUS_PROXY_NAME;\nvar TOAST_NAME = \"Toast\";\nvar TOAST_SWIPE_START = \"toast.swipeStart\";\nvar TOAST_SWIPE_MOVE = \"toast.swipeMove\";\nvar TOAST_SWIPE_CANCEL = \"toast.swipeCancel\";\nvar TOAST_SWIPE_END = \"toast.swipeEnd\";\nvar Toast = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;\n const [open = true, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(\n ToastImpl,\n {\n open,\n ...toastProps,\n ref: forwardedRef,\n onClose: () => setOpen(false),\n onPause: useCallbackRef(props.onPause),\n onResume: useCallbackRef(props.onResume),\n onSwipeStart: composeEventHandlers(props.onSwipeStart, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"start\");\n }),\n onSwipeMove: composeEventHandlers(props.onSwipeMove, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"move\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-y\", `${y}px`);\n }),\n onSwipeCancel: composeEventHandlers(props.onSwipeCancel, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"cancel\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-y\");\n }),\n onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"end\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-y\", `${y}px`);\n setOpen(false);\n })\n }\n ) });\n }\n);\nToast.displayName = TOAST_NAME;\nvar [ToastInteractiveProvider, useToastInteractiveContext] = createToastContext(TOAST_NAME, {\n onClose() {\n }\n});\nvar ToastImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n type = \"foreground\",\n duration: durationProp,\n open,\n onClose,\n onEscapeKeyDown,\n onPause,\n onResume,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n ...toastProps\n } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [node, setNode] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const pointerStartRef = React.useRef(null);\n const swipeDeltaRef = React.useRef(null);\n const duration = durationProp || context.duration;\n const closeTimerStartTimeRef = React.useRef(0);\n const closeTimerRemainingTimeRef = React.useRef(duration);\n const closeTimerRef = React.useRef(0);\n const { onToastAdd, onToastRemove } = context;\n const handleClose = useCallbackRef(() => {\n const isFocusInToast = node?.contains(document.activeElement);\n if (isFocusInToast) context.viewport?.focus();\n onClose();\n });\n const startTimer = React.useCallback(\n (duration2) => {\n if (!duration2 || duration2 === Infinity) return;\n window.clearTimeout(closeTimerRef.current);\n closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();\n closeTimerRef.current = window.setTimeout(handleClose, duration2);\n },\n [handleClose]\n );\n React.useEffect(() => {\n const viewport = context.viewport;\n if (viewport) {\n const handleResume = () => {\n startTimer(closeTimerRemainingTimeRef.current);\n onResume?.();\n };\n const handlePause = () => {\n const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;\n closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;\n window.clearTimeout(closeTimerRef.current);\n onPause?.();\n };\n viewport.addEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.addEventListener(VIEWPORT_RESUME, handleResume);\n return () => {\n viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.removeEventListener(VIEWPORT_RESUME, handleResume);\n };\n }\n }, [context.viewport, duration, onPause, onResume, startTimer]);\n React.useEffect(() => {\n if (open && !context.isClosePausedRef.current) startTimer(duration);\n }, [open, duration, context.isClosePausedRef, startTimer]);\n React.useEffect(() => {\n onToastAdd();\n return () => onToastRemove();\n }, [onToastAdd, onToastRemove]);\n const announceTextContent = React.useMemo(() => {\n return node ? getAnnounceTextContent(node) : null;\n }, [node]);\n if (!context.viewport) return null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n announceTextContent && /* @__PURE__ */ jsx(\n ToastAnnounce,\n {\n __scopeToast,\n role: \"status\",\n \"aria-live\": type === \"foreground\" ? \"assertive\" : \"polite\",\n \"aria-atomic\": true,\n children: announceTextContent\n }\n ),\n /* @__PURE__ */ jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM.createPortal(\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n DismissableLayer.Root,\n {\n asChild: true,\n onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {\n if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();\n context.isFocusedToastEscapeKeyDownRef.current = false;\n }),\n children: /* @__PURE__ */ jsx(\n Primitive.li,\n {\n role: \"status\",\n \"aria-live\": \"off\",\n \"aria-atomic\": true,\n tabIndex: 0,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-swipe-direction\": context.swipeDirection,\n ...toastProps,\n ref: composedRefs,\n style: { userSelect: \"none\", touchAction: \"none\", ...props.style },\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key !== \"Escape\") return;\n onEscapeKeyDown?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) {\n context.isFocusedToastEscapeKeyDownRef.current = true;\n handleClose();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (event.button !== 0) return;\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (!pointerStartRef.current) return;\n const x = event.clientX - pointerStartRef.current.x;\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const isHorizontalSwipe = [\"left\", \"right\"].includes(context.swipeDirection);\n const clamp = [\"left\", \"up\"].includes(context.swipeDirection) ? Math.min : Math.max;\n const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;\n const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { x: clampedX, y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {\n discrete: false\n });\n } else if (isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_START, onSwipeStart, eventDetail, {\n discrete: false\n });\n event.target.setPointerCapture(event.pointerId);\n } else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) {\n pointerStartRef.current = null;\n }\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const delta = swipeDeltaRef.current;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const toast = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) {\n handleAndDispatchCustomEvent(TOAST_SWIPE_END, onSwipeEnd, eventDetail, {\n discrete: true\n });\n } else {\n handleAndDispatchCustomEvent(\n TOAST_SWIPE_CANCEL,\n onSwipeCancel,\n eventDetail,\n {\n discrete: true\n }\n );\n }\n toast.addEventListener(\"click\", (event2) => event2.preventDefault(), {\n once: true\n });\n }\n })\n }\n )\n }\n ) }),\n context.viewport\n ) })\n ] });\n }\n);\nvar ToastAnnounce = (props) => {\n const { __scopeToast, children, ...announceProps } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);\n const [isAnnounced, setIsAnnounced] = React.useState(false);\n useNextFrame(() => setRenderAnnounceText(true));\n React.useEffect(() => {\n const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);\n return () => window.clearTimeout(timer);\n }, []);\n return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Fragment, { children: [\n context.label,\n \" \",\n children\n ] }) }) });\n};\nvar TITLE_NAME = \"ToastTitle\";\nvar ToastTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...titleProps, ref: forwardedRef });\n }\n);\nToastTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"ToastDescription\";\nvar ToastDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...descriptionProps, ref: forwardedRef });\n }\n);\nToastDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"ToastAction\";\nvar ToastAction = React.forwardRef(\n (props, forwardedRef) => {\n const { altText, ...actionProps } = props;\n if (!altText.trim()) {\n console.error(\n `Invalid prop \\`altText\\` supplied to \\`${ACTION_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n return null;\n }\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });\n }\n);\nToastAction.displayName = ACTION_NAME;\nvar CLOSE_NAME = \"ToastClose\";\nvar ToastClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props;\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, interactiveContext.onClose)\n }\n ) });\n }\n);\nToastClose.displayName = CLOSE_NAME;\nvar ToastAnnounceExclude = React.forwardRef((props, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-toast-announce-exclude\": \"\",\n \"data-radix-toast-announce-alt\": altText || void 0,\n ...announceExcludeProps,\n ref: forwardedRef\n }\n );\n});\nfunction getAnnounceTextContent(container) {\n const textContent = [];\n const childNodes = Array.from(container.childNodes);\n childNodes.forEach((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);\n if (isHTMLElement(node)) {\n const isHidden = node.ariaHidden || node.hidden || node.style.display === \"none\";\n const isExcluded = node.dataset.radixToastAnnounceExclude === \"\";\n if (!isHidden) {\n if (isExcluded) {\n const altText = node.dataset.radixToastAnnounceAlt;\n if (altText) textContent.push(altText);\n } else {\n textContent.push(...getAnnounceTextContent(node));\n }\n }\n }\n });\n return textContent;\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const currentTarget = detail.originalEvent.currentTarget;\n const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });\n if (handler) currentTarget.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(currentTarget, event);\n } else {\n currentTarget.dispatchEvent(event);\n }\n}\nvar isDeltaInDirection = (delta, direction, threshold = 0) => {\n const deltaX = Math.abs(delta.x);\n const deltaY = Math.abs(delta.y);\n const isDeltaX = deltaX > deltaY;\n if (direction === \"left\" || direction === \"right\") {\n return isDeltaX && deltaX > threshold;\n } else {\n return !isDeltaX && deltaY > threshold;\n }\n};\nfunction useNextFrame(callback = () => {\n}) {\n const fn = useCallbackRef(callback);\n useLayoutEffect(() => {\n let raf1 = 0;\n let raf2 = 0;\n raf1 = window.requestAnimationFrame(() => raf2 = window.requestAnimationFrame(fn));\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [fn]);\n}\nfunction isHTMLElement(node) {\n return node.nodeType === node.ELEMENT_NODE;\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction focusFirst(candidates) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\nvar Provider = ToastProvider;\nvar Viewport = ToastViewport;\nvar Root2 = Toast;\nvar Title = ToastTitle;\nvar Description = ToastDescription;\nvar Action = ToastAction;\nvar Close = ToastClose;\nexport {\n Action,\n Close,\n Description,\n Provider,\n Root2 as Root,\n Title,\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n Viewport,\n createToastScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n\t<ToastPrimitives.Viewport\n\t\tdata-slot=\"toast-viewport\"\n\t\tclassName={cn(\n\t\t\t\"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst toastVariants = cva(\n\t\"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"border bg-background text-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nconst Toast = ({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>) => {\n\treturn (\n\t\t<ToastPrimitives.Root\n\t\t\tdata-slot=\"toast-root\"\n\t\t\tclassName={cn(toastVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nconst ToastAction = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n\t<ToastPrimitives.Action\n\t\tdata-slot=\"toast-action\"\n\t\tclassName={cn(\n\t\t\t\"ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastClose = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n\t<ToastPrimitives.Close\n\t\tdata-slot=\"toast-close\"\n\t\tclassName={cn(\n\t\t\t\"text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n\t\t\tclassName,\n\t\t)}\n\t\ttoast-close=\"\"\n\t\t{...props}\n\t>\n\t\t<X className=\"h-4 w-4\" />\n\t</ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n\t<ToastPrimitives.Title\n\t\tdata-slot=\"toast-title\"\n\t\tclassName={cn(\"text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastDescription = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n\t<ToastPrimitives.Description\n\t\tdata-slot=\"toast-description\"\n\t\tclassName={cn(\"text-sm opacity-90\", className)}\n\t\t{...props}\n\t/>\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n\ttype ToastProps,\n\ttype ToastActionElement,\n\tToastProvider,\n\tToastViewport,\n\tToast,\n\tToastTitle,\n\tToastDescription,\n\tToastClose,\n\tToastAction,\n};\n"],"names":["PROVIDER_NAME","Collection","useCollection","createCollectionScope","createCollection","createToastContext","createToastScope","createContextScope","ToastProviderProvider","useToastProviderContext","ToastProvider","props","__scopeToast","label","duration","swipeDirection","swipeThreshold","children","viewport","setViewport","React","useState","toastCount","setToastCount","isFocusedToastEscapeKeyDownRef","useRef","isClosePausedRef","trim","jsx","Provider","scope","onViewportChange","onToastAdd","useCallback","prevCount","onToastRemove","displayName","VIEWPORT_NAME","VIEWPORT_DEFAULT_HOTKEY","VIEWPORT_PAUSE","VIEWPORT_RESUME","ToastViewport","forwardRef","forwardedRef","hotkey","viewportProps","context","getItems","wrapperRef","headFocusProxyRef","tailFocusProxyRef","ref","composedRefs","useComposedRefs","hotkeyLabel","join","replace","hasToasts","useEffect","handleKeyDown","event","length","every","key","code","current","focus","document","addEventListener","removeEventListener","wrapper","handlePause","pauseEvent","CustomEvent","dispatchEvent","handleResume","resumeEvent","handleFocusOutResume","contains","relatedTarget","handlePointerLeaveResume","activeElement","window","getSortedTabbableCandidates","tabbingDirection","tabbableCandidates","map","toastItem","toastNode","toastTabbableCandidates","getTabbableCandidates","reverse","flat","isMetaKey","altKey","ctrlKey","metaKey","focusedElement","isTabbingBackwards","shiftKey","target","sortedCandidates","index","findIndex","candidate","focusFirst","slice","preventDefault","jsxs","DismissableLayer.Branch","role","tabIndex","style","pointerEvents","FocusProxy","onFocusFromOutsideViewport","Slot","Primitive","ol","FOCUS_PROXY_NAME","proxyProps","VisuallyHidden","position","onFocus","prevFocusedElement","TOAST_NAME","Toast","forceMount","open","openProp","defaultOpen","onOpenChange","toastProps","setOpen","useControllableState","prop","defaultProp","onChange","Presence","present","ToastImpl","onClose","onPause","useCallbackRef","onResume","onSwipeStart","composeEventHandlers","currentTarget","setAttribute","onSwipeMove","x","y","detail","delta","setProperty","onSwipeCancel","removeProperty","onSwipeEnd","ToastInteractiveProvider","useToastInteractiveContext","type","durationProp","onEscapeKeyDown","node","setNode","pointerStartRef","swipeDeltaRef","closeTimerStartTimeRef","closeTimerRemainingTimeRef","closeTimerRef","handleClose","isFocusInToast","startTimer","Infinity","clearTimeout","Date","getTime","setTimeout","elapsedTime","announceTextContent","useMemo","getAnnounceTextContent","Fragment","ToastAnnounce","ReactDOM","createPortal","ItemSlot","DismissableLayer.Root","asChild","li","userSelect","touchAction","onKeyDown","nativeEvent","defaultPrevented","onPointerDown","button","clientX","clientY","onPointerMove","hasSwipeMoveStarted","Boolean","isHorizontalSwipe","includes","clamp","Math","min","max","clampedX","clampedY","moveStartBuffer","pointerType","eventDetail","originalEvent","handleAndDispatchCustomEvent","discrete","isDeltaInDirection","setPointerCapture","pointerId","abs","onPointerUp","hasPointerCapture","releasePointerCapture","toast","once","announceProps","renderAnnounceText","setRenderAnnounceText","isAnnounced","setIsAnnounced","callback","fn","useLayoutEffect","raf1","raf2","requestAnimationFrame","cancelAnimationFrame","useNextFrame","timer","Portal","ToastTitle","titleProps","div","ToastDescription","descriptionProps","ToastAction","altText","actionProps","ToastAnnounceExclude","ToastClose","CLOSE_NAME","closeProps","interactiveContext","onClick","announceExcludeProps","container","textContent","Array","from","childNodes","forEach","nodeType","TEXT_NODE","push","ELEMENT_NODE","isHTMLElement","isHidden","ariaHidden","hidden","display","isExcluded","dataset","radixToastAnnounceExclude","radixToastAnnounceAlt","name","handler","bubbles","cancelable","dispatchDiscreteCustomEvent","direction","threshold","deltaX","deltaY","isDeltaX","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","disabled","FILTER_SKIP","FILTER_ACCEPT","nextNode","currentNode","candidates","previouslyFocusedElement","some","Viewport","Root","Title","Description","Action","Close","className","ToastPrimitives","data-slot","cn","toastVariants","cva","variants","variant","default","destructive","defaultVariants","createElement","toast-close","X"],"mappings":"u0BAqBA,IAAMA,EAAgB,iBAEfC,EAAYC,EAAeC,GAAyBC,EAA+B,UAkBnFC,EAAoBC,GAAoBC,EAAmB,QAAS,CAACJ,KACrEK,EAAuBC,GAC5BJ,EAA8CL,GA2B1CU,EAA+CC,IACnD,MAAMC,aACJA,EAAAC,MACAA,EAAQ,eAAAC,SACRA,EAAW,IAAAC,eACXA,EAAiB,QAAAC,eACjBA,EAAiB,GAAAC,SACjBA,GACEN,GACGO,EAAUC,GAAqBC,EAAAC,SAAsC,OACrEC,EAAYC,GAAuBH,EAAAC,SAAS,GAC7CG,EAAuCJ,EAAAK,QAAO,GAC9CC,EAAyBN,EAAAK,QAAO,GAQtC,OANKZ,EAAMc,OAOTC,EAAC3B,EAAW4B,SAAX,CAAoBC,MAAOlB,EAC1BK,SAAAW,EAACpB,EAAA,CACCsB,MAAOlB,EACPC,QACAC,WACAC,iBACAC,iBACAM,aACAJ,WACAa,iBAAkBZ,EAClBa,WAAkBZ,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACjFC,cAAqBf,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACpFV,iCACAE,mBAECT,cAEL,EAIJP,EAAc0B,YAAcpC,EAM5B,IAAMqC,EAAgB,gBAChBC,EAA0B,CAAC,MAC3BC,EAAiB,sBACjBC,EAAkB,uBAkBlBC,EAAsBrB,EAAAsB,YAC1B,CAAC/B,EAAwCgC,KACvC,MAAM/B,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,cAAAA,GAAqB,CACrBC,YAAU,cACVF,UAAWG,EAAG,wBAAyBH,MACnCvS,IAIAwO,GAAmB,EACxB+D,eACGvS,KAEHS,EAAC+R,cAAAA,GAA2B,CAC3BC,YAAU,oBACVF,UAAWG,EAAG,qBAAsBH,MAChCvS","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{c as e}from"../chunks/utils-C6LYO_CH.mjs";import*as t from"react";import n from"react";import{u as o,c as r,P as i}from"../chunks/index-BzUzK8k1.mjs";import{c as a}from"../chunks/index-BkrjWCcN.mjs";import{P as s,D as c}from"../chunks/index-DFm8Tejm.mjs";import{u as l}from"../chunks/index-DagWVwpf.mjs";import{c as u,R as d,A as p,C as m,a as f}from"../chunks/index-B_Oam-QU.mjs";import{P as h}from"../chunks/index-5xCD9zck.mjs";import{Slottable as g}from"@radix-ui/react-slot";import{u as x}from"../chunks/index-VNeBf_qQ.mjs";import{R as y}from"../chunks/index-CRTXCtD-.mjs";import{jsx as v,jsxs as b}from"react/jsx-runtime";import"../chunks/bundle-mjs-E0baekTQ.mjs";import"../chunks/index-CBuWa3V_.mjs";import"react-dom";import"../chunks/index-Cj8SbPde.mjs";var[w,T]=a("Tooltip",[u]),C=u(),E="TooltipProvider",k=700,_="tooltip.open",[D,P]=w(E),R=e=>{const{__scopeTooltip:n,delayDuration:o=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[s,c]=t.useState(!0),l=t.useRef(!1),u=t.useRef(0);return t.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),v(D,{scope:n,isOpenDelayed:s,delayDuration:o,onOpen:t.useCallback((()=>{window.clearTimeout(u.current),c(!1)}),[]),onClose:t.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>c(!0)),r)}),[r]),isPointerInTransitRef:l,onPointerInTransitChange:t.useCallback((e=>{l.current=e}),[]),disableHoverableContent:i,children:a})};R.displayName=E;var L="Tooltip",[O,j]=w(L),M=e=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=P(L,e.__scopeTooltip),p=C(n),[m,f]=t.useState(null),h=l(),g=t.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,w=t.useRef(!1),[T=!1,E]=x({prop:r,defaultProp:i,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(_))):u.onClose(),a?.(e)}}),k=t.useMemo((()=>T?w.current?"delayed-open":"instant-open":"closed"),[T]),D=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,E(!0)}),[E]),R=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,E(!1)}),[E]),j=t.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{w.current=!0,E(!0),g.current=0}),b)}),[b,E]);return t.useEffect((()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)}),[]),v(d,{...p,children:v(O,{scope:n,contentId:h,open:T,stateAttribute:k,trigger:m,onTriggerChange:f,onTriggerEnter:t.useCallback((()=>{u.isOpenDelayed?j():D()}),[u.isOpenDelayed,j,D]),onTriggerLeave:t.useCallback((()=>{y?R():(window.clearTimeout(g.current),g.current=0)}),[R,y]),onOpen:D,onClose:R,disableHoverableContent:y,children:o})})};M.displayName=L;var I="TooltipTrigger",N=t.forwardRef(((e,n)=>{const{__scopeTooltip:i,...a}=e,s=j(I,i),c=P(I,i),l=C(i),u=t.useRef(null),d=o(n,u,s.onTriggerChange),m=t.useRef(!1),f=t.useRef(!1),g=t.useCallback((()=>m.current=!1),[]);return t.useEffect((()=>()=>document.removeEventListener("pointerup",g)),[g]),v(p,{asChild:!0,...l,children:v(h.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:r(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(f.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),f.current=!0))})),onPointerLeave:r(e.onPointerLeave,(()=>{s.onTriggerLeave(),f.current=!1})),onPointerDown:r(e.onPointerDown,(()=>{m.current=!0,document.addEventListener("pointerup",g,{once:!0})})),onFocus:r(e.onFocus,(()=>{m.current||s.onOpen()})),onBlur:r(e.onBlur,s.onClose),onClick:r(e.onClick,s.onClose)})})}));N.displayName=I;var H="TooltipPortal",[A,B]=w(H,{forceMount:void 0}),F=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=j(H,t);return v(A,{scope:t,forceMount:n,children:v(i,{present:n||a.open,children:v(s,{asChild:!0,container:r,children:o})})})};F.displayName=H;var z="TooltipContent",S=t.forwardRef(((e,t)=>{const n=B(z,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,s=j(z,e.__scopeTooltip);return v(i,{present:o||s.open,children:s.disableHoverableContent?v(q,{side:r,...a,ref:t}):v(K,{side:r,...a,ref:t})})})),K=t.forwardRef(((e,n)=>{const r=j(z,e.__scopeTooltip),i=P(z,e.__scopeTooltip),a=t.useRef(null),s=o(n,a),[c,l]=t.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:m}=i,f=t.useCallback((()=>{l(null),m(!1)}),[m]),h=t.useCallback(((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);l(i),m(!0)}),[m]);return t.useEffect((()=>()=>f()),[f]),t.useEffect((()=>{if(u&&p){const e=e=>h(e,p),t=e=>h(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,h,f]),t.useEffect((()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=u?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,c=t[i].x,l=t[i].y;s>o!=l>o&&n<(c-a)*(o-s)/(l-s)+a&&(r=!r)}return r}(n,c);o?f():r&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,c,d,f]),v(q,{...e,ref:s})})),[X,Y]=w(L,{isInside:!1}),q=t.forwardRef(((e,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,u=j(z,o),d=C(o),{onClose:p}=u;return t.useEffect((()=>(document.addEventListener(_,p),()=>document.removeEventListener(_,p))),[p]),t.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),v(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:b(m,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v(g,{children:r}),v(X,{scope:o,isInside:!0,children:v(y,{id:u.contentId,role:"tooltip",children:i||r})})]})})}));S.displayName=z;var G="TooltipArrow";t.forwardRef(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=C(n);return Y(G,n).isInside?null:v(f,{...r,...o,ref:t})})).displayName=G;var J=R,Q=M,U=N,V=F,W=S;function Z({delayDuration:e=700,...t}){return n.createElement(J,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function $({...e}){return n.createElement(Z,null,n.createElement(Q,{"data-slot":"tooltip",...e}))}function ee({...e}){return n.createElement(U,{"data-slot":"tooltip-trigger",...e})}function te({className:t,sideOffset:o=0,children:r,...i}){return n.createElement(V,null,n.createElement(W,{"data-slot":"tooltip-content",sideOffset:o,className:e("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow",t),...i},r))}export{$ as Tooltip,te as TooltipContent,Z as TooltipProvider,ee as TooltipTrigger};
1
+ import{c as e}from"../chunks/utils-B9uwc_lt.mjs";import*as t from"react";import n from"react";import{u as o,c as r,P as i}from"../chunks/index-IXx8l3RV.mjs";import{c as a}from"../chunks/index-BX6nSpY1.mjs";import{P as s,D as c}from"../chunks/index-DZldl4eo.mjs";import{u as l}from"../chunks/index-DdNjMgpV.mjs";import{c as u,R as d,A as p,C as f,a as m}from"../chunks/index-Ck1fOwnt.mjs";import{P as h}from"../chunks/index-BSf-atXx.mjs";import{createSlottable as g}from"@radix-ui/react-slot";import{u as x}from"../chunks/index-DyUn0c26.mjs";import{R as y}from"../chunks/index-CUXMuJ__.mjs";import{jsx as v,jsxs as b}from"react/jsx-runtime";import"../chunks/bundle-mjs-BYGwPY3j.mjs";import"../chunks/index-DuMyb05s.mjs";import"react-dom";import"../chunks/index-XatPIL6c.mjs";var[w,C]=a("Tooltip",[u]),T=u(),E="TooltipProvider",k=700,R="tooltip.open",[_,D]=w(E),P=e=>{const{__scopeTooltip:n,delayDuration:o=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=t.useRef(!0),c=t.useRef(!1),l=t.useRef(0);return t.useEffect((()=>{const e=l.current;return()=>window.clearTimeout(e)}),[]),v(_,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:t.useCallback((()=>{window.clearTimeout(l.current),s.current=!1}),[]),onClose:t.useCallback((()=>{window.clearTimeout(l.current),l.current=window.setTimeout((()=>s.current=!0),r)}),[r]),isPointerInTransitRef:c,onPointerInTransitChange:t.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:a})};P.displayName=E;var L="Tooltip",[O,j]=w(L),M=e=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=D(L,e.__scopeTooltip),p=T(n),[f,m]=t.useState(null),h=l(),g=t.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,w=t.useRef(!1),[C=!1,E]=x({prop:r,defaultProp:i,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(R))):u.onClose(),a?.(e)}}),k=t.useMemo((()=>C?w.current?"delayed-open":"instant-open":"closed"),[C]),_=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,E(!0)}),[E]),P=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,E(!1)}),[E]),j=t.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{w.current=!0,E(!0),g.current=0}),b)}),[b,E]);return t.useEffect((()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)}),[]),v(d,{...p,children:v(O,{scope:n,contentId:h,open:C,stateAttribute:k,trigger:f,onTriggerChange:m,onTriggerEnter:t.useCallback((()=>{u.isOpenDelayedRef.current?j():_()}),[u.isOpenDelayedRef,j,_]),onTriggerLeave:t.useCallback((()=>{y?P():(window.clearTimeout(g.current),g.current=0)}),[P,y]),onOpen:_,onClose:P,disableHoverableContent:y,children:o})})};M.displayName=L;var I="TooltipTrigger",N=t.forwardRef(((e,n)=>{const{__scopeTooltip:i,...a}=e,s=j(I,i),c=D(I,i),l=T(i),u=t.useRef(null),d=o(n,u,s.onTriggerChange),f=t.useRef(!1),m=t.useRef(!1),g=t.useCallback((()=>f.current=!1),[]);return t.useEffect((()=>()=>document.removeEventListener("pointerup",g)),[g]),v(p,{asChild:!0,...l,children:v(h.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:r(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(m.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),m.current=!0))})),onPointerLeave:r(e.onPointerLeave,(()=>{s.onTriggerLeave(),m.current=!1})),onPointerDown:r(e.onPointerDown,(()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})})),onFocus:r(e.onFocus,(()=>{f.current||s.onOpen()})),onBlur:r(e.onBlur,s.onClose),onClick:r(e.onClick,s.onClose)})})}));N.displayName=I;var H="TooltipPortal",[A,B]=w(H,{forceMount:void 0}),F=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=j(H,t);return v(A,{scope:t,forceMount:n,children:v(i,{present:n||a.open,children:v(s,{asChild:!0,container:r,children:o})})})};F.displayName=H;var z="TooltipContent",K=t.forwardRef(((e,t)=>{const n=B(z,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,s=j(z,e.__scopeTooltip);return v(i,{present:o||s.open,children:s.disableHoverableContent?v(G,{side:r,...a,ref:t}):v(S,{side:r,...a,ref:t})})})),S=t.forwardRef(((e,n)=>{const r=j(z,e.__scopeTooltip),i=D(z,e.__scopeTooltip),a=t.useRef(null),s=o(n,a),[c,l]=t.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:f}=i,m=t.useCallback((()=>{l(null),f(!1)}),[f]),h=t.useCallback(((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);l(i),f(!0)}),[f]);return t.useEffect((()=>()=>m()),[m]),t.useEffect((()=>{if(u&&p){const e=e=>h(e,p),t=e=>h(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,h,m]),t.useEffect((()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=u?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,c=t[i].x,l=t[i].y;s>o!=l>o&&n<(c-a)*(o-s)/(l-s)+a&&(r=!r)}return r}(n,c);o?m():r&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,c,d,m]),v(G,{...e,ref:s})})),[X,Y]=w(L,{isInside:!1}),q=g("TooltipContent"),G=t.forwardRef(((e,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,u=j(z,o),d=T(o),{onClose:p}=u;return t.useEffect((()=>(document.addEventListener(R,p),()=>document.removeEventListener(R,p))),[p]),t.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),v(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:b(f,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v(q,{children:r}),v(X,{scope:o,isInside:!0,children:v(y,{id:u.contentId,role:"tooltip",children:i||r})})]})})}));K.displayName=z;var J="TooltipArrow";t.forwardRef(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=T(n);return Y(J,n).isInside?null:v(m,{...r,...o,ref:t})})).displayName=J;var Q=P,U=M,V=N,W=F,Z=K;function $({delayDuration:e=700,...t}){return n.createElement(Q,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ee({...e}){return n.createElement($,null,n.createElement(U,{"data-slot":"tooltip",...e}))}function te({...e}){return n.createElement(V,{"data-slot":"tooltip-trigger",...e})}function ne({className:t,sideOffset:o=0,children:r,...i}){return n.createElement(W,null,n.createElement(Z,{"data-slot":"tooltip-content",sideOffset:o,className:e("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow",t),...i},r))}export{ee as Tooltip,ne as TooltipContent,$ as TooltipProvider,te as TooltipTrigger};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-tooltip/dist/index.mjs","../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/tooltip/src/tooltip.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slottable } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHiddenPrimitive from \"@radix-ui/react-visually-hidden\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar [createTooltipContext, createTooltipScope] = createContextScope(\"Tooltip\", [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar PROVIDER_NAME = \"TooltipProvider\";\nvar DEFAULT_DELAY_DURATION = 700;\nvar TOOLTIP_OPEN = \"tooltip.open\";\nvar [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);\nvar TooltipProvider = (props) => {\n const {\n __scopeTooltip,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n disableHoverableContent = false,\n children\n } = props;\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const isPointerInTransitRef = React.useRef(false);\n const skipDelayTimerRef = React.useRef(0);\n React.useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n return /* @__PURE__ */ jsx(\n TooltipProviderContextProvider,\n {\n scope: __scopeTooltip,\n isOpenDelayed,\n delayDuration,\n onOpen: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n setIsOpenDelayed(false);\n }, []),\n onClose: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration\n );\n }, [skipDelayDuration]),\n isPointerInTransitRef,\n onPointerInTransitChange: React.useCallback((inTransit) => {\n isPointerInTransitRef.current = inTransit;\n }, []),\n disableHoverableContent,\n children\n }\n );\n};\nTooltipProvider.displayName = PROVIDER_NAME;\nvar TOOLTIP_NAME = \"Tooltip\";\nvar [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);\nvar Tooltip = (props) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent: disableHoverableContentProp,\n delayDuration: delayDurationProp\n } = props;\n const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = React.useState(null);\n const contentId = useId();\n const openTimerRef = React.useRef(0);\n const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;\n const delayDuration = delayDurationProp ?? providerContext.delayDuration;\n const wasOpenDelayedRef = React.useRef(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: (open2) => {\n if (open2) {\n providerContext.onOpen();\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n providerContext.onClose();\n }\n onOpenChange?.(open2);\n }\n });\n const stateAttribute = React.useMemo(() => {\n return open ? wasOpenDelayedRef.current ? \"delayed-open\" : \"instant-open\" : \"closed\";\n }, [open]);\n const handleOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n setOpen(false);\n }, [setOpen]);\n const handleDelayedOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n openTimerRef.current = 0;\n }, delayDuration);\n }, [delayDuration, setOpen]);\n React.useEffect(() => {\n return () => {\n if (openTimerRef.current) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n TooltipContextProvider,\n {\n scope: __scopeTooltip,\n contentId,\n open,\n stateAttribute,\n trigger,\n onTriggerChange: setTrigger,\n onTriggerEnter: React.useCallback(() => {\n if (providerContext.isOpenDelayed) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen]),\n onTriggerLeave: React.useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n }, [handleClose, disableHoverableContent]),\n onOpen: handleOpen,\n onClose: handleClose,\n disableHoverableContent,\n children\n }\n ) });\n};\nTooltip.displayName = TOOLTIP_NAME;\nvar TRIGGER_NAME = \"TooltipTrigger\";\nvar TooltipTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...triggerProps } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);\n const isPointerDownRef = React.useRef(false);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const handlePointerUp = React.useCallback(() => isPointerDownRef.current = false, []);\n React.useEffect(() => {\n return () => document.removeEventListener(\"pointerup\", handlePointerUp);\n }, [handlePointerUp]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n \"aria-describedby\": context.open ? context.contentId : void 0,\n \"data-state\": context.stateAttribute,\n ...triggerProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === \"touch\") return;\n if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n }),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, () => {\n isPointerDownRef.current = true;\n document.addEventListener(\"pointerup\", handlePointerUp, { once: true });\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n if (!isPointerDownRef.current) context.onOpen();\n }),\n onBlur: composeEventHandlers(props.onBlur, context.onClose),\n onClick: composeEventHandlers(props.onClick, context.onClose)\n }\n ) });\n }\n);\nTooltipTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"TooltipPortal\";\nvar [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar TooltipPortal = (props) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nTooltipPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"TooltipContent\";\nvar TooltipContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = \"top\", ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });\n }\n);\nvar TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = React.useState(null);\n const { trigger, onClose } = context;\n const content = ref.current;\n const { onPointerInTransitChange } = providerContext;\n const handleRemoveGraceArea = React.useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n const handleCreateGraceArea = React.useCallback(\n (event, hoverTarget) => {\n const currentTarget = event.currentTarget;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange]\n );\n React.useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n React.useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);\n trigger.addEventListener(\"pointerleave\", handleTriggerLeave);\n content.addEventListener(\"pointerleave\", handleContentLeave);\n return () => {\n trigger.removeEventListener(\"pointerleave\", handleTriggerLeave);\n content.removeEventListener(\"pointerleave\", handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n React.useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event) => {\n const target = event.target;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener(\"pointermove\", handleTrackPointerGrace);\n return () => document.removeEventListener(\"pointermove\", handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n return /* @__PURE__ */ jsx(TooltipContentImpl, { ...props, ref: composedRefs });\n});\nvar [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });\nvar TooltipContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n \"aria-label\": ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n React.useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n React.useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event) => {\n const target = event.target;\n if (target?.contains(context.trigger)) onClose();\n };\n window.addEventListener(\"scroll\", handleScroll, { capture: true });\n return () => window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n return /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: onClose,\n children: /* @__PURE__ */ jsxs(\n PopperPrimitive.Content,\n {\n \"data-state\": context.stateAttribute,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-tooltip-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-tooltip-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-tooltip-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-tooltip-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-tooltip-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n },\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { id: context.contentId, role: \"tooltip\", children: ariaLabel || children }) })\n ]\n }\n )\n }\n );\n }\n);\nTooltipContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"TooltipArrow\";\nvar TooltipArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(\n ARROW_NAME,\n __scopeTooltip\n );\n return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nTooltipArrow.displayName = ARROW_NAME;\nfunction getExitSideFromRect(point, rect) {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return \"left\";\n case right:\n return \"right\";\n case top:\n return \"top\";\n case bottom:\n return \"bottom\";\n default:\n throw new Error(\"unreachable\");\n }\n}\nfunction getPaddedExitPoints(exitPoint, exitSide, padding = 5) {\n const paddedExitPoints = [];\n switch (exitSide) {\n case \"top\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"bottom\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case \"left\":\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"right\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n return paddedExitPoints;\n}\nfunction getPointsFromRect(rect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom }\n ];\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction getHull(points) {\n const newPoints = points.slice();\n newPoints.sort((a, b) => {\n if (a.x < b.x) return -1;\n else if (a.x > b.x) return 1;\n else if (a.y < b.y) return -1;\n else if (a.y > b.y) return 1;\n else return 0;\n });\n return getHullPresorted(newPoints);\n}\nfunction getHullPresorted(points) {\n if (points.length <= 1) return points.slice();\n const upperHull = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();\n else break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n const lowerHull = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();\n else break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n}\nvar Provider = TooltipProvider;\nvar Root3 = Tooltip;\nvar Trigger = TooltipTrigger;\nvar Portal = TooltipPortal;\nvar Content2 = TooltipContent;\nvar Arrow2 = TooltipArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Portal,\n Provider,\n Root3 as Root,\n Tooltip,\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n TooltipProvider,\n TooltipTrigger,\n Trigger,\n createTooltipScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport React from \"react\";\n\nfunction TooltipProvider({\n\tdelayDuration = 700,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n\treturn (\n\t\t<TooltipPrimitive.Provider\n\t\t\tdata-slot=\"tooltip-provider\"\n\t\t\tdelayDuration={delayDuration}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n\t\t</TooltipProvider>\n\t);\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n\treturn <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 0,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Content\n\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</TooltipPrimitive.Content>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"names":["createTooltipContext","createTooltipScope","createContextScope","createPopperScope","usePopperScope","PROVIDER_NAME","DEFAULT_DELAY_DURATION","TOOLTIP_OPEN","TooltipProviderContextProvider","useTooltipProviderContext","TooltipProvider","props","__scopeTooltip","delayDuration","skipDelayDuration","disableHoverableContent","children","isOpenDelayed","setIsOpenDelayed","React","useState","isPointerInTransitRef","useRef","skipDelayTimerRef","useEffect","skipDelayTimer","current","window","clearTimeout","jsx","scope","onOpen","useCallback","onClose","setTimeout","onPointerInTransitChange","inTransit","displayName","TOOLTIP_NAME","TooltipContextProvider","useTooltipContext","Tooltip","open","openProp","defaultOpen","onOpenChange","disableHoverableContentProp","delayDurationProp","providerContext","popperScope","trigger","setTrigger","contentId","useId","openTimerRef","wasOpenDelayedRef","setOpen","useControllableState","prop","defaultProp","onChange","document","dispatchEvent","CustomEvent","stateAttribute","useMemo","handleOpen","handleClose","handleDelayedOpen","PopperPrimitive.Root","onTriggerChange","onTriggerEnter","onTriggerLeave","TRIGGER_NAME","TooltipTrigger","forwardRef","forwardedRef","triggerProps","context","ref","composedRefs","useComposedRefs","isPointerDownRef","hasPointerMoveOpenedRef","handlePointerUp","removeEventListener","PopperPrimitive.Anchor","asChild","Primitive","button","onPointerMove","composeEventHandlers","event","pointerType","onPointerLeave","onPointerDown","addEventListener","once","onFocus","onBlur","onClick","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","TooltipPortal","container","Presence","present","PortalPrimitive","CONTENT_NAME","TooltipContent","portalContext","side","contentProps","TooltipContentImpl","TooltipContentHoverable","pointerGraceArea","setPointerGraceArea","content","handleRemoveGraceArea","handleCreateGraceArea","hoverTarget","currentTarget","exitPoint","x","clientX","y","clientY","paddedExitPoints","exitSide","padding","push","getPaddedExitPoints","point","rect","top","Math","abs","bottom","right","left","min","Error","getExitSideFromRect","getBoundingClientRect","graceArea","points","newPoints","slice","sort","a","b","length","upperHull","i","p","q","r","pop","lowerHull","concat","getHullPresorted","getHull","getPointsFromRect","handleTriggerLeave","handleContentLeave","handleTrackPointerGrace","target","pointerPosition","hasEnteredTarget","contains","isPointerOutsideGraceArea","polygon","inside","j","xi","yi","xj","yj","isPointInPolygon","VisuallyHiddenContentContextProvider","useVisuallyHiddenContentContext","isInside","ariaLabel","onEscapeKeyDown","onPointerDownOutside","handleScroll","capture","DismissableLayer","disableOutsidePointerEvents","onFocusOutside","preventDefault","onDismiss","jsxs","PopperPrimitive.Content","style","Slottable","VisuallyHiddenPrimitive.Root","id","role","ARROW_NAME","arrowProps","PopperPrimitive.Arrow","Provider","Root","Trigger","Portal","Content","createElement","TooltipPrimitive","data-slot","className","sideOffset","cn"],"mappings":"gwBAkBA,IAAOA,EAAsBC,GAAsBC,EAAmB,UAAW,CAC/EC,IAEIC,EAAiBD,IAMjBE,EAAgB,kBAChBC,EAAyB,IACzBC,EAAe,gBAYdC,EAAgCC,GACrCT,EAAkDK,GAqB9CK,EACJC,IAEA,MAAMC,eACJA,EAAAC,cACAA,EAAgBP,EAA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B,CAACC,YAAU,aAAcxM,IAGlD,CAEA,SAAS+D,OAAoB/D,IAC5B,OAAOQ,EAAA8L,cAACC,EAAwB,CAACC,YAAU,qBAAsBxM,GAClE,CAEA,SAASoG,IAAeqG,UACvBA,EAASC,WACTA,EAAa,EAACrM,SACdA,KACGL,IAEH,OACCQ,gBAAC+L,EACA,KAAA/L,EAAA8L,cAACC,EAAwB,CACxBC,YAAU,kBACVE,WAAYA,EACZD,UAAWE,EACV,0YACAF,MAEGzM,GAEHK,GAIL","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-tooltip/dist/index.mjs","../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/tooltip/src/tooltip.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlottable } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHiddenPrimitive from \"@radix-ui/react-visually-hidden\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar [createTooltipContext, createTooltipScope] = createContextScope(\"Tooltip\", [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar PROVIDER_NAME = \"TooltipProvider\";\nvar DEFAULT_DELAY_DURATION = 700;\nvar TOOLTIP_OPEN = \"tooltip.open\";\nvar [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);\nvar TooltipProvider = (props) => {\n const {\n __scopeTooltip,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n disableHoverableContent = false,\n children\n } = props;\n const isOpenDelayedRef = React.useRef(true);\n const isPointerInTransitRef = React.useRef(false);\n const skipDelayTimerRef = React.useRef(0);\n React.useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n return /* @__PURE__ */ jsx(\n TooltipProviderContextProvider,\n {\n scope: __scopeTooltip,\n isOpenDelayedRef,\n delayDuration,\n onOpen: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n isOpenDelayedRef.current = false;\n }, []),\n onClose: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => isOpenDelayedRef.current = true,\n skipDelayDuration\n );\n }, [skipDelayDuration]),\n isPointerInTransitRef,\n onPointerInTransitChange: React.useCallback((inTransit) => {\n isPointerInTransitRef.current = inTransit;\n }, []),\n disableHoverableContent,\n children\n }\n );\n};\nTooltipProvider.displayName = PROVIDER_NAME;\nvar TOOLTIP_NAME = \"Tooltip\";\nvar [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);\nvar Tooltip = (props) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent: disableHoverableContentProp,\n delayDuration: delayDurationProp\n } = props;\n const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = React.useState(null);\n const contentId = useId();\n const openTimerRef = React.useRef(0);\n const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;\n const delayDuration = delayDurationProp ?? providerContext.delayDuration;\n const wasOpenDelayedRef = React.useRef(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: (open2) => {\n if (open2) {\n providerContext.onOpen();\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n providerContext.onClose();\n }\n onOpenChange?.(open2);\n }\n });\n const stateAttribute = React.useMemo(() => {\n return open ? wasOpenDelayedRef.current ? \"delayed-open\" : \"instant-open\" : \"closed\";\n }, [open]);\n const handleOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n setOpen(false);\n }, [setOpen]);\n const handleDelayedOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n openTimerRef.current = 0;\n }, delayDuration);\n }, [delayDuration, setOpen]);\n React.useEffect(() => {\n return () => {\n if (openTimerRef.current) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n TooltipContextProvider,\n {\n scope: __scopeTooltip,\n contentId,\n open,\n stateAttribute,\n trigger,\n onTriggerChange: setTrigger,\n onTriggerEnter: React.useCallback(() => {\n if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),\n onTriggerLeave: React.useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n }, [handleClose, disableHoverableContent]),\n onOpen: handleOpen,\n onClose: handleClose,\n disableHoverableContent,\n children\n }\n ) });\n};\nTooltip.displayName = TOOLTIP_NAME;\nvar TRIGGER_NAME = \"TooltipTrigger\";\nvar TooltipTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...triggerProps } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);\n const isPointerDownRef = React.useRef(false);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const handlePointerUp = React.useCallback(() => isPointerDownRef.current = false, []);\n React.useEffect(() => {\n return () => document.removeEventListener(\"pointerup\", handlePointerUp);\n }, [handlePointerUp]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n \"aria-describedby\": context.open ? context.contentId : void 0,\n \"data-state\": context.stateAttribute,\n ...triggerProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === \"touch\") return;\n if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n }),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, () => {\n if (context.open) {\n context.onClose();\n }\n isPointerDownRef.current = true;\n document.addEventListener(\"pointerup\", handlePointerUp, { once: true });\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n if (!isPointerDownRef.current) context.onOpen();\n }),\n onBlur: composeEventHandlers(props.onBlur, context.onClose),\n onClick: composeEventHandlers(props.onClick, context.onClose)\n }\n ) });\n }\n);\nTooltipTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"TooltipPortal\";\nvar [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar TooltipPortal = (props) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nTooltipPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"TooltipContent\";\nvar TooltipContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = \"top\", ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });\n }\n);\nvar TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = React.useState(null);\n const { trigger, onClose } = context;\n const content = ref.current;\n const { onPointerInTransitChange } = providerContext;\n const handleRemoveGraceArea = React.useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n const handleCreateGraceArea = React.useCallback(\n (event, hoverTarget) => {\n const currentTarget = event.currentTarget;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange]\n );\n React.useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n React.useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);\n trigger.addEventListener(\"pointerleave\", handleTriggerLeave);\n content.addEventListener(\"pointerleave\", handleContentLeave);\n return () => {\n trigger.removeEventListener(\"pointerleave\", handleTriggerLeave);\n content.removeEventListener(\"pointerleave\", handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n React.useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event) => {\n const target = event.target;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener(\"pointermove\", handleTrackPointerGrace);\n return () => document.removeEventListener(\"pointermove\", handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n return /* @__PURE__ */ jsx(TooltipContentImpl, { ...props, ref: composedRefs });\n});\nvar [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });\nvar Slottable = createSlottable(\"TooltipContent\");\nvar TooltipContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n \"aria-label\": ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n React.useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n React.useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event) => {\n const target = event.target;\n if (target?.contains(context.trigger)) onClose();\n };\n window.addEventListener(\"scroll\", handleScroll, { capture: true });\n return () => window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n return /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: onClose,\n children: /* @__PURE__ */ jsxs(\n PopperPrimitive.Content,\n {\n \"data-state\": context.stateAttribute,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-tooltip-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-tooltip-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-tooltip-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-tooltip-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-tooltip-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n },\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { id: context.contentId, role: \"tooltip\", children: ariaLabel || children }) })\n ]\n }\n )\n }\n );\n }\n);\nTooltipContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"TooltipArrow\";\nvar TooltipArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(\n ARROW_NAME,\n __scopeTooltip\n );\n return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nTooltipArrow.displayName = ARROW_NAME;\nfunction getExitSideFromRect(point, rect) {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return \"left\";\n case right:\n return \"right\";\n case top:\n return \"top\";\n case bottom:\n return \"bottom\";\n default:\n throw new Error(\"unreachable\");\n }\n}\nfunction getPaddedExitPoints(exitPoint, exitSide, padding = 5) {\n const paddedExitPoints = [];\n switch (exitSide) {\n case \"top\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"bottom\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case \"left\":\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"right\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n return paddedExitPoints;\n}\nfunction getPointsFromRect(rect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom }\n ];\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction getHull(points) {\n const newPoints = points.slice();\n newPoints.sort((a, b) => {\n if (a.x < b.x) return -1;\n else if (a.x > b.x) return 1;\n else if (a.y < b.y) return -1;\n else if (a.y > b.y) return 1;\n else return 0;\n });\n return getHullPresorted(newPoints);\n}\nfunction getHullPresorted(points) {\n if (points.length <= 1) return points.slice();\n const upperHull = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();\n else break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n const lowerHull = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();\n else break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n}\nvar Provider = TooltipProvider;\nvar Root3 = Tooltip;\nvar Trigger = TooltipTrigger;\nvar Portal = TooltipPortal;\nvar Content2 = TooltipContent;\nvar Arrow2 = TooltipArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Portal,\n Provider,\n Root3 as Root,\n Tooltip,\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n TooltipProvider,\n TooltipTrigger,\n Trigger,\n createTooltipScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport React from \"react\";\n\nfunction TooltipProvider({\n\tdelayDuration = 700,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n\treturn (\n\t\t<TooltipPrimitive.Provider\n\t\t\tdata-slot=\"tooltip-provider\"\n\t\t\tdelayDuration={delayDuration}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n\t\t</TooltipProvider>\n\t);\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n\treturn <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 0,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Content\n\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</TooltipPrimitive.Content>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"names":["createTooltipContext","createTooltipScope","createContextScope","createPopperScope","usePopperScope","PROVIDER_NAME","DEFAULT_DELAY_DURATION","TOOLTIP_OPEN","TooltipProviderContextProvider","useTooltipProviderContext","TooltipProvider","props","__scopeTooltip","delayDuration","skipDelayDuration","disableHoverableContent","children","isOpenDelayedRef","React","useRef","isPointerInTransitRef","skipDelayTimerRef","useEffect","skipDelayTimer","current","window","clearTimeout","jsx","scope","onOpen","useCallback","onClose","setTimeout","onPointerInTransitChange","inTransit","displayName","TOOLTIP_NAME","TooltipContextProvider","useTooltipContext","Tooltip","open","openProp","defaultOpen","onOpenChange","disableHoverableContentProp","delayDurationProp","providerContext","popperScope","trigger","setTrigger","useState","contentId","useId","openTimerRef","wasOpenDelayedRef","setOpen","useControllableState","prop","defaultProp","onChange","document","dispatchEvent","CustomEvent","stateAttribute","useMemo","handleOpen","handleClose","handleDelayedOpen","PopperPrimitive.Root","onTriggerChange","onTriggerEnter","onTriggerLeave","TRIGGER_NAME","TooltipTrigger","forwardRef","forwardedRef","triggerProps","context","ref","composedRefs","useComposedRefs","isPointerDownRef","hasPointerMoveOpenedRef","handlePointerUp","removeEventListener","PopperPrimitive.Anchor","asChild","Primitive","button","onPointerMove","composeEventHandlers","event","pointerType","onPointerLeave","onPointerDown","addEventListener","once","onFocus","onBlur","onClick","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","TooltipPortal","container","Presence","present","PortalPrimitive","CONTENT_NAME","TooltipContent","portalContext","side","contentProps","TooltipContentImpl","TooltipContentHoverable","pointerGraceArea","setPointerGraceArea","content","handleRemoveGraceArea","handleCreateGraceArea","hoverTarget","currentTarget","exitPoint","x","clientX","y","clientY","paddedExitPoints","exitSide","padding","push","getPaddedExitPoints","point","rect","top","Math","abs","bottom","right","left","min","Error","getExitSideFromRect","getBoundingClientRect","graceArea","points","newPoints","slice","sort","a","b","length","upperHull","i","p","q","r","pop","lowerHull","concat","getHullPresorted","getHull","getPointsFromRect","handleTriggerLeave","handleContentLeave","handleTrackPointerGrace","target","pointerPosition","hasEnteredTarget","contains","isPointerOutsideGraceArea","polygon","inside","j","xi","yi","xj","yj","isPointInPolygon","VisuallyHiddenContentContextProvider","useVisuallyHiddenContentContext","isInside","Slottable","createSlottable","ariaLabel","onEscapeKeyDown","onPointerDownOutside","handleScroll","capture","DismissableLayer","disableOutsidePointerEvents","onFocusOutside","preventDefault","onDismiss","jsxs","PopperPrimitive.Content","style","VisuallyHiddenPrimitive.Root","id","role","ARROW_NAME","arrowProps","PopperPrimitive.Arrow","Provider","Root","Trigger","Portal","Content","createElement","TooltipPrimitive","data-slot","className","sideOffset","cn"],"mappings":"swBAkBA,IAAOA,EAAsBC,GAAsBC,EAAmB,UAAW,CAC/EC,IAEIC,EAAiBD,IAMjBE,EAAgB,kBAChBC,EAAyB,IACzBC,EAAe,gBAYdC,EAAgCC,GACrCT,EAAkDK,GAqB9CK,EACJC,IAEA,MAAMC,eACJA,EAAAC,cACAA,EAAgBP,EAAAQ,kBAChBA,EAAoB,IAAAC,wBACpBA,GAA0B,EAAAC,SAC1BA,GACEL,EACEM,EAAyBC,EAAAC,QAAO,GAChCC,EAA8BF,EAAAC,QAAO,GACrCE,EAA0BH,EAAAC,OAAO,GAOvC,OALMD,EAAAI,WAAU,KACd,MAAMC,EAAiBF,EAAkBG,QACzC,MAAO,IAAMC,OAAOC,aAAaH,EAAc,GAC9C,IAGDI,EAACnB,EAAA,CACCoB,MAAOhB,EACPK,mBACAJ,gBACAgB,OAAcX,EAAAY,aAAY,KACxBL,OAAOC,aAAaL,EAAkBG,SACtCP,EAAiBO,SAAU,CAAA,GAC1B,IACHO,QAAeb,EAAAY,aAAY,KACzBL,OAAOC,aAAaL,EAAkBG,SACtCH,EAAkBG,QAAUC,OAAOO,YACjC,IAAOf,EAAiBO,SAAU,GAClCV,EAAA,GAED,CAACA,IACJM,wBACAa,yBAAgCf,EAAAY,aAAaI,IAC3Cd,EAAsBI,QAAUU,CAAA,GAC/B,IACHnB,0BAECC,YAAA,EAKPN,EAAgByB,YAAc9B,EAM9B,IAAM+B,EAAe,WAedC,EAAwBC,GAC7BtC,EAA0CoC,GAoBtCG,EAAmC5B,IACvC,MAAMC,eACJA,EAAAI,SACAA,EACAwB,KAAMC,EAAAC,YACNA,GAAc,EAAAC,aACdA,EACA5B,wBAAyB6B,EACzB/B,cAAegC,GACblC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B8L,GAAe/L,EACpCoC,EAAc3C,EAAeQ,GAOnC,OANqCyK,EACnCoB,EACA7L,GAIkC0K,SAAW,KAC7C3J,EAAiBgL,EAAhB,IAA0B5J,KAAiB2J,EAAY5H,IAAKH,GAAc,IAKpExC,YAAcsK,EA8I3B,IAAMG,EAAWlM,EACXmM,EAAOtK,EACPuK,EAAUrI,EACVsI,EAASvG,EACTwG,EAAUlG,ECzuBhB,SAASpG,GAAgBG,cACxBA,EAAgB,OACbF,IAEH,OACCO,EAAA+L,cAACC,EAAyB,CACzBC,YAAU,mBACVtM,cAAeA,KACXF,GAGP,CAEA,SAAS4B,OAAa5B,IACrB,OACCO,EAACR,cAAAA,EAAAA,KACAQ,EAACgM,cAAAA,EAAqB,CAACC,YAAU,aAAcxM,IAGlD,CAEA,SAAS8D,OAAoB9D,IAC5B,OAAOO,EAAA+L,cAACC,EAAwB,CAACC,YAAU,qBAAsBxM,GAClE,CAEA,SAASmG,IAAesG,UACvBA,EAASC,WACTA,EAAa,EAACrM,SACdA,KACGL,IAEH,OACCO,gBAACgM,EACA,KAAAhM,EAAA+L,cAACC,EAAwB,CACxBC,YAAU,kBACVE,WAAYA,EACZD,UAAWE,EACV,0YACAF,MAEGzM,GAEHK,GAIL","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Investtools",
3
3
  "name": "ivt",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "Ivt Components Library",
6
6
  "keywords": [
7
7
  "ivt",
@@ -26,10 +26,10 @@
26
26
  "lint:fix": "biome lint --write",
27
27
  "biome:ci": "biome check --no-errors-on-unmatched",
28
28
  "biome:fix": "biome check --write --no-errors-on-unmatched",
29
- "rollup": "GENERATE_SOURCEMAP=false && rollup -c --bundleConfigAsCjs",
29
+ "rollup": "export NODE_OPTIONS='--max-old-space-size=20192' && GENERATE_SOURCEMAP=false && rollup -c --bundleConfigAsCjs",
30
30
  "preview": "vite preview",
31
- "storybook": "storybook dev -p 6006",
32
- "build-storybook": "storybook build",
31
+ "storybook": "npx storybook dev -p 6006",
32
+ "build-storybook": "npx storybook build",
33
33
  "prepare": "husky",
34
34
  "test": "vitest"
35
35
  },
@@ -56,6 +56,10 @@
56
56
  "import": "./dist/alert/index.mjs",
57
57
  "types": "./dist/alert/index.d.ts"
58
58
  },
59
+ "./alert-dialog": {
60
+ "import": "./dist/alert-dialog/index.mjs",
61
+ "types": "./dist/alert-dialog/index.d.ts"
62
+ },
59
63
  "./badge": {
60
64
  "import": "./dist/badge/index.mjs",
61
65
  "types": "./dist/badge/index.d.ts"
@@ -203,6 +207,7 @@
203
207
  "@dnd-kit/modifiers": "^9.0.0",
204
208
  "@dnd-kit/sortable": "^10.0.0",
205
209
  "@radix-ui/react-accordion": "^1.2.3",
210
+ "@radix-ui/react-alert-dialog": "^1.1.7",
206
211
  "@radix-ui/react-avatar": "^1.1.3",
207
212
  "@radix-ui/react-checkbox": "^1.1.4",
208
213
  "@radix-ui/react-dialog": "^1.1.6",
@@ -215,7 +220,7 @@
215
220
  "@radix-ui/react-scroll-area": "^1.2.3",
216
221
  "@radix-ui/react-select": "^2.1.6",
217
222
  "@radix-ui/react-separator": "^1.1.2",
218
- "@radix-ui/react-slot": "^1.1.2",
223
+ "@radix-ui/react-slot": "^1.2.0",
219
224
  "@radix-ui/react-tabs": "^1.1.3",
220
225
  "@radix-ui/react-toast": "^1.2.6",
221
226
  "@radix-ui/react-tooltip": "^1.1.8",
@@ -281,6 +286,7 @@
281
286
  "rollup-plugin-dts": "^6.1.1",
282
287
  "rollup-plugin-peer-deps-external": "^2.2.4",
283
288
  "rollup-plugin-postcss": "^4.0.2",
289
+ "rollup-plugin-preserve-directives": "^0.4.0",
284
290
  "storybook": "^8.6.4",
285
291
  "tailwind-merge": "^3.0.2",
286
292
  "tailwindcss": "^4.0.12",
@@ -1,2 +0,0 @@
1
- import*as e from"react";import{useState as t}from"react";import{u as n}from"./index-BzUzK8k1.mjs";import{P as r}from"./index-5xCD9zck.mjs";import{u as o}from"./index-CBuWa3V_.mjs";import{jsx as a}from"react/jsx-runtime";import{_ as c,a as i,b as u}from"./tslib.es6-DnJNy3VA.mjs";var s=0;function l(){e.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??d()),document.body.insertAdjacentElement("beforeend",e[1]??d()),s++,()=>{1===s&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),s--}}),[])}function d(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var f="focusScope.autoFocusOnMount",m="focusScope.autoFocusOnUnmount",v={bubbles:!1,cancelable:!0},p=e.forwardRef(((t,c)=>{const{loop:i=!1,trapped:u=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...d}=t,[p,y]=e.useState(null),w=o(s),S=o(l),C=e.useRef(null),k=n(c,(e=>y(e))),A=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(u){let e=function(e){if(A.paused||!p)return;const t=e.target;p.contains(t)?C.current=t:E(C.current,{select:!0})},t=function(e){if(A.paused||!p)return;const t=e.relatedTarget;null!==t&&(p.contains(t)||E(C.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&E(p)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return p&&r.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[u,p,A.paused]),e.useEffect((()=>{if(p){b.add(A);const t=document.activeElement;if(!p.contains(t)){const n=new CustomEvent(f,v);p.addEventListener(f,w),p.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(E(r,{select:t}),document.activeElement!==n)return}((e=h(p),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&E(p))}return()=>{p.removeEventListener(f,w),setTimeout((()=>{const e=new CustomEvent(m,v);p.addEventListener(m,S),p.dispatchEvent(e),e.defaultPrevented||E(t??document.body,{select:!0}),p.removeEventListener(m,S),b.remove(A)}),0)}}var e}),[p,w,S,A]);const M=e.useCallback((e=>{if(!i&&!u)return;if(A.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,o]=function(e){const t=h(e),n=g(t,e),r=g(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||n!==o?e.shiftKey&&n===r&&(e.preventDefault(),i&&E(o,{select:!0})):(e.preventDefault(),i&&E(r,{select:!0})):n===t&&e.preventDefault()}}),[i,u,A.paused]);return a(r.div,{tabIndex:-1,...d,ref:k,onKeyDown:M})}));function h(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function g(e,t){for(const n of e)if(!y(n,{upTo:t}))return n}function y(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function E(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}p.displayName="FocusScope";var b=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=w(e,t),e.unshift(t)},remove(t){e=w(e,t),e[0]?.resume()}}}();function w(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var S=new WeakMap,C=new WeakMap,k={},A=0,M=function(e){return e&&(e.host||M(e.parentNode))},L=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=M(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);k[n]||(k[n]=new WeakMap);var a=k[n],c=[],i=new Set,u=new Set(o),s=function(e){e&&!i.has(e)&&(i.add(e),s(e.parentNode))};o.forEach(s);var l=function(e){e&&!u.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,u=(S.get(e)||0)+1,s=(a.get(e)||0)+1;S.set(e,u),a.set(e,s),c.push(e),1===u&&o&&C.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return l(t),i.clear(),A++,function(){c.forEach((function(e){var t=S.get(e)-1,o=a.get(e)-1;S.set(e,t),a.set(e,o),t||(C.has(e)||e.removeAttribute(r),C.delete(e)),o||e.removeAttribute(n)})),--A||(S=new WeakMap,S=new WeakMap,C=new WeakMap,k={})}},N=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),L(r,o,n,"aria-hidden")):function(){return null}},T="right-scroll-bar-position",x="width-before-scroll-bar";function R(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var P="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,I=new WeakMap;function F(e,n){var r,o,a,c=(r=null,o=function(t){return e.forEach((function(e){return R(e,t)}))},(a=t((function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}}))[0]).callback=o,a.facade);return P((function(){var t=I.get(c);if(t){var n=new Set(t),r=new Set(e),o=c.current;n.forEach((function(e){r.has(e)||R(e,null)})),r.forEach((function(e){n.has(e)||R(e,o)}))}I.set(c,e)}),[e]),c}function W(e){return e}var _=function(t){var n=t.sideCar,r=i(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,c({},r))};_.isSideCarExport=!0;var B=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=W);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=c({async:!0,ssr:!1},e),t}(),j=function(){},D=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:j,onWheelCapture:j,onTouchMoveCapture:j}),a=o[0],u=o[1],s=t.forwardProps,l=t.children,d=t.className,f=t.removeScrollBar,m=t.enabled,v=t.shards,p=t.sideCar,h=t.noIsolation,g=t.inert,y=t.allowPinchZoom,E=t.as,b=void 0===E?"div":E,w=t.gapMode,S=i(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,k=F([r,n]),A=c(c({},S),a);return e.createElement(e.Fragment,null,m&&e.createElement(C,{sideCar:B,removeScrollBar:f,shards:v,noIsolation:h,inert:g,setCallbacks:u,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),c(c({},A),{ref:k})):e.createElement(b,c({},A,{className:d,ref:k}),l))}));D.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},D.classNames={fullWidth:x,zeroRight:T};function K(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var X=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=K())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Y=function(){var t,n=(t=X(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},O={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||"",10)||0},Z=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return O;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[H(n),H(r),H(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},q=Y(),U="data-scroll-locked",z=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(U,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(T," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(x," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(T," .").concat(T," {\n right: 0 ").concat(r,";\n }\n \n .").concat(x," .").concat(x," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(U,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},G=function(){var e=parseInt(document.body.getAttribute(U)||"0",10);return isFinite(e)?e:0},J=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect((function(){return document.body.setAttribute(U,(G()+1).toString()),function(){var e=G()-1;e<=0?document.body.removeAttribute(U):document.body.setAttribute(U,e.toString())}}),[]);var c=e.useMemo((function(){return Z(a)}),[a]);return e.createElement(q,{styles:z(c,!n,a,r?"":"!important")})},Q=!1;if("undefined"!=typeof window)try{var V=Object.defineProperty({},"passive",{get:function(){return Q=!0,!0}});window.addEventListener("test",V,V),window.removeEventListener("test",V,V)}catch(e){Q=!1}var $=!!Q&&{passive:!1},ee=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},te=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),ne(e,r)){var o=re(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ne=function(e,t){return"v"===e?function(e){return ee(e,"overflowY")}(t):function(e){return ee(e,"overflowX")}(t)},re=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},oe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ae=function(e){return[e.deltaX,e.deltaY]},ce=function(e){return e&&"current"in e?e.current:e},ie=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ue=0,se=[];function le(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var de,fe=(de=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(ue++)[0],c=e.useState(Y)[0],i=e.useRef(t);e.useEffect((function(){i.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=u([t.lockRef.current],(t.shards||[]).map(ce),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var n,a=oe(e),c=r.current,u="deltaX"in e?e.deltaX:c[0]-a[0],s="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=te(d,l);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=te(d,l)),!f)return!1;if(!o.current&&"changedTouches"in e&&(u||s)&&(o.current=n),!n)return!0;var m=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),u=!1,s=a>0,l=0,d=0;do{var f=re(e,c),m=f[0],v=f[1]-f[2]-o*m;(m||v)&&ne(e,c)&&(l+=v,d+=m),c=c instanceof ShadowRoot?c.host:c.parentNode}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(s&&Math.abs(l)<1||!s&&Math.abs(d)<1)&&(u=!0),u}(m,t,e,"h"===m?u:s)}),[]),l=e.useCallback((function(e){var t=e;if(se.length&&se[se.length-1]===c){var r="deltaY"in t?ae(t):oe(t),o=n.current.filter((function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(i.current.shards||[]).map(ce).filter(Boolean).filter((function(e){return e.contains(t.target)}));(a.length>0?s(t,a[0]):!i.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),d=e.useCallback((function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:le(r)};n.current.push(a),setTimeout((function(){n.current=n.current.filter((function(e){return e!==a}))}),1)}),[]),f=e.useCallback((function(e){r.current=oe(e),o.current=void 0}),[]),m=e.useCallback((function(e){d(e.type,ae(e),e.target,s(e,t.lockRef.current))}),[]),v=e.useCallback((function(e){d(e.type,oe(e),e.target,s(e,t.lockRef.current))}),[]);e.useEffect((function(){return se.push(c),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",l,$),document.addEventListener("touchmove",l,$),document.addEventListener("touchstart",f,$),function(){se=se.filter((function(e){return e!==c})),document.removeEventListener("wheel",l,$),document.removeEventListener("touchmove",l,$),document.removeEventListener("touchstart",f,$)}}),[]);var p=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(c,{styles:ie(a)}):null,p?e.createElement(J,{gapMode:t.gapMode}):null)},B.useMedium(de),_),me=e.forwardRef((function(t,n){return e.createElement(D,c({},t,{ref:n,sideCar:fe}))}));me.classNames=D.classNames;export{p as F,me as R,N as h,l as u};
2
- //# sourceMappingURL=Combination-CaCdPc0V.mjs.map