ivt 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.mjs +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/button/index.d.ts +4 -3
- package/dist/button/index.mjs +1 -1
- package/dist/calendar/index.d.ts +2 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/chunks/{Combination-w1gWj54H.mjs → Combination-CyYyS_SM.mjs} +2 -2
- package/dist/chunks/{Combination-w1gWj54H.mjs.map → Combination-CyYyS_SM.mjs.map} +1 -1
- package/dist/chunks/{TextWrap-CjH4DiRJ.mjs → TextWrap-aRTaok1G.mjs} +2 -2
- package/dist/chunks/{TextWrap-CjH4DiRJ.mjs.map → TextWrap-aRTaok1G.mjs.map} +1 -1
- package/dist/chunks/{accordion-B9KfEWUD.mjs → accordion-DpawKek3.mjs} +2 -2
- package/dist/chunks/{accordion-B9KfEWUD.mjs.map → accordion-DpawKek3.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-WLX8GCHw.mjs → bundle-mjs-DnMeAVOT.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-WLX8GCHw.mjs.map → bundle-mjs-DnMeAVOT.mjs.map} +1 -1
- package/dist/chunks/{button-C25JgpF1.mjs → button-CUUUd-GC.mjs} +2 -2
- package/dist/chunks/{button-C25JgpF1.mjs.map → button-CUUUd-GC.mjs.map} +1 -1
- package/dist/chunks/{calendar-Bg8q2q0f.mjs → calendar-Bgc5EEL2.mjs} +2 -2
- package/dist/chunks/calendar-Bgc5EEL2.mjs.map +1 -0
- package/dist/chunks/check-0el77MKz.mjs +2 -0
- package/dist/chunks/{check-B7qxEGdi.mjs.map → check-0el77MKz.mjs.map} +1 -1
- package/dist/chunks/chevron-down-D5Xyp48A.mjs +2 -0
- package/dist/chunks/{chevron-down-C5QWUB1b.mjs.map → chevron-down-D5Xyp48A.mjs.map} +1 -1
- package/dist/chunks/chevron-left-DSinxt9A.mjs +2 -0
- package/dist/chunks/{chevron-left-yZO8_iYx.mjs.map → chevron-left-DSinxt9A.mjs.map} +1 -1
- package/dist/chunks/chevron-right-DvIJOX9A.mjs +2 -0
- package/dist/chunks/{chevron-right-DX1OAykB.mjs.map → chevron-right-DvIJOX9A.mjs.map} +1 -1
- package/dist/chunks/{command-BdZ-rcJh.mjs → command-BkvrXopz.mjs} +2 -2
- package/dist/chunks/{command-BdZ-rcJh.mjs.map → command-BkvrXopz.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-CRElQpLA.mjs → createLucideIcon-De2tZJhv.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-CRElQpLA.mjs.map → createLucideIcon-De2tZJhv.mjs.map} +1 -1
- package/dist/chunks/{dialog-BEfPREgp.mjs → dialog-Ci5YNXh2.mjs} +2 -2
- package/dist/chunks/{dialog-BEfPREgp.mjs.map → dialog-Ci5YNXh2.mjs.map} +1 -1
- package/dist/chunks/{index-BFX-PqV0.mjs → index-0ulImjdF.mjs} +2 -2
- package/dist/chunks/{index-BFX-PqV0.mjs.map → index-0ulImjdF.mjs.map} +1 -1
- package/dist/chunks/{index-D1rtromL.mjs → index-BGhqW2Il.mjs} +1 -1
- package/dist/chunks/{index-D1rtromL.mjs.map → index-BGhqW2Il.mjs.map} +1 -1
- package/dist/chunks/{index-CIU1Xq1J.mjs → index-BuGzJybI.mjs} +2 -2
- package/dist/chunks/{index-CIU1Xq1J.mjs.map → index-BuGzJybI.mjs.map} +1 -1
- package/dist/chunks/{index-oT2uIdb1.mjs → index-C5go0LX8.mjs} +1 -1
- package/dist/chunks/{index-oT2uIdb1.mjs.map → index-C5go0LX8.mjs.map} +1 -1
- package/dist/chunks/{index-COE6uEyP.mjs → index-CVTJI-8T.mjs} +2 -2
- package/dist/chunks/{index-COE6uEyP.mjs.map → index-CVTJI-8T.mjs.map} +1 -1
- package/dist/chunks/{index-DP22y5yX.mjs → index-CllKujAS.mjs} +2 -2
- package/dist/chunks/{index-DP22y5yX.mjs.map → index-CllKujAS.mjs.map} +1 -1
- package/dist/chunks/{index-CN1SA0_I.mjs → index-CmGsz_8M.mjs} +1 -1
- package/dist/chunks/{index-CN1SA0_I.mjs.map → index-CmGsz_8M.mjs.map} +1 -1
- package/dist/chunks/{index-46Dn4Q--.mjs → index-DMXVIqDM.mjs} +2 -2
- package/dist/chunks/{index-46Dn4Q--.mjs.map → index-DMXVIqDM.mjs.map} +1 -1
- package/dist/chunks/{index-DyAmMjEH.mjs → index-DhIMkiDX.mjs} +2 -2
- package/dist/chunks/{index-DyAmMjEH.mjs.map → index-DhIMkiDX.mjs.map} +1 -1
- package/dist/chunks/{index-CYJu5yO5.mjs → index-Eo-UV7HL.mjs} +2 -2
- package/dist/chunks/{index-CYJu5yO5.mjs.map → index-Eo-UV7HL.mjs.map} +1 -1
- package/dist/chunks/{index-DM6C2fpF.mjs → index-SI7n7FwH.mjs} +2 -2
- package/dist/chunks/{index-DM6C2fpF.mjs.map → index-SI7n7FwH.mjs.map} +1 -1
- package/dist/chunks/{index-ClSqYyO3.mjs → index-wbuw6FYR.mjs} +1 -1
- package/dist/chunks/{index-ClSqYyO3.mjs.map → index-wbuw6FYR.mjs.map} +1 -1
- package/dist/chunks/{input-D7H1CxUv.mjs → input-YYNIX4HJ.mjs} +2 -2
- package/dist/chunks/{input-D7H1CxUv.mjs.map → input-YYNIX4HJ.mjs.map} +1 -1
- package/dist/chunks/{label-Cue4yhAm.mjs → label-xCRg1H88.mjs} +2 -2
- package/dist/chunks/{label-Cue4yhAm.mjs.map → label-xCRg1H88.mjs.map} +1 -1
- package/dist/chunks/{pagination-BYLwRYiM.mjs → pagination-CJBX9rpr.mjs} +2 -2
- package/dist/chunks/{pagination-BYLwRYiM.mjs.map → pagination-CJBX9rpr.mjs.map} +1 -1
- package/dist/chunks/{popover-fxWu9ghI.mjs → popover-C5RxsRcQ.mjs} +2 -2
- package/dist/chunks/{popover-fxWu9ghI.mjs.map → popover-C5RxsRcQ.mjs.map} +1 -1
- package/dist/chunks/{progress-CKxTxjba.mjs → progress-D1bk3yWe.mjs} +2 -2
- package/dist/chunks/{progress-CKxTxjba.mjs.map → progress-D1bk3yWe.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DSDAk121.mjs → scroll-area-00P-K3zA.mjs} +2 -2
- package/dist/chunks/{scroll-area-DSDAk121.mjs.map → scroll-area-00P-K3zA.mjs.map} +1 -1
- package/dist/chunks/{select-BtEQWkQs.mjs → select-3Bu7wZI4.mjs} +2 -2
- package/dist/chunks/{select-BtEQWkQs.mjs.map → select-3Bu7wZI4.mjs.map} +1 -1
- package/dist/chunks/{skeleton-DsvXPbHg.mjs → skeleton-Cug3TaOR.mjs} +2 -2
- package/dist/chunks/{skeleton-DsvXPbHg.mjs.map → skeleton-Cug3TaOR.mjs.map} +1 -1
- package/dist/chunks/{sortable-D4tl3H9D.mjs → sortable-BfuXuKfa.mjs} +2 -2
- package/dist/chunks/{sortable-D4tl3H9D.mjs.map → sortable-BfuXuKfa.mjs.map} +1 -1
- package/dist/chunks/{table-Cql47amq.mjs → table-BEFxdl4s.mjs} +2 -2
- package/dist/chunks/{table-Cql47amq.mjs.map → table-BEFxdl4s.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-C59-pKsO.mjs → tslib.es6-BF29wwud.mjs} +1 -1
- package/dist/chunks/{tslib.es6-C59-pKsO.mjs.map → tslib.es6-BF29wwud.mjs.map} +1 -1
- package/dist/chunks/{utils-Dd3mX7Lt.mjs → utils-ihtedRak.mjs} +2 -2
- package/dist/chunks/{utils-Dd3mX7Lt.mjs.map → utils-ihtedRak.mjs.map} +1 -1
- package/dist/chunks/x-CTH8w2xf.mjs +2 -0
- package/dist/chunks/{x-CYyikW5M.mjs.map → x-CTH8w2xf.mjs.map} +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.d.ts +1 -0
- package/dist/data-table/index.mjs +1 -1
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropzone/index.d.ts +3 -1
- package/dist/dropzone/index.mjs +2 -2
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index/index.d.ts +1 -1
- package/dist/index.css +1 -7
- package/dist/input/index.mjs +1 -1
- package/dist/label/index.mjs +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/scroll-area/index.mjs +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/separator/index.mjs +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sortable/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/toast/index.d.ts +2 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +5 -4
- package/dist/chunks/calendar-Bg8q2q0f.mjs.map +0 -1
- package/dist/chunks/check-B7qxEGdi.mjs +0 -2
- package/dist/chunks/chevron-down-C5QWUB1b.mjs +0 -2
- package/dist/chunks/chevron-left-yZO8_iYx.mjs +0 -2
- package/dist/chunks/chevron-right-DX1OAykB.mjs +0 -2
- package/dist/chunks/x-CYyikW5M.mjs +0 -2
package/dist/toast/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import t from"react";import*as r from"react-dom";import{u as o,P as n,c as s,a,b as i}from"../chunks/index-ClSqYyO3.mjs";import{createCollection as c}from"@radix-ui/react-collection";import{c as d}from"../chunks/index-D1rtromL.mjs";import{B as u,R as l,P as p}from"../chunks/index-COE6uEyP.mjs";import{P as m,d as f}from"../chunks/index-CN1SA0_I.mjs";import{u as v}from"../chunks/index-46Dn4Q--.mjs";import{V as w}from"../chunks/index-BFX-PqV0.mjs";import{jsx as h,jsxs as x,Fragment as y}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import{c as E}from"../chunks/utils-Dd3mX7Lt.mjs";import{X as T}from"../chunks/x-CYyikW5M.mjs";import"@radix-ui/react-slot";import"../chunks/bundle-mjs-WLX8GCHw.mjs";import"../chunks/createLucideIcon-CRElQpLA.mjs";var b="ToastProvider",[C,P,R]=c("Toast"),[N,k]=d("Toast",[R]),[D,L]=N(b),S=t=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=t,[c,d]=e.useState(null),[u,l]=e.useState(0),p=e.useRef(!1),m=e.useRef(!1);return o.trim()||console.error(`Invalid prop \`label\` supplied to \`${b}\`. Expected non-empty \`string\`.`),h(C.Provider,{scope:r,children:h(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:e.useCallback((()=>l((e=>e+1))),[]),onToastRemove:e.useCallback((()=>l((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],I="toast.viewportPause",A="toast.viewportResume",M=e.forwardRef(((t,r)=>{const{__scopeToast:n,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=t,c=L(_,n),d=P(n),l=e.useRef(null),p=e.useRef(null),f=e.useRef(null),v=e.useRef(null),w=o(r,v,c.onViewportChange),y=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;e.useEffect((()=>{const e=e=>{0!==s.length&&s.every((t=>e[t]||e.code===t))&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[s]),e.useEffect((()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(I);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}}),[g,c.isClosePausedRef]);const E=e.useCallback((({tabbingDirection:e})=>{const t=d().map((t=>{const r=t.ref.current,o=[r,...te(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[d]);return e.useEffect((()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void p.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));re(n.slice(s+1))?t.preventDefault():o?p.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[d,E]),x(u,{ref:l,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&h(K,{ref:p,onFocusFromOutsideViewport:()=>{re(E({tabbingDirection:"forwards"}))}}),h(C.Slot,{scope:n,children:h(m.ol,{tabIndex:-1,...i,ref:w})}),g&&h(K,{ref:f,onFocusFromOutsideViewport:()=>{re(E({tabbingDirection:"backwards"}))}})]})}));M.displayName=_;var j="ToastFocusProxy",K=e.forwardRef(((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(j,r);return h(w,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));K.displayName=j;var O="Toast",V=e.forwardRef(((e,t)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:c,...d}=e,[u=!0,l]=v({prop:o,defaultProp:i,onChange:c});return h(n,{present:r||u,children:h(X,{open:u,...d,ref:t,onClose:()=>l(!1),onPause:a(e.onPause),onResume:a(e.onResume),onSwipeStart:s(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:s(e.onSwipeMove,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)})),onSwipeCancel:s(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:s(e.onSwipeEnd,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),l(!1)}))})})}));V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=e.forwardRef(((t,n)=>{const{__scopeToast:i,type:c="foreground",duration:d,open:u,onClose:p,onEscapeKeyDown:f,onPause:v,onResume:w,onSwipeStart:g,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=t,R=L(O,i),[N,k]=e.useState(null),D=o(n,(e=>k(e))),S=e.useRef(null),_=e.useRef(null),F=d||R.duration,M=e.useRef(0),j=e.useRef(F),K=e.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=a((()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),p()})),B=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(K.current),M.current=(new Date).getTime(),K.current=window.setTimeout(X,e))}),[X]);e.useEffect((()=>{const e=R.viewport;if(e){const t=()=>{B(j.current),w?.()},r=()=>{const e=(new Date).getTime()-M.current;j.current=j.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(I,r),e.addEventListener(A,t),()=>{e.removeEventListener(I,r),e.removeEventListener(A,t)}}}),[R.viewport,F,v,w,B]),e.useEffect((()=>{u&&!R.isClosePausedRef.current&&B(F)}),[u,F,R.isClosePausedRef,B]),e.useEffect((()=>(V(),()=>U())),[V,U]);const H=e.useMemo((()=>N?Q(N):null),[N]);return R.viewport?x(y,{children:[H&&h(q,{__scopeToast:i,role:"status","aria-live":"foreground"===c?"assertive":"polite","aria-atomic":!0,children:H}),h($,{scope:i,onClose:X,children:r.createPortal(h(C.ItemSlot,{scope:i,children:h(l,{asChild:!0,onEscapeKeyDown:s(f,(()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1})),children:h(m.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:s(t.onKeyDown,(e=>{"Escape"===e.key&&(f?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))})),onPointerDown:s(t.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:s(t.onPointerMove,(e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Z("toast.swipeMove",E,u,{discrete:!1})):ee(d,R.swipeDirection,c)?(_.current=d,Z("toast.swipeStart",g,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)})),onPointerUp:s(t.onPointerUp,(e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};ee(t,R.swipeDirection,R.swipeThreshold)?Z("toast.swipeEnd",b,o,{discrete:!0}):Z("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),R.viewport)})]}):null})),q=t=>{const{__scopeToast:r,children:o,...n}=t,s=L(O,r),[c,d]=e.useState(!1),[u,l]=e.useState(!1);return function(e=()=>{}){const t=a(e);i((()=>{let e=0,r=0;return e=window.requestAnimationFrame((()=>r=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}}),[t])}((()=>d(!0))),e.useEffect((()=>{const e=window.setTimeout((()=>l(!0)),1e3);return()=>window.clearTimeout(e)}),[]),u?null:h(p,{asChild:!0,children:h(w,{...n,children:c&&x(y,{children:[s.label," ",o]})})})},B=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return h(m.div,{...o,ref:t})}));B.displayName="ToastTitle";var H=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return h(m.div,{...o,ref:t})}));H.displayName="ToastDescription";var W="ToastAction",Y=e.forwardRef(((e,t)=>{const{altText:r,...o}=e;return r.trim()?h(J,{altText:r,asChild:!0,children:h(G,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${W}\`. Expected non-empty \`string\`.`),null)}));Y.displayName=W;var z="ToastClose",G=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e,n=U(z,r);return h(J,{asChild:!0,children:h(m.button,{type:"button",...o,ref:t,onClick:s(e.onClick,n.onClose)})})}));G.displayName=z;var J=e.forwardRef(((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return h(m.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})}));function Q(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...Q(e))}})),t}function Z(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?f(n,s):n.dispatchEvent(s)}var ee=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function te(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function re(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var oe=M,ne=V,se=B,ae=H,ie=Y,ce=G;const de=S,ue=({className:e,...r})=>t.createElement(oe,{"data-slot":"toast-viewport",className:E("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]",e),...r}),le=g("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",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive"}},defaultVariants:{variant:"default"}}),pe=({className:e,variant:r,...o})=>t.createElement(ne,{"data-slot":"toast-root",className:E(le({variant:r}),e),...o}),me=({className:e,...r})=>t.createElement(ie,{"data-slot":"toast-action",className:E("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",e),...r}),fe=({className:e,...r})=>t.createElement(ce,{"data-slot":"toast-close",className:E("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",e),"toast-close":"",...r},t.createElement(T,{className:"h-4 w-4"})),ve=({className:e,...r})=>t.createElement(se,{"data-slot":"toast-title",className:E("text-sm font-semibold",e),...r}),we=({className:e,...r})=>t.createElement(ae,{"data-slot":"toast-description",className:E("text-sm opacity-90",e),...r});export{pe as Toast,me as ToastAction,fe as ToastClose,we as ToastDescription,de as ToastProvider,ve as ToastTitle,ue as ToastViewport};
|
1
|
+
import*as e from"react";import t from"react";import*as r from"react-dom";import{u as o,P as n,c as s,a,b as i}from"../chunks/index-wbuw6FYR.mjs";import{createCollection as c}from"@radix-ui/react-collection";import{c as d}from"../chunks/index-BGhqW2Il.mjs";import{B as u,R as l,P as p}from"../chunks/index-CVTJI-8T.mjs";import{P as m,d as f}from"../chunks/index-CmGsz_8M.mjs";import{u as v}from"../chunks/index-DMXVIqDM.mjs";import{V as w}from"../chunks/index-0ulImjdF.mjs";import{jsx as h,jsxs as x,Fragment as y}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import{c as E}from"../chunks/utils-ihtedRak.mjs";import{X as T}from"../chunks/x-CTH8w2xf.mjs";import"@radix-ui/react-slot";import"../chunks/bundle-mjs-DnMeAVOT.mjs";import"../chunks/createLucideIcon-De2tZJhv.mjs";var b="ToastProvider",[C,P,R]=c("Toast"),[N,k]=d("Toast",[R]),[D,L]=N(b),S=t=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=t,[c,d]=e.useState(null),[u,l]=e.useState(0),p=e.useRef(!1),m=e.useRef(!1);return o.trim()||console.error(`Invalid prop \`label\` supplied to \`${b}\`. Expected non-empty \`string\`.`),h(C.Provider,{scope:r,children:h(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:e.useCallback((()=>l((e=>e+1))),[]),onToastRemove:e.useCallback((()=>l((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],I="toast.viewportPause",A="toast.viewportResume",M=e.forwardRef(((t,r)=>{const{__scopeToast:n,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=t,c=L(_,n),d=P(n),l=e.useRef(null),p=e.useRef(null),f=e.useRef(null),v=e.useRef(null),w=o(r,v,c.onViewportChange),y=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;e.useEffect((()=>{const e=e=>{0!==s.length&&s.every((t=>e[t]||e.code===t))&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[s]),e.useEffect((()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(I);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}}),[g,c.isClosePausedRef]);const E=e.useCallback((({tabbingDirection:e})=>{const t=d().map((t=>{const r=t.ref.current,o=[r,...te(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[d]);return e.useEffect((()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void p.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));re(n.slice(s+1))?t.preventDefault():o?p.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[d,E]),x(u,{ref:l,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&h(K,{ref:p,onFocusFromOutsideViewport:()=>{re(E({tabbingDirection:"forwards"}))}}),h(C.Slot,{scope:n,children:h(m.ol,{tabIndex:-1,...i,ref:w})}),g&&h(K,{ref:f,onFocusFromOutsideViewport:()=>{re(E({tabbingDirection:"backwards"}))}})]})}));M.displayName=_;var j="ToastFocusProxy",K=e.forwardRef(((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(j,r);return h(w,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));K.displayName=j;var O="Toast",V=e.forwardRef(((e,t)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:c,...d}=e,[u=!0,l]=v({prop:o,defaultProp:i,onChange:c});return h(n,{present:r||u,children:h(X,{open:u,...d,ref:t,onClose:()=>l(!1),onPause:a(e.onPause),onResume:a(e.onResume),onSwipeStart:s(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:s(e.onSwipeMove,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)})),onSwipeCancel:s(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:s(e.onSwipeEnd,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),l(!1)}))})})}));V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=e.forwardRef(((t,n)=>{const{__scopeToast:i,type:c="foreground",duration:d,open:u,onClose:p,onEscapeKeyDown:f,onPause:v,onResume:w,onSwipeStart:g,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=t,R=L(O,i),[N,k]=e.useState(null),D=o(n,(e=>k(e))),S=e.useRef(null),_=e.useRef(null),F=d||R.duration,M=e.useRef(0),j=e.useRef(F),K=e.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=a((()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),p()})),B=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(K.current),M.current=(new Date).getTime(),K.current=window.setTimeout(X,e))}),[X]);e.useEffect((()=>{const e=R.viewport;if(e){const t=()=>{B(j.current),w?.()},r=()=>{const e=(new Date).getTime()-M.current;j.current=j.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(I,r),e.addEventListener(A,t),()=>{e.removeEventListener(I,r),e.removeEventListener(A,t)}}}),[R.viewport,F,v,w,B]),e.useEffect((()=>{u&&!R.isClosePausedRef.current&&B(F)}),[u,F,R.isClosePausedRef,B]),e.useEffect((()=>(V(),()=>U())),[V,U]);const H=e.useMemo((()=>N?Q(N):null),[N]);return R.viewport?x(y,{children:[H&&h(q,{__scopeToast:i,role:"status","aria-live":"foreground"===c?"assertive":"polite","aria-atomic":!0,children:H}),h($,{scope:i,onClose:X,children:r.createPortal(h(C.ItemSlot,{scope:i,children:h(l,{asChild:!0,onEscapeKeyDown:s(f,(()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1})),children:h(m.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:s(t.onKeyDown,(e=>{"Escape"===e.key&&(f?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))})),onPointerDown:s(t.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:s(t.onPointerMove,(e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Z("toast.swipeMove",E,u,{discrete:!1})):ee(d,R.swipeDirection,c)?(_.current=d,Z("toast.swipeStart",g,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)})),onPointerUp:s(t.onPointerUp,(e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};ee(t,R.swipeDirection,R.swipeThreshold)?Z("toast.swipeEnd",b,o,{discrete:!0}):Z("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),R.viewport)})]}):null})),q=t=>{const{__scopeToast:r,children:o,...n}=t,s=L(O,r),[c,d]=e.useState(!1),[u,l]=e.useState(!1);return function(e=()=>{}){const t=a(e);i((()=>{let e=0,r=0;return e=window.requestAnimationFrame((()=>r=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}}),[t])}((()=>d(!0))),e.useEffect((()=>{const e=window.setTimeout((()=>l(!0)),1e3);return()=>window.clearTimeout(e)}),[]),u?null:h(p,{asChild:!0,children:h(w,{...n,children:c&&x(y,{children:[s.label," ",o]})})})},B=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return h(m.div,{...o,ref:t})}));B.displayName="ToastTitle";var H=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return h(m.div,{...o,ref:t})}));H.displayName="ToastDescription";var W="ToastAction",Y=e.forwardRef(((e,t)=>{const{altText:r,...o}=e;return r.trim()?h(J,{altText:r,asChild:!0,children:h(G,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${W}\`. Expected non-empty \`string\`.`),null)}));Y.displayName=W;var z="ToastClose",G=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e,n=U(z,r);return h(J,{asChild:!0,children:h(m.button,{type:"button",...o,ref:t,onClick:s(e.onClick,n.onClose)})})}));G.displayName=z;var J=e.forwardRef(((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return h(m.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})}));function Q(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...Q(e))}})),t}function Z(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?f(n,s):n.dispatchEvent(s)}var ee=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function te(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function re(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var oe=M,ne=V,se=B,ae=H,ie=Y,ce=G;const de=S,ue=({className:e,...r})=>t.createElement(oe,{"data-slot":"toast-viewport",className:E("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]",e),...r}),le=g("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",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive"}},defaultVariants:{variant:"default"}}),pe=({className:e,variant:r,...o})=>t.createElement(ne,{"data-slot":"toast-root",className:E(le({variant:r}),e),...o}),me=({className:e,...r})=>t.createElement(ie,{"data-slot":"toast-action",className:E("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",e),...r}),fe=({className:e,...r})=>t.createElement(ce,{"data-slot":"toast-close",className:E("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",e),"toast-close":"",...r},t.createElement(T,{className:"h-4 w-4"})),ve=({className:e,...r})=>t.createElement(se,{"data-slot":"toast-title",className:E("text-sm font-semibold",e),...r}),we=({className:e,...r})=>t.createElement(ae,{"data-slot":"toast-description",className:E("text-sm opacity-90",e),...r});export{pe as Toast,me as ToastAction,fe as ToastClose,we as ToastDescription,de as ToastProvider,ve as ToastTitle,ue as ToastViewport};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/toast/index.mjs.map
CHANGED
@@ -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 * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n <ToastPrimitives.Viewport\n data-slot=\"toast-viewport\"\n className={cn(\n \"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 className,\n )}\n {...props}\n />\n);\n\nconst toastVariants = cva(\n \"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 {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive:\n \"destructive group border-destructive-foreground bg-destructive-foreground text-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Toast = ({\n className,\n variant,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>) => {\n return (\n <ToastPrimitives.Root\n data-slot=\"toast-root\"\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n};\n\nconst ToastAction = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n <ToastPrimitives.Action\n data-slot=\"toast-action\"\n className={cn(\n \"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 className,\n )}\n {...props}\n />\n);\n\nconst ToastClose = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n <ToastPrimitives.Close\n data-slot=\"toast-close\"\n className={cn(\n \"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 className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n <ToastPrimitives.Title\n data-slot=\"toast-title\"\n className={cn(\"text-sm font-semibold\", className)}\n {...props}\n />\n);\n\nconst ToastDescription = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n <ToastPrimitives.Description\n data-slot=\"toast-description\"\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\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":"6xBAqBA,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,EAAmB9B,EAA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A2B,CAC1BC,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 * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n <ToastPrimitives.Viewport\n data-slot=\"toast-viewport\"\n className={cn(\n \"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 className,\n )}\n {...props}\n />\n);\n\nconst toastVariants = cva(\n \"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 {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive:\n \"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Toast = ({\n className,\n variant,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>) => {\n return (\n <ToastPrimitives.Root\n data-slot=\"toast-root\"\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n};\n\nconst ToastAction = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n <ToastPrimitives.Action\n data-slot=\"toast-action\"\n className={cn(\n \"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 className,\n )}\n {...props}\n />\n);\n\nconst ToastClose = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n <ToastPrimitives.Close\n data-slot=\"toast-close\"\n className={cn(\n \"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 className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n <ToastPrimitives.Title\n data-slot=\"toast-title\"\n className={cn(\"text-sm font-semibold\", className)}\n {...props}\n />\n);\n\nconst ToastDescription = ({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n <ToastPrimitives.Description\n data-slot=\"toast-description\"\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\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":"6xBAqBA,IAAMA,EAAgB,iBAEfC,EAAYC,EA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GAAWiM,GAClB,MAAMC,EAA2BxO,SAASc,cAC1C,OAAOyN,EAAWE,MAAMpM,GAElBA,IAAcmM,IAClBnM,EAAUtC,QACHC,SAASc,gBAAkB0N,IAEtC,CAEA,IACME,GAAWpQ,EACXqQ,GAAOhL,EACPiL,GAAQ/D,EACRgE,GAAc7D,EACd8D,GAAS3D,EACT4D,GAAQxD,ECt7BRlP,MAAAA,GDg7BWA,EC96BXiC,GAAgB,EACpB0Q,eACG1S,KAEHS,EAACkS,cAAAA,GAAwB,CACvBC,YAAU,iBACVF,UAAWG,EACT,oIACAH,MAEE1S,IAIF8S,GAAgBC,EACpB,4lBACA,CACEC,SAAU,CACRC,QAAS,CACPC,QAAS,uCACTC,YACE,kHAGNC,gBAAiB,CACfH,QAAS,aAKT5L,GAAQ,EACZqL,YACAO,aACGjT,KAIDS,EAAA4S,cAACV,GAAoB,CACnBC,YAAU,aACVF,UAAWG,EAAGC,GAAc,CAAEG,YAAYP,MACtC1S,IAKJ6O,GAAc,EAClB6D,eACG1S,KAEHS,EAACkS,cAAAA,GAAsB,CACrBC,YAAU,eACVF,UAAWG,EACT,qgBACAH,MAEE1S,IAIFiP,GAAa,EACjByD,eACG1S,KAEHS,EAACkS,cAAAA,GAAqB,CACpBC,YAAU,cACVF,UAAWG,EACT,wVACAH,GAEFY,cAAY,MACRtT,GAEJS,EAAC8S,cAAAA,EAAAA,CAAEb,UAAU,aAIXnE,GAAa,EACjBmE,eACG1S,KAEHS,EAACkS,cAAAA,GAAqB,CACpBC,YAAU,cACVF,UAAWG,EAAG,wBAAyBH,MACnC1S,IAIF0O,GAAmB,EACvBgE,eACG1S,KAEHS,EAACkS,cAAAA,GAA2B,CAC1BC,YAAU,oBACVF,UAAWG,EAAG,qBAAsBH,MAChC1S","x_google_ignoreList":[0]}
|
package/dist/tooltip/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{u as t,c as n,P as o}from"../chunks/index-
|
1
|
+
import*as e from"react";import{u as t,c as n,P as o}from"../chunks/index-wbuw6FYR.mjs";import{c as r}from"../chunks/index-BGhqW2Il.mjs";import{P as i,D as a}from"../chunks/index-CVTJI-8T.mjs";import{u as s}from"../chunks/index-DhIMkiDX.mjs";import{c,R as l,A as u,C as d,a as p}from"../chunks/index-BuGzJybI.mjs";import{P as f}from"../chunks/index-CmGsz_8M.mjs";import{Slottable as m}from"@radix-ui/react-slot";import{u as h}from"../chunks/index-DMXVIqDM.mjs";import{R as g}from"../chunks/index-0ulImjdF.mjs";import{jsx as x,jsxs as y}from"react/jsx-runtime";import{c as v}from"../chunks/utils-ihtedRak.mjs";import"react-dom";import"../chunks/index-SI7n7FwH.mjs";import"../chunks/bundle-mjs-DnMeAVOT.mjs";var[b,w]=r("Tooltip",[c]),C=c(),T="TooltipProvider",E=700,k="tooltip.open",[_,D]=b(T),P=t=>{const{__scopeTooltip:n,delayDuration:o=E,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=t,[s,c]=e.useState(!0),l=e.useRef(!1),u=e.useRef(0);return e.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),x(_,{scope:n,isOpenDelayed:s,delayDuration:o,onOpen:e.useCallback((()=>{window.clearTimeout(u.current),c(!1)}),[]),onClose:e.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>c(!0)),r)}),[r]),isPointerInTransitRef:l,onPointerInTransitChange:e.useCallback((e=>{l.current=e}),[]),disableHoverableContent:i,children:a})};P.displayName=T;var R="Tooltip",[L,O]=b(R),j=t=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:c,delayDuration:u}=t,d=D(R,t.__scopeTooltip),p=C(n),[f,m]=e.useState(null),g=s(),y=e.useRef(0),v=c??d.disableHoverableContent,b=u??d.delayDuration,w=e.useRef(!1),[T=!1,E]=h({prop:r,defaultProp:i,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(k))):d.onClose(),a?.(e)}}),_=e.useMemo((()=>T?w.current?"delayed-open":"instant-open":"closed"),[T]),P=e.useCallback((()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,E(!0)}),[E]),O=e.useCallback((()=>{window.clearTimeout(y.current),y.current=0,E(!1)}),[E]),j=e.useCallback((()=>{window.clearTimeout(y.current),y.current=window.setTimeout((()=>{w.current=!0,E(!0),y.current=0}),b)}),[b,E]);return e.useEffect((()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)}),[]),x(l,{...p,children:x(L,{scope:n,contentId:g,open:T,stateAttribute:_,trigger:f,onTriggerChange:m,onTriggerEnter:e.useCallback((()=>{d.isOpenDelayed?j():P()}),[d.isOpenDelayed,j,P]),onTriggerLeave:e.useCallback((()=>{v?O():(window.clearTimeout(y.current),y.current=0)}),[O,v]),onOpen:P,onClose:O,disableHoverableContent:v,children:o})})};j.displayName=R;var M="TooltipTrigger",I=e.forwardRef(((o,r)=>{const{__scopeTooltip:i,...a}=o,s=O(M,i),c=D(M,i),l=C(i),d=e.useRef(null),p=t(r,d,s.onTriggerChange),m=e.useRef(!1),h=e.useRef(!1),g=e.useCallback((()=>m.current=!1),[]);return e.useEffect((()=>()=>document.removeEventListener("pointerup",g)),[g]),x(u,{asChild:!0,...l,children:x(f.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:p,onPointerMove:n(o.onPointerMove,(e=>{"touch"!==e.pointerType&&(h.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),h.current=!0))})),onPointerLeave:n(o.onPointerLeave,(()=>{s.onTriggerLeave(),h.current=!1})),onPointerDown:n(o.onPointerDown,(()=>{m.current=!0,document.addEventListener("pointerup",g,{once:!0})})),onFocus:n(o.onFocus,(()=>{m.current||s.onOpen()})),onBlur:n(o.onBlur,s.onClose),onClick:n(o.onClick,s.onClose)})})}));I.displayName=M;var N="TooltipPortal",[H,A]=b(N,{forceMount:void 0}),B=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,s=O(N,t);return x(H,{scope:t,forceMount:n,children:x(o,{present:n||s.open,children:x(i,{asChild:!0,container:a,children:r})})})};B.displayName=N;var z="TooltipContent",F=e.forwardRef(((e,t)=>{const n=A(z,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,s=O(z,e.__scopeTooltip);return x(o,{present:r||s.open,children:s.disableHoverableContent?x(Y,{side:i,...a,ref:t}):x(S,{side:i,...a,ref:t})})})),S=e.forwardRef(((n,o)=>{const r=O(z,n.__scopeTooltip),i=D(z,n.__scopeTooltip),a=e.useRef(null),s=t(o,a),[c,l]=e.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:f}=i,m=e.useCallback((()=>{l(null),f(!1)}),[f]),h=e.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 e.useEffect((()=>()=>m()),[m]),e.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]),e.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]),x(Y,{...n,ref:s})})),[K,X]=b(R,{isInside:!1}),Y=e.forwardRef(((t,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=t,u=O(z,o),p=C(o),{onClose:f}=u;return e.useEffect((()=>(document.addEventListener(k,f),()=>document.removeEventListener(k,f))),[f]),e.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&f()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,f]),x(a,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:y(d,{"data-state":u.stateAttribute,...p,...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:[x(m,{children:r}),x(K,{scope:o,isInside:!0,children:x(g,{id:u.contentId,role:"tooltip",children:i||r})})]})})}));F.displayName=z;var q="TooltipArrow";e.forwardRef(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=C(n);return X(q,n).isInside?null:x(p,{...r,...o,ref:t})})).displayName=q;var G=P,J=j,Q=I,U=B,V=F;function W({delayDuration:t=700,...n}){return e.createElement(G,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function Z({...t}){return e.createElement(W,null,e.createElement(J,{"data-slot":"tooltip",...t}))}function $({...t}){return e.createElement(Q,{"data-slot":"tooltip-trigger",...t})}function ee({className:t,sideOffset:n=0,children:o,...r}){return e.createElement(U,null,e.createElement(V,{"data-slot":"tooltip-content",sideOffset:n,className:v("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),...r},o))}export{Z as Tooltip,ee as TooltipContent,W as TooltipProvider,$ 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 * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"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 className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\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":"isBAkBA,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,GACGM,EAAeC,GAA0BC,EAAAC,UAAS,GACnDC,EAA8BF,EAAAG,QAAO,GACrCC,EAA0BJ,EAAAG,OAAO,GAOvC,OALMH,EAAAK,WAAU,KACd,MAAMC,EAAiBF,EAAkBG,QACzC,MAAO,IAAMC,OAAOC,aAAaH,EAAc,GAC9C,IAGDI,EAACrB,EAAA,CACCsB,MAAOlB,EACPK,gBACAJ,gBACAkB,OAAcZ,EAAAa,aAAY,KACxB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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 * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction TooltipProvider({\n delayDuration = 700,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"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 className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\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":"isBAkBA,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,GACGM,EAAeC,GAA0BC,EAAAC,UAAS,GACnDC,EAA8BF,EAAAG,QAAO,GACrCC,EAA0BJ,EAAAG,OAAO,GAOvC,OALMH,EAAAK,WAAU,KACd,MAAMC,EAAiBF,EAAkBG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